gdb-disassemble
moss@moss-PC:~$ cd Linux_Programming/
moss@moss-PC:~/Linux_Programming$ gcc -o test test.c
moss@moss-PC:~/Linux_Programming$ gdb ./test
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/moss/Linux_Programming/test...(no debugging symbols found)...done.
(gdb) disassemble main
Dump of assembler code for function main:
0x08048459 <+0>: push %ebp
0x0804845a <+1>: mov %esp,%ebp
0x0804845c <+3>: and $0xfffffff0,%esp
0x0804845f <+6>: sub $0x10,%esp
0x08048462 <+9>: movl $0x8048552,0x4(%esp)
0x0804846a <+17>: movl $0x7b,(%esp)
0x08048471 <+24>: call 0x8048414
0x08048476 <+29>: leave
0x08048477 <+30>: ret
End of assembler dump.
(gdb) x/s 0x08048471
0x8048471 : "/350/236/377/377/377/311Ð/220/220/220/220/220/220/220U/211/345]Ít&"
(gdb) x/s 0x08048476
0x8048476 : "/311Ð/220/220/220/220/220/220/220U/211/345]Ít&"
(gdb) x/s 0x0804846a
0x804846a : "/307/004${"
(gdb) x/s 0x08048462
0x8048462 : "/307D$/004R/205/004/b/307/004${"
(gdb) x/s 0x8048552
0x8048552: "yaho!"
(gdb)
0x8048558 <__FRAME_END__>: ""
(gdb) diassemble function
Undefined command: "diassemble". Try "help".
(gdb) disassemble function
Dump of assembler code for function function:
0x08048414 <+0>: push %ebp
0x08048415 <+1>: mov %esp,%ebp
0x08048417 <+3>: sub $0x48,%esp
0x0804841a <+6>: mov 0xc(%ebp),%eax
0x0804841d <+9>: mov %eax,-0x2c(%ebp)
0x08048420 <+12>: mov %gs:0x14,%eax
0x08048426 <+18>: mov %eax,-0xc(%ebp)
0x08048429 <+21>: xor %eax,%eax
0x0804842b <+23>: mov $0x8048540,%eax
0x08048430 <+28>: mov -0x2c(%ebp),%edx
0x08048433 <+31>: mov %edx,0x8(%esp)
0x08048437 <+35>: mov 0x8(%ebp),%edx
0x0804843a <+38>: mov %edx,0x4(%esp)
0x0804843e <+42>: mov %eax,(%esp)
0x08048441 <+45>: call 0x8048338
0x08048446 <+50>: mov -0xc(%ebp),%edx
0x08048449 <+53>: xor %gs:0x14,%edx
0x08048450 <+60>: je 0x8048457
0x08048452 <+62>: call 0x8048348 <__stack_chk_fail@plt>
0x08048457 <+67>: leave
0x08048458 <+68>: ret
End of assembler dump.
(gdb)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.