HackingTheArtOfExploitation

Programming

Objdump

Examine compiled binary.

reader@hacking:~/booksrc $ objdump -D a.out | grep -A20 main.:
08048374 <main>:
 8048374: 55 push %ebp
 8048375: 89 e5 mov %esp,%ebp
 8048377: 83 ec 08 sub $0x8,%esp
 804837a: 83 e4 f0 and $0xfffffff0,%esp
 804837d: b8 00 00 00 00 mov $0x0,%eax
 8048382: 29 c4 sub %eax,%esp
 8048384: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp)
 804838b: 83 7d fc 09 cmpl $0x9,0xfffffffc(%ebp)
 804838f: 7e 02 jle 8048393 <main+0x1f>
 8048391: eb 13 jmp 80483a6 <main+0x32>
 8048393: c7 04 24 84 84 04 08 movl $0x8048484,(%esp)
 804839a: e8 01 ff ff ff call 80482a0 <printf@plt>
 804839f: 8d 45 fc lea 0xfffffffc(%ebp),%eax
 80483a2: ff 00 incl (%eax)
 80483a4: eb e5 jmp 804838b <main+0x17>
 80483a6: c9 leave
 80483a7: c3 ret
 80483a8: 90 nop
 80483a9: 90 nop
 80483aa: 90 nop
reader@hacking:~/booksrc $

References:

  • Hacking - The Art of Exploitation Book