SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 288 | Next

Shon Harris, Allen Harper, Chris Eagle, and Jonathan Ness

"Gray Hat Hacking, Second Edition"

By
default, gdb uses AT&T format. The second command disassembles the given function
(to include main if given). For example, to disassemble the function called greeting in
both formats, you would type
$gdb -q meet
(gdb) disassemble greeting
Dump of assembler code for function greeting:
0x804835c : push %ebp
0x804835d : mov %esp,%ebp
0x804835f : sub $0x190,%esp
0x8048365 : pushl 0xc(%ebp)
0x8048368 : lea 0xfffffe70(%ebp),%eax
0x804836e : push %eax
0x804836f : call 0x804829c
0x8048374 : add $0x8,%esp
0x8048377 : lea 0xfffffe70(%ebp),%eax
0x804837d : push %eax
0x804837e : pushl 0x8(%ebp)
0x8048381 : push $0x8048418
0x8048386 : call 0x804828c
0x804838b : add $0xc,%esp
0x804838e : leave
0x804838f : ret
End of assembler dump.
(gdb) set disassembly-flavor intel
(gdb) disassemble greeting
Dump of assembler code for function greeting:
0x804835c : push ebp
0x804835d : mov ebp,esp
0x804835f : sub esp,0x190
??¦truncated for brevity??¦
End of assembler dump.


Pages:
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300