-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathasm_code.txt
193 lines (171 loc) · 8.7 KB
/
asm_code.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
sample: file format elf64-x86-64
Disassembly of section .init:
0000000000001000 <_init>:
1000: f3 0f 1e fa endbr64
1004: 48 83 ec 08 sub $0x8,%rsp
1008: 48 8b 05 d9 2f 00 00 mov 0x2fd9(%rip),%rax # 3fe8 <__gmon_start__@Base>
100f: 48 85 c0 test %rax,%rax
1012: 74 02 je 1016 <_init+0x16>
1014: ff d0 call *%rax
1016: 48 83 c4 08 add $0x8,%rsp
101a: c3 ret
Disassembly of section .plt:
0000000000001020 <.plt>:
1020: ff 35 8a 2f 00 00 push 0x2f8a(%rip) # 3fb0 <_GLOBAL_OFFSET_TABLE_+0x8>
1026: f2 ff 25 8b 2f 00 00 bnd jmp *0x2f8b(%rip) # 3fb8 <_GLOBAL_OFFSET_TABLE_+0x10>
102d: 0f 1f 00 nopl (%rax)
1030: f3 0f 1e fa endbr64
1034: 68 00 00 00 00 push $0x0
1039: f2 e9 e1 ff ff ff bnd jmp 1020 <_init+0x20>
103f: 90 nop
1040: f3 0f 1e fa endbr64
1044: 68 01 00 00 00 push $0x1
1049: f2 e9 d1 ff ff ff bnd jmp 1020 <_init+0x20>
104f: 90 nop
1050: f3 0f 1e fa endbr64
1054: 68 02 00 00 00 push $0x2
1059: f2 e9 c1 ff ff ff bnd jmp 1020 <_init+0x20>
105f: 90 nop
Disassembly of section .plt.got:
0000000000001060 <__cxa_finalize@plt>:
1060: f3 0f 1e fa endbr64
1064: f2 ff 25 8d 2f 00 00 bnd jmp *0x2f8d(%rip) # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
106b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
Disassembly of section .plt.sec:
0000000000001070 <__stack_chk_fail@plt>:
1070: f3 0f 1e fa endbr64
1074: f2 ff 25 45 2f 00 00 bnd jmp *0x2f45(%rip) # 3fc0 <__stack_chk_fail@GLIBC_2.4>
107b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
0000000000001080 <printf@plt>:
1080: f3 0f 1e fa endbr64
1084: f2 ff 25 3d 2f 00 00 bnd jmp *0x2f3d(%rip) # 3fc8 <printf@GLIBC_2.2.5>
108b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
0000000000001090 <__isoc99_scanf@plt>:
1090: f3 0f 1e fa endbr64
1094: f2 ff 25 35 2f 00 00 bnd jmp *0x2f35(%rip) # 3fd0 <__isoc99_scanf@GLIBC_2.7>
109b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
Disassembly of section .text:
00000000000010a0 <_start>:
10a0: f3 0f 1e fa endbr64
10a4: 31 ed xor %ebp,%ebp
10a6: 49 89 d1 mov %rdx,%r9
10a9: 5e pop %rsi
10aa: 48 89 e2 mov %rsp,%rdx
10ad: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp
10b1: 50 push %rax
10b2: 54 push %rsp
10b3: 45 31 c0 xor %r8d,%r8d
10b6: 31 c9 xor %ecx,%ecx
10b8: 48 8d 3d f5 00 00 00 lea 0xf5(%rip),%rdi # 11b4 <main>
10bf: ff 15 13 2f 00 00 call *0x2f13(%rip) # 3fd8 <__libc_start_main@GLIBC_2.34>
10c5: f4 hlt
10c6: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1)
10cd: 00 00 00
00000000000010d0 <deregister_tm_clones>:
10d0: 48 8d 3d 39 2f 00 00 lea 0x2f39(%rip),%rdi # 4010 <__TMC_END__>
10d7: 48 8d 05 32 2f 00 00 lea 0x2f32(%rip),%rax # 4010 <__TMC_END__>
10de: 48 39 f8 cmp %rdi,%rax
10e1: 74 15 je 10f8 <deregister_tm_clones+0x28>
10e3: 48 8b 05 f6 2e 00 00 mov 0x2ef6(%rip),%rax # 3fe0 <_ITM_deregisterTMCloneTable@Base>
10ea: 48 85 c0 test %rax,%rax
10ed: 74 09 je 10f8 <deregister_tm_clones+0x28>
10ef: ff e0 jmp *%rax
10f1: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
10f8: c3 ret
10f9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
0000000000001100 <register_tm_clones>:
1100: 48 8d 3d 09 2f 00 00 lea 0x2f09(%rip),%rdi # 4010 <__TMC_END__>
1107: 48 8d 35 02 2f 00 00 lea 0x2f02(%rip),%rsi # 4010 <__TMC_END__>
110e: 48 29 fe sub %rdi,%rsi
1111: 48 89 f0 mov %rsi,%rax
1114: 48 c1 ee 3f shr $0x3f,%rsi
1118: 48 c1 f8 03 sar $0x3,%rax
111c: 48 01 c6 add %rax,%rsi
111f: 48 d1 fe sar %rsi
1122: 74 14 je 1138 <register_tm_clones+0x38>
1124: 48 8b 05 c5 2e 00 00 mov 0x2ec5(%rip),%rax # 3ff0 <_ITM_registerTMCloneTable@Base>
112b: 48 85 c0 test %rax,%rax
112e: 74 08 je 1138 <register_tm_clones+0x38>
1130: ff e0 jmp *%rax
1132: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
1138: c3 ret
1139: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
0000000000001140 <__do_global_dtors_aux>:
1140: f3 0f 1e fa endbr64
1144: 80 3d c5 2e 00 00 00 cmpb $0x0,0x2ec5(%rip) # 4010 <__TMC_END__>
114b: 75 2b jne 1178 <__do_global_dtors_aux+0x38>
114d: 55 push %rbp
114e: 48 83 3d a2 2e 00 00 cmpq $0x0,0x2ea2(%rip) # 3ff8 <__cxa_finalize@GLIBC_2.2.5>
1155: 00
1156: 48 89 e5 mov %rsp,%rbp
1159: 74 0c je 1167 <__do_global_dtors_aux+0x27>
115b: 48 8b 3d a6 2e 00 00 mov 0x2ea6(%rip),%rdi # 4008 <__dso_handle>
1162: e8 f9 fe ff ff call 1060 <__cxa_finalize@plt>
1167: e8 64 ff ff ff call 10d0 <deregister_tm_clones>
116c: c6 05 9d 2e 00 00 01 movb $0x1,0x2e9d(%rip) # 4010 <__TMC_END__>
1173: 5d pop %rbp
1174: c3 ret
1175: 0f 1f 00 nopl (%rax)
1178: c3 ret
1179: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
0000000000001180 <frame_dummy>:
1180: f3 0f 1e fa endbr64
1184: e9 77 ff ff ff jmp 1100 <register_tm_clones>
0000000000001189 <fun>:
1189: f3 0f 1e fa endbr64
118d: 55 push %rbp
118e: 48 89 e5 mov %rsp,%rbp
1191: 48 83 ec 10 sub $0x10,%rsp
1195: 89 7d fc mov %edi,-0x4(%rbp)
1198: 8b 45 fc mov -0x4(%rbp),%eax
119b: 89 c6 mov %eax,%esi
119d: 48 8d 05 60 0e 00 00 lea 0xe60(%rip),%rax # 2004 <_IO_stdin_used+0x4>
11a4: 48 89 c7 mov %rax,%rdi
11a7: b8 00 00 00 00 mov $0x0,%eax
11ac: e8 cf fe ff ff call 1080 <printf@plt>
11b1: 90 nop
11b2: c9 leave
11b3: c3 ret
00000000000011b4 <main>:
11b4: f3 0f 1e fa endbr64
11b8: 55 push %rbp
11b9: 48 89 e5 mov %rsp,%rbp
11bc: 48 83 ec 10 sub $0x10,%rsp
11c0: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax
11c7: 00 00
11c9: 48 89 45 f8 mov %rax,-0x8(%rbp)
11cd: 31 c0 xor %eax,%eax
11cf: 48 8d 45 f4 lea -0xc(%rbp),%rax
11d3: 48 89 c6 mov %rax,%rsi
11d6: 48 8d 05 27 0e 00 00 lea 0xe27(%rip),%rax # 2004 <_IO_stdin_used+0x4>
11dd: 48 89 c7 mov %rax,%rdi
11e0: b8 00 00 00 00 mov $0x0,%eax
11e5: e8 a6 fe ff ff call 1090 <__isoc99_scanf@plt>
11ea: 8b 45 f4 mov -0xc(%rbp),%eax
11ed: 89 c7 mov %eax,%edi
11ef: e8 95 ff ff ff call 1189 <fun>
11f4: 8b 45 f4 mov -0xc(%rbp),%eax
11f7: 83 f8 01 cmp $0x1,%eax
11fa: 7e 09 jle 1205 <main+0x51>
11fc: c7 45 f4 64 00 00 00 movl $0x64,-0xc(%rbp)
1203: eb 07 jmp 120c <main+0x58>
1205: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%rbp)
120c: 8b 45 f4 mov -0xc(%rbp),%eax
120f: 85 c0 test %eax,%eax
1211: 74 0a je 121d <main+0x69>
1213: bf 01 00 00 00 mov $0x1,%edi
1218: e8 6c ff ff ff call 1189 <fun>
121d: b8 00 00 00 00 mov $0x0,%eax
1222: 48 8b 55 f8 mov -0x8(%rbp),%rdx
1226: 64 48 2b 14 25 28 00 sub %fs:0x28,%rdx
122d: 00 00
122f: 74 05 je 1236 <main+0x82>
1231: e8 3a fe ff ff call 1070 <__stack_chk_fail@plt>
1236: c9 leave
1237: c3 ret
Disassembly of section .fini:
0000000000001238 <_fini>:
1238: f3 0f 1e fa endbr64
123c: 48 83 ec 08 sub $0x8,%rsp
1240: 48 83 c4 08 add $0x8,%rsp
1244: c3 ret