Skip to content

Instantly share code, notes, and snippets.

@samcv
Created February 13, 2017 22:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save samcv/3a0e5115bfe52ad5c836a8237f5d296c to your computer and use it in GitHub Desktop.
./build/bitfield: file format elf64-x86-64
Disassembly of section .init:
0000000000001e18 <_init>:
1e18: 48 83 ec 08 sub rsp,0x8
1e1c: 48 8b 05 bd 21 21 00 mov rax,QWORD PTR [rip+0x2121bd] # 213fe0 <_DYNAMIC+0x1f0>
1e23: 48 85 c0 test rax,rax
1e26: 74 02 je 1e2a <_init+0x12>
1e28: ff d0 call rax
1e2a: 48 83 c4 08 add rsp,0x8
1e2e: c3 ret
Disassembly of section .plt:
0000000000001e30 <__printf_chk@plt-0x10>:
1e30: ff 35 d2 21 21 00 push QWORD PTR [rip+0x2121d2] # 214008 <_GLOBAL_OFFSET_TABLE_+0x8>
1e36: ff 25 d4 21 21 00 jmp QWORD PTR [rip+0x2121d4] # 214010 <_GLOBAL_OFFSET_TABLE_+0x10>
1e3c: 0f 1f 40 00 nop DWORD PTR [rax+0x0]
0000000000001e40 <__printf_chk@plt>:
1e40: ff 25 d2 21 21 00 jmp QWORD PTR [rip+0x2121d2] # 214018 <_GLOBAL_OFFSET_TABLE_+0x18>
1e46: 68 00 00 00 00 push 0x0
1e4b: e9 e0 ff ff ff jmp 1e30 <_init+0x18>
Disassembly of section .plt.got:
0000000000001e50 <.plt.got>:
1e50: ff 25 a2 21 21 00 jmp QWORD PTR [rip+0x2121a2] # 213ff8 <_DYNAMIC+0x208>
1e56: 66 90 xchg ax,ax
Disassembly of section .text:
0000000000001e60 <main>:
1e60: 48 81 ec 28 10 00 00 sub rsp,0x1028
1e67: 48 83 0c 24 00 or QWORD PTR [rsp],0x0
1e6c: 48 81 c4 20 10 00 00 add rsp,0x1020
1e73: 48 8d 35 0a 03 00 00 lea rsi,[rip+0x30a] # 2184 <_IO_stdin_used+0x4>
1e7a: ba 01 00 00 00 mov edx,0x1
1e7f: bf 01 00 00 00 mov edi,0x1
1e84: 31 c0 xor eax,eax
1e86: e8 b5 ff ff ff call 1e40 <__printf_chk@plt>
1e8b: 31 c0 xor eax,eax
1e8d: 48 83 c4 08 add rsp,0x8
1e91: c3 ret
1e92: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
1e99: 00 00 00
1e9c: 0f 1f 40 00 nop DWORD PTR [rax+0x0]
0000000000001ea0 <_start>:
1ea0: 31 ed xor ebp,ebp
1ea2: 49 89 d1 mov r9,rdx
1ea5: 5e pop rsi
1ea6: 48 89 e2 mov rdx,rsp
1ea9: 48 83 e4 f0 and rsp,0xfffffffffffffff0
1ead: 50 push rax
1eae: 54 push rsp
1eaf: 4c 8d 05 ba 02 00 00 lea r8,[rip+0x2ba] # 2170 <__libc_csu_fini>
1eb6: 48 8d 0d 43 02 00 00 lea rcx,[rip+0x243] # 2100 <__libc_csu_init>
1ebd: 48 8d 3d 9c ff ff ff lea rdi,[rip+0xffffffffffffff9c] # 1e60 <main>
1ec4: ff 15 0e 21 21 00 call QWORD PTR [rip+0x21210e] # 213fd8 <_DYNAMIC+0x1e8>
1eca: f4 hlt
1ecb: 0f 1f 44 00 00 nop DWORD PTR [rax+rax*1+0x0]
0000000000001ed0 <deregister_tm_clones>:
1ed0: 48 8d 3d 41 2a 21 00 lea rdi,[rip+0x212a41] # 214918 <__TMC_END__>
1ed7: 48 8d 05 41 2a 21 00 lea rax,[rip+0x212a41] # 21491f <__TMC_END__+0x7>
1ede: 55 push rbp
1edf: 48 29 f8 sub rax,rdi
1ee2: 48 89 e5 mov rbp,rsp
1ee5: 48 83 f8 0e cmp rax,0xe
1ee9: 76 15 jbe 1f00 <deregister_tm_clones+0x30>
1eeb: 48 8b 05 de 20 21 00 mov rax,QWORD PTR [rip+0x2120de] # 213fd0 <_DYNAMIC+0x1e0>
1ef2: 48 85 c0 test rax,rax
1ef5: 74 09 je 1f00 <deregister_tm_clones+0x30>
1ef7: 5d pop rbp
1ef8: ff e0 jmp rax
1efa: 66 0f 1f 44 00 00 nop WORD PTR [rax+rax*1+0x0]
1f00: 5d pop rbp
1f01: c3 ret
1f02: 0f 1f 40 00 nop DWORD PTR [rax+0x0]
1f06: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
1f0d: 00 00 00
0000000000001f10 <register_tm_clones>:
1f10: 48 8d 3d 01 2a 21 00 lea rdi,[rip+0x212a01] # 214918 <__TMC_END__>
1f17: 48 8d 35 fa 29 21 00 lea rsi,[rip+0x2129fa] # 214918 <__TMC_END__>
1f1e: 55 push rbp
1f1f: 48 29 fe sub rsi,rdi
1f22: 48 89 e5 mov rbp,rsp
1f25: 48 c1 fe 03 sar rsi,0x3
1f29: 48 89 f0 mov rax,rsi
1f2c: 48 c1 e8 3f shr rax,0x3f
1f30: 48 01 c6 add rsi,rax
1f33: 48 d1 fe sar rsi,1
1f36: 74 18 je 1f50 <register_tm_clones+0x40>
1f38: 48 8b 05 b1 20 21 00 mov rax,QWORD PTR [rip+0x2120b1] # 213ff0 <_DYNAMIC+0x200>
1f3f: 48 85 c0 test rax,rax
1f42: 74 0c je 1f50 <register_tm_clones+0x40>
1f44: 5d pop rbp
1f45: ff e0 jmp rax
1f47: 66 0f 1f 84 00 00 00 nop WORD PTR [rax+rax*1+0x0]
1f4e: 00 00
1f50: 5d pop rbp
1f51: c3 ret
1f52: 0f 1f 40 00 nop DWORD PTR [rax+0x0]
1f56: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
1f5d: 00 00 00
0000000000001f60 <__do_global_dtors_aux>:
1f60: 80 3d b1 29 21 00 00 cmp BYTE PTR [rip+0x2129b1],0x0 # 214918 <__TMC_END__>
1f67: 75 27 jne 1f90 <__do_global_dtors_aux+0x30>
1f69: 48 83 3d 87 20 21 00 cmp QWORD PTR [rip+0x212087],0x0 # 213ff8 <_DYNAMIC+0x208>
1f70: 00
1f71: 55 push rbp
1f72: 48 89 e5 mov rbp,rsp
1f75: 74 0c je 1f83 <__do_global_dtors_aux+0x23>
1f77: 48 8b 3d aa 20 21 00 mov rdi,QWORD PTR [rip+0x2120aa] # 214028 <__dso_handle>
1f7e: e8 cd fe ff ff call 1e50 <__printf_chk@plt+0x10>
1f83: e8 48 ff ff ff call 1ed0 <deregister_tm_clones>
1f88: 5d pop rbp
1f89: c6 05 88 29 21 00 01 mov BYTE PTR [rip+0x212988],0x1 # 214918 <__TMC_END__>
1f90: f3 c3 repz ret
1f92: 0f 1f 40 00 nop DWORD PTR [rax+0x0]
1f96: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
1f9d: 00 00 00
0000000000001fa0 <frame_dummy>:
1fa0: 48 8d 3d 41 1e 21 00 lea rdi,[rip+0x211e41] # 213de8 <__JCR_END__>
1fa7: 48 83 3f 00 cmp QWORD PTR [rdi],0x0
1fab: 75 0b jne 1fb8 <frame_dummy+0x18>
1fad: e9 5e ff ff ff jmp 1f10 <register_tm_clones>
1fb2: 66 0f 1f 44 00 00 nop WORD PTR [rax+rax*1+0x0]
1fb8: 48 8b 05 29 20 21 00 mov rax,QWORD PTR [rip+0x212029] # 213fe8 <_DYNAMIC+0x1f8>
1fbf: 48 85 c0 test rax,rax
1fc2: 74 e9 je 1fad <frame_dummy+0xd>
1fc4: 55 push rbp
1fc5: 48 89 e5 mov rbp,rsp
1fc8: ff d0 call rax
1fca: 5d pop rbp
1fcb: e9 40 ff ff ff jmp 1f10 <register_tm_clones>
0000000000001fd0 <get_gencat>:
1fd0: 48 8d 05 f9 09 00 00 lea rax,[rip+0x9f9] # 29d0 <sorted_table+0x10>
1fd7: c6 46 02 00 mov BYTE PTR [rsi+0x2],0x0
1fdb: 41 ba 0e 00 00 00 mov r10d,0xe
1fe1: 45 31 c0 xor r8d,r8d
1fe4: 48 89 c2 mov rdx,rax
1fe7: eb 0d jmp 1ff6 <get_gencat+0x26>
1fe9: 0f 1f 80 00 00 00 00 nop DWORD PTR [rax+0x0]
1ff0: 41 89 ca mov r10d,ecx
1ff3: 4d 63 c1 movsxd r8,r9d
1ff6: 48 83 c2 10 add rdx,0x10
1ffa: 8b 4a f0 mov ecx,DWORD PTR [rdx-0x10]
1ffd: 45 8d 48 01 lea r9d,[r8+0x1]
2001: 39 cf cmp edi,ecx
2003: 73 eb jae 1ff0 <get_gencat+0x20>
2005: 44 39 d7 cmp edi,r10d
2008: 0f 83 b0 00 00 00 jae 20be <get_gencat+0xee>
200e: 48 8d 0d 6b 47 00 00 lea rcx,[rip+0x476b] # 6780 <point_index>
2015: 89 fa mov edx,edi
2017: 0f b7 14 51 movzx edx,WORD PTR [rcx+rdx*2]
201b: 4c 8d 15 7e a1 00 00 lea r10,[rip+0xa17e] # c1a0 <mybitfield>
2022: 48 8d 14 92 lea rdx,[rdx+rdx*4]
2026: 48 8d 0d 13 20 21 00 lea rcx,[rip+0x212013] # 214040 <General_Category_1>
202d: 41 b9 0e 00 00 00 mov r9d,0xe
2033: 41 0f b6 54 92 04 movzx edx,BYTE PTR [r10+rdx*4+0x4]
2039: c0 ea 05 shr dl,0x5
203c: 83 e2 07 and edx,0x7
203f: 0f b6 14 11 movzx edx,BYTE PTR [rcx+rdx*1]
2043: 31 c9 xor ecx,ecx
2045: 88 16 mov BYTE PTR [rsi],dl
2047: eb 0d jmp 2056 <get_gencat+0x86>
2049: 0f 1f 80 00 00 00 00 nop DWORD PTR [rax+0x0]
2050: 41 89 d1 mov r9d,edx
2053: 49 63 c8 movsxd rcx,r8d
2056: 48 83 c0 10 add rax,0x10
205a: 8b 50 f0 mov edx,DWORD PTR [rax-0x10]
205d: 44 8d 41 01 lea r8d,[rcx+0x1]
2061: 39 d7 cmp edi,edx
2063: 73 eb jae 2050 <get_gencat+0x80>
2065: 44 39 cf cmp edi,r9d
2068: 73 31 jae 209b <get_gencat+0xcb>
206a: 48 8d 05 0f 47 00 00 lea rax,[rip+0x470f] # 6780 <point_index>
2071: 89 ff mov edi,edi
2073: 0f b7 04 78 movzx eax,WORD PTR [rax+rdi*2]
2077: 48 8d 04 80 lea rax,[rax+rax*4]
207b: 48 8d 15 ae 1f 21 00 lea rdx,[rip+0x211fae] # 214030 <General_Category_2>
2082: 41 0f b6 44 82 06 movzx eax,BYTE PTR [r10+rax*4+0x6]
2088: c0 e8 04 shr al,0x4
208b: 83 e0 0f and eax,0xf
208e: 0f b6 04 02 movzx eax,BYTE PTR [rdx+rax*1]
2092: 88 46 01 mov BYTE PTR [rsi+0x1],al
2095: b8 01 00 00 00 mov eax,0x1
209a: c3 ret
209b: 48 8d 05 1e 09 00 00 lea rax,[rip+0x91e] # 29c0 <sorted_table>
20a2: 48 c1 e1 04 shl rcx,0x4
20a6: 48 01 c1 add rcx,rax
20a9: 3b 79 04 cmp edi,DWORD PTR [rcx+0x4]
20ac: 76 43 jbe 20f1 <get_gencat+0x121>
20ae: 2b 79 0c sub edi,DWORD PTR [rcx+0xc]
20b1: 48 8d 05 c8 46 00 00 lea rax,[rip+0x46c8] # 6780 <point_index>
20b8: 0f b7 04 78 movzx eax,WORD PTR [rax+rdi*2]
20bc: eb b9 jmp 2077 <get_gencat+0xa7>
20be: 48 8d 15 fb 08 00 00 lea rdx,[rip+0x8fb] # 29c0 <sorted_table>
20c5: 49 c1 e0 04 shl r8,0x4
20c9: 49 01 d0 add r8,rdx
20cc: 41 3b 78 04 cmp edi,DWORD PTR [r8+0x4]
20d0: 77 09 ja 20db <get_gencat+0x10b>
20d2: 49 63 50 08 movsxd rdx,DWORD PTR [r8+0x8]
20d6: e9 40 ff ff ff jmp 201b <get_gencat+0x4b>
20db: 89 f9 mov ecx,edi
20dd: 41 2b 48 0c sub ecx,DWORD PTR [r8+0xc]
20e1: 48 8d 15 98 46 00 00 lea rdx,[rip+0x4698] # 6780 <point_index>
20e8: 0f b7 14 4a movzx edx,WORD PTR [rdx+rcx*2]
20ec: e9 2a ff ff ff jmp 201b <get_gencat+0x4b>
20f1: 48 63 41 08 movsxd rax,DWORD PTR [rcx+0x8]
20f5: eb 80 jmp 2077 <get_gencat+0xa7>
20f7: 66 0f 1f 84 00 00 00 nop WORD PTR [rax+rax*1+0x0]
20fe: 00 00
0000000000002100 <__libc_csu_init>:
2100: 41 57 push r15
2102: 41 56 push r14
2104: 41 89 ff mov r15d,edi
2107: 41 55 push r13
2109: 41 54 push r12
210b: 4c 8d 25 c6 1c 21 00 lea r12,[rip+0x211cc6] # 213dd8 <__frame_dummy_init_array_entry>
2112: 55 push rbp
2113: 48 8d 2d c6 1c 21 00 lea rbp,[rip+0x211cc6] # 213de0 <__init_array_end>
211a: 53 push rbx
211b: 49 89 f6 mov r14,rsi
211e: 49 89 d5 mov r13,rdx
2121: 4c 29 e5 sub rbp,r12
2124: 48 83 ec 08 sub rsp,0x8
2128: 48 c1 fd 03 sar rbp,0x3
212c: e8 e7 fc ff ff call 1e18 <_init>
2131: 48 85 ed test rbp,rbp
2134: 74 20 je 2156 <__libc_csu_init+0x56>
2136: 31 db xor ebx,ebx
2138: 0f 1f 84 00 00 00 00 nop DWORD PTR [rax+rax*1+0x0]
213f: 00
2140: 4c 89 ea mov rdx,r13
2143: 4c 89 f6 mov rsi,r14
2146: 44 89 ff mov edi,r15d
2149: 41 ff 14 dc call QWORD PTR [r12+rbx*8]
214d: 48 83 c3 01 add rbx,0x1
2151: 48 39 dd cmp rbp,rbx
2154: 75 ea jne 2140 <__libc_csu_init+0x40>
2156: 48 83 c4 08 add rsp,0x8
215a: 5b pop rbx
215b: 5d pop rbp
215c: 41 5c pop r12
215e: 41 5d pop r13
2160: 41 5e pop r14
2162: 41 5f pop r15
2164: c3 ret
2165: 90 nop
2166: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
216d: 00 00 00
0000000000002170 <__libc_csu_fini>:
2170: f3 c3 repz ret
Disassembly of section .fini:
0000000000002174 <_fini>:
2174: 48 83 ec 08 sub rsp,0x8
2178: 48 83 c4 08 add rsp,0x8
217c: c3 ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment