0

I'm sorry if this question is stupid or has been asked, but I couldn't find it.

I have a program that I was attempting to use a buffer over flow. It is a simple program that uses getchar() to retrieve the input from the user. The buffer is set to size 12. I can get the program to crash by typing >12 x's or using >12 \x78's, but it won't seg fault if I type in hundreds of A's or \x41's.

Any help or pointing in the right direction would be greatly appreciated.

4

2 回答 2

0

0x41414141 可能是进程文本页面内的有效地址。查看流程的细分图以了解详细信息。

于 2011-05-07T04:15:25.233 回答
0

为了消除猜测,请查看汇编代码,然后查看程序的机器指令。在调试器中运行它,看看内存中发生了什么。您可以看到堆栈局部变量放置在哪些地址以及哪些地址寄存器,尤其是指令指针保存在函数调用中。

你看过维基百科上的堆栈溢出之类的例子吗?

于 2011-05-07T06:14:32.940 回答