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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
| EntryPoint:
push 0000000Ch
push 00000000h
push L00403328
call jmp_MSVCRT.dll!memset
add esp,0000000Ch
push 00000000h
call jmp_KERNEL32.dll!GetModuleHandleW
mov [L0040332C],eax
push 00000000h
push 00001000h
push 00000000h
call jmp_KERNEL32.dll!HeapCreate
mov [L00403328],eax
call SUB_L00402320
call SUB_L0040201E
push L00403020
push L0040302C
call SUB_L00402084
push 00000000h
call SUB_L00401077
call SUB_L00402370
push [L00403328]
call jmp_KERNEL32.dll!HeapDestroy
call jmp_KERNEL32.dll!ExitProcess
SUB_L00401077:
call SUB_L004021EF
retn
;------------------------------------------------------------------------------
00000183h DUP (??)
;
;
;------------------------------------------------------------------------------
; Name: .text
; Virtual Address: 00402000h Virtual Size: 00000397h
; Pointer To RawData: 00000600h Size Of RawData: 00000400h
;
jmp_MSVCRT.dll!memset:
jmp [MSVCRT.dll!memset]
jmp_KERNEL32.dll!GetModuleHandleW:
jmp [KERNEL32.dll!GetModuleHandleW]
jmp_KERNEL32.dll!HeapCreate:
jmp [KERNEL32.dll!HeapCreate]
jmp_KERNEL32.dll!HeapDestroy:
jmp [KERNEL32.dll!HeapDestroy]
jmp_KERNEL32.dll!ExitProcess:
jmp [KERNEL32.dll!ExitProcess]
SUB_L0040201E:
push ebp
mov ebp,esp
push ecx
push ecx
push 00000008h
lea eax,[ebp-08h]
push 00000000h
push eax
call jmp_MSVCRT.dll!memset
add esp,0000000Ch
lea eax,[ebp-08h]
push eax
mov dword ptr [ebp-08h],00000008h
mov dword ptr [ebp-04h],00000B48h
call [COMCTL32.DLL!InitCommonControlsEx]
push 00000000h
call [OLE32.DLL!CoInitialize]
leave
retn
;------------------------------------------------------------------------------
SUB_L00402055:
push esi
push 00000001h
call SUB_L00402118
push [esp+10h]
push [esp+0Ch]
push [esp+14h]
call SUB_L004021C1
push eax
call [USER32.DLL!MessageBoxW]
push 00000000h
mov esi,eax
call SUB_L00402118
mov eax,esi
pop esi
retn 000Ch
;------------------------------------------------------------------------------
SUB_L00402084:
push 00000000h
push [esp+0Ch]
push [esp+0Ch]
call SUB_L00402055
retn 0008h
;------------------------------------------------------------------------------
L00402096:
push ebx
push esi
push edi
mov edi,[esp+10h]
push 00000000h
push edi
call [USER32.DLL!GetWindowThreadProcessId]
mov ebx,[KERNEL32.dll!GetCurrentThreadId]
mov esi,eax
call ebx
cmp esi,eax
jnz L0040210F
push edi
call [USER32.DLL!IsWindowVisible]
test eax,eax
jz L0040210F
push 00000014h
push L00403334
call SUB_L004022A5
pop ecx
mov esi,eax
pop ecx
mov [esi+04h],edi
call ebx
push FFFFFFECh
push edi
mov [esi],eax
mov word ptr [esi+08h],0000h
call [USER32.DLL!GetWindowLongA]
test al,08h
jz L004020ED
mov byte ptr [esi+08h],01h
L004020ED:
call [USER32.DLL!GetForegroundWindow]
cmp edi,eax
jz L0040210F
push edi
call [USER32.DLL!IsWindowEnabled]
test eax,eax
jz L0040210F
push 00000000h
push edi
mov byte ptr [esi+09h],01h
call [USER32.DLL!EnableWindow]
L0040210F:
pop edi
xor eax,eax
pop esi
inc eax
pop ebx
retn 0008h
;------------------------------------------------------------------------------
SUB_L00402118:
push ebx
xor ebx,ebx
push esi
push edi
cmp [esp+10h],ebx
jz L00402167
push [esp+10h]
push L00402096
call [USER32.DLL!EnumWindows]
mov esi,[L00403334]
cmp esi,ebx
jz L004021BB
L0040213C:
mov edi,[esi]
call [KERNEL32.dll!GetCurrentThreadId]
cmp [esi+08h],eax
jnz L0040215F
cmp [esi+10h],bl
jz L0040215F
push 00000003h
push ebx
push ebx
push ebx
push ebx
push FFFFFFFEh
push [esi+0Ch]
call [USER32.DLL!SetWindowPos]
L0040215F:
mov esi,edi
cmp edi,ebx
jnz L0040213C
jmp L004021BB
L00402167:
mov esi,[L00403334]
cmp esi,ebx
jz L004021BB
push ebp
L00402172:
mov ebp,[esi]
lea edi,[esi+08h]
call [KERNEL32.dll!GetCurrentThreadId]
cmp [edi],eax
jnz L004021B4
cmp [esi+11h],bl
jz L00402191
push 00000001h
push [esi+0Ch]
call [USER32.DLL!EnableWindow]
L00402191:
cmp [esi+10h],bl
jz L004021A7
push 00000003h
push ebx
push ebx
push ebx
push ebx
push FFFFFFFFh
push [esi+0Ch]
call [USER32.DLL!SetWindowPos]
L004021A7:
push edi
push L00403334
call SUB_L004022D2
pop ecx
pop ecx
L004021B4:
mov esi,ebp
cmp ebp,ebx
jnz L00402172
pop ebp
L004021BB:
pop edi
pop esi
pop ebx
retn 0004h
;------------------------------------------------------------------------------
SUB_L004021C1:
push ebp
mov ebp,esp
push ecx
push esi
call [USER32.DLL!GetForegroundWindow]
mov esi,eax
test esi,esi
jz L004021EA
lea eax,[ebp-04h]
push eax
push esi
call [USER32.DLL!GetWindowThreadProcessId]
call [KERNEL32.dll!GetCurrentProcessId]
cmp [ebp-04h],eax
jz L004021EA
xor esi,esi
L004021EA:
mov eax,esi
pop esi
leave
retn
;------------------------------------------------------------------------------
SUB_L004021EF:
mov eax,[L00403338]
test eax,eax
jz L004021FE
push eax
call SUB_L004021FF
L004021FE:
retn
;------------------------------------------------------------------------------
SUB_L004021FF:
push ebp
mov ebp,esp
push esi
mov esi,[ebp+08h]
cmp dword ptr [esi+14h],00000000h
jz L00402228
push esi
call SUB_L0040222D
jmp L0040221A
L00402214:
push [ebp+08h]
call [esi+14h]
L0040221A:
lea eax,[ebp+08h]
push eax
push esi
call SUB_L00402252
test eax,eax
jnz L00402214
L00402228:
pop esi
pop ebp
retn 0004h
;------------------------------------------------------------------------------
SUB_L0040222D:
mov eax,[esp+04h]
mov ecx,[eax+10h]
xor edx,edx
mov [eax+18h],edx
mov [eax+1Ch],ecx
cmp ecx,edx
jz L0040224F
cmp [ecx],edx
jz L0040224F
push esi
L00402245:
mov ecx,[ecx]
mov [eax+1Ch],ecx
cmp [ecx],edx
jnz L00402245
pop esi
L0040224F:
retn 0004h
;------------------------------------------------------------------------------
SUB_L00402252:
mov ecx,[esp+04h]
push edi
mov edi,[esp+0Ch]
xor eax,eax
push esi
L0040225E:
mov edx,[ecx+18h]
test edx,edx
js L00402287
cmp edx,[ecx+08h]
jge L00402287
mov esi,[ecx+0Ch]
lea esi,[esi+edx*4]
cmp dword ptr [esi],00000000h
jz L00402280
mov esi,[esi]
cmp dword ptr [esi],00000000h
jz L00402280
mov eax,esi
mov [edi],edx
L00402280:
inc [ecx+18h]
test eax,eax
jz L0040225E
L00402287:
pop esi
test eax,eax
jnz L004022A1
mov edx,[ecx+1Ch]
test edx,edx
jz L004022A1
lea eax,[edx+08h]
mov [edi],eax
mov edx,[ecx+1Ch]
mov edx,[edx+04h]
mov [ecx+1Ch],edx
L004022A1:
pop edi
retn 0008h
;------------------------------------------------------------------------------
SUB_L004022A5:
push [esp+08h]
push 00000008h
push [L00403328]
call [KERNEL32.dll!HeapAlloc]
test eax,eax
jz L004022CE
mov ecx,[esp+04h]
mov edx,[ecx]
test edx,edx
jz L004022CC
mov [edx+04h],eax
mov edx,[ecx]
mov [eax],edx
L004022CC:
mov [ecx],eax
L004022CE:
add eax,00000008h
retn
;------------------------------------------------------------------------------
SUB_L004022D2:
mov eax,[esp+08h]
mov ecx,[esp+04h]
sub eax,00000008h
mov edx,[eax]
cmp [ecx],eax
jnz L004022F1
mov [ecx],edx
mov ecx,[eax]
test ecx,ecx
jz L00402302
and dword ptr [ecx+04h],00000000h
jmp L00402302
L004022F1:
mov ecx,[eax+04h]
mov [ecx],edx
mov ecx,[eax]
test ecx,ecx
jz L00402302
mov edx,[eax+04h]
mov [ecx+04h],edx
L00402302:
push eax
push 00000000h
push [L00403328]
call [KERNEL32.dll!HeapFree]
retn
;------------------------------------------------------------------------------
Align 16
SUB_L00402320:
push ebp
mov ebp,esp
push 00000000h
push 00001000h
push 00000000h
call [KERNEL32.dll!HeapCreate]
mov [L00403340],eax
mov dword ptr [L0040333C],00000000h
mov dword ptr [L00403344],00000010h
mov eax,[L00403344]
push eax
push 00000000h
mov ecx,[L00403340]
push ecx
call [KERNEL32.dll!HeapAlloc]
mov [L0040304C],eax
pop ebp
retn
;------------------------------------------------------------------------------
Align 16
SUB_L00402370:
push ebp
mov ebp,esp
mov eax,[L0040304C]
push eax
push 00000000h
mov ecx,[L00403340]
push ecx
call [KERNEL32.dll!HeapFree]
mov edx,[L00403340]
push edx
call [KERNEL32.dll!HeapDestroy]
pop ebp
retn
;------------------------------------------------------------------------------
00000069h DUP (??)
;
;
;------------------------------------------------------------------------------
; Name: .data (Data Section)
; Virtual Address: 00403000h Virtual Size: 00000348h
; Pointer To RawData: 00000A00h Size Of RawData: 00000400h
;
db 00h;
db FFh; 'п'
db FFh; 'п'
db FFh; 'п'
db FFh; 'п'
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 01h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 90h; '?'
db 90h; '?'
L00403020:
db 22h; '"'
db 04h;
db 35h; '5'
db 04h;
db 3Ah; ':'
db 04h;
db 41h; 'A'
db 04h;
db 42h; 'B'
db 04h;
db 00h;
db 00h;
L0040302C:
db 17h;
db 04h;
db 30h; '0'
db 04h;
db 33h; '3'
db 04h;
db 3Eh; '>'
db 04h;
db 3Bh; ';'
db 04h;
db 3Eh; '>'
db 04h;
db 32h; '2'
db 04h;
db 3Eh; '>'
db 04h;
db 3Ah; ':'
db 04h;
db 00h;
db 00h;
db 00h;
db 00h;
db 90h; '?'
db 90h; '?'
db 00h;
db 00h;
db 00h;
db 00h;
db FFh; 'п'
db FFh; 'п'
db FFh; 'п'
db FFh; 'п'
L0040304C:
dd 00000000h
dd 000030C8h
dd 00000000h
dd 00000000h
dd 0000319Ah
dd 0000312Ch
dd 000030D0h
dd 00000000h
dd 00000000h
dd 000031E4h
dd 00003134h
dd 000030F4h
dd 00000000h
dd 00000000h
dd 000032DAh
dd 00003158h
dd 0000311Ch
dd 00000000h
dd 00000000h
dd 000032FEh
dd 00003180h
dd 00003124h
dd 00000000h
dd 00000000h
dd 0000331Ch
dd 00003188h
dd 00000000h
dd 00000000h
dd 00000000h
dd 00000000h
dd 00000000h
dd 00003190h
dd 00000000h
dd 000031A6h
dd 000031BAh
dd 000031C8h
dd 000031D6h
dd 000031F2h
dd 00003208h
dd 0000321Eh
dd 0000322Ah
dd 00000000h
dd 00003236h
dd 00003244h
dd 00003260h
dd 00003272h
dd 00003284h
dd 0000329Ah
dd 000032ACh
dd 000032BCh
dd 000032CAh
dd 00000000h
dd 000032E6h
dd 00000000h
dd 0000330Ch
dd 00000000h
MSVCRT.dll!memset:
dd ??
dd 00000000
KERNEL32.dll!GetModuleHandleW:
dd ??
KERNEL32.dll!HeapCreate:
dd ??
KERNEL32.dll!HeapDestroy:
dd ??
KERNEL32.dll!ExitProcess:
dd ??
KERNEL32.dll!GetCurrentThreadId:
dd ??
KERNEL32.dll!GetCurrentProcessId:
dd ??
KERNEL32.dll!HeapAlloc:
dd ??
KERNEL32.dll!HeapFree:
dd ??
dd 00000000
USER32.DLL!MessageBoxW:
dd ??
USER32.DLL!GetWindowThreadProcessId:
dd ??
USER32.DLL!IsWindowVisible:
dd ??
USER32.DLL!GetWindowLongA:
dd ??
USER32.DLL!GetForegroundWindow:
dd ??
USER32.DLL!IsWindowEnabled:
dd ??
USER32.DLL!EnableWindow:
dd ??
USER32.DLL!EnumWindows:
dd ??
USER32.DLL!SetWindowPos:
dd ??
dd 00000000
COMCTL32.DLL!InitCommonControlsEx:
dd ??
dd 00000000
OLE32.DLL!CoInitialize:
dd ??
dd 00000000
dw 0299h
db 'memset',0
db 00h
db 'MSVCRT.dll',0
db 00h
dw 01FAh
db 'GetModuleHandleW',0
db 00h
dw 02A4h
db 'HeapCreate',0
db 00h
dw 02A5h
db 'HeapDestroy',0
dw 0105h
db 'ExitProcess',0
db 'KERNEL32.dll',0
db 00h
dw 01AEh
db 'GetCurrentThreadId',0
db 00h
dw 01ABh
db 'GetCurrentProcessId',0
dw 02A2h
db 'HeapAlloc',0
dw 02A6h
db 'HeapFree',0
db 00h
dw 0000h
db 'MessageBoxW',0
dw 0000h
db 'GetWindowThreadProcessId',0
db 00h
dw 0000h
db 'IsWindowVisible',0
dw 0000h
db 'GetWindowLongA',0
db 00h
dw 0000h
db 'GetForegroundWindow',0
dw 0000h
db 'IsWindowEnabled',0
dw 0000h
db 'EnableWindow',0
db 00h
dw 0000h
db 'EnumWindows',0
dw 0000h
db 'SetWindowPos',0
db 00h
db 'USER32.DLL',0
db 00h
dw 0000h
db 'InitCommonControlsEx',0
db 00h
db 'COMCTL32.DLL',0
db 00h
dw 0000h
db 'CoInitialize',0
db 00h
db 'OLE32.DLL',0
db 00h;
db 00h;
L00403328:
db 00h;
db 00h;
db 00h;
db 00h;
L0040332C:
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
db 00h;
L00403334:
db 00h;
db 00h;
db 00h;
db 00h;
L00403338:
dd 00000000h
L0040333C:
dd 00000000h
L00403340:
dd 00000000h
L00403344:
dd 00000000h
;------------------------------------------------------------------------------
000000B8h DUP (??)
;
;
;------------------------------------------------------------------------------
; Imports from MSVCRT.dll
;
extrn memset
;
; Imports from KERNEL32.dll
;
extrn GetModuleHandleW
extrn HeapCreate
extrn HeapDestroy
extrn ExitProcess
extrn GetCurrentThreadId
extrn GetCurrentProcessId
extrn HeapAlloc
extrn HeapFree
;
; Imports from USER32.DLL
;
extrn MessageBoxW
extrn GetWindowThreadProcessId
extrn IsWindowVisible
extrn GetWindowLongA
extrn GetForegroundWindow
extrn IsWindowEnabled
extrn EnableWindow
extrn EnumWindows
extrn SetWindowPos
;
; Imports from COMCTL32.DLL
;
extrn InitCommonControlsEx
;
; Imports from OLE32.DLL
;
extrn CoInitialize
;
;------------------------------------------------------------------------------ |