Skip to content

Instantly share code, notes, and snippets.

@samcv
Created February 13, 2017 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samcv/748cea9beae13990dbeafe28e14eb3d9 to your computer and use it in GitHub Desktop.
Save samcv/748cea9beae13990dbeafe28e14eb3d9 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: 41 55 push r13
1e62: 41 54 push r12
1e64: 55 push rbp
1e65: 53 push rbx
1e66: 48 81 ec 28 10 00 00 sub rsp,0x1028
1e6d: 48 83 0c 24 00 or QWORD PTR [rsp],0x0
1e72: 48 81 c4 20 10 00 00 add rsp,0x1020
1e79: 48 8d 1d a0 49 1e 00 lea rbx,[rip+0x1e49a0] # 1e6820 <__FRAME_END__+0x1d2fb0>
1e80: 48 8d 2d d9 0b 00 00 lea rbp,[rip+0xbd9] # 2a60 <sorted_table>
1e87: 4c 8d 25 92 49 00 00 lea r12,[rip+0x4992] # 6820 <point_index>
1e8e: 41 bd 00 00 0f 00 mov r13d,0xf0000
1e94: 48 8d 05 d5 0b 00 00 lea rax,[rip+0xbd5] # 2a70 <sorted_table+0x10>
1e9b: 31 d2 xor edx,edx
1e9d: eb 04 jmp 1ea3 <main+0x43>
1e9f: 90 nop
1ea0: 48 63 d1 movsxd rdx,ecx
1ea3: 48 83 c0 10 add rax,0x10
1ea7: 8d 4a 01 lea ecx,[rdx+0x1]
1eaa: 44 39 68 f0 cmp DWORD PTR [rax-0x10],r13d
1eae: 76 f0 jbe 1ea0 <main+0x40>
1eb0: 48 c1 e2 04 shl rdx,0x4
1eb4: 48 8d 44 15 00 lea rax,[rbp+rdx*1+0x0]
1eb9: 44 39 28 cmp DWORD PTR [rax],r13d
1ebc: 76 48 jbe 1f06 <main+0xa6>
1ebe: 0f b7 0b movzx ecx,WORD PTR [rbx]
1ec1: 48 8d 35 3c 03 00 00 lea rsi,[rip+0x33c] # 2204 <_IO_stdin_used+0x4>
1ec8: 44 89 ea mov edx,r13d
1ecb: 31 c0 xor eax,eax
1ecd: bf 01 00 00 00 mov edi,0x1
1ed2: 48 83 eb 02 sub rbx,0x2
1ed6: e8 65 ff ff ff call 1e40 <__printf_chk@plt>
1edb: 41 83 ed 01 sub r13d,0x1
1edf: 75 b3 jne 1e94 <main+0x34>
1ee1: 48 8d 35 25 03 00 00 lea rsi,[rip+0x325] # 220d <_IO_stdin_used+0xd>
1ee8: ba 01 00 00 00 mov edx,0x1
1eed: bf 01 00 00 00 mov edi,0x1
1ef2: 31 c0 xor eax,eax
1ef4: e8 47 ff ff ff call 1e40 <__printf_chk@plt>
1ef9: 48 83 c4 08 add rsp,0x8
1efd: 31 c0 xor eax,eax
1eff: 5b pop rbx
1f00: 5d pop rbp
1f01: 41 5c pop r12
1f03: 41 5d pop r13
1f05: c3 ret
1f06: 44 39 68 04 cmp DWORD PTR [rax+0x4],r13d
1f0a: 72 05 jb 1f11 <main+0xb1>
1f0c: 8b 48 08 mov ecx,DWORD PTR [rax+0x8]
1f0f: eb b0 jmp 1ec1 <main+0x61>
1f11: 44 89 ee mov esi,r13d
1f14: 2b 70 0c sub esi,DWORD PTR [rax+0xc]
1f17: 41 0f b7 0c 74 movzx ecx,WORD PTR [r12+rsi*2]
1f1c: eb a3 jmp 1ec1 <main+0x61>
1f1e: 66 90 xchg ax,ax
0000000000001f20 <_start>:
1f20: 31 ed xor ebp,ebp
1f22: 49 89 d1 mov r9,rdx
1f25: 5e pop rsi
1f26: 48 89 e2 mov rdx,rsp
1f29: 48 83 e4 f0 and rsp,0xfffffffffffffff0
1f2d: 50 push rax
1f2e: 54 push rsp
1f2f: 4c 8d 05 ba 02 00 00 lea r8,[rip+0x2ba] # 21f0 <__libc_csu_fini>
1f36: 48 8d 0d 43 02 00 00 lea rcx,[rip+0x243] # 2180 <__libc_csu_init>
1f3d: 48 8d 3d 1c ff ff ff lea rdi,[rip+0xffffffffffffff1c] # 1e60 <main>
1f44: ff 15 8e 20 21 00 call QWORD PTR [rip+0x21208e] # 213fd8 <_DYNAMIC+0x1e8>
1f4a: f4 hlt
1f4b: 0f 1f 44 00 00 nop DWORD PTR [rax+rax*1+0x0]
0000000000001f50 <deregister_tm_clones>:
1f50: 48 8d 3d c1 29 21 00 lea rdi,[rip+0x2129c1] # 214918 <__TMC_END__>
1f57: 48 8d 05 c1 29 21 00 lea rax,[rip+0x2129c1] # 21491f <__TMC_END__+0x7>
1f5e: 55 push rbp
1f5f: 48 29 f8 sub rax,rdi
1f62: 48 89 e5 mov rbp,rsp
1f65: 48 83 f8 0e cmp rax,0xe
1f69: 76 15 jbe 1f80 <deregister_tm_clones+0x30>
1f6b: 48 8b 05 5e 20 21 00 mov rax,QWORD PTR [rip+0x21205e] # 213fd0 <_DYNAMIC+0x1e0>
1f72: 48 85 c0 test rax,rax
1f75: 74 09 je 1f80 <deregister_tm_clones+0x30>
1f77: 5d pop rbp
1f78: ff e0 jmp rax
1f7a: 66 0f 1f 44 00 00 nop WORD PTR [rax+rax*1+0x0]
1f80: 5d pop rbp
1f81: c3 ret
1f82: 0f 1f 40 00 nop DWORD PTR [rax+0x0]
1f86: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
1f8d: 00 00 00
0000000000001f90 <register_tm_clones>:
1f90: 48 8d 3d 81 29 21 00 lea rdi,[rip+0x212981] # 214918 <__TMC_END__>
1f97: 48 8d 35 7a 29 21 00 lea rsi,[rip+0x21297a] # 214918 <__TMC_END__>
1f9e: 55 push rbp
1f9f: 48 29 fe sub rsi,rdi
1fa2: 48 89 e5 mov rbp,rsp
1fa5: 48 c1 fe 03 sar rsi,0x3
1fa9: 48 89 f0 mov rax,rsi
1fac: 48 c1 e8 3f shr rax,0x3f
1fb0: 48 01 c6 add rsi,rax
1fb3: 48 d1 fe sar rsi,1
1fb6: 74 18 je 1fd0 <register_tm_clones+0x40>
1fb8: 48 8b 05 31 20 21 00 mov rax,QWORD PTR [rip+0x212031] # 213ff0 <_DYNAMIC+0x200>
1fbf: 48 85 c0 test rax,rax
1fc2: 74 0c je 1fd0 <register_tm_clones+0x40>
1fc4: 5d pop rbp
1fc5: ff e0 jmp rax
1fc7: 66 0f 1f 84 00 00 00 nop WORD PTR [rax+rax*1+0x0]
1fce: 00 00
1fd0: 5d pop rbp
1fd1: c3 ret
1fd2: 0f 1f 40 00 nop DWORD PTR [rax+0x0]
1fd6: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
1fdd: 00 00 00
0000000000001fe0 <__do_global_dtors_aux>:
1fe0: 80 3d 31 29 21 00 00 cmp BYTE PTR [rip+0x212931],0x0 # 214918 <__TMC_END__>
1fe7: 75 27 jne 2010 <__do_global_dtors_aux+0x30>
1fe9: 48 83 3d 07 20 21 00 cmp QWORD PTR [rip+0x212007],0x0 # 213ff8 <_DYNAMIC+0x208>
1ff0: 00
1ff1: 55 push rbp
1ff2: 48 89 e5 mov rbp,rsp
1ff5: 74 0c je 2003 <__do_global_dtors_aux+0x23>
1ff7: 48 8b 3d 2a 20 21 00 mov rdi,QWORD PTR [rip+0x21202a] # 214028 <__dso_handle>
1ffe: e8 4d fe ff ff call 1e50 <__printf_chk@plt+0x10>
2003: e8 48 ff ff ff call 1f50 <deregister_tm_clones>
2008: 5d pop rbp
2009: c6 05 08 29 21 00 01 mov BYTE PTR [rip+0x212908],0x1 # 214918 <__TMC_END__>
2010: f3 c3 repz ret
2012: 0f 1f 40 00 nop DWORD PTR [rax+0x0]
2016: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
201d: 00 00 00
0000000000002020 <frame_dummy>:
2020: 48 8d 3d c1 1d 21 00 lea rdi,[rip+0x211dc1] # 213de8 <__JCR_END__>
2027: 48 83 3f 00 cmp QWORD PTR [rdi],0x0
202b: 75 0b jne 2038 <frame_dummy+0x18>
202d: e9 5e ff ff ff jmp 1f90 <register_tm_clones>
2032: 66 0f 1f 44 00 00 nop WORD PTR [rax+rax*1+0x0]
2038: 48 8b 05 a9 1f 21 00 mov rax,QWORD PTR [rip+0x211fa9] # 213fe8 <_DYNAMIC+0x1f8>
203f: 48 85 c0 test rax,rax
2042: 74 e9 je 202d <frame_dummy+0xd>
2044: 55 push rbp
2045: 48 89 e5 mov rbp,rsp
2048: ff d0 call rax
204a: 5d pop rbp
204b: e9 40 ff ff ff jmp 1f90 <register_tm_clones>
0000000000002050 <get_gencat>:
2050: 48 8d 05 19 0a 00 00 lea rax,[rip+0xa19] # 2a70 <sorted_table+0x10>
2057: c6 46 02 00 mov BYTE PTR [rsi+0x2],0x0
205b: 41 ba 0e 00 00 00 mov r10d,0xe
2061: 45 31 c0 xor r8d,r8d
2064: 48 89 c2 mov rdx,rax
2067: eb 0d jmp 2076 <get_gencat+0x26>
2069: 0f 1f 80 00 00 00 00 nop DWORD PTR [rax+0x0]
2070: 41 89 ca mov r10d,ecx
2073: 4d 63 c1 movsxd r8,r9d
2076: 48 83 c2 10 add rdx,0x10
207a: 8b 4a f0 mov ecx,DWORD PTR [rdx-0x10]
207d: 45 8d 48 01 lea r9d,[r8+0x1]
2081: 39 cf cmp edi,ecx
2083: 73 eb jae 2070 <get_gencat+0x20>
2085: 44 39 d7 cmp edi,r10d
2088: 0f 83 b0 00 00 00 jae 213e <get_gencat+0xee>
208e: 48 8d 0d 8b 47 00 00 lea rcx,[rip+0x478b] # 6820 <point_index>
2095: 89 fa mov edx,edi
2097: 0f b7 14 51 movzx edx,WORD PTR [rcx+rdx*2]
209b: 4c 8d 15 9e a1 00 00 lea r10,[rip+0xa19e] # c240 <mybitfield>
20a2: 48 8d 14 92 lea rdx,[rdx+rdx*4]
20a6: 48 8d 0d 93 1f 21 00 lea rcx,[rip+0x211f93] # 214040 <General_Category_1>
20ad: 41 b9 0e 00 00 00 mov r9d,0xe
20b3: 41 0f b6 54 92 04 movzx edx,BYTE PTR [r10+rdx*4+0x4]
20b9: c0 ea 05 shr dl,0x5
20bc: 83 e2 07 and edx,0x7
20bf: 0f b6 14 11 movzx edx,BYTE PTR [rcx+rdx*1]
20c3: 31 c9 xor ecx,ecx
20c5: 88 16 mov BYTE PTR [rsi],dl
20c7: eb 0d jmp 20d6 <get_gencat+0x86>
20c9: 0f 1f 80 00 00 00 00 nop DWORD PTR [rax+0x0]
20d0: 41 89 d1 mov r9d,edx
20d3: 49 63 c8 movsxd rcx,r8d
20d6: 48 83 c0 10 add rax,0x10
20da: 8b 50 f0 mov edx,DWORD PTR [rax-0x10]
20dd: 44 8d 41 01 lea r8d,[rcx+0x1]
20e1: 39 d7 cmp edi,edx
20e3: 73 eb jae 20d0 <get_gencat+0x80>
20e5: 44 39 cf cmp edi,r9d
20e8: 73 31 jae 211b <get_gencat+0xcb>
20ea: 48 8d 05 2f 47 00 00 lea rax,[rip+0x472f] # 6820 <point_index>
20f1: 89 ff mov edi,edi
20f3: 0f b7 04 78 movzx eax,WORD PTR [rax+rdi*2]
20f7: 48 8d 04 80 lea rax,[rax+rax*4]
20fb: 48 8d 15 2e 1f 21 00 lea rdx,[rip+0x211f2e] # 214030 <General_Category_2>
2102: 41 0f b6 44 82 06 movzx eax,BYTE PTR [r10+rax*4+0x6]
2108: c0 e8 04 shr al,0x4
210b: 83 e0 0f and eax,0xf
210e: 0f b6 04 02 movzx eax,BYTE PTR [rdx+rax*1]
2112: 88 46 01 mov BYTE PTR [rsi+0x1],al
2115: b8 01 00 00 00 mov eax,0x1
211a: c3 ret
211b: 48 8d 05 3e 09 00 00 lea rax,[rip+0x93e] # 2a60 <sorted_table>
2122: 48 c1 e1 04 shl rcx,0x4
2126: 48 01 c1 add rcx,rax
2129: 3b 79 04 cmp edi,DWORD PTR [rcx+0x4]
212c: 76 43 jbe 2171 <get_gencat+0x121>
212e: 2b 79 0c sub edi,DWORD PTR [rcx+0xc]
2131: 48 8d 05 e8 46 00 00 lea rax,[rip+0x46e8] # 6820 <point_index>
2138: 0f b7 04 78 movzx eax,WORD PTR [rax+rdi*2]
213c: eb b9 jmp 20f7 <get_gencat+0xa7>
213e: 48 8d 15 1b 09 00 00 lea rdx,[rip+0x91b] # 2a60 <sorted_table>
2145: 49 c1 e0 04 shl r8,0x4
2149: 49 01 d0 add r8,rdx
214c: 41 3b 78 04 cmp edi,DWORD PTR [r8+0x4]
2150: 77 09 ja 215b <get_gencat+0x10b>
2152: 49 63 50 08 movsxd rdx,DWORD PTR [r8+0x8]
2156: e9 40 ff ff ff jmp 209b <get_gencat+0x4b>
215b: 89 f9 mov ecx,edi
215d: 41 2b 48 0c sub ecx,DWORD PTR [r8+0xc]
2161: 48 8d 15 b8 46 00 00 lea rdx,[rip+0x46b8] # 6820 <point_index>
2168: 0f b7 14 4a movzx edx,WORD PTR [rdx+rcx*2]
216c: e9 2a ff ff ff jmp 209b <get_gencat+0x4b>
2171: 48 63 41 08 movsxd rax,DWORD PTR [rcx+0x8]
2175: eb 80 jmp 20f7 <get_gencat+0xa7>
2177: 66 0f 1f 84 00 00 00 nop WORD PTR [rax+rax*1+0x0]
217e: 00 00
0000000000002180 <__libc_csu_init>:
2180: 41 57 push r15
2182: 41 56 push r14
2184: 41 89 ff mov r15d,edi
2187: 41 55 push r13
2189: 41 54 push r12
218b: 4c 8d 25 46 1c 21 00 lea r12,[rip+0x211c46] # 213dd8 <__frame_dummy_init_array_entry>
2192: 55 push rbp
2193: 48 8d 2d 46 1c 21 00 lea rbp,[rip+0x211c46] # 213de0 <__init_array_end>
219a: 53 push rbx
219b: 49 89 f6 mov r14,rsi
219e: 49 89 d5 mov r13,rdx
21a1: 4c 29 e5 sub rbp,r12
21a4: 48 83 ec 08 sub rsp,0x8
21a8: 48 c1 fd 03 sar rbp,0x3
21ac: e8 67 fc ff ff call 1e18 <_init>
21b1: 48 85 ed test rbp,rbp
21b4: 74 20 je 21d6 <__libc_csu_init+0x56>
21b6: 31 db xor ebx,ebx
21b8: 0f 1f 84 00 00 00 00 nop DWORD PTR [rax+rax*1+0x0]
21bf: 00
21c0: 4c 89 ea mov rdx,r13
21c3: 4c 89 f6 mov rsi,r14
21c6: 44 89 ff mov edi,r15d
21c9: 41 ff 14 dc call QWORD PTR [r12+rbx*8]
21cd: 48 83 c3 01 add rbx,0x1
21d1: 48 39 dd cmp rbp,rbx
21d4: 75 ea jne 21c0 <__libc_csu_init+0x40>
21d6: 48 83 c4 08 add rsp,0x8
21da: 5b pop rbx
21db: 5d pop rbp
21dc: 41 5c pop r12
21de: 41 5d pop r13
21e0: 41 5e pop r14
21e2: 41 5f pop r15
21e4: c3 ret
21e5: 90 nop
21e6: 66 2e 0f 1f 84 00 00 nop WORD PTR cs:[rax+rax*1+0x0]
21ed: 00 00 00
00000000000021f0 <__libc_csu_fini>:
21f0: f3 c3 repz ret
Disassembly of section .fini:
00000000000021f4 <_fini>:
21f4: 48 83 ec 08 sub rsp,0x8
21f8: 48 83 c4 08 add rsp,0x8
21fc: c3 ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment