Skip to content

Instantly share code, notes, and snippets.

@jvns
Created September 6, 2014 15:40
Show Gist options
  • Save jvns/75298b0a5b6cde5de175 to your computer and use it in GitHub Desktop.
Save jvns/75298b0a5b6cde5de175 to your computer and use it in GitHub Desktop.
objdump -d ./hello
./hello: file format elf64-x86-64
Disassembly of section .init:
00000000004003c8 <_init>:
4003c8: 48 83 ec 08 sub $0x8,%rsp
4003cc: e8 6b 00 00 00 callq 40043c <call_gmon_start>
4003d1: e8 fa 00 00 00 callq 4004d0 <frame_dummy>
4003d6: e8 d5 01 00 00 callq 4005b0 <__do_global_ctors_aux>
4003db: 48 83 c4 08 add $0x8,%rsp
4003df: c3 retq
Disassembly of section .plt:
00000000004003e0 <puts@plt-0x10>:
4003e0: ff 35 0a 0c 20 00 pushq 0x200c0a(%rip) # 600ff0 <_GLOBAL_OFFSET_TABLE_+0x8>
4003e6: ff 25 0c 0c 20 00 jmpq *0x200c0c(%rip) # 600ff8 <_GLOBAL_OFFSET_TABLE_+0x10>
4003ec: 0f 1f 40 00 nopl 0x0(%rax)
00000000004003f0 <puts@plt>:
4003f0: ff 25 0a 0c 20 00 jmpq *0x200c0a(%rip) # 601000 <_GLOBAL_OFFSET_TABLE_+0x18>
4003f6: 68 00 00 00 00 pushq $0x0
4003fb: e9 e0 ff ff ff jmpq 4003e0 <_init+0x18>
0000000000400400 <__libc_start_main@plt>:
400400: ff 25 02 0c 20 00 jmpq *0x200c02(%rip) # 601008 <_GLOBAL_OFFSET_TABLE_+0x20>
400406: 68 01 00 00 00 pushq $0x1
40040b: e9 d0 ff ff ff jmpq 4003e0 <_init+0x18>
Disassembly of section .text:
0000000000400410 <_start>:
400410: 31 ed xor %ebp,%ebp
400412: 49 89 d1 mov %rdx,%r9
400415: 5e pop %rsi
400416: 48 89 e2 mov %rsp,%rdx
400419: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp
40041d: 50 push %rax
40041e: 54 push %rsp
40041f: 49 c7 c0 a0 05 40 00 mov $0x4005a0,%r8
400426: 48 c7 c1 10 05 40 00 mov $0x400510,%rcx
40042d: 48 c7 c7 f4 04 40 00 mov $0x4004f4,%rdi
400434: e8 c7 ff ff ff callq 400400 <__libc_start_main@plt>
400439: f4 hlt
40043a: 90 nop
40043b: 90 nop
000000000040043c <call_gmon_start>:
40043c: 48 83 ec 08 sub $0x8,%rsp
400440: 48 8b 05 99 0b 20 00 mov 0x200b99(%rip),%rax # 600fe0 <_DYNAMIC+0x190>
400447: 48 85 c0 test %rax,%rax
40044a: 74 02 je 40044e <call_gmon_start+0x12>
40044c: ff d0 callq *%rax
40044e: 48 83 c4 08 add $0x8,%rsp
400452: c3 retq
400453: 90 nop
400454: 90 nop
400455: 90 nop
400456: 90 nop
400457: 90 nop
400458: 90 nop
400459: 90 nop
40045a: 90 nop
40045b: 90 nop
40045c: 90 nop
40045d: 90 nop
40045e: 90 nop
40045f: 90 nop
0000000000400460 <__do_global_dtors_aux>:
400460: 55 push %rbp
400461: 48 89 e5 mov %rsp,%rbp
400464: 53 push %rbx
400465: 48 83 ec 08 sub $0x8,%rsp
400469: 80 3d b0 0b 20 00 00 cmpb $0x0,0x200bb0(%rip) # 601020 <__bss_start>
400470: 75 4b jne 4004bd <__do_global_dtors_aux+0x5d>
400472: bb 40 0e 60 00 mov $0x600e40,%ebx
400477: 48 8b 05 aa 0b 20 00 mov 0x200baa(%rip),%rax # 601028 <dtor_idx.6533>
40047e: 48 81 eb 38 0e 60 00 sub $0x600e38,%rbx
400485: 48 c1 fb 03 sar $0x3,%rbx
400489: 48 83 eb 01 sub $0x1,%rbx
40048d: 48 39 d8 cmp %rbx,%rax
400490: 73 24 jae 4004b6 <__do_global_dtors_aux+0x56>
400492: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
400498: 48 83 c0 01 add $0x1,%rax
40049c: 48 89 05 85 0b 20 00 mov %rax,0x200b85(%rip) # 601028 <dtor_idx.6533>
4004a3: ff 14 c5 38 0e 60 00 callq *0x600e38(,%rax,8)
4004aa: 48 8b 05 77 0b 20 00 mov 0x200b77(%rip),%rax # 601028 <dtor_idx.6533>
4004b1: 48 39 d8 cmp %rbx,%rax
4004b4: 72 e2 jb 400498 <__do_global_dtors_aux+0x38>
4004b6: c6 05 63 0b 20 00 01 movb $0x1,0x200b63(%rip) # 601020 <__bss_start>
4004bd: 48 83 c4 08 add $0x8,%rsp
4004c1: 5b pop %rbx
4004c2: 5d pop %rbp
4004c3: c3 retq
4004c4: 66 66 66 2e 0f 1f 84 data32 data32 nopw %cs:0x0(%rax,%rax,1)
4004cb: 00 00 00 00 00
00000000004004d0 <frame_dummy>:
4004d0: 48 83 3d 70 09 20 00 cmpq $0x0,0x200970(%rip) # 600e48 <__JCR_END__>
4004d7: 00
4004d8: 55 push %rbp
4004d9: 48 89 e5 mov %rsp,%rbp
4004dc: 74 12 je 4004f0 <frame_dummy+0x20>
4004de: b8 00 00 00 00 mov $0x0,%eax
4004e3: 48 85 c0 test %rax,%rax
4004e6: 74 08 je 4004f0 <frame_dummy+0x20>
4004e8: 5d pop %rbp
4004e9: bf 48 0e 60 00 mov $0x600e48,%edi
4004ee: ff e0 jmpq *%rax
4004f0: 5d pop %rbp
4004f1: c3 retq
4004f2: 90 nop
4004f3: 90 nop
00000000004004f4 <main>:
4004f4: 55 push %rbp
4004f5: 48 89 e5 mov %rsp,%rbp
4004f8: bf fc 05 40 00 mov $0x4005fc,%edi
4004fd: e8 ee fe ff ff callq 4003f0 <puts@plt>
400502: 5d pop %rbp
400503: c3 retq
400504: 90 nop
400505: 90 nop
400506: 90 nop
400507: 90 nop
400508: 90 nop
400509: 90 nop
40050a: 90 nop
40050b: 90 nop
40050c: 90 nop
40050d: 90 nop
40050e: 90 nop
40050f: 90 nop
0000000000400510 <__libc_csu_init>:
400510: 48 89 6c 24 d8 mov %rbp,-0x28(%rsp)
400515: 4c 89 64 24 e0 mov %r12,-0x20(%rsp)
40051a: 48 8d 2d 03 09 20 00 lea 0x200903(%rip),%rbp # 600e24 <__init_array_end>
400521: 4c 8d 25 fc 08 20 00 lea 0x2008fc(%rip),%r12 # 600e24 <__init_array_end>
400528: 4c 89 6c 24 e8 mov %r13,-0x18(%rsp)
40052d: 4c 89 74 24 f0 mov %r14,-0x10(%rsp)
400532: 4c 89 7c 24 f8 mov %r15,-0x8(%rsp)
400537: 48 89 5c 24 d0 mov %rbx,-0x30(%rsp)
40053c: 48 83 ec 38 sub $0x38,%rsp
400540: 4c 29 e5 sub %r12,%rbp
400543: 41 89 fd mov %edi,%r13d
400546: 49 89 f6 mov %rsi,%r14
400549: 48 c1 fd 03 sar $0x3,%rbp
40054d: 49 89 d7 mov %rdx,%r15
400550: e8 73 fe ff ff callq 4003c8 <_init>
400555: 48 85 ed test %rbp,%rbp
400558: 74 1c je 400576 <__libc_csu_init+0x66>
40055a: 31 db xor %ebx,%ebx
40055c: 0f 1f 40 00 nopl 0x0(%rax)
400560: 4c 89 fa mov %r15,%rdx
400563: 4c 89 f6 mov %r14,%rsi
400566: 44 89 ef mov %r13d,%edi
400569: 41 ff 14 dc callq *(%r12,%rbx,8)
40056d: 48 83 c3 01 add $0x1,%rbx
400571: 48 39 eb cmp %rbp,%rbx
400574: 75 ea jne 400560 <__libc_csu_init+0x50>
400576: 48 8b 5c 24 08 mov 0x8(%rsp),%rbx
40057b: 48 8b 6c 24 10 mov 0x10(%rsp),%rbp
400580: 4c 8b 64 24 18 mov 0x18(%rsp),%r12
400585: 4c 8b 6c 24 20 mov 0x20(%rsp),%r13
40058a: 4c 8b 74 24 28 mov 0x28(%rsp),%r14
40058f: 4c 8b 7c 24 30 mov 0x30(%rsp),%r15
400594: 48 83 c4 38 add $0x38,%rsp
400598: c3 retq
400599: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
00000000004005a0 <__libc_csu_fini>:
4005a0: f3 c3 repz retq
4005a2: 90 nop
4005a3: 90 nop
4005a4: 90 nop
4005a5: 90 nop
4005a6: 90 nop
4005a7: 90 nop
4005a8: 90 nop
4005a9: 90 nop
4005aa: 90 nop
4005ab: 90 nop
4005ac: 90 nop
4005ad: 90 nop
4005ae: 90 nop
4005af: 90 nop
00000000004005b0 <__do_global_ctors_aux>:
4005b0: 55 push %rbp
4005b1: 48 89 e5 mov %rsp,%rbp
4005b4: 53 push %rbx
4005b5: 48 83 ec 08 sub $0x8,%rsp
4005b9: 48 8b 05 68 08 20 00 mov 0x200868(%rip),%rax # 600e28 <__CTOR_LIST__>
4005c0: 48 83 f8 ff cmp $0xffffffffffffffff,%rax
4005c4: 74 19 je 4005df <__do_global_ctors_aux+0x2f>
4005c6: bb 28 0e 60 00 mov $0x600e28,%ebx
4005cb: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
4005d0: 48 83 eb 08 sub $0x8,%rbx
4005d4: ff d0 callq *%rax
4005d6: 48 8b 03 mov (%rbx),%rax
4005d9: 48 83 f8 ff cmp $0xffffffffffffffff,%rax
4005dd: 75 f1 jne 4005d0 <__do_global_ctors_aux+0x20>
4005df: 48 83 c4 08 add $0x8,%rsp
4005e3: 5b pop %rbx
4005e4: 5d pop %rbp
4005e5: c3 retq
4005e6: 90 nop
4005e7: 90 nop
Disassembly of section .fini:
00000000004005e8 <_fini>:
4005e8: 48 83 ec 08 sub $0x8,%rsp
4005ec: e8 6f fe ff ff callq 400460 <__do_global_dtors_aux>
4005f1: 48 83 c4 08 add $0x8,%rsp
4005f5: c3 retq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment