| 1 | + | #pragma once |
| 2 | + | /* some code and/or ideas are from trustedsec SA Github repo -- thankyou trustedsec! */ |
| 3 | + | #include <windows.h> |
| 4 | + | |
| 5 | + | |
| 6 | + | #ifdef BOF |
| 7 | + | |
| 8 | + | #ifdef __cplusplus |
| 9 | + | extern "C" { |
| 10 | + | #endif |
| 11 | + | |
| 12 | + | #include "beacon.h" |
| 13 | + | |
| 14 | + | void go(char* buff, int len); |
| 15 | + | |
| 16 | + | /* resolve some extra funcs for the screenshot */ |
| 17 | + | |
| 18 | + | DECLSPEC_IMPORT DWORD WINAPI User32$MessageBoxA(HWND, LPCTSTR, LPCTSTR, UINT); |
| 19 | + | #define MessageBoxCustom User32$MessageBoxA |
| 20 | + | |
| 21 | + | DECLSPEC_IMPORT int WINAPI User32$GetSystemMetrics(int nIndex); |
| 22 | + | #define GetSystemMetrics User32$GetSystemMetrics |
| 23 | + | |
| 24 | + | DECLSPEC_IMPORT HDC WINAPI User32$GetDC(HWND hWnd); |
| 25 | + | #define GetDC User32$GetDC |
| 26 | + | |
| 27 | + | DECLSPEC_IMPORT HDC WINAPI GDI32$CreateCompatibleDC(HDC hdc); |
| 28 | + | #define CreateCompatibleDC GDI32$CreateCompatibleDC |
| 29 | + | |
| 30 | + | DECLSPEC_IMPORT HBITMAP WINAPI GDI32$CreateCompatibleBitmap(HDC hdc, int cx, int cy); |
| 31 | + | #define CreateCompatibleBitmap GDI32$CreateCompatibleBitmap |
| 32 | + | |
| 33 | + | DECLSPEC_IMPORT HGDIOBJ WINAPI GDI32$SelectObject(HDC hdc, HGDIOBJ h); |
| 34 | + | #define SelectObject GDI32$SelectObject |
| 35 | + | |
| 36 | + | DECLSPEC_IMPORT BOOL WINAPI GDI32$BitBlt(HDC hdc, |
| 37 | + | int x, |
| 38 | + | int y, |
| 39 | + | int cx, |
| 40 | + | int cy, |
| 41 | + | HDC hdcSrc, |
| 42 | + | int x1, |
| 43 | + | int y1, |
| 44 | + | DWORD rop); |
| 45 | + | #define BitBlt GDI32$BitBlt |
| 46 | + | |
| 47 | + | DECLSPEC_IMPORT BOOL WINAPI User32$OpenClipboard(HWND hWndNewOwner); |
| 48 | + | #define OpenClipboard User32$OpenClipboard |
| 49 | + | |
| 50 | + | DECLSPEC_IMPORT BOOL WINAPI User32$EmptyClipboard(); |
| 51 | + | #define EmptyClipboard User32$EmptyClipboard |
| 52 | + | |
| 53 | + | DECLSPEC_IMPORT BOOL WINAPI User32$SetClipboardData(UINT uFormat, HANDLE hMem); |
| 54 | + | #define SetClipboardData User32$SetClipboardData |
| 55 | + | |
| 56 | + | DECLSPEC_IMPORT BOOL WINAPI User32$CloseClipboard(); |
| 57 | + | #define CloseClipboard User32$CloseClipboard |
| 58 | + | |
| 59 | + | DECLSPEC_IMPORT BOOL WINAPI GDI32$DeleteDC(HDC hdc); |
| 60 | + | #define DeleteDC GDI32$DeleteDC |
| 61 | + | |
| 62 | + | DECLSPEC_IMPORT int WINAPI User32$ReleaseDC(HWND hWnd, HDC hDC); |
| 63 | + | #define ReleaseDC User32$ReleaseDC |
| 64 | + | |
| 65 | + | DECLSPEC_IMPORT HGDIOBJ WINAPI GDI32$DeleteObject(HGDIOBJ ho); |
| 66 | + | #define DeleteObject GDI32$DeleteObject |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | /* End of function resolutions for screenshot */ |
| 71 | + | |
| 72 | + | /* Resolve some functions for writing BMP to disk*/ |
| 73 | + | |
| 74 | + | DECLSPEC_IMPORT HDC WINAPI GDI32$CreateDCA(LPCSTR pwszDriver, |
| 75 | + | LPCSTR pwszDevice, |
| 76 | + | LPCSTR pszPort, |
| 77 | + | const DEVMODEA* pdm); |
| 78 | + | #define CreateDCA GDI32$CreateDCA |
| 79 | + | |
| 80 | + | DECLSPEC_IMPORT int WINAPI GDI32$GetDeviceCaps(HDC hdc, |
| 81 | + | int index); |
| 82 | + | #define GetDeviceCaps GDI32$GetDeviceCaps |
| 83 | + | |
| 84 | + | DECLSPEC_IMPORT int WINAPI GDI32$GetObjectA(HANDLE h, |
| 85 | + | int c, |
| 86 | + | LPVOID pv); |
| 87 | + | #define GetObjectA GDI32$GetObjectA |
| 88 | + | DECLSPEC_IMPORT HGLOBAL WINAPI KERNEL32$GlobalAlloc( |
| 89 | + | UINT uFlags, |
| 90 | + | SIZE_T dwBytes); |
| 91 | + | #define GlobalAlloc KERNEL32$GlobalAlloc |
| 92 | + | |
| 93 | + | DECLSPEC_IMPORT WINBASEAPI LPVOID WINAPI KERNEL32$GlobalLock(HGLOBAL); |
| 94 | + | #define GlobalLock KERNEL32$GlobalLock |
| 95 | + | |
| 96 | + | DECLSPEC_IMPORT WINGDIAPI HGDIOBJ WINAPI GDI32$GetStockObject(int); |
| 97 | + | #define GetStockObject GDI32$GetStockObject |
| 98 | + | |
| 99 | + | DECLSPEC_IMPORT WINGDIAPI HPALETTE WINAPI GDI32$SelectPalette(HDC, HPALETTE, BOOL); |
| 100 | + | #define SelectPalette GDI32$SelectPalette |
| 101 | + | |
| 102 | + | DECLSPEC_IMPORT WINGDIAPI UINT WINAPI GDI32$RealizePalette(HDC); |
| 103 | + | #define RealizePalette GDI32$RealizePalette |
| 104 | + | |
| 105 | + | DECLSPEC_IMPORT WINGDIAPI int WINAPI GDI32$GetDIBits(HDC hdc, |
| 106 | + | HBITMAP hbm, |
| 107 | + | UINT start, |
| 108 | + | UINT cLines, |
| 109 | + | LPVOID lpvBits, |
| 110 | + | LPBITMAPINFO lpbmi, |
| 111 | + | UINT usage); |
| 112 | + | #define GetDIBits GDI32$GetDIBits |
| 113 | + | |
| 114 | + | DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI KERNEL32$GlobalUnlock(HGLOBAL); |
| 115 | + | #define GlobalUnlock KERNEL32$GlobalUnlock |
| 116 | + | |
| 117 | + | DECLSPEC_IMPORT WINBASEAPI HGLOBAL WINAPI KERNEL32$GlobalFree(HGLOBAL); |
| 118 | + | #define GlobalFree KERNEL32$GlobalFree |
| 119 | + | |
| 120 | + | DECLSPEC_IMPORT WINBASEAPI BOOL WINAPI KERNEL32$CloseHandle(HANDLE); |
| 121 | + | #define CloseHandle KERNEL32$CloseHandle |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | /* End of function resolutions for writing BMP to disk */ |
| 127 | + | |
| 128 | + | |
| 129 | + | /* COM */ |
| 130 | + | DECLSPEC_IMPORT HRESULT WINAPI OLE32$CLSIDFromString(LPCWSTR, LPCLSID); |
| 131 | + | DECLSPEC_IMPORT HRESULT WINAPI OLE32$CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID* ppv); |
| 132 | + | DECLSPEC_IMPORT HRESULT WINAPI OLE32$CoInitializeEx(LPVOID, DWORD); |
| 133 | + | DECLSPEC_IMPORT VOID WINAPI OLE32$CoUninitialize(); |
| 134 | + | DECLSPEC_IMPORT HRESULT WINAPI OLE32$IIDFromString(LPWSTR lpsz, LPIID lpiid); |
| 135 | + | DECLSPEC_IMPORT HRESULT WINAPI OLE32$CoInitialize(LPVOID pvReserved); |
| 136 | + | DECLSPEC_IMPORT HRESULT WINAPI OLE32$CoCreateInstanceEx(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); |
| 137 | + | DECLSPEC_IMPORT BSTR WINAPI OleAut32$SysAllocString(const OLECHAR*); |
| 138 | + | DECLSPEC_IMPORT LPVOID WINAPI OLEAUT32$VariantInit(VARIANTARG* pvarg); |
| 139 | + | DECLSPEC_IMPORT HRESULT WINAPI OLE32$CoInitializeSecurity(PSECURITY_DESCRIPTOR pSecDesc, LONG cAuthSvc, SOLE_AUTHENTICATION_SERVICE* asAuthSvc, void* pReserved1, DWORD dwAuthnLevel, DWORD dwImpLevel, void* pAuthList, DWORD dwCapabilities, void* pReserved3); |
| 140 | + | |
| 141 | + | /* Registry */ |
| 142 | + | DECLSPEC_IMPORT LSTATUS APIENTRY ADVAPI32$RegOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult); |
| 143 | + | DECLSPEC_IMPORT LSTATUS APIENTRY ADVAPI32$RegDeleteTreeA(HKEY hKey, LPCSTR lpSubKey); |
| 144 | + | DECLSPEC_IMPORT LSTATUS APIENTRY ADVAPI32$RegCreateKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, DWORD dwOptions, REGSAM samDesired, |
| 145 | + | CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition); |
| 146 | + | DECLSPEC_IMPORT LSTATUS APIENTRY ADVAPI32$RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, |
| 147 | + | CONST BYTE* lpData, DWORD cbData); |
| 148 | + | |
| 149 | + | |
| 150 | + | /* FileSystem */ |
| 151 | + | DECLSPEC_IMPORT HANDLE WINAPI KERNEL32$CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); |
| 152 | + | DECLSPEC_IMPORT DWORD WINAPI KERNEL32$SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod); |
| 153 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpDistanceToMoveHigh, DWORD dwMoveMethod); |
| 154 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); |
| 155 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize); |
| 156 | + | DECLSPEC_IMPORT DWORD WINAPI VERSION$GetFileVersionInfoSizeW(LPCWSTR lptstrFilenamea, LPDWORD lpdwHandle); |
| 157 | + | DECLSPEC_IMPORT BOOL WINAPI VERSION$GetFileVersionInfoW(LPCWSTR lptstrFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData); |
| 158 | + | DECLSPEC_IMPORT BOOL WINAPI VERSION$VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID* lplpBuffer, PUINT puLen); |
| 159 | + | |
| 160 | + | |
| 161 | + | /* Memory */ |
| 162 | + | DECLSPEC_IMPORT LPVOID WINAPI KERNEL32$HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes); |
| 163 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$HeapFree(HANDLE, DWORD, PVOID); |
| 164 | + | DECLSPEC_IMPORT LPVOID WINAPI KERNEL32$HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes); |
| 165 | + | DECLSPEC_IMPORT void* __cdecl MSVCRT$memcpy(LPVOID, LPVOID, size_t); |
| 166 | + | DECLSPEC_IMPORT void __cdecl MSVCRT$memset(void*, int, size_t); |
| 167 | + | |
| 168 | + | |
| 169 | + | /* Process */ |
| 170 | + | DECLSPEC_IMPORT HANDLE WINAPI KERNEL32$OpenProcess(DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwProcessId); |
| 171 | + | DECLSPEC_IMPORT BOOL WINAPI ADVAPI32$CreateProcessWithLogonW(LPCWSTR lpUsername, LPCWSTR lpDomain, LPCWSTR lpPassword, DWORD dwLogonFlags, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); |
| 172 | + | DECLSPEC_IMPORT HANDLE WINAPI KERNEL32$GetProcessHeap(); |
| 173 | + | DECLSPEC_IMPORT SIZE_T WINAPI KERNEL32$VirtualQueryEx(HANDLE hProcess, LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength); |
| 174 | + | DECLSPEC_IMPORT DWORD WINAPI KERNEL32$GetProcessId(HANDLE Process); |
| 175 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$ReadProcessMemory(HANDLE hProcess, LPCVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesRead); |
| 176 | + | DECLSPEC_IMPORT VOID WINAPI KERNEL32$Sleep(DWORD dwMilliseconds); |
| 177 | + | DECLSPEC_IMPORT HANDLE WINAPI KERNEL32$GetCurrentProcess(VOID); |
| 178 | + | DECLSPEC_IMPORT BOOL WINAPI ADVAPI32$LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpName, PLUID lpLuid); |
| 179 | + | DECLSPEC_IMPORT DWORD WINAPI PSAPI$GetModuleFileNameExW(HANDLE hProcess, HMODULE hModule, LPWSTR lpFilename, DWORD nSize); |
| 180 | + | |
| 181 | + | |
| 182 | + | /* GetLast Error */ |
| 183 | + | DECLSPEC_IMPORT DWORD WINAPI KERNEL32$GetLastError(VOID); |
| 184 | + | |
| 185 | + | |
| 186 | + | /* Directories */ |
| 187 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$RemoveDirectoryA(LPCSTR); |
| 188 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); |
| 189 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$MoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName); |
| 190 | + | DECLSPEC_IMPORT BOOL WINAPI SHLWAPI$PathIsDirectoryA(LPCSTR); |
| 191 | + | DECLSPEC_IMPORT BOOL WINAPI SHLWAPI$PathFileExistsA(LPCSTR pszPath); |
| 192 | + | |
| 193 | + | |
| 194 | + | /* strings */ |
| 195 | + | DECLSPEC_IMPORT PSTR WINAPI SHLWAPI$StrChrA(PCSTR pszStart, WORD wMatch); |
| 196 | + | DECLSPEC_IMPORT LPSTR __cdecl MSVCRT$strchr(LPSTR, int); |
| 197 | + | DECLSPEC_IMPORT errno_t __cdecl MSVCRT$strcat_s(LPSTR, size_t, LPCSTR); |
| 198 | + | DECLSPEC_IMPORT errno_t __cdecl MSVCRT$strcpy_s(LPSTR, size_t, LPCSTR); |
| 199 | + | DECLSPEC_IMPORT errno_t __cdecl MSVCRT$strncpy_s(LPSTR, size_t, LPCSTR, size_t); |
| 200 | + | DECLSPEC_IMPORT int __cdecl MSVCRT$_snprintf(LPSTR, size_t, LPCSTR, ...); |
| 201 | + | DECLSPEC_IMPORT void WINAPI MSVCRT$sprintf(char*, char[], ...); |
| 202 | + | DECLSPEC_IMPORT int __cdecl MSVCRT$_vsnprintf(LPSTR, size_t, LPCSTR, va_list); |
| 203 | + | DECLSPEC_IMPORT size_t __cdecl MSVCRT$wcslen(LPCWSTR); |
| 204 | + | DECLSPEC_IMPORT int __cdecl MSVCRT$strcmp(const char* _Str1, const char* _Str2); |
| 205 | + | DECLSPEC_IMPORT LPSTR WINAPI Kernel32$lstrcpyA(LPSTR lpString1, LPCSTR lpString2); |
| 206 | + | DECLSPEC_IMPORT LPSTR WINAPI Kernel32$lstrcatA(LPSTR lpString1, LPCSTR lpString2); |
| 207 | + | DECLSPEC_IMPORT LPSTR WINAPI Kernel32$lstrcpynA(LPSTR lpString1, LPCSTR lpString2, int iMaxLength); |
| 208 | + | DECLSPEC_IMPORT int WINAPI KERNEL32$lstrlenW(LPCWSTR lpString); |
| 209 | + | DECLSPEC_IMPORT LPWSTR WINAPI KERNEL32$lstrcpyW(LPWSTR lpString1, LPCWSTR lpString2); |
| 210 | + | |
| 211 | + | |
| 212 | + | /* RPC */ |
| 213 | + | DECLSPEC_IMPORT RPC_STATUS RPC_ENTRY Rpcrt4$RpcStringFreeA(RPC_CSTR* String); |
| 214 | + | DECLSPEC_IMPORT RPC_STATUS RPC_ENTRY Rpcrt4$UuidCreate(UUID* Uuid); |
| 215 | + | DECLSPEC_IMPORT RPC_STATUS RPC_ENTRY Rpcrt4$UuidToStringA(const UUID* Uuid, RPC_CSTR* StringUuid); |
| 216 | + | |
| 217 | + | |
| 218 | + | /* Random */ |
| 219 | + | DECLSPEC_IMPORT void WINAPI MSVCRT$srand(int initial); |
| 220 | + | DECLSPEC_IMPORT int WINAPI MSVCRT$rand(); |
| 221 | + | |
| 222 | + | |
| 223 | + | /* DateTime */ |
| 224 | + | DECLSPEC_IMPORT time_t WINAPI MSVCRT$time(time_t* time); |
| 225 | + | |
| 226 | + | |
| 227 | + | /* SystemInfo */ |
| 228 | + | DECLSPEC_IMPORT void WINAPI KERNEL32$GetSystemInfo(LPSYSTEM_INFO lpSystemInfo); |
| 229 | + | DECLSPEC_IMPORT BOOL WINAPI KERNEL32$IsProcessorFeaturePresent(DWORD ProcessorFeature); |
| 230 | + | DECLSPEC_IMPORT BOOL WINAPI ADVAPI32$GetUserNameW(LPWSTR lpBuffer, LPDWORD pcbBuffer); |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | #ifdef __cplusplus |
| 238 | + | } |
| 239 | + | #endif |
| 240 | + | |
| 241 | + | |
| 242 | + | /* helper macros */ |
| 243 | + | |
| 244 | + | #define malloc(size) KERNEL32$HeapAlloc(KERNEL32$GetProcessHeap(), HEAP_ZERO_MEMORY, size) /* trustedsec */ |
| 245 | + | #define free(addr) KERNEL32$HeapFree(KERNEL32$GetProcessHeap(), 0, (LPVOID)addr) /* trustedsec */ |
| 246 | + | #define ZeroMemory(address, size) memset(address, 0, size); |
| 247 | + | |
| 248 | + | |
| 249 | + | /* ----------------------------------- DEFINITIONS ------------------------------------------*/ |
| 250 | + | |
| 251 | + | /* COM */ |
| 252 | + | #define CLSIDFromString OLE32$CLSIDFromString |
| 253 | + | #define CoCreateInstance OLE32$CoCreateInstance |
| 254 | + | #define CoInitializeEx OLE32$CoInitializeEx |
| 255 | + | #define CoUninitialize OLE32$CoUninitialize |
| 256 | + | #define IIDFromString OLE32$IIDFromString |
| 257 | + | #define CoInitialize OLE32$CoInitialize |
| 258 | + | #define CoCreateInstanceEx OLE32$CoCreateInstanceEx |
| 259 | + | #define SysAllocString OleAut32$SysAllocString |
| 260 | + | #define VariantInit OLEAUT32$VariantInit |
| 261 | + | #define CoInitialize OLE32$CoInitialize |
| 262 | + | #define CoInitializeSecurity OLE32$CoInitializeSecurity |
| 263 | + | |
| 264 | + | /* memory */ |
| 265 | + | #define HeapFree KERNEL32$HeapFree |
| 266 | + | #define HeapAlloc KERNEL32$HeapAlloc |
| 267 | + | #define HeapReAlloc KERNEL32$HeapReAlloc |
| 268 | + | #define memcpy MSVCRT$memcpy |
| 269 | + | #define memset MSVCRT$memset |
| 270 | + | |
| 271 | + | |
| 272 | + | /* process */ |
| 273 | + | #define GetProcessHeap KERNEL32$GetProcessHeap |
| 274 | + | #define CreateProcessWithLogonW ADVAPI32$CreateProcessWithLogonW |
| 275 | + | #define OpenProcess KERNEL32$OpenProcess |
| 276 | + | #define VirtualQueryEx KERNEL32$VirtualQueryEx |
| 277 | + | #define GetProcessId KERNEL32$GetProcessId |
| 278 | + | #define ReadProcessMemory KERNEL32$ReadProcessMemory |
| 279 | + | #define GetCurrentProcess KERNEL32$GetCurrentProcess |
| 280 | + | #define Sleep KERNEL32$Sleep |
| 281 | + | #define LookupPrivilegeValueW ADVAPI32$LookupPrivilegeValueW |
| 282 | + | #define GetModuleFileNameExW PSAPI$GetModuleFileNameExW |
| 283 | + | |
| 284 | + | |
| 285 | + | /* debug */ |
| 286 | + | #define EnumerateLoadedModulesW64 DBGHELP$EnumerateLoadedModulesW64 |
| 287 | + | #define SymInitializeW DBGHELP$SymInitializeW |
| 288 | + | #define SymCleanup DBGHELP$SymCleanup |
| 289 | + | |
| 290 | + | |
| 291 | + | /* filesystem */ |
| 292 | + | #define CreateFileA KERNEL32$CreateFileA |
| 293 | + | #define SetFilePointer KERNEL32$SetFilePointer |
| 294 | + | #define SetFilePointerEx KERNEL32$SetFilePointerEx |
| 295 | + | #define WriteFile KERNEL32$WriteFile |
| 296 | + | #define GetFileSizeEx KERNEL32$GetFileSizeEx |
| 297 | + | #define GetFileVersionInfoSizeW VERSION$GetFileVersionInfoSizeW |
| 298 | + | #define GetFileVersionInfoW VERSION$GetFileVersionInfoW |
| 299 | + | #define VerQueryValueW VERSION$VerQueryValueW |
| 300 | + | |
| 301 | + | /* error */ |
| 302 | + | #define GetLastError KERNEL32$GetLastError |
| 303 | + | |
| 304 | + | |
| 305 | + | /* registry */ |
| 306 | + | #define RegOpenKeyExA ADVAPI32$RegOpenKeyExA |
| 307 | + | #define RegDeleteTreeA ADVAPI32$RegDeleteTreeA |
| 308 | + | #define RegCreateKeyExA ADVAPI32$RegCreateKeyExA |
| 309 | + | #define RegSetValueExA ADVAPI32$RegSetValueExA |
| 310 | + | |
| 311 | + | |
| 312 | + | /* directory */ |
| 313 | + | #define RemoveDirectoryA KERNEL32$RemoveDirectoryA |
| 314 | + | #define CreateDirectoryA KERNEL32$CreateDirectoryA |
| 315 | + | #define MoveFileA KERNEL32$MoveFileA |
| 316 | + | #define PathIsDirectoryA SHLWAPI$PathIsDirectoryA |
| 317 | + | #define PathFileExistsA SHLWAPI$PathFileExistsA |
| 318 | + | |
| 319 | + | |
| 320 | + | /* strings */ |
| 321 | + | #define strchr MSVCRT$strchr |
| 322 | + | #define strcat_s MSVCRT$strcat_s |
| 323 | + | #define strcpy_s MSVCRT$strcpy_s |
| 324 | + | #define strncpy_s MSVCRT$strncpy_s |
| 325 | + | #define snprintf MSVCRT$_snprintf /*beacon can't find snprintf without the preceeding '_' */ |
| 326 | + | #define wcslen MSVCRT$wcslen |
| 327 | + | #define vsnprintf MSVCRT$vsnprintf |
| 328 | + | #define lstrlenW KERNEL32$lstrlenW |
| 329 | + | #define lstrcpyW KERNEL32$lstrcpyW |
| 330 | + | #define strcmp MSVCRT$strcmp |
| 331 | + | #define lstrcpyA Kernel32$lstrcpyA |
| 332 | + | #define lstrcatA Kernel32$lstrcatA |
| 333 | + | #define lstrcpynA Kernel32$lstrcpynA |
| 334 | + | #define lstrlenW KERNEL32$lstrlenW |
| 335 | + | #define lstrcpyW KERNEL32$lstrcpyW |
| 336 | + | #define sprintf MSVCRT$sprintf |
| 337 | + | |
| 338 | + | |
| 339 | + | /* RPC */ |
| 340 | + | #define RpcStringFreeA Rpcrt4$RpcStringFreeA |
| 341 | + | #define UuidCreate Rpcrt4$UuidCreate |
| 342 | + | #define UuidToStringA Rpcrt4$UuidToStringA |
| 343 | + | |
| 344 | + | |
| 345 | + | /* Random */ |
| 346 | + | #define srand MSVCRT$srand |
| 347 | + | #define rand MSVCRT$rand |
| 348 | + | |
| 349 | + | |
| 350 | + | /* DateTime */ |
| 351 | + | #define time MSVCRT$time |
| 352 | + | |
| 353 | + | |
| 354 | + | /* SystemInfo */ |
| 355 | + | #define GetSystemInfo KERNEL32$GetSystemInfo |
| 356 | + | #define GetUserNameW ADVAPI32$GetUserNameW |
| 357 | + | #define IsProcessorFeaturePresent KERNEL32$IsProcessorFeaturePresent |
| 358 | + | |
| 359 | + | #else |
| 360 | + | |
| 361 | + | #endif |
| 362 | + | |