-
Notifications
You must be signed in to change notification settings - Fork 128
/
055A3421813CAF77E1387FF77B2E2E28.c
2743 lines (2593 loc) · 79 KB
/
055A3421813CAF77E1387FF77B2E2E28.c
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
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* This file has been generated by the Hex-Rays decompiler.
Copyright (c) 2009 Hex-Rays <info@hex-rays.com>
Detected compiler: Visual C++
*/
#include <windows.h>
#include <defs.h>
//-------------------------------------------------------------------------
// Data declarations
extern int dword_100037B0[8]; // weak
extern char *off_100037D2; // weak
extern char byte_100037D9[3]; // weak
extern char byte_100038A7; // weak
extern int dword_10003C3A; // weak
extern int dword_10003C42; // weak
extern int dword_10003C46; // weak
extern int dword_10003C4A; // weak
extern int dword_10003C4E; // weak
extern int dword_10003C52; // weak
extern int (__stdcall *dword_10003C56)(_DWORD); // weak
extern int dword_10003C5A; // weak
extern int dword_10003C5E; // weak
extern int dword_10003C62; // weak
extern int (__stdcall *dword_10003C66)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // weak
extern int (__stdcall *dword_10003C6A)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // weak
extern int dword_10003C6E; // weak
extern int dword_10003C72; // weak
extern int dword_10003C76; // weak
extern int (__stdcall *dword_10003C7A)(_DWORD); // weak
extern _UNKNOWN unk_100050E0; // weak
extern _UNKNOWN unk_10005110; // weak
extern _UNKNOWN unk_10005124; // weak
extern _UNKNOWN unk_10005140; // weak
extern _UNKNOWN unk_10005160; // weak
extern _UNKNOWN unk_10005180; // weak
extern _UNKNOWN unk_1000519C; // weak
extern _UNKNOWN unk_100051BC; // weak
extern _UNKNOWN unk_100051E8; // weak
extern _UNKNOWN unk_10005204; // weak
extern _UNKNOWN unk_1000521C; // weak
extern _UNKNOWN unk_1000523C; // weak
extern _UNKNOWN unk_10005264; // weak
extern _UNKNOWN unk_10005280; // weak
extern _UNKNOWN unk_100052A8; // weak
extern _UNKNOWN unk_100052CC; // weak
extern _UNKNOWN unk_10005328; // weak
extern _UNKNOWN unk_10005344; // weak
extern char ProcName[]; // idb
extern const WCHAR ModuleName[]; // idb
extern wchar_t a_lnk[5]; // weak
extern wchar_t a_tmp[5]; // weak
extern wchar_t aWtr[5]; // weak
extern char aFindfirstfilew[15]; // weak
extern char aKernel32_dll_0[13]; // weak
extern char aFindnextfilew[14]; // weak
extern char aFindfirstfilee[17]; // weak
extern char aNtquerydirecto[21]; // weak
extern char aNtdll_dll_0[10]; // weak
extern char aZwquerydirecto[21]; // weak
extern const WCHAR word_10005428; // idb
extern const WCHAR String2[]; // idb
extern const WCHAR aWincmd_exe[]; // idb
extern const WCHAR aProgman[]; // idb
extern const WCHAR aSyslistview32[]; // idb
extern const WCHAR aDirectuihwnd[]; // idb
extern const WCHAR String[]; // idb
extern wchar_t aShell32_dll_as[18]; // weak
extern const WCHAR aS08x[]; // idb
extern const WCHAR a08x08x08x08x[]; // idb
extern const WCHAR Name[]; // idb
extern const WCHAR aCopyOf[]; // idb
extern const WCHAR aCopyOfShortcut[]; // idb
extern const WCHAR aWtr4141_tmp[]; // idb
extern _UNKNOWN unk_100055D8; // weak
extern _UNKNOWN unk_100055E8; // weak
extern _UNKNOWN unk_100055F8; // weak
extern _UNKNOWN unk_10005608; // weak
extern _UNKNOWN unk_10005618; // weak
extern _DWORD dword_10006000[4]; // idb
extern int dword_10006010; // weak
extern int dword_10006020; // weak
extern int dword_10006028; // weak
extern _DWORD dword_1000602C; // idb
extern _UNKNOWN unk_10006030; // weak
extern int dword_10006038; // weak
extern int dword_1000603C; // weak
extern int dword_10006040[]; // weak
extern int dword_10006044; // weak
extern int dword_10006048; // weak
extern int (__stdcall *dword_10006178)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // weak
extern int (__stdcall *dword_1000617C)(_DWORD, _DWORD); // weak
extern int (__stdcall *dword_10006180)(_DWORD, _DWORD); // weak
extern int (__stdcall *dword_10006184)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // weak
extern int dword_10006188; // weak
extern HMODULE hModule; // idb
//-------------------------------------------------------------------------
// Function declarations
#define __thiscall __cdecl // Test compile in C mode
// BOOL __userpurge sub_10001000<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, void *a4);
// char __userpurge sub_10001090<al>(int a1<eax>, unsigned int a2, int a3, int a4, int a5);
// char __userpurge sub_10001230<al>(signed int a1<eax>, int a2<ecx>, unsigned int a3, int a4);
// char __userpurge sub_100012A0<al>(int a1<edi>, int a2, unsigned int a3, int a4);
// char __usercall sub_10001340<al>(int a1<eax>, int a2<edx>, int a3<ecx>);
// char __usercall sub_10001390<al>(int a1<eax>, int a2<edx>, int a3<ecx>, int a4<esi>);
BOOL __cdecl sub_10001430();
int __stdcall sub_100014C0(int a1, int a2, int a3, int a4, int a5, unsigned int a6, int a7, int a8, int a9, int a10, int a11);
signed int __stdcall sub_10001580(int a1, int a2);
signed int __stdcall sub_10001600(int a1, int a2);
int __stdcall sub_10001700(int a1, int a2, int a3, int a4, int a5, int a6);
BOOL __cdecl sub_10001790();
signed int __stdcall EnumFunc(HWND hWnd, int a2);
// __int32 __userpurge sub_10001850<eax>(__int32 result<eax>, int a2);
signed int __stdcall sub_100018F0(HWND a1, int a2);
// void *__usercall sub_10001910<eax>(HWND a1<esi>);
// HMODULE __userpurge sub_100019A0<eax>(const CHAR *a1<edi>, DWORD a2, int a3, int a4);
// BOOL __userpurge sub_10001A50<eax>(int a1<esi>, LPCSTR flOldProtect, int a3);
// signed int __userpurge sub_10001B20<eax>(int a1<eax>, DWORD lpString1, LPCSTR lpString2, int a4);
// signed int __userpurge sub_10001C40<eax>(DWORD a1<ecx>, int a2<edi>, LPCSTR lpString1, LPCSTR lpString2, int a5);
// WCHAR *__usercall sub_10001D00<eax>(const WCHAR *a1<eax>);
// signed int __usercall sub_10001D90<eax>(const WCHAR *a1<eax>, DWORD a2<ecx>, LPVOID *a3<ebx>, DWORD *a4<edi>);
BOOL __stdcall DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved);
signed int __cdecl sub_10001EA7();
// int __userpurge sub_10001EAD<eax>(int a1<ebp>, int a2, int a3, int a4);
DWORD __cdecl sub_10001ED0();
// signed int __usercall sub_10001F80<eax>(const WCHAR *a1<esi>);
bool __stdcall sub_10001FD0(LPCWSTR lpFileName, int a2);
HANDLE __cdecl sub_100020A0();
HANDLE __cdecl sub_10002130();
HRESULT __stdcall DllGetClassObject(const IID *const rclsid, const IID *const riid, LPVOID *ppv);
// int __userpurge StartAddress<eax>(int a1<eax>, LPCWSTR lpFileName);
// void __usercall sub_10002340(LPCWSTR lpFileName<ecx>, int a2<eax>);
void __stdcall sub_100023D0(LPCWSTR lpFileName);
// bool __userpurge sub_10002460<eax>(int a1<ebx>, LPCWSTR lpFileName);
// bool __userpurge sub_100024B0<eax>(DWORD a1<ecx>, DWORD a2<edi>, void *a3<esi>, const void *a4);
bool __thiscall sub_100024F0(void *this);
// void __usercall sub_100025B0(const WCHAR *a1<eax>);
int __cdecl sub_100027B0(int a1);
int __cdecl loc_100027C8(int); // weak
signed int __cdecl sub_100027D0(int a1, int a2, int a3, int a4);
// int __usercall sub_100027F2<eax>(int a1<ebp>, int a2, int a3);
// int __userpurge sub_10002886<eax>(int result<eax>, int a2<ebp>, int a3);
// signed int __usercall sub_100028A8<eax>(int a1<ebp>);
void *__cdecl sub_10002D70(void *a1, unsigned __int8 a2, unsigned int a3);
// DWORD __stdcall GetModuleBaseNameW(HANDLE hProcess, HMODULE hModule, LPWSTR lpBaseName, DWORD nSize);
// BOOL __stdcall EnumProcessModules(HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded);
signed int __thiscall sub_10002DD4(DWORD this);
signed int __cdecl sub_10002F0F(int a1, int a2, int a3, int a4, int a5);
int __cdecl sub_10002FBF(void **a1, int a2, int a3, int a4, const void *a5, unsigned int a6);
int __cdecl sub_1000300D(int, LPCWSTR lpString2); // idb
int __cdecl sub_100030C2(int a1, const void *a2, const void *a3, unsigned int a4, int a5, const void *a6, unsigned int a7, int a8);
signed int __cdecl sub_1000320E(int a1, int a2, const void *a3);
unsigned int __cdecl sub_10003327();
signed int (__cdecl *__cdecl sub_10003336())(int);
unsigned int __cdecl sub_10003340();
unsigned int __cdecl sub_1000334F();
int __cdecl sub_1000335E(int a1, int a2, int a3, int a4);
int __cdecl sub_100034D2(LPCWSTR lpString2, const void *a2, unsigned int a3, int a4);
int __cdecl sub_100035ED(LPCWSTR lpFileName, HANDLE hObject, int); // idb
int __cdecl sub_1000368F(LPVOID lpAddress); // idb
int __cdecl sub_100036A8(int a1, int a2);
__int16 __cdecl sub_100036CB(int a1, int a2);
HMODULE __cdecl sub_10003708();
FARPROC __cdecl sub_10003733(int a1, int a2);
void __cdecl sub_10003774(void *a1, const void *a2, unsigned int a3);
FARPROC __cdecl sub_10003788(int a1);
FARPROC __cdecl sub_10003799(int a1);
void __fastcall sub_10003ACF(int a1, int a2);
void __cdecl sub_10003B11();
// int __usercall sub_10003B64<eax>(int a1<eax>, int a2<edx>, int a3<ecx>);
// int __stdcall RtlUnwind(_DWORD, _DWORD, _DWORD, _DWORD); weak
signed int __cdecl sub_10003C84(int a1);
int __stdcall sub_10003E22(int a1);
int __cdecl sub_10003E95(int a1, int a2, int a3);
signed int __stdcall sub_10003F58(int a1);
void __cdecl sub_100040B7(void *a1, const void *a2, unsigned int a3);
int __cdecl sub_100040CB(const void *a1, int a2, void *a3);
signed int __cdecl sub_1000414D(int a1, int a2);
signed int __cdecl sub_100041EB(int a1, int a2, const void *a3, int a4);
void __cdecl sub_100042CC();
// DWORD __stdcall GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh);
// BOOL __stdcall GetFileAttributesExW(LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation);
// HMODULE __stdcall GetModuleHandleW(LPCWSTR lpModuleName);
// BOOL __stdcall SetFileTime(HANDLE hFile, const FILETIME *lpCreationTime, const FILETIME *lpLastAccessTime, const FILETIME *lpLastWriteTime);
// BOOL __stdcall WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);
// DWORD __stdcall GetFileAttributesW(LPCWSTR lpFileName);
// HANDLE __stdcall CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
// int __stdcall lstrlenW(LPCWSTR lpString);
// FARPROC __stdcall GetProcAddress(HMODULE hModule, LPCSTR lpProcName);
// BOOL __stdcall CloseHandle(HANDLE hObject);
// BOOL __stdcall DeleteFileW(LPCWSTR lpFileName);
// LPWSTR __stdcall lstrcpyW(LPWSTR lpString1, LPCWSTR lpString2);
// BOOL __stdcall SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes);
// HANDLE __stdcall GetCurrentProcess();
// void __stdcall SetLastError(DWORD dwErrCode);
// int __stdcall lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2);
// DWORD __stdcall GetCurrentThreadId();
// DWORD __stdcall GetCurrentProcessId();
// int __stdcall lstrcmpA(LPCSTR lpString1, LPCSTR lpString2);
// BOOL __stdcall IsBadReadPtr(const void *lp, UINT_PTR ucb);
// DWORD __stdcall GetModuleFileNameW(HMODULE hModule, LPWCH lpFilename, DWORD nSize);
// int __stdcall lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2);
// HMODULE __stdcall GetModuleHandleA(LPCSTR lpModuleName);
// BOOL __stdcall VirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect);
// LPWSTR __stdcall lstrcatW(LPWSTR lpString1, LPCWSTR lpString2);
// BOOL __stdcall VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
// LPWSTR __stdcall lstrcpynW(LPWSTR lpString1, LPCWSTR lpString2, int iMaxLength);
// BOOL __stdcall ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
// LPVOID __stdcall VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
// HANDLE __stdcall CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR lpName);
// UINT __stdcall SetErrorMode(UINT uMode);
// BOOL __stdcall FreeLibrary(HMODULE hLibModule);
// LPVOID __stdcall HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
// DWORD __stdcall WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds);
// DWORD __stdcall GetTickCount();
// HANDLE __stdcall GetProcessHeap();
// void __stdcall Sleep(DWORD dwMilliseconds);
// DWORD __stdcall GetLastError();
// BOOL __stdcall DisableThreadLibraryCalls(HMODULE hLibModule);
// BOOL __stdcall ReleaseMutex(HANDLE hMutex);
// HANDLE __stdcall CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId);
// DWORD __stdcall SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);
// DWORD __stdcall GetWindowThreadProcessId(HWND hWnd, LPDWORD lpdwProcessId);
// LRESULT __stdcall SendMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
// BOOL __stdcall IsWindowVisible(HWND hWnd);
// BOOL __stdcall EnumChildWindows(HWND hWndParent, WNDENUMPROC lpEnumFunc, LPARAM lParam);
// int __stdcall GetClassNameW(HWND hWnd, LPWSTR lpClassName, int nMaxCount);
// BOOL __stdcall EnumWindows(WNDENUMPROC lpEnumFunc, LPARAM lParam);
// BOOL __stdcall PostMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
// int wsprintfW(LPWSTR, LPCWSTR, ...);
//----- (10001000) --------------------------------------------------------
BOOL __userpurge sub_10001000<eax>(int a1<ebx>, int a2<edi>, int a3<esi>, void *a4)
{
FARPROC v4; // eax@1
HMODULE v5; // eax@1
BOOL result; // eax@2
int v7; // edx@2
int v8; // ecx@2
int v9; // edx@2
int v10; // ecx@2
int v11; // edx@2
char v12; // [sp+0h] [bp-30h]@2
int v13; // [sp+8h] [bp-28h]@2
int v14; // [sp+Ch] [bp-24h]@2
int v15; // [sp+10h] [bp-20h]@2
int v16; // [sp+14h] [bp-1Ch]@2
int v17; // [sp+18h] [bp-18h]@2
int v18; // [sp+1Ch] [bp-14h]@2
int v19; // [sp+20h] [bp-10h]@2
int v20; // [sp+24h] [bp-Ch]@2
int v21; // [sp+28h] [bp-8h]@2
v5 = GetModuleHandleW(L"NTDLL.DLL");
v4 = GetProcAddress(v5, "ZwSetInformationFile");
if ( !v4
|| (v7 = *(_DWORD *)(a1 + 4),
v13 = *(_DWORD *)a1,
v8 = *(_DWORD *)a2,
v14 = v7,
v9 = *(_DWORD *)(a2 + 4),
v15 = v8,
v10 = *(_DWORD *)a3,
v16 = v9,
v11 = *(_DWORD *)(a3 + 4),
v17 = v10,
v19 = v10,
v18 = v11,
v20 = v11,
v21 = 128,
(result = ((int (__stdcall *)(void *, char *, int *, signed int, signed int))v4)(a4, &v12, &v13, 40, 4)) != 0) )
result = SetFileTime(a4, (const FILETIME *)a1, (const FILETIME *)a2, (const FILETIME *)a3);
return result;
}
//----- (10001090) --------------------------------------------------------
char __userpurge sub_10001090<al>(int a1<eax>, unsigned int a2, int a3, int a4, int a5)
{
unsigned int v5; // ebp@1
int v7; // ebx@3
signed int v8; // eax@6
signed int v9; // edi@7
signed int v10; // eax@11
int v11; // ecx@11
int v12; // esi@13
int v13; // edx@15
int v14; // eax@22
int v15; // ecx@22
int v16; // edx@23
int v17; // ecx@24
int v18; // esi@24
int v19; // [sp+18h] [bp-14h]@1
unsigned int v20; // [sp+1Ch] [bp-10h]@1
unsigned int v21; // [sp+24h] [bp-8h]@4
int v22; // [sp+28h] [bp-4h]@4
char v23; // [sp+30h] [bp+4h]@1
v5 = a2;
v19 = a1;
v23 = 0;
v20 = 0;
if ( !a1 )
return 1;
while ( 1 )
{
v7 = *(_DWORD *)v5;
if ( a3 == -1 )
{
v21 = -1;
v22 = -1;
}
else
{
v21 = *(_DWORD *)(a3 + v5);
v22 = *(_DWORD *)(v5 + 4 + a3);
}
v8 = *(_DWORD *)(a5 + v5);
if ( !(v8 & 1) )
{
v9 = v8 / 2;
if ( ((v22 & v21) == -1 || !v22 && v21 == 4171) && v9 > 4 )
{
v11 = (int)L".LNK";
v10 = 4;
while ( v10 )
{
v12 = *(_WORD *)v11;
if ( (unsigned int)(v12 - 97) <= 0x19 )
v12 -= 32;
v13 = *(_WORD *)(a4 + v5 + 2 * v9 - 8 - (_DWORD)L".LNK" + v11);
if ( (unsigned int)(v13 - 97) <= 0x19 )
v13 -= 32;
v7 = *(_DWORD *)v5;
if ( v12 != v13 )
break;
v11 += 2;
--v10;
if ( !*(_WORD *)v11 )
goto LABEL_21;
}
}
if ( sub_100012A0(a4 + v5, v9, v21, v22) )
break;
}
v20 = v5;
v23 = 1;
v5 += v7;
LABEL_31:
v19 -= v7;
if ( !v7 )
return v23 != 0;
}
LABEL_21:
if ( v7 )
{
v15 = v7 + v5;
v14 = v19 - v7;
if ( v5 <= v7 + v5 || (v16 = v14 + v15, v5 >= v14 + v15) )
{
if ( v19 != v7 )
{
do
{
--v14;
*(_BYTE *)(v15 - v7) = *(_BYTE *)v15;
++v15;
}
while ( v14 );
}
}
else
{
v17 = v5 - 1 + v14;
v18 = v16 - 1;
if ( v19 != v7 )
{
do
{
--v14;
*(_BYTE *)v17-- = *(_BYTE *)v18--;
}
while ( v14 );
}
}
goto LABEL_31;
}
if ( v20 )
*(_DWORD *)v20 = 0;
return v23 != 0;
}
// 10005384: using guessed type wchar_t a_lnk[5];
//----- (10001230) --------------------------------------------------------
char __userpurge sub_10001230<al>(signed int a1<eax>, int a2<ecx>, unsigned int a3, int a4)
{
int v4; // edi@1
char result; // al@2
signed int v6; // esi@3
v4 = a2;
if ( a1 & 1 )
{
result = 0;
}
else
{
v6 = a1 / 2;
if ( (a4 & a3) != -1 && (a4 || a3 != 4171) || v6 <= 4 || !sub_10001340(4, a2 + 2 * v6 - 8, (int)L".LNK") )
result = sub_100012A0(v4, v6, a3, a4) != 0;
else
result = 1;
}
return result;
}
// 10005384: using guessed type wchar_t a_lnk[5];
//----- (100012A0) --------------------------------------------------------
char __userpurge sub_100012A0<al>(int a1<edi>, int a2, unsigned int a3, int a4)
{
int v4; // esi@1
signed int v6; // ecx@9
unsigned __int16 v7; // ax@10
v4 = 0;
if ( ((a4 & a3) == -1 || !a4 && a3 >= 0x1000 && a3 <= 0x800000)
&& a2 == 12
&& sub_10001340(4, a1 + 16, (int)L".TMP")
&& sub_10001340(12, a1, (int)L"~WTR") )
{
v6 = 4;
while ( 1 )
{
v7 = *(_WORD *)(a1 + 2 * v6);
if ( v7 < 0x30u )
break;
if ( v7 > 0x39u )
break;
++v6;
v4 = (v7 + v4 - 48) % 10;
if ( v6 > 7 )
return v4 == 0;
}
}
return 0;
}
// 10005390: using guessed type wchar_t a_tmp[5];
// 1000539C: using guessed type wchar_t aWtr[5];
//----- (10001340) --------------------------------------------------------
char __usercall sub_10001340<al>(int a1<eax>, int a2<edx>, int a3<ecx>)
{
unsigned __int16 v3; // ax@1
int v4; // edi@1
int v5; // esi@1
int v6; // edx@3
int v7; // eax@5
char result; // al@9
v4 = a1;
v3 = *(_WORD *)a3;
v5 = a2;
if ( *(_WORD *)a3 )
{
while ( v4 )
{
v6 = v3;
if ( (unsigned int)v3 - 97 <= 0x19 )
v6 = v3 - 32;
v7 = *(_WORD *)v5;
if ( (unsigned int)(v7 - 97) <= 0x19 )
v7 -= 32;
if ( v6 != v7 )
break;
v3 = *(_WORD *)(a3 + 2);
a3 += 2;
v5 += 2;
--v4;
if ( !v3 )
goto LABEL_9;
}
result = 0;
}
else
{
LABEL_9:
result = 1;
}
return result;
}
//----- (10001390) --------------------------------------------------------
char __usercall sub_10001390<al>(int a1<eax>, int a2<edx>, int a3<ecx>, int a4<esi>)
{
char result; // al@2
switch ( a4 )
{
case 3:
*(_DWORD *)a1 = 60;
*(_DWORD *)a2 = 40;
*(_DWORD *)a3 = 94;
result = 1;
break;
case 1:
*(_DWORD *)a1 = 60;
*(_DWORD *)a2 = 40;
*(_DWORD *)a3 = 64;
result = 1;
break;
case 2:
*(_DWORD *)a1 = 60;
*(_DWORD *)a2 = 40;
*(_DWORD *)a3 = 68;
result = 1;
break;
case 37:
*(_DWORD *)a1 = 60;
*(_DWORD *)a2 = 40;
*(_DWORD *)a3 = 104;
result = 1;
break;
case 38:
*(_DWORD *)a1 = 60;
*(_DWORD *)a2 = 40;
*(_DWORD *)a3 = 80;
result = 1;
break;
case 12:
*(_DWORD *)a1 = 8;
*(_DWORD *)a2 = -1;
*(_DWORD *)a3 = 12;
result = 1;
break;
default:
result = 0;
break;
}
return result;
}
//----- (10001430) --------------------------------------------------------
BOOL __cdecl sub_10001430()
{
sub_100019A0("FindFirstFileW", (DWORD)"KERNEL32.DLL", (int)sub_10001580, (int)&dword_1000617C);
sub_100019A0("FindNextFileW", (DWORD)"KERNEL32.DLL", (int)sub_10001600, (int)&dword_10006180);
sub_100019A0("FindFirstFileExW", (DWORD)"KERNEL32.DLL", (int)sub_10001700, (int)&dword_10006184);
sub_100019A0("NtQueryDirectoryFile", (DWORD)"NTDLL.DLL", (int)sub_100014C0, (int)&dword_10006178);
sub_100019A0("ZwQueryDirectoryFile", (DWORD)"NTDLL.DLL", (int)sub_100014C0, (int)&dword_10006178);
return sub_10001790();
}
// 10006178: using guessed type int (__stdcall *dword_10006178)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 1000617C: using guessed type int (__stdcall *dword_1000617C)(_DWORD, _DWORD);
// 10006180: using guessed type int (__stdcall *dword_10006180)(_DWORD, _DWORD);
// 10006184: using guessed type int (__stdcall *dword_10006184)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
//----- (100014C0) --------------------------------------------------------
int __stdcall sub_100014C0(int a1, int a2, int a3, int a4, int a5, unsigned int a6, int a7, int a8, int a9, int a10, int a11)
{
int result; // eax@2
unsigned __int8 v12; // sf@8
unsigned __int8 v13; // of@8
int v14; // [sp+2Ch] [bp-10h]@3
int v15; // [sp+30h] [bp-Ch]@6
int v16; // [sp+34h] [bp-8h]@6
int v17; // [sp+38h] [bp-4h]@6
if ( dword_10006178 )
{
v14 = 0;
while ( 1 )
{
result = dword_10006178(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
if ( result )
break;
if ( !a6 )
break;
if ( !sub_10001390((int)&v15, (int)&v17, (int)&v16, a8) || sub_10001090(a7, a6, v17, v16, v15) )
return 0;
LOBYTE(a11) = 0;
v13 = __SETO__(v14 + 1, 10);
v12 = v14++ - 9 < 0;
if ( !(v12 ^ v13) )
return -1073741809;
}
}
else
{
result = -1073741801;
}
return result;
}
// 10006178: using guessed type int (__stdcall *dword_10006178)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
//----- (10001580) --------------------------------------------------------
signed int __stdcall sub_10001580(int a1, int a2)
{
int v2; // ebx@2
int v3; // ST08_4@3
unsigned int v4; // ST04_4@3
int v5; // eax@3
if ( !dword_1000617C || (v2 = dword_1000617C(a1, a2), v2 == -1) )
return -1;
v3 = *(_DWORD *)(a2 + 28);
v4 = *(_DWORD *)(a2 + 32);
v5 = lstrlenW((LPCWSTR)(a2 + 44));
if ( sub_10001230(2 * v5, a2 + 44, v4, v3) && !sub_10001600(v2, a2) )
{
SetLastError(2u);
CloseHandle((HANDLE)v2);
return -1;
}
return v2;
}
// 1000617C: using guessed type int (__stdcall *dword_1000617C)(_DWORD, _DWORD);
//----- (10001600) --------------------------------------------------------
signed int __stdcall sub_10001600(int a1, int a2)
{
int v3; // esi@3
signed int v4; // eax@5
signed int v5; // edi@6
signed int v6; // eax@10
int v7; // ecx@10
int v8; // esi@12
int v9; // edx@14
char v10; // zf@16
int v11; // [sp+Ch] [bp-Ch]@10
unsigned int v12; // [sp+10h] [bp-8h]@5
int v13; // [sp+14h] [bp-4h]@5
if ( dword_10006180 )
{
v3 = a2;
LABEL_4:
while ( dword_10006180(a1, v3) )
{
v12 = *(_DWORD *)(v3 + 32);
v13 = *(_DWORD *)(v3 + 28);
v4 = 2 * lstrlenW((LPCWSTR)(v3 + 44));
if ( !(v4 & 1) )
{
v5 = v4 / 2;
if ( ((v13 & v12) == -1 || !v13 && v12 == 4171) && v5 > 4 )
{
v7 = (int)L".LNK";
v6 = 4;
v11 = v3 + 44 + 2 * v5 - 8 - (_DWORD)L".LNK";
while ( v6 )
{
v8 = *(_WORD *)v7;
if ( (unsigned int)(v8 - 97) <= 0x19 )
v8 -= 32;
v9 = *(_WORD *)(v11 + v7);
if ( (unsigned int)(v9 - 97) <= 0x19 )
v9 -= 32;
v10 = v8 == v9;
v3 = a2;
if ( !v10 )
break;
v7 += 2;
--v6;
if ( !*(_WORD *)v7 )
goto LABEL_4;
}
}
if ( sub_100012A0(v3 + 44, v5, v12, v13) )
continue;
}
return 1;
}
}
return 0;
}
// 10005384: using guessed type wchar_t a_lnk[5];
// 10006180: using guessed type int (__stdcall *dword_10006180)(_DWORD, _DWORD);
//----- (10001700) --------------------------------------------------------
int __stdcall sub_10001700(int a1, int a2, int a3, int a4, int a5, int a6)
{
int result; // eax@2
int v7; // edi@2
int v8; // ST14_4@4
unsigned int v9; // ST10_4@4
int v10; // eax@4
if ( !dword_10006184 || (result = dword_10006184(a1, a2, a3, a4, a5, a6), v7 = result, result == -1) )
return -1;
if ( a2 )
return result;
v8 = *(_DWORD *)(a3 + 28);
v9 = *(_DWORD *)(a3 + 32);
v10 = lstrlenW((LPCWSTR)(a3 + 44));
if ( sub_10001230(2 * v10, a3 + 44, v9, v8) && !sub_10001600(v7, a3) )
{
SetLastError(2u);
CloseHandle((HANDLE)v7);
return -1;
}
return v7;
}
// 10006184: using guessed type int (__stdcall *dword_10006184)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
//----- (10001790) --------------------------------------------------------
BOOL __cdecl sub_10001790()
{
LPARAM v0; // esi@1
HANDLE v1; // eax@1
WCHAR String1; // [sp+8h] [bp-208h]@1
char v4; // [sp+Ah] [bp-206h]@1
String1 = 0;
sub_10002D70(&v4, 0, 0x206u);
v0 = 0;
v1 = GetCurrentProcess();
GetModuleBaseNameW(v1, 0, &String1, 0x104u);
if ( !lstrcmpiW(&String1, L"totalcmd.exe") || !lstrcmpiW(&String1, L"wincmd.exe") )
v0 = 1;
return EnumWindows((WNDENUMPROC)EnumFunc, v0);
}
//----- (10001810) --------------------------------------------------------
signed int __stdcall EnumFunc(HWND hWnd, int a2)
{
DWORD dwProcessId; // [sp+0h] [bp-4h]@1
dwProcessId = 0;
GetWindowThreadProcessId(hWnd, &dwProcessId);
if ( dwProcessId == GetCurrentProcessId() )
sub_10001850((__int32)hWnd, a2);
return 1;
}
//----- (10001850) --------------------------------------------------------
__int32 __userpurge sub_10001850<eax>(__int32 result<eax>, int a2)
{
LPARAM v2; // esi@1
DWORD v3; // eax@6
DWORD v4; // eax@6
WCHAR String1; // [sp+4h] [bp-208h]@4
v2 = result;
if ( result )
{
result = IsWindowVisible((HWND)result);
if ( result )
{
if ( a2 )
{
v3 = GetCurrentThreadId();
SendMessageW((HWND)v2, 28u, 0, v3);
v4 = GetCurrentThreadId();
SendMessageW((HWND)v2, 0x1Cu, 1u, v4);
result = SendMessageW((HWND)v2, 6u, 2u, v2);
}
else
{
GetClassNameW((HWND)v2, &String1, 260);
result = lstrcmpiW(&String1, L"Progman");
if ( result )
{
sub_10001910((HWND)v2);
result = EnumChildWindows((HWND)v2, (WNDENUMPROC)sub_100018F0, 0);
}
}
}
}
return result;
}
//----- (100018F0) --------------------------------------------------------
signed int __stdcall sub_100018F0(HWND a1, int a2)
{
sub_10001910(a1);
return 1;
}
//----- (10001910) --------------------------------------------------------
void *__usercall sub_10001910<eax>(HWND a1<esi>)
{
void *result; // eax@1
WCHAR String1; // [sp+0h] [bp-208h]@1
char v3; // [sp+2h] [bp-206h]@1
String1 = 0;
result = sub_10002D70(&v3, 0, 0x206u);
if ( a1 )
{
result = (void *)IsWindowVisible(a1);
if ( result )
{
GetClassNameW(a1, &String1, 260);
if ( !lstrcmpiW(&String1, L"SysListView32") || (result = (void *)lstrcmpiW(&String1, L"DirectUIHWND"), !result) )
{
PostMessageW(a1, 256u, 116u, 0);
result = (void *)PostMessageW(a1, 0x101u, 0x74u, 0);
}
}
}
return result;
}
//----- (100019A0) --------------------------------------------------------
HMODULE __userpurge sub_100019A0<eax>(const CHAR *a1<edi>, DWORD a2, int a3, int a4)
{
HMODULE result; // eax@2
int v5; // esi@3
FARPROC v6; // eax@5
int v7; // ebx@5
int v8; // eax@8
int v9; // ecx@8
int v10; // eax@8
if ( dword_10006188 < 16 )
{
result = GetModuleHandleA((LPCSTR)a2);
v5 = (int)result;
if ( result )
{
v6 = GetProcAddress(result, a1);
v7 = (int)v6;
if ( v6 && v6 != (FARPROC)a3 )
{
v8 = sub_10001A50(v5, a1, a3);
sub_10001B20(v8, a2, a1, a3);
v9 = dword_10006188;
v10 = 20 * dword_10006188;
dword_10006040[5 * dword_10006188] = v5;
*(int *)((char *)&dword_10006048 + v10) = a3;
*(int *)((char *)&dword_10006044 + v10) = v7;
*(int *)((char *)&dword_10006038 + v10) = a2;
*(int *)((char *)&dword_1000603C + v10) = (int)a1;
*(_DWORD *)a4 = v7;
dword_10006188 = v9 + 1;
result = (HMODULE)1;
}
else
{
result = 0;
}
}
}
else
{
result = 0;
}
return result;
}
// 10006038: using guessed type int dword_10006038;
// 1000603C: using guessed type int dword_1000603C;
// 10006040: using guessed type int dword_10006040[];
// 10006044: using guessed type int dword_10006044;
// 10006048: using guessed type int dword_10006048;
// 10006188: using guessed type int dword_10006188;
//----- (10001A50) --------------------------------------------------------
BOOL __userpurge sub_10001A50<eax>(int a1<esi>, LPCSTR flOldProtect, int a3)
{
BOOL result; // eax@2
int v4; // eax@3
int v5; // ebx@4
unsigned int v6; // ebp@4
int v7; // edi@6
void *v8; // edi@9
int v9; // [sp+0h] [bp-Ch]@5
unsigned int v10; // [sp+4h] [bp-8h]@4
int v11; // [sp+8h] [bp-4h]@4
if ( *(_WORD *)a1 != 23117 || (v4 = *(_DWORD *)(*(_DWORD *)(a1 + 60) + a1 + 120), !v4) )
return 0;
v11 = a1 + *(_DWORD *)(v4 + a1 + 28);
v5 = a1 + *(_DWORD *)(v4 + a1 + 32);
v6 = 0;
v10 = *(_DWORD *)(v4 + a1 + 24);
if ( !v10 )
goto LABEL_12;
v9 = v4 + a1 + 36;
while ( 1 )
{
v7 = a1 + *(_DWORD *)v9;
if ( !lstrcmpA((LPCSTR)(a1 + *(_DWORD *)v5), flOldProtect) )
break;
++v6;
v5 += 4;
if ( v6 >= v10 )
return 1;
}
v8 = (void *)(v11 + 4 * *(_WORD *)(v7 + 2 * v6));
result = VirtualProtect(v8, 4u, 0x80u, (PDWORD)&flOldProtect);
if ( result )
{
*(_DWORD *)v8 = a3 - a1;
LABEL_12:
result = 1;
}
return result;
}
//----- (10001B20) --------------------------------------------------------
signed int __userpurge sub_10001B20<eax>(int a1<eax>, DWORD lpString1, LPCSTR lpString2, int a4)
{
DWORD v4; // ebx@1
void *v5; // esp@1
HANDLE v6; // eax@1
signed int result; // eax@2
char v8; // [sp-Ch] [bp-1234h]@1
HMODULE lp; // [sp+0h] [bp-1228h]@1
WCHAR Filename; // [sp+1000h] [bp-228h]@5
DWORD v11; // [sp+1208h] [bp-20h]@4
DWORD cbNeeded; // [sp+120Ch] [bp-1Ch]@1
char *v13; // [sp+1210h] [bp-18h]@1
int v14; // [sp+1218h] [bp-10h]@1
signed int (__usercall *v15)<eax>(int<ebp>); // [sp+121Ch] [bp-Ch]@1
_UNKNOWN *v16; // [sp+1220h] [bp-8h]@1
int v17; // [sp+1224h] [bp-4h]@1
v17 = -1;
v16 = &unk_100055E8;
v15 = sub_100028A8;
v14 = a1;
v5 = alloca(4624);
v13 = &v8;
v4 = 0;
cbNeeded = 0;
v6 = GetCurrentProcess();
if ( EnumProcessModules(v6, &lp, 0x1000u, &cbNeeded) >= 0 )
{
cbNeeded >>= 2;
while ( 1 )
{
v11 = v4;
if ( v4 >= cbNeeded )
break;
v17 = 0;
if ( !GetModuleFileNameW(*(&lp + v4), &Filename, 0x104u)
|| IsBadReadPtr(*(&lp + v4), 0x40u)
|| sub_10001F80(&Filename) )
{
v17 = -1;
++v4;
}
else
{
sub_10001C40(lpString1, (int)*(&lp + v4), (LPCSTR)lpString1, lpString2, a4);
v17 = -1;
++v4;
}
}
result = 1;
}
else
{
result = 0;
}
return result;
}
//----- (10001C40) --------------------------------------------------------
signed int __userpurge sub_10001C40<eax>(DWORD a1<ecx>, int a2<edi>, LPCSTR lpString1, LPCSTR lpString2, int a5)
{
int v6; // ebp@3
int v7; // edx@5
int v8; // ebp@5
const CHAR *v9; // edx@6
int v10; // ecx@6
int v11; // ebx@6
void *v12; // esi@6
char v13; // sf@9
int v14; // eax@9
DWORD flOldProtect; // [sp+0h] [bp-4h]@1
flOldProtect = a1;
if ( *(_WORD *)a2 != 23117 )
return 0;
v6 = *(_DWORD *)(*(_DWORD *)(a2 + 60) + a2 + 128);
if ( !v6 )
return 0;
v7 = *(_DWORD *)(v6 + 12 + a2);
v8 = a2 + v6;
if ( !v7 )
return 1;
while ( 1 )
{
v10 = *(_DWORD *)(v8 + 16);
v9 = (const CHAR *)(a2 + v7);
v12 = (void *)(v10 + a2);
v11 = *(_DWORD *)v8 + a2;
if ( *(_DWORD *)v8 )
{
if ( v10 )
{
if ( !lstrcmpiA(lpString1, v9) )
{