c原始碼:
#include <stdio.h>
main()
{
printf("Hello World\n");
}
[root@localhost test]# ls
hello.c
[root@localhost test]# gcc hello.c
[root@localhost test]# ls
a.out hello.c
[root@localhost test]# ./a.out
Hello Wolrd
[root@localhost test]# objdump -d a.out > hello.asm #反組譯
[root@localhost test]# ls
a.out hello.asm hello.c
[root@localhost test]# vi hello.asm #反組譯結果
8048337: 68 38 95 04 08 push $0x8049538
804833c: e8 bf 7c fb f7 call 0 <_init-0x8048250>
8048341: 83 c4 10 add $0x10,%esp
8048344: c9 leave
8048345: c3 ret
8048346: 90 nop
8048347: 90 nop
08048348 <main>:
8048348: 55 push %ebp
8048349: 89 e5 mov %esp,%ebp
804834b: 83 ec 08 sub $0x8,%esp
804834e: 83 e4 f0 and $0xfffffff0,%esp
8048351: b8 00 00 00 00 mov $0x0,%eax
8048356: 29 c4 sub %eax,%esp
8048358: 83 ec 0c sub $0xc,%esp
804835b: 68 40 84 04 08 push $0x8048440
8048360: e8 23 ff ff ff call 8048288 <_init+0x38>
8048365: 83 c4 10 add $0x10,%esp
8048368: c9 leave
8048369: c3 ret
804836a: 90 nop
804836b: 90 nop
0804836c <__libc_csu_init>:
804836c: 55 push %ebp
804836d: 89 e5 mov %esp,%ebp
804836f: 57 push %edi
8048370: 56 push %esi
8048371: 53 push %ebx
8048372: 83 ec 0c sub $0xc,%esp
8048375: e8 00 00 00 00 call 804837a <__libc_csu_init+0xe>
804837a: 5b pop %ebx
804837b: 81 c3 c2 11 00 00 add $0x11c2,%ebx
8048381: e8 ca fe ff ff call 8048250 <_init>
8048386: 8d 93 18 ff ff ff lea 0xffffff18(%ebx),%edx
804838c: 8d 8b 18 ff ff ff lea 0xffffff18(%ebx),%ecx
8048392: 29 ca sub %ecx,%edx
8048394: c1 fa 02 sar $0x2,%edx
a.out: file format elf32-i386
Disassembly of section .init:
08048250 <_init>:
8048250: 55 push %ebp
8048251: 89 e5 mov %esp,%ebp
8048253: 83 ec 08 sub $0x8,%esp
8048256: e8 61 00 00 00 call 80482bc <call_gmon_start>
804825b: e8 bc 00 00 00 call 804831c <frame_dummy>
8048260: e8 93 01 00 00 call 80483f8 <__do_global_ctors_aux>
8048265: c9 leave
8048266: c3 ret
Disassembly of section .plt:
08048268 <.plt>:
8048268: ff 35 40 95 04 08 pushl 0x8049540
804826e: ff 25 44 95 04 08 jmp *0x8049544
8048274: 00 00 add %al,(%eax)
8048276: 00 00 add %al,(%eax)
8048278: ff 25 48 95 04 08 jmp *0x8049548
804827e: 68 00 00 00 00 push $0x0
8048283: e9 e0 ff ff ff jmp 8048268 <_init+0x18>
8048288: ff 25 4c 95 04 08 jmp *0x804954c
804828e: 68 08 00 00 00 push $0x8
8048293: e9 d0 ff ff ff jmp 8048268 <_init+0x18>
Disassembly of section .text:
08048298 <_start>:
8048298: 31 ed xor %ebp,%ebp
804829a: 5e pop %esi
804829b: 89 e1 mov %esp,%ecx
804829d: 83 e4 f0 and $0xfffffff0,%esp
"hello.asm" 214L, 9749C