Full text of SMASHING THE STACK FOR FUN AND PROFIT, by Aleph One:
"What we have done is add 12 to buffer1[]'s address. This new address is where the return address is stored. We want to skip pass the assignment to the printf call. How did we know to add 8 to the return address? We used a test value first (for example 1), compiled the program, and then started gdb:
------------------------------------------------------------------------------
[aleph1]$ gdb example3
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type 'show copying' to see the conditions.
There is absolutely no warranty for GDB; type 'show warranty' for details.
GDB 4.15 (i586-unknown-linux), Copyright 1995 Free Software Foundation, Inc...
(no debugging symbols found)...
(gdb) disassemble main
Dump of assembler code for function main:
0x8000490
0x8000491
0x8000493
0x8000496
0x800049d
0x800049f
0x80004a1
0x80004a3
0x80004a8
0x80004ab
0x80004b2
0x80004b5
0x80004b6
0x80004bb
0x80004c0
0x80004c3
0x80004c5
0x80004c6
0x80004c7
0 Comments:
Post a Comment
<< Home