Skip to content

Instantly share code, notes, and snippets.

@cjhanks
Created January 22, 2016 23:50
Show Gist options
  • Save cjhanks/c9a761ff3a98788f385e to your computer and use it in GitHub Desktop.
Save cjhanks/c9a761ff3a98788f385e to your computer and use it in GitHub Desktop.
Decompiled
a.out: file format elf64-x86-64
Disassembly of section .init:
00000000004003a8 <_init>:
4003a8: 48 83 ec 08 sub $0x8,%rsp
4003ac: 48 8b 05 45 0c 20 00 mov 0x200c45(%rip),%rax # 600ff8 <_DYNAMIC+0x1d0>
4003b3: 48 85 c0 test %rax,%rax
4003b6: 74 05 je 4003bd <_init+0x15>
4003b8: e8 33 00 00 00 callq 4003f0 <__gmon_start__@plt>
4003bd: 48 83 c4 08 add $0x8,%rsp
4003c1: c3 retq
Disassembly of section .plt:
00000000004003d0 <__libc_start_main@plt-0x10>:
4003d0: ff 35 32 0c 20 00 pushq 0x200c32(%rip) # 601008 <_GLOBAL_OFFSET_TABLE_+0x8>
4003d6: ff 25 34 0c 20 00 jmpq *0x200c34(%rip) # 601010 <_GLOBAL_OFFSET_TABLE_+0x10>
4003dc: 0f 1f 40 00 nopl 0x0(%rax)
00000000004003e0 <__libc_start_main@plt>:
4003e0: ff 25 32 0c 20 00 jmpq *0x200c32(%rip) # 601018 <_GLOBAL_OFFSET_TABLE_+0x18>
4003e6: 68 00 00 00 00 pushq $0x0
4003eb: e9 e0 ff ff ff jmpq 4003d0 <_init+0x28>
00000000004003f0 <__gmon_start__@plt>:
4003f0: ff 25 2a 0c 20 00 jmpq *0x200c2a(%rip) # 601020 <_GLOBAL_OFFSET_TABLE_+0x20>
4003f6: 68 01 00 00 00 pushq $0x1
4003fb: e9 d0 ff ff ff jmpq 4003d0 <_init+0x28>
Disassembly of section .text:
0000000000400400 <main>:
int
main(int, char*[])
{
400400: 31 c0 xor %eax,%eax
400402: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
}
}
{
volatile int b;
for (int i = 0; i < 1000000; ++i) {
b = i;
400408: 89 44 24 fc mov %eax,-0x4(%rsp)
b = i;
}
}
{
volatile int b;
for (int i = 0; i < 1000000; ++i) {
40040c: 83 c0 01 add $0x1,%eax
40040f: 3d 40 42 0f 00 cmp $0xf4240,%eax
400414: 75 f2 jne 400408 <main+0x8>
b = i;
}
}
}
400416: 31 c0 xor %eax,%eax
400418: c3 retq
0000000000400419 <_start>:
400419: 31 ed xor %ebp,%ebp
40041b: 49 89 d1 mov %rdx,%r9
40041e: 5e pop %rsi
40041f: 48 89 e2 mov %rsp,%rdx
400422: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp
400426: 50 push %rax
400427: 54 push %rsp
400428: 49 c7 c0 80 05 40 00 mov $0x400580,%r8
40042f: 48 c7 c1 10 05 40 00 mov $0x400510,%rcx
400436: 48 c7 c7 00 04 40 00 mov $0x400400,%rdi
40043d: e8 9e ff ff ff callq 4003e0 <__libc_start_main@plt>
400442: f4 hlt
400443: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
40044a: 00 00 00
40044d: 0f 1f 00 nopl (%rax)
0000000000400450 <deregister_tm_clones>:
400450: b8 3f 10 60 00 mov $0x60103f,%eax
400455: 55 push %rbp
400456: 48 2d 38 10 60 00 sub $0x601038,%rax
40045c: 48 83 f8 0e cmp $0xe,%rax
400460: 48 89 e5 mov %rsp,%rbp
400463: 77 02 ja 400467 <deregister_tm_clones+0x17>
400465: 5d pop %rbp
400466: c3 retq
400467: b8 00 00 00 00 mov $0x0,%eax
40046c: 48 85 c0 test %rax,%rax
40046f: 74 f4 je 400465 <deregister_tm_clones+0x15>
400471: 5d pop %rbp
400472: bf 38 10 60 00 mov $0x601038,%edi
400477: ff e0 jmpq *%rax
400479: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
0000000000400480 <register_tm_clones>:
400480: b8 38 10 60 00 mov $0x601038,%eax
400485: 55 push %rbp
400486: 48 2d 38 10 60 00 sub $0x601038,%rax
40048c: 48 c1 f8 03 sar $0x3,%rax
400490: 48 89 e5 mov %rsp,%rbp
400493: 48 89 c2 mov %rax,%rdx
400496: 48 c1 ea 3f shr $0x3f,%rdx
40049a: 48 01 d0 add %rdx,%rax
40049d: 48 d1 f8 sar %rax
4004a0: 75 02 jne 4004a4 <register_tm_clones+0x24>
4004a2: 5d pop %rbp
4004a3: c3 retq
4004a4: ba 00 00 00 00 mov $0x0,%edx
4004a9: 48 85 d2 test %rdx,%rdx
4004ac: 74 f4 je 4004a2 <register_tm_clones+0x22>
4004ae: 5d pop %rbp
4004af: 48 89 c6 mov %rax,%rsi
4004b2: bf 38 10 60 00 mov $0x601038,%edi
4004b7: ff e2 jmpq *%rdx
4004b9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
00000000004004c0 <__do_global_dtors_aux>:
4004c0: 80 3d 71 0b 20 00 00 cmpb $0x0,0x200b71(%rip) # 601038 <__TMC_END__>
4004c7: 75 11 jne 4004da <__do_global_dtors_aux+0x1a>
4004c9: 55 push %rbp
4004ca: 48 89 e5 mov %rsp,%rbp
4004cd: e8 7e ff ff ff callq 400450 <deregister_tm_clones>
4004d2: 5d pop %rbp
4004d3: c6 05 5e 0b 20 00 01 movb $0x1,0x200b5e(%rip) # 601038 <__TMC_END__>
4004da: f3 c3 repz retq
4004dc: 0f 1f 40 00 nopl 0x0(%rax)
00000000004004e0 <frame_dummy>:
4004e0: 48 83 3d 38 09 20 00 cmpq $0x0,0x200938(%rip) # 600e20 <__JCR_END__>
4004e7: 00
4004e8: 74 1e je 400508 <frame_dummy+0x28>
4004ea: b8 00 00 00 00 mov $0x0,%eax
4004ef: 48 85 c0 test %rax,%rax
4004f2: 74 14 je 400508 <frame_dummy+0x28>
4004f4: 55 push %rbp
4004f5: bf 20 0e 60 00 mov $0x600e20,%edi
4004fa: 48 89 e5 mov %rsp,%rbp
4004fd: ff d0 callq *%rax
4004ff: 5d pop %rbp
400500: e9 7b ff ff ff jmpq 400480 <register_tm_clones>
400505: 0f 1f 00 nopl (%rax)
400508: e9 73 ff ff ff jmpq 400480 <register_tm_clones>
40050d: 0f 1f 00 nopl (%rax)
0000000000400510 <__libc_csu_init>:
400510: 41 57 push %r15
400512: 41 89 ff mov %edi,%r15d
400515: 41 56 push %r14
400517: 49 89 f6 mov %rsi,%r14
40051a: 41 55 push %r13
40051c: 49 89 d5 mov %rdx,%r13
40051f: 41 54 push %r12
400521: 4c 8d 25 e8 08 20 00 lea 0x2008e8(%rip),%r12 # 600e10 <__frame_dummy_init_array_entry>
400528: 55 push %rbp
400529: 48 8d 2d e8 08 20 00 lea 0x2008e8(%rip),%rbp # 600e18 <__init_array_end>
400530: 53 push %rbx
400531: 4c 29 e5 sub %r12,%rbp
400534: 31 db xor %ebx,%ebx
400536: 48 c1 fd 03 sar $0x3,%rbp
40053a: 48 83 ec 08 sub $0x8,%rsp
40053e: e8 65 fe ff ff callq 4003a8 <_init>
400543: 48 85 ed test %rbp,%rbp
400546: 74 1e je 400566 <__libc_csu_init+0x56>
400548: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
40054f: 00
400550: 4c 89 ea mov %r13,%rdx
400553: 4c 89 f6 mov %r14,%rsi
400556: 44 89 ff mov %r15d,%edi
400559: 41 ff 14 dc callq *(%r12,%rbx,8)
40055d: 48 83 c3 01 add $0x1,%rbx
400561: 48 39 eb cmp %rbp,%rbx
400564: 75 ea jne 400550 <__libc_csu_init+0x40>
400566: 48 83 c4 08 add $0x8,%rsp
40056a: 5b pop %rbx
40056b: 5d pop %rbp
40056c: 41 5c pop %r12
40056e: 41 5d pop %r13
400570: 41 5e pop %r14
400572: 41 5f pop %r15
400574: c3 retq
400575: 66 66 2e 0f 1f 84 00 data32 nopw %cs:0x0(%rax,%rax,1)
40057c: 00 00 00 00
0000000000400580 <__libc_csu_fini>:
400580: f3 c3 repz retq
Disassembly of section .fini:
0000000000400584 <_fini>:
400584: 48 83 ec 08 sub $0x8,%rsp
400588: 48 83 c4 08 add $0x8,%rsp
40058c: c3 retq
int
main(int, char*[])
{
{
int b;
for (int i = 0; i < 1000000; ++i) {
b = i;
}
}
{
volatile int b;
for (int i = 0; i < 1000000; ++i) {
b = i;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment