Skip to content

Commit df65deb

Browse files
committed
add new stuff to obfus.h
1 parent a2f0aa4 commit df65deb

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

include/obfus.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ static const char *FAKE_DONGLE[] = {"skeydrv.dll", "HASPDOSDRV",
159159
"SSIVDDP.DLL", "WIBUKEY",
160160
"\\\\.\\WIZZKEYRL",
161161
"\\\\.\\NVKEY"};
162+
static const char FAKE_MACROMIX_1[] SECTION_ATTRIBUTE("MacroMix") = {0};
162163

163164
#else
164165

@@ -1092,6 +1093,15 @@ char *getFwriteName_proxy() {
10921093
}
10931094
#define fwrite(...) ((size_t(*)())GetProcAddress(LoadLibraryA_proxy(getStdLibName_proxy()), getFwriteName_proxy()))(__VA_ARGS__)
10941095

1096+
// fflush
1097+
char *getFflushName_proxy() {
1098+
BREAK_STACK_1;
1099+
FAKE_CPUID;
1100+
return "fflush";
1101+
// return ({ char result[32]; sprintf(result, getCharMask(_6), _f, _f, _l, _u, _s, _h); result; });
1102+
}
1103+
#define fflush(...) ((size_t(*)())GetProcAddress(LoadLibraryA_proxy(getStdLibName_proxy()), getFflushName_proxy()))(__VA_ARGS__)
1104+
10951105
// exit
10961106
char *getExitName_proxy() {
10971107
BREAK_STACK_1;
@@ -1295,6 +1305,9 @@ int toupper_proxy(int c) OBFH_SECTION_ATTRIBUTE {
12951305
#define ReadFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped) \
12961306
ReadFile(obfh_int_proxy(hFile), obfh_int_proxy(lpBuffer), obfh_int_proxy(nNumberOfBytesToRead), obfh_int_proxy(lpNumberOfBytesRead), obfh_int_proxy(lpOverlapped))
12971307

1308+
#define CopyFile(lpExistingFileName, lpNewFileName) \
1309+
CopyFile(obfh_int_proxy(lpExistingFileName), obfh_int_proxy(lpNewFileName))
1310+
12981311
#define WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped) \
12991312
WriteFile(obfh_int_proxy(hFile), obfh_int_proxy(lpBuffer), obfh_int_proxy(nNumberOfBytesToWrite), obfh_int_proxy(lpNumberOfBytesWritten), obfh_int_proxy(lpOverlapped))
13001313

@@ -1354,6 +1367,27 @@ int toupper_proxy(int c) OBFH_SECTION_ATTRIBUTE {
13541367
#define ResetEvent(hEvent) \
13551368
ResetEvent(obfh_int_proxy(hEvent))
13561369

1370+
#define InitializeCriticalSection(lpCriticalSection) \
1371+
InitializeCriticalSection(obfh_int_proxy(lpCriticalSection))
1372+
1373+
#define EnterCriticalSection(lpCriticalSection) \
1374+
EnterCriticalSection(obfh_int_proxy(lpCriticalSection))
1375+
1376+
#define LeaveCriticalSection(lpCriticalSection) \
1377+
LeaveCriticalSection(obfh_int_proxy(lpCriticalSection))
1378+
1379+
#define DeleteCriticalSection(lpCriticalSection) \
1380+
DeleteCriticalSection(obfh_int_proxy(lpCriticalSection))
1381+
1382+
#define RegCloseKey(hKey) \
1383+
RegCloseKey(obfh_int_proxy(hKey))
1384+
1385+
#define RegOpenKeyA(hKey, lpSubKey, phkResult) \
1386+
RegOpenKeyA(obfh_int_proxy(hKey), obfh_int_proxy(lpSubKey), obfh_int_proxy(phkResult))
1387+
1388+
#define RegCreateKeyA(hKey, lpSubKey, phkResult) \
1389+
RegCreateKeyA(obfh_int_proxy(hKey), obfh_int_proxy(lpSubKey), obfh_int_proxy(phkResult))
1390+
13571391
#define WaitForMultipleObjects(nCount, lpHandles, bWaitAll, dwMilliseconds) WaitForMultipleObjects(obfh_int_proxy(nCount), obfh_int_proxy(lpHandles), obfh_int_proxy(bWaitAll), obfh_int_proxy(dwMilliseconds))
13581392

13591393
#define memmove(_Dst, _Src, _Size) memmove(_Dst, _Src, obfh_int_proxy(_Size *(TRUE + FALSE)))

0 commit comments

Comments
 (0)