aboutsummaryrefslogtreecommitdiffstats
path: root/code/tools/lcc/x86/win32/tst/init.sbk
blob: 2c1cc670145e6d4172a376afe6c433fba1629412 (plain)
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
.486
.model flat
extrn __fltused:near
extrn __ftol:near
_DATA segment
public _words
align 4
_words label byte
dd 1
dd 2
dd 3
db 105
db 102
db 0
db 3 dup (0)
db 2 dup (0)
dd 4
dd 5
db 4 dup (0)
db 102
db 111
db 114
db 3 dup (0)
db 2 dup (0)
dd 6
dd 7
dd 8
db 101
db 108
db 115
db 101
db 0
db 1 dup (0)
db 2 dup (0)
dd 9
dd 10
dd 11
db 119
db 104
db 105
db 108
db 101
db 1 dup (0)
db 2 dup (0)
dd 0
db 8 dup (0)
db 8 dup (0)
public _wordlist
align 4
_wordlist label byte
dd _words
public _x
align 4
_x label byte
dd 1
dd 2
dd 3
dd 4
dd 0
dd 5
dd 6
db 12 dup (0)
dd 7
db 16 dup (0)
public _y
align 4
_y label byte
dd _x
dd _x+20
dd _x+40
dd 00H
public _main
_DATA ends
_TEXT segment
_main:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,8
mov dword ptr (-8)[ebp],0
jmp L8
L5:
mov dword ptr (-4)[ebp],0
jmp L12
L9:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
mov esi,dword ptr (_y)[esi*4]
mov edi,dword ptr [esi][edi*4]
push edi
lea edi,(L13)
push edi
call _printf
add esp,8
L10:
inc dword ptr (-4)[ebp]
L12:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (-8)[ebp]
mov esi,dword ptr (_y)[esi*4]
cmp dword ptr [esi][edi*4],0
jne L9
lea edi,(L14)
push edi
call _printf
add esp,4
L6:
inc dword ptr (-8)[ebp]
L8:
mov edi,dword ptr (-8)[ebp]
mov edi,dword ptr (_y)[edi*4]
cmp edi,0
jne L5
call _f
add esp,0
mov edi,dword ptr (_wordlist)
push edi
call _g
add esp,4
mov eax,0
L4:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
_DATA segment
align 4
L16 label byte
dd L17
dd L18
dd L19
dd L20
dd 00H
public _f
_DATA ends
_TEXT segment
_f:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
lea edi,(L16)
mov dword ptr (-4)[ebp],edi
jmp L24
L21:
mov edi,dword ptr (-4)[ebp]
mov edi,dword ptr [edi]
push edi
lea edi,(L25)
push edi
call _printf
add esp,8
L22:
mov edi,dword ptr (-4)[ebp]
lea edi,(4)[edi]
mov dword ptr (-4)[ebp],edi
L24:
mov edi,dword ptr (-4)[ebp]
mov edi,dword ptr [edi]
cmp edi,0
jne L21
mov eax,0
L15:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _g
_g:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
jmp L30
L27:
mov dword ptr (-4)[ebp],0
jmp L34
L31:
mov edi,dword ptr (-4)[ebp]
mov esi,dword ptr (20)[ebp]
mov edi,dword ptr [esi][edi*4]
push edi
lea edi,(L35)
push edi
call _printf
add esp,8
L32:
inc dword ptr (-4)[ebp]
L34:
mov edi,dword ptr (-4)[ebp]
cmp edi,3
jb L31
mov edi,dword ptr (20)[ebp]
lea edi,(12)[edi]
push edi
lea edi,(L25)
push edi
call _printf
add esp,8
L28:
mov edi,dword ptr (20)[ebp]
lea edi,(20)[edi]
mov dword ptr (20)[ebp],edi
L30:
mov edi,dword ptr (20)[ebp]
cmp dword ptr [edi],0
jne L27
call _h
add esp,0
mov eax,0
L26:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
public _h
_h:
push ebx
push esi
push edi
push ebp
mov ebp,esp
sub esp,4
mov dword ptr (-4)[ebp],0
jmp L40
L37:
imul edi,dword ptr (-4)[ebp],20
lea esi,(_words+12)[edi]
push esi
mov esi,dword ptr (_words+8)[edi]
push esi
mov esi,dword ptr (_words+4)[edi]
push esi
mov edi,dword ptr (_words)[edi]
push edi
lea edi,(L41)
push edi
call _printf
add esp,20
L38:
inc dword ptr (-4)[ebp]
L40:
mov edi,dword ptr (-4)[ebp]
cmp edi,5
jb L37
mov eax,0
L36:
mov esp,ebp
pop ebp
pop edi
pop esi
pop ebx
ret
_TEXT ends
extrn _printf:near
_TEXT segment
_TEXT ends
_TEXT segment
align 1
L41 label byte
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 100
db 32
db 37
db 115
db 10
db 0
align 1
L35 label byte
db 37
db 100
db 32
db 0
align 1
L25 label byte
db 37
db 115
db 10
db 0
align 1
L20 label byte
db 119
db 104
db 105
db 108
db 101
db 0
align 1
L19 label byte
db 101
db 108
db 115
db 101
db 0
align 1
L18 label byte
db 102
db 111
db 114
db 0
align 1
L17 label byte
db 105
db 102
db 0
align 1
L14 label byte
db 10
db 0
align 1
L13 label byte
db 32
db 37
db 100
db 0
_TEXT ends
end