C源代码反汇编(Centos7)
gcc
执行指令 gcc -v,如果发现找不到gcc 指令,则执行yum install gcc 进行安装.
objdump
执行指令 whereis objdump。就会看见objdump的路径,是Linux默认的指令。
C源代码文件(文件内容如下)
#include <stdio.h>
static int add(int a, int b)
{
return a + b;
}
int main(int argc, const char *argv[])
{
int a = 1;
int b = 1;
int c;
c = add(a, b);
printf(" %d + %d = %d\n", a, b, c);
return c;
}
编译C源代码和生产反汇编文件
编译:gcc -o gcc_objdump objdump.c
反汇编:objdump -l -x -d gcc_objdump > objdump.dmp
分析
- 执行gcc_objdump文件,会得到 1 + 1 = 2; 执行指令是 ./gcc_objdump
- gcc_objdump是一个可执行的elf文件。ELF文件由4部分组成,分别是ELF头(ELF header)、程序头表(Program header table)、节(Section)和节头表(Section header table)。实际上,一个文件中不一定包含全部内容,而且他们的位置也未必如同所示这样安排,只有ELF头的位置是固定的,其余各部分的位置、大小等信息由ELF头中的各项值来决定。
- objdump.dmp文件可以由vim工具打开,也可以使用EditPlus打开。
objdump.dmp内容如下
gcc_objdump: file format elf64-x86-64
gcc_objdump
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000400430
Program Header:
PHDR off 0x0000000000000040 vaddr 0x0000000000400040 paddr 0x0000000000400040 align 2**3
filesz 0x00000000000001f8 memsz 0x00000000000001f8 flags r-x
INTERP off 0x0000000000000238 vaddr 0x0000000000400238 paddr 0x0000000000400238 align 2**0
filesz 0x000000000000001c memsz 0x000000000000001c flags r--
LOAD off 0x0000000000000000 vaddr 0x0000000000400000 paddr 0x0000000000400000 align 2**21
filesz 0x0000000000000774 memsz 0x0000000000000774 flags r-x
LOAD off 0x0000000000000e10 vaddr 0x0000000000600e10 paddr 0x0000000000600e10 align 2**21
filesz 0x000000000000021c memsz 0x0000000000000220 flags rw-
DYNAMIC off 0x0000000000000e28 vaddr 0x0000000000600e28 paddr 0x0000000000600e28 align 2**3
filesz 0x00000000000001d0 memsz 0x00000000000001d0 flags rw-
NOTE off 0x0000000000000254 vaddr 0x0000000000400254 paddr 0x0000000000400254 align 2**2
filesz 0x0000000000000044 memsz 0x0000000000000044 flags r--
EH_FRAME off 0x0000000000000620 vaddr 0x0000000000400620 paddr 0x0000000000400620 align 2**2
filesz 0x000000000000003c memsz 0x000000000000003c flags r--
STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4
filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
RELRO off 0x0000000000000e10 vaddr 0x0000000000600e10 paddr 0x0000000000600e10 align 2**0
filesz 0x00000000000001f0 memsz 0x00000000000001f0 flags r--
Dynamic Section:
NEEDED libc.so.6
INIT 0x00000000004003c8
FINI 0x00000000004005f4
INIT_ARRAY 0x0000000000600e10
INIT_ARRAYSZ 0x0000000000000008
FINI_ARRAY 0x0000000000600e18
FINI_ARRAYSZ 0x0000000000000008
GNU_HASH 0x0000000000400298
STRTAB 0x0000000000400318
SYMTAB 0x00000000004002b8
STRSZ 0x000000000000003f
SYMENT 0x0000000000000018
DEBUG 0x0000000000000000
PLTGOT 0x0000000000601000
PLTRELSZ 0x0000000000000030
PLTREL 0x0000000000000007
JMPREL 0x0000000000400398
RELA 0x0000000000400380
RELASZ 0x0000000000000018
RELAENT 0x0000000000000018
VERNEED 0x0000000000400360
VERNEEDNUM 0x0000000000000001
VERSYM 0x0000000000400358
Version References:
required from libc.so.6:
0x09691a75 0x00 02 GLIBC_2.2.5
Sections:
Idx Name Size VMA LMA File off Algn
0 .interp 0000001c 0000000000400238 0000000000400238 00000238 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .note.ABI-tag 00000020 0000000000400254 0000000000400254 00000254 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .note.gnu.build-id 00000024 0000000000400274 0000000000400274 00000274 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .gnu.hash 0000001c 0000000000400298 0000000000400298 00000298 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .dynsym 00000060 00000000004002b8 00000000004002b8 000002b8 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .dynstr 0000003f 0000000000400318 0000000000400318 00000318 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .gnu.version 00000008 0000000000400358 0000000000400358 00000358 2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .gnu.version_r 00000020 0000000000400360 0000000000400360 00000360 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .rela.dyn 00000018 0000000000400380 0000000000400380 00000380 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .rela.plt 00000030 0000000000400398 0000000000400398 00000398 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 .init 0000001a 00000000004003c8 00000000004003c8 000003c8 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .plt 00000030 00000000004003f0 00000000004003f0 000003f0 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .plt.got 00000008 0000000000400420 0000000000400420 00000420 2**3
CONTENTS, ALLOC, LOAD, READONLY, CODE
13 .text 000001c2 0000000000400430 0000000000400430 00000430 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
14 .fini 00000009 00000000004005f4 00000000004005f4 000005f4 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
15 .rodata 0000001f 0000000000400600 0000000000400600 00000600 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
16 .eh_frame_hdr 0000003c 0000000000400620 0000000000400620 00000620 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
17 .eh_frame 00000114 0000000000400660 0000000000400660 00000660 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
18 .init_array 00000008 0000000000600e10 0000000000600e10 00000e10 2**3
CONTENTS, ALLOC, LOAD, DATA
19 .fini_array 00000008 0000000000600e18 0000000000600e18 00000e18 2**3
CONTENTS, ALLOC, LOAD, DATA
20 .jcr 00000008 0000000000600e20 0000000000600e20 00000e20 2**3
CONTENTS, ALLOC, LOAD, DATA
21 .dynamic 000001d0 0000000000600e28 0000000000600e28 00000e28 2**3
CONTENTS, ALLOC, LOAD, DATA
22 .got 00000008 0000000000600ff8 0000000000600ff8 00000ff8 2**3
CONTENTS, ALLOC, LOAD, DATA
23 .got.plt 00000028 0000000000601000 0000000000601000 00001000 2**3
CONTENTS, ALLOC, LOAD, DATA
24 .data 00000004 0000000000601028 0000000000601028 00001028 2**0
CONTENTS, ALLOC, LOAD, DATA
25 .bss 00000004 000000000060102c 000000000060102c 0000102c 2**0
ALLOC
26 .comment 0000002d 0000000000000000 0000000000000000 0000102c 2**0
CONTENTS, READONLY
SYMBOL TABLE:
0000000000400238 l d .interp 0000000000000000 .interp
0000000000400254 l d .note.ABI-tag 0000000000000000 .note.ABI-tag
0000000000400274 l d .note.gnu.build-id 0000000000000000 .note.gnu.build-id
0000000000400298 l d .gnu.hash 0000000000000000 .gnu.hash
00000000004002b8 l d .dynsym 0000000000000000 .dynsym
0000000000400318 l d .dynstr 0000000000000000 .dynstr
0000000000400358 l d .gnu.version 0000000000000000 .gnu.version
0000000000400360 l d .gnu.version_r 0000000000000000 .gnu.version_r
0000000000400380 l d .rela.dyn 0000000000000000 .rela.dyn
0000000000400398 l d .rela.plt 0000000000000000 .rela.plt
00000000004003c8 l d .init 0000000000000000 .init
00000000004003f0 l d .plt 0000000000000000 .plt
0000000000400420 l d .plt.got 0000000000000000 .plt.got
0000000000400430 l d .text 0000000000000000 .text
00000000004005f4 l d .fini 0000000000000000 .fini
0000000000400600 l d .rodata 0000000000000000 .rodata
0000000000400620 l d .eh_frame_hdr 0000000000000000 .eh_frame_hdr
0000000000400660 l d .eh_frame 0000000000000000 .eh_frame
0000000000600e10 l d .init_array 0000000000000000 .init_array
0000000000600e18 l d .fini_array 0000000000000000 .fini_array
0000000000600e20 l d .jcr 0000000000000000 .jcr
0000000000600e28 l d .dynamic 0000000000000000 .dynamic
0000000000600ff8 l d .got 0000000000000000 .got
0000000000601000 l d .got.plt 0000000000000000 .got.plt
0000000000601028 l d .data 0000000000000000 .data
000000000060102c l d .bss 0000000000000000 .bss
0000000000000000 l d .comment 0000000000000000 .comment
0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
0000000000600e20 l O .jcr 0000000000000000 __JCR_LIST__
0000000000400460 l F .text 0000000000000000 deregister_tm_clones
0000000000400490 l F .text 0000000000000000 register_tm_clones
00000000004004d0 l F .text 0000000000000000 __do_global_dtors_aux
000000000060102c l O .bss 0000000000000001 completed.6355
0000000000600e18 l O .fini_array 0000000000000000 __do_global_dtors_aux_fini_array_entry
00000000004004f0 l F .text 0000000000000000 frame_dummy
0000000000600e10 l O .init_array 0000000000000000 __frame_dummy_init_array_entry
0000000000000000 l df *ABS* 0000000000000000 objdump.c
000000000040051d l F .text 0000000000000014 add_a_and_b
0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
0000000000400770 l O .eh_frame 0000000000000000 __FRAME_END__
0000000000600e20 l O .jcr 0000000000000000 __JCR_END__
0000000000000000 l df *ABS* 0000000000000000
0000000000600e18 l .init_array 0000000000000000 __init_array_end
0000000000600e28 l O .dynamic 0000000000000000 _DYNAMIC
0000000000600e10 l .init_array 0000000000000000 __init_array_start
0000000000400620 l .eh_frame_hdr 0000000000000000 __GNU_EH_FRAME_HDR
0000000000601000 l O .got.plt 0000000000000000 _GLOBAL_OFFSET_TABLE_
00000000004005f0 g F .text 0000000000000002 __libc_csu_fini
0000000000601028 w .data 0000000000000000 data_start
000000000060102c g .data 0000000000000000 _edata
00000000004005f4 g F .fini 0000000000000000 _fini
0000000000000000 F *UND* 0000000000000000 printf@@GLIBC_2.2.5
0000000000000000 F *UND* 0000000000000000 __libc_start_main@@GLIBC_2.2.5
0000000000601028 g .data 0000000000000000 __data_start
0000000000000000 w *UND* 0000000000000000 __gmon_start__
0000000000400608 g O .rodata 0000000000000000 .hidden __dso_handle
0000000000400600 g O .rodata 0000000000000004 _IO_stdin_used
0000000000400580 g F .text 0000000000000065 __libc_csu_init
0000000000601030 g .bss 0000000000000000 _end
0000000000400430 g F .text 0000000000000000 _start
000000000060102c g .bss 0000000000000000 __bss_start
0000000000400531 g F .text 000000000000004e main
0000000000601030 g O .data 0000000000000000 .hidden __TMC_END__
00000000004003c8 g F .init 0000000000000000 _init
Disassembly of section .init:
00000000004003c8 <_init>:
_init():
4003c8: 48 83 ec 08 sub $0x8,%rsp
4003cc: 48 8b 05 25 0c 20 00 mov 0x200c25(%rip),%rax # 600ff8 <__gmon_start__>
4003d3: 48 85 c0 test %rax,%rax
4003d6: 74 05 je 4003dd <_init+0x15>
4003d8: e8 43 00 00 00 callq 400420 <.plt.got>
4003dd: 48 83 c4 08 add $0x8,%rsp
4003e1: c3 retq
Disassembly of section .plt:
00000000004003f0 <.plt>:
4003f0: ff 35 12 0c 20 00 pushq 0x200c12(%rip) # 601008 <_GLOBAL_OFFSET_TABLE_+0x8>
4003f6: ff 25 14 0c 20 00 jmpq *0x200c14(%rip) # 601010 <_GLOBAL_OFFSET_TABLE_+0x10>
4003fc: 0f 1f 40 00 nopl 0x0(%rax)
0000000000400400 <printf@plt>:
400400: ff 25 12 0c 20 00 jmpq *0x200c12(%rip) # 601018 <printf@GLIBC_2.2.5>
400406: 68 00 00 00 00 pushq $0x0
40040b: e9 e0 ff ff ff jmpq 4003f0 <.plt>
0000000000400410 <__libc_start_main@plt>:
400410: ff 25 0a 0c 20 00 jmpq *0x200c0a(%rip) # 601020 <__libc_start_main@GLIBC_2.2.5>
400416: 68 01 00 00 00 pushq $0x1
40041b: e9 d0 ff ff ff jmpq 4003f0 <.plt>
Disassembly of section .plt.got:
0000000000400420 <.plt.got>:
400420: ff 25 d2 0b 20 00 jmpq *0x200bd2(%rip) # 600ff8 <__gmon_start__>
400426: 66 90 xchg %ax,%ax
Disassembly of section .text:
0000000000400430 <_start>:
_start():
400430: 31 ed xor %ebp,%ebp
400432: 49 89 d1 mov %rdx,%r9
400435: 5e pop %rsi
400436: 48 89 e2 mov %rsp,%rdx
400439: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp
40043d: 50 push %rax
40043e: 54 push %rsp
40043f: 49 c7 c0 f0 05 40 00 mov $0x4005f0,%r8
400446: 48 c7 c1 80 05 40 00 mov $0x400580,%rcx
40044d: 48 c7 c7 31 05 40 00 mov $0x400531,%rdi
400454: e8 b7 ff ff ff callq 400410 <__libc_start_main@plt>
400459: f4 hlt
40045a: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
0000000000400460 <deregister_tm_clones>:
deregister_tm_clones():
400460: b8 37 10 60 00 mov $0x601037,%eax
400465: 55 push %rbp
400466: 48 2d 30 10 60 00 sub $0x601030,%rax
40046c: 48 83 f8 0e cmp $0xe,%rax
400470: 48 89 e5 mov %rsp,%rbp
400473: 77 02 ja 400477 <deregister_tm_clones+0x17>
400475: 5d pop %rbp
400476: c3 retq
400477: b8 00 00 00 00 mov $0x0,%eax
40047c: 48 85 c0 test %rax,%rax
40047f: 74 f4 je 400475 <deregister_tm_clones+0x15>
400481: 5d pop %rbp
400482: bf 30 10 60 00 mov $0x601030,%edi
400487: ff e0 jmpq *%rax
400489: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
0000000000400490 <register_tm_clones>:
register_tm_clones():
400490: b8 30 10 60 00 mov $0x601030,%eax
400495: 55 push %rbp
400496: 48 2d 30 10 60 00 sub $0x601030,%rax
40049c: 48 c1 f8 03 sar $0x3,%rax
4004a0: 48 89 e5 mov %rsp,%rbp
4004a3: 48 89 c2 mov %rax,%rdx
4004a6: 48 c1 ea 3f shr $0x3f,%rdx
4004aa: 48 01 d0 add %rdx,%rax
4004ad: 48 d1 f8 sar %rax
4004b0: 75 02 jne 4004b4 <register_tm_clones+0x24>
4004b2: 5d pop %rbp
4004b3: c3 retq
4004b4: ba 00 00 00 00 mov $0x0,%edx
4004b9: 48 85 d2 test %rdx,%rdx
4004bc: 74 f4 je 4004b2 <register_tm_clones+0x22>
4004be: 5d pop %rbp
4004bf: 48 89 c6 mov %rax,%rsi
4004c2: bf 30 10 60 00 mov $0x601030,%edi
4004c7: ff e2 jmpq *%rdx
4004c9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
00000000004004d0 <__do_global_dtors_aux>:
__do_global_dtors_aux():
4004d0: 80 3d 55 0b 20 00 00 cmpb $0x0,0x200b55(%rip) # 60102c <_edata>
4004d7: 75 11 jne 4004ea <__do_global_dtors_aux+0x1a>
4004d9: 55 push %rbp
4004da: 48 89 e5 mov %rsp,%rbp
4004dd: e8 7e ff ff ff callq 400460 <deregister_tm_clones>
4004e2: 5d pop %rbp
4004e3: c6 05 42 0b 20 00 01 movb $0x1,0x200b42(%rip) # 60102c <_edata>
4004ea: f3 c3 repz retq
4004ec: 0f 1f 40 00 nopl 0x0(%rax)
00000000004004f0 <frame_dummy>:
frame_dummy():
4004f0: 48 83 3d 28 09 20 00 cmpq $0x0,0x200928(%rip) # 600e20 <__JCR_END__>
4004f7: 00
4004f8: 74 1e je 400518 <frame_dummy+0x28>
4004fa: b8 00 00 00 00 mov $0x0,%eax
4004ff: 48 85 c0 test %rax,%rax
400502: 74 14 je 400518 <frame_dummy+0x28>
400504: 55 push %rbp
400505: bf 20 0e 60 00 mov $0x600e20,%edi
40050a: 48 89 e5 mov %rsp,%rbp
40050d: ff d0 callq *%rax
40050f: 5d pop %rbp
400510: e9 7b ff ff ff jmpq 400490 <register_tm_clones>
400515: 0f 1f 00 nopl (%rax)
400518: e9 73 ff ff ff jmpq 400490 <register_tm_clones>
000000000040051d <add_a_and_b>:
add_a_and_b():
40051d: 55 push %rbp
40051e: 48 89 e5 mov %rsp,%rbp
400521: 89 7d fc mov %edi,-0x4(%rbp)
400524: 89 75 f8 mov %esi,-0x8(%rbp)
400527: 8b 45 f8 mov -0x8(%rbp),%eax
40052a: 8b 55 fc mov -0x4(%rbp),%edx
40052d: 01 d0 add %edx,%eax
40052f: 5d pop %rbp
400530: c3 retq
0000000000400531 <main>:
main():
400531: 55 push %rbp
400532: 48 89 e5 mov %rsp,%rbp
400535: 48 83 ec 20 sub $0x20,%rsp
400539: 89 7d ec mov %edi,-0x14(%rbp)
40053c: 48 89 75 e0 mov %rsi,-0x20(%rbp)
400540: c7 45 fc 01 00 00 00 movl $0x1,-0x4(%rbp)
400547: c7 45 f8 02 00 00 00 movl $0x2,-0x8(%rbp)
40054e: 8b 55 f8 mov -0x8(%rbp),%edx
400551: 8b 45 fc mov -0x4(%rbp),%eax
400554: 89 d6 mov %edx,%esi
400556: 89 c7 mov %eax,%edi
400558: e8 c0 ff ff ff callq 40051d <add_a_and_b>
40055d: 89 45 f4 mov %eax,-0xc(%rbp)
400560: 8b 4d f4 mov -0xc(%rbp),%ecx
400563: 8b 55 f8 mov -0x8(%rbp),%edx
400566: 8b 45 fc mov -0x4(%rbp),%eax
400569: 89 c6 mov %eax,%esi
40056b: bf 10 06 40 00 mov $0x400610,%edi
400570: b8 00 00 00 00 mov $0x0,%eax
400575: e8 86 fe ff ff callq 400400 <printf@plt>
40057a: 8b 45 f4 mov -0xc(%rbp),%eax
40057d: c9 leaveq
40057e: c3 retq
40057f: 90 nop
0000000000400580 <__libc_csu_init>:
__libc_csu_init():
400580: 41 57 push %r15
400582: 41 89 ff mov %edi,%r15d
400585: 41 56 push %r14
400587: 49 89 f6 mov %rsi,%r14
40058a: 41 55 push %r13
40058c: 49 89 d5 mov %rdx,%r13
40058f: 41 54 push %r12
400591: 4c 8d 25 78 08 20 00 lea 0x200878(%rip),%r12 # 600e10 <__frame_dummy_init_array_entry>
400598: 55 push %rbp
400599: 48 8d 2d 78 08 20 00 lea 0x200878(%rip),%rbp # 600e18 <__init_array_end>
4005a0: 53 push %rbx
4005a1: 4c 29 e5 sub %r12,%rbp
4005a4: 31 db xor %ebx,%ebx
4005a6: 48 c1 fd 03 sar $0x3,%rbp
4005aa: 48 83 ec 08 sub $0x8,%rsp
4005ae: e8 15 fe ff ff callq 4003c8 <_init>
4005b3: 48 85 ed test %rbp,%rbp
4005b6: 74 1e je 4005d6 <__libc_csu_init+0x56>
4005b8: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
4005bf: 00
4005c0: 4c 89 ea mov %r13,%rdx
4005c3: 4c 89 f6 mov %r14,%rsi
4005c6: 44 89 ff mov %r15d,%edi
4005c9: 41 ff 14 dc callq *(%r12,%rbx,8)
4005cd: 48 83 c3 01 add $0x1,%rbx
4005d1: 48 39 eb cmp %rbp,%rbx
4005d4: 75 ea jne 4005c0 <__libc_csu_init+0x40>
4005d6: 48 83 c4 08 add $0x8,%rsp
4005da: 5b pop %rbx
4005db: 5d pop %rbp
4005dc: 41 5c pop %r12
4005de: 41 5d pop %r13
4005e0: 41 5e pop %r14
4005e2: 41 5f pop %r15
4005e4: c3 retq
4005e5: 90 nop
4005e6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
4005ed: 00 00 00
00000000004005f0 <__libc_csu_fini>:
__libc_csu_fini():
4005f0: f3 c3 repz retq
Disassembly of section .fini:
00000000004005f4 <_fini>:
_fini():
4005f4: 48 83 ec 08 sub $0x8,%rsp
4005f8: 48 83 c4 08 add $0x8,%rsp
4005fc: c3 retq
main函数
0000000000400531 <main>:
main():
400531: 55 push %rbp
400532: 48 89 e5 mov %rsp,%rbp
400535: 48 83 ec 20 sub $0x20,%rsp
400539: 89 7d ec mov %edi,-0x14(%rbp)
40053c: 48 89 75 e0 mov %rsi,-0x20(%rbp)
400540: c7 45 fc 01 00 00 00 movl $0x1,-0x4(%rbp)
400547: c7 45 f8 02 00 00 00 movl $0x2,-0x8(%rbp)
40054e: 8b 55 f8 mov -0x8(%rbp),%edx
400551: 8b 45 fc mov -0x4(%rbp),%eax
400554: 89 d6 mov %edx,%esi
400556: 89 c7 mov %eax,%edi
400558: e8 c0 ff ff ff callq 40051d <add_a_and_b>
40055d: 89 45 f4 mov %eax,-0xc(%rbp)
400560: 8b 4d f4 mov -0xc(%rbp),%ecx
400563: 8b 55 f8 mov -0x8(%rbp),%edx
400566: 8b 45 fc mov -0x4(%rbp),%eax
400569: 89 c6 mov %eax,%esi
40056b: bf 10 06 40 00 mov $0x400610,%edi
400570: b8 00 00 00 00 mov $0x0,%eax
400575: e8 86 fe ff ff callq 400400 <printf@plt>
40057a: 8b 45 f4 mov -0xc(%rbp),%eax
40057d: c9 leaveq
40057e: c3 retq
40057f: 90 nop
add函数
000000000040051d <add_a_and_b>:
add_a_and_b():
40051d: 55 push %rbp
40051e: 48 89 e5 mov %rsp,%rbp
400521: 89 7d fc mov %edi,-0x4(%rbp)
400524: 89 75 f8 mov %esi,-0x8(%rbp)
400527: 8b 45 f8 mov -0x8(%rbp),%eax
40052a: 8b 55 fc mov -0x4(%rbp),%edx
40052d: 01 d0 add %edx,%eax
40052f: 5d pop %rbp
400530: c3 retq
还没有评论,来说两句吧...