我真的不得到这个代码是如何做它做什么:C中的shellcode - 这是什么意思?
char shellcode[] = "\xbb\x00\x00\x00\x00"
"\xb8\x01\x00\x00\x00"
"\xcd\x80";
int main()
{
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shellcode;
}
好吧,我知道:
int *ret;
设置为int的指针。 和:
ret = (int *)&ret + 2;
设置的RET地址和2个字节(我认为)
但我不明白这是什么意思:
(int *)&ret
我知道&ret
手段,不是(int *)&ret
的意思。 另外,它是如何通过将shellcode
的值赋值为ret
来执行shellcode的?
UPDATE: 之间有什么区别:
(int *)&ret + 2
和:
&ret + 2
好奇为什么这么多downvotes ... shellcode看起来很无害。 – FatalError 2012-03-22 03:39:26