开发者

Buffer Overflow - why some ascii's work and not others

开发者 https://www.devze.com 2023-03-03 06:42 出处:网络
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 retrie

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 开发者_如何学Cor pointing in the right direction would be greatly appreciated.


0x41414141 may be a valid address within a text page of the process. Look at the segment map of the process for details.


To eliminate guessing, look at the assembly code and then at machine instructions of your program. Run it in a debugger and see what happens in the memory. You can see at what addresses on the stack local variables are placed and and what addresses registers and especially the instruction pointer are saved on a function call.

Have you look at examples like the stack overflow on Wikipedia?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号