Add rayman2 source files
This commit is contained in:
53
Rayman_X/cpa/public/PTC/PTCDefn.h
Normal file
53
Rayman_X/cpa/public/PTC/PTCDefn.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef _PTCDEFN_H_ /* {*/
|
||||
#define _PTCDEFN_H_
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////////////////////*/
|
||||
/* Index of System Functions pointer and Name*/
|
||||
|
||||
#define PTC_C_GetModuleHandleIndex 0
|
||||
#define PTC_C_FlushInstructionCacheIndex 1
|
||||
#define PTC_C_GetCurrentProcessIndex 2
|
||||
#define PTC_C_QueryPerformanceFrequencyIndex 3
|
||||
#define PTC_C_OpenEventIndex 4
|
||||
#define PTC_C_CreateEventIndex 5
|
||||
#define PTC_C_ResetEventIndex 6
|
||||
#define PTC_C_SetEventIndex 7
|
||||
#define PTC_C_CreateFileIndex 8
|
||||
#define PTC_C_WriteFileIndex 9
|
||||
#define PTC_C_ReadFileIndex 10
|
||||
#define PTC_C_CloseHandleIndex 11
|
||||
#define PTC_C_SetFilePointerIndex 12
|
||||
#define PTC_C_FlushFileBuffersIndex 13
|
||||
#define PTC_C_QueryPerformanceCounterIndex 14
|
||||
#define PTC_C_GetDriveTypeIndex 15
|
||||
#define PTC_C_GetVolumeInformationIndex 16
|
||||
#define PTC_C_GetLogicalDriveStringsIndex 17
|
||||
#define PTC_C_GetFileSizeIndex 18
|
||||
#define PTC_C_CreateToolhelp32SnapshotIndex 19
|
||||
#define PTC_C_Process32FirstIndex 20
|
||||
#define PTC_C_Process32NextIndex 21
|
||||
#define PTC_C_Module32FirstIndex 22
|
||||
#define PTC_C_Module32NextIndex 23
|
||||
#define PTC_C_EnumProcessesIndex 24
|
||||
#define PTC_C_EnumProcessModulesIndex 25
|
||||
#define PTC_C_LoadLibraryIndex 26
|
||||
#define PTC_C_FreeLibraryIndex 27
|
||||
/* ANNECY OA - 21/07/99 { */
|
||||
#define PTC_C_GetDiskFreeSpaceIndex 28
|
||||
#define PTC_C_SetFileAttributsIndex 29
|
||||
#define PTC_C_GetFileAttributsIndex 30
|
||||
#define PTC_C_GetFileInformationByHandleIndex 31
|
||||
#define PTC_C_SetErrorModeIndex 32
|
||||
#define PTC_C_SetFileTimeIndex 33
|
||||
#define PTC_C_GetFileTimeIndex 34
|
||||
/* END ANNECY OA } */
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////////////////////*/
|
||||
/* Index of Linked DLL Image Base and Name*/
|
||||
|
||||
#define PTC_C_Kernel32Index 0
|
||||
#define PTC_C_User32Index 1
|
||||
#define PTC_C_PSAPIIndex 2
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////////////////////*/
|
||||
#endif /* _PTCDEFN_H_ }*/
|
810
Rayman_X/cpa/public/PTC/PTCFcts.h
Normal file
810
Rayman_X/cpa/public/PTC/PTCFcts.h
Normal file
@@ -0,0 +1,810 @@
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* inline functions which mask real system functions
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
#include <tlhelp32.h>
|
||||
|
||||
#ifndef _PTCFCTS_H_ /* {*/
|
||||
#define _PTCFCTS_H_
|
||||
|
||||
#ifdef PTC_SYSTEM_ACTIVED /* {*/
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ---------------- */
|
||||
/* random functions */
|
||||
/* ---------------- */
|
||||
__inline long PTC_fn_lGetRandom()
|
||||
{
|
||||
long lTmp;
|
||||
|
||||
PTC_g_lCurrentRandom ^= 123459876;
|
||||
lTmp = PTC_g_lCurrentRandom / 127773;
|
||||
PTC_g_lCurrentRandom = 16807 * (PTC_g_lCurrentRandom - lTmp * 127773) - 2836 * lTmp;
|
||||
if (PTC_g_lCurrentRandom < 0) PTC_g_lCurrentRandom += 2147483647;
|
||||
|
||||
return PTC_g_lCurrentRandom;
|
||||
}
|
||||
|
||||
__inline long PTC_fn_lGetRandomRange(long _lMin , long _lMax)
|
||||
{
|
||||
/* ANNECY OA - 20/07/99 { */
|
||||
if (_lMin != _lMax)
|
||||
return (_lMin + (PTC_fn_lGetRandom() % (_lMax - _lMin)));
|
||||
else
|
||||
return _lMax;
|
||||
/* END ANNECY OA } */
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* Macro to create dynamical code for calling system functions */
|
||||
|
||||
/* -------------------- */
|
||||
/* Compute BufferUpdate */
|
||||
/* -------------------- */
|
||||
__inline DWORD PTC_fn_dwGetAddressOfBuffer()
|
||||
{
|
||||
return (DWORD)(PTC_ga_cGeneratedCode + PTC_fn_lGetRandomRange(0 , PTC_C_CODESIZE - 15));
|
||||
}
|
||||
|
||||
#define PTC_M_EndGeneratedCode(dwBeginAddress)\
|
||||
{\
|
||||
char *p_cBegin = (char*)dwBeginAddress;\
|
||||
char *p_cEnd = p_cBegin + 15;\
|
||||
while(p_cBegin < p_cEnd) *p_cBegin++ = (char)PTC_fn_lGetRandomRange(0,255);\
|
||||
}
|
||||
|
||||
/* ----------------------- */
|
||||
/* jmp indirect : 12 bytes */
|
||||
/* ----------------------- */
|
||||
//#define PTC_M_IndirectJmp(IndexFunctionPtr,lOffset)\
|
||||
//{\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 0] = (char) 0xA1;\
|
||||
// *((DWORD*)&PTC_ga_cGeneratedCode [lOffset + 1]) = (DWORD) &(PTC_ga_stImportedFunctions [IndexFunctionPtr] . dwAddress);\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 5] = (char) 0x33;\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 6] = (char) 0x05;\
|
||||
// *((DWORD*)&PTC_ga_cGeneratedCode [lOffset + 7]) = (DWORD) (PTC_ga_stImportedFunctions [IndexFunctionPtr] . szName);\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 11] = (char) 0xFF;\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 12] = (char) 0xE0;\
|
||||
// PTC_FlushInstructionCache (PTC_GetCurrentProcess () , PTC_ga_cGeneratedCode , PTC_C_CODESIZE);\
|
||||
//}
|
||||
|
||||
#define PTC_M_IndirectJmp2(IndexFunctionPtr,dwBeginAddress)\
|
||||
{\
|
||||
char *p_cBeginOfCode = (char*) (dwBeginAddress);\
|
||||
*p_cBeginOfCode = (char) 0xA1;\
|
||||
*((DWORD*)(p_cBeginOfCode + 1)) = (DWORD) &(PTC_ga_stImportedFunctions [IndexFunctionPtr] . dwAddress);\
|
||||
*(p_cBeginOfCode + 5) = (char) 0x33;\
|
||||
*(p_cBeginOfCode + 6) = (char) 0x05;\
|
||||
*((DWORD*)(p_cBeginOfCode + 7)) = (DWORD) (PTC_ga_stImportedFunctions [IndexFunctionPtr] . szName);\
|
||||
*(p_cBeginOfCode + 11) = (char) 0xFF;\
|
||||
*(p_cBeginOfCode + 12) = (char) 0xE0;\
|
||||
PTC_FlushInstructionCache (PTC_GetCurrentProcess () , PTC_ga_cGeneratedCode , PTC_C_CODESIZE);\
|
||||
}
|
||||
|
||||
/* ---------------------- */
|
||||
/* jmp direct : 5 bytes */
|
||||
/* ---------------------- */
|
||||
//#define PTC_M_DirectJmp(IndexFunctionPtr,lOffset)\
|
||||
//{\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 0] = (char) 0xE9;\
|
||||
// *((DWORD*)&PTC_ga_cGeneratedCode [lOffset + 1]) = (DWORD) ((PTC_ga_stImportedFunctions [IndexFunctionPtr] . dwAddress ^ *((DWORD*)(PTC_ga_stImportedFunctions [IndexFunctionPtr] . szName)))- (DWORD) (PTC_ga_cGeneratedCode + lOffset + 5));\
|
||||
// PTC_FlushInstructionCache (PTC_GetCurrentProcess () , PTC_ga_cGeneratedCode , PTC_C_CODESIZE);\
|
||||
//}
|
||||
|
||||
#define PTC_M_DirectJmp2(IndexFunctionPtr,dwBeginAddress)\
|
||||
{\
|
||||
char *p_cBeginOfCode = (char*) (dwBeginAddress);\
|
||||
*p_cBeginOfCode = (char) 0xE9;\
|
||||
*((DWORD*)(p_cBeginOfCode + 1)) = (DWORD) ((PTC_ga_stImportedFunctions [IndexFunctionPtr] . dwAddress ^ *((DWORD*)(PTC_ga_stImportedFunctions [IndexFunctionPtr] . szName)))- (DWORD) (p_cBeginOfCode + 5));\
|
||||
PTC_FlushInstructionCache (PTC_GetCurrentProcess () , PTC_ga_cGeneratedCode , PTC_C_CODESIZE);\
|
||||
}
|
||||
/* --------------------------- */
|
||||
/* push direct + ret : 6 bytes */
|
||||
/* --------------------------- */
|
||||
//#define PTC_M_DirectPush(IndexFunctionPtr,lOffset)\
|
||||
//{\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 0] = (char) 0x68;\
|
||||
// *((DWORD*)&PTC_ga_cGeneratedCode [lOffset + 1]) = (DWORD) ((PTC_ga_stImportedFunctions [IndexFunctionPtr] . dwAddress ^ *((DWORD*)(PTC_ga_stImportedFunctions [IndexFunctionPtr] . szName))));\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 5] = (char) 0xC3;\
|
||||
// PTC_FlushInstructionCache (PTC_GetCurrentProcess () , PTC_ga_cGeneratedCode , PTC_C_CODESIZE);\
|
||||
//}
|
||||
|
||||
#define PTC_M_DirectPush2(IndexFunctionPtr,dwBeginAddress)\
|
||||
{\
|
||||
char *p_cBeginOfCode = (char*) (dwBeginAddress);\
|
||||
*p_cBeginOfCode = (char) 0x68;\
|
||||
*((DWORD*)(p_cBeginOfCode + 1)) = (DWORD) ((PTC_ga_stImportedFunctions [IndexFunctionPtr] . dwAddress ^ *((DWORD*)(PTC_ga_stImportedFunctions [IndexFunctionPtr] . szName))));\
|
||||
*(p_cBeginOfCode + 5) = (char) 0xC3;\
|
||||
PTC_FlushInstructionCache (PTC_GetCurrentProcess () , PTC_ga_cGeneratedCode , PTC_C_CODESIZE);\
|
||||
}
|
||||
/* ------------------------------ */
|
||||
/* push indirect + ret : 12 bytes */
|
||||
/* ------------------------------ */
|
||||
//#define PTC_M_IndirectPush(IndexFunctionPtr,lOffset)\
|
||||
//{\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 0] = (char) 0xA1;\
|
||||
// *((DWORD*)&PTC_ga_cGeneratedCode [lOffset + 1]) = (DWORD) &(PTC_ga_stImportedFunctions [IndexFunctionPtr] . dwAddress);\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 5] = (char) 0x33;\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 6] = (char) 0x05;\
|
||||
// *((DWORD*)&PTC_ga_cGeneratedCode [lOffset + 7]) = (DWORD) (PTC_ga_stImportedFunctions [IndexFunctionPtr] . szName);\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 11] = (char) 0x50;\
|
||||
// PTC_ga_cGeneratedCode [lOffset + 12] = (char) 0xC3;\
|
||||
// PTC_FlushInstructionCache (PTC_GetCurrentProcess () , PTC_ga_cGeneratedCode , PTC_C_CODESIZE);\
|
||||
//}
|
||||
|
||||
#define PTC_M_IndirectPush2(IndexFunctionPtr,dwBeginAddress)\
|
||||
{\
|
||||
char *p_cBeginOfCode = (char*) (dwBeginAddress);\
|
||||
*p_cBeginOfCode = (char) 0xA1;\
|
||||
*((DWORD*)(p_cBeginOfCode + 1)) = (DWORD) &(PTC_ga_stImportedFunctions [IndexFunctionPtr] . dwAddress);\
|
||||
*(p_cBeginOfCode + 5) = (char) 0x33;\
|
||||
*(p_cBeginOfCode + 6) = (char) 0x05;\
|
||||
*((DWORD*)(p_cBeginOfCode + 7)) = (DWORD) (PTC_ga_stImportedFunctions [IndexFunctionPtr] . szName);\
|
||||
*(p_cBeginOfCode + 11) = (char) 0x50;\
|
||||
*(p_cBeginOfCode + 12) = (char) 0xC3;\
|
||||
PTC_FlushInstructionCache (PTC_GetCurrentProcess () , PTC_ga_cGeneratedCode , PTC_C_CODESIZE);\
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* System functions redefinition */
|
||||
|
||||
#pragma warning( disable : 4055)
|
||||
|
||||
/* --------------------- */
|
||||
/* FlushInstructionCache */
|
||||
/* --------------------- */
|
||||
typedef BOOL (WINAPI *PTC_tdFlushInstructionCacheFunctionPtr) (HANDLE hProcess, LPCVOID lpBaseAddress, DWORD dwSize);
|
||||
|
||||
__inline BOOL WINAPI PTC_FlushInstructionCache(HANDLE hProcess, LPCVOID lpBaseAddress, DWORD dwSize)
|
||||
{
|
||||
DWORD dwAddress = PTC_ga_stImportedFunctions [PTC_C_FlushInstructionCacheIndex] . dwAddress;
|
||||
DWORD dwKey = *((DWORD*) PTC_ga_stImportedFunctions [PTC_C_FlushInstructionCacheIndex] . szName);
|
||||
|
||||
return (((PTC_tdFlushInstructionCacheFunctionPtr)(dwAddress ^ dwKey)) (hProcess , lpBaseAddress , dwSize));
|
||||
}
|
||||
|
||||
/* ----------------- */
|
||||
/* GetCurrentProcess */
|
||||
/* ----------------- */
|
||||
typedef HANDLE (WINAPI *PTC_tdGetCurrentProcessFunctionPtr)(VOID);
|
||||
|
||||
__inline HANDLE WINAPI PTC_GetCurrentProcess(VOID)
|
||||
{
|
||||
DWORD dwAddress = PTC_ga_stImportedFunctions [PTC_C_GetCurrentProcessIndex] . dwAddress;
|
||||
DWORD dwKey = *((DWORD*) PTC_ga_stImportedFunctions [PTC_C_GetCurrentProcessIndex] . szName);
|
||||
|
||||
return (((PTC_tdGetCurrentProcessFunctionPtr)(dwAddress ^ dwKey)) ());
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* --------------- */
|
||||
/* GetModuleHandle */
|
||||
/* --------------- */
|
||||
typedef HMODULE (WINAPI *PTC_tdGetModuleHandle)(LPCTSTR lpModuleName);
|
||||
|
||||
__inline HMODULE WINAPI PTC_GetModuleHandle(LPCTSTR lpModuleName)
|
||||
{
|
||||
HMODULE hResult;
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_GetModuleHandleIndex , dwAddress);
|
||||
hResult = (((PTC_tdGetModuleHandle) dwAddress) (lpModuleName));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
__inline HMODULE WINAPI PTC_DirectGetModuleHandle(LPCTSTR lpModuleName)
|
||||
{
|
||||
DWORD dwAddress = PTC_ga_stImportedFunctions [PTC_C_GetModuleHandleIndex] . dwAddress;
|
||||
DWORD dwKey = *((DWORD*) PTC_ga_stImportedFunctions [PTC_C_GetModuleHandleIndex] . szName);
|
||||
|
||||
return (((PTC_tdGetModuleHandle)(dwAddress ^ dwKey)) (lpModuleName));
|
||||
}
|
||||
|
||||
/* ------------------------- */
|
||||
/* QueryPerformanceFrequency */
|
||||
/* ------------------------- */
|
||||
typedef BOOL (WINAPI *PTC_tdQueryPerformanceFrequencyFunctionPtr)(LARGE_INTEGER *lpFrequency);
|
||||
|
||||
__inline BOOL WINAPI PTC_QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_QueryPerformanceFrequencyIndex , dwAddress);
|
||||
bResult = (((PTC_tdQueryPerformanceFrequencyFunctionPtr) dwAddress) (lpFrequency));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ---------- */
|
||||
/* OpenEventA */
|
||||
/* ---------- */
|
||||
typedef HANDLE (WINAPI *PTC_tdOpenEventFunctionPtr)(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCTSTR lpName);
|
||||
|
||||
__inline HANDLE PTC_OpenEvent(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCTSTR lpName)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
HANDLE hResult;
|
||||
|
||||
PTC_M_DirectJmp2(PTC_C_OpenEventIndex , dwAddress);
|
||||
hResult = (((PTC_tdOpenEventFunctionPtr) dwAddress) (dwDesiredAccess, bInheritHandle, lpName));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
/* ------------ */
|
||||
/* CreateEventA */
|
||||
/* ------------ */
|
||||
typedef HANDLE (WINAPI *PTC_tdCreateEventFunctionPtr)(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCTSTR lpName);
|
||||
|
||||
__inline HANDLE WINAPI PTC_CreateEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCTSTR lpName)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
HANDLE hResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_CreateEventIndex , dwAddress);
|
||||
hResult = (((PTC_tdCreateEventFunctionPtr) dwAddress) (lpEventAttributes, bManualReset, bInitialState, lpName));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
|
||||
/* ---------- */
|
||||
/* ResetEvent */
|
||||
/* ---------- */
|
||||
typedef BOOL (WINAPI *PTC_tdResetEventFunctionPtr)(HANDLE hEvent);
|
||||
|
||||
__inline BOOL PTC_ResetEvent(HANDLE hEvent)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_ResetEventIndex , dwAddress);
|
||||
bResult = (((PTC_tdResetEventFunctionPtr) dwAddress) (hEvent));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* -------- */
|
||||
/* SetEvent */
|
||||
/* -------- */
|
||||
typedef BOOL (WINAPI *PTC_tdSetEventFunctionPtr)(HANDLE hEvent);
|
||||
|
||||
__inline BOOL PTC_SetEvent(HANDLE hEvent)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_SetEventIndex , dwAddress);
|
||||
bResult = (((PTC_tdSetEventFunctionPtr) dwAddress) (hEvent));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ---------- */
|
||||
/* CreateFile */
|
||||
/* ---------- */
|
||||
typedef HANDLE (WINAPI *PTC_tdCreateFileFunctionPtr)(LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDistribution,
|
||||
DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
|
||||
|
||||
|
||||
__inline HANDLE WINAPI PTC_CreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDistribution,
|
||||
DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
HANDLE hResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_CreateFileIndex , dwAddress);
|
||||
hResult = (((PTC_tdCreateFileFunctionPtr) dwAddress) (lpFileName, dwDesiredAccess, dwShareMode,
|
||||
lpSecurityAttributes, dwCreationDistribution,
|
||||
dwFlagsAndAttributes, hTemplateFile));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
/* --------- */
|
||||
/* WriteFile */
|
||||
/* --------- */
|
||||
typedef BOOL (WINAPI *PTC_tdWriteFileFunctionPtr)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
|
||||
LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);
|
||||
|
||||
__inline BOOL WINAPI PTC_WriteFile (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
|
||||
LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_WriteFileIndex , dwAddress);
|
||||
bResult = (((PTC_tdWriteFileFunctionPtr) dwAddress) (hFile, lpBuffer, nNumberOfBytesToWrite,lpNumberOfBytesWritten,lpOverlapped));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* -------- */
|
||||
/* ReadFile */
|
||||
/* -------- */
|
||||
typedef BOOL (WINAPI *PTC_tdReadFileFunctionPtr)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToRead,
|
||||
LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
|
||||
|
||||
__inline BOOL WINAPI PTC_ReadFile (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToRead,
|
||||
LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectPush2(PTC_C_ReadFileIndex , dwAddress);
|
||||
bResult = (((PTC_tdReadFileFunctionPtr) dwAddress) (hFile, lpBuffer, nNumberOfBytesToRead,lpNumberOfBytesRead,lpOverlapped));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ----------- */
|
||||
/* CloseHandle */
|
||||
/* ----------- */
|
||||
typedef BOOL (WINAPI *PTC_tdCloseHandleFunctionPtr)(HANDLE hObject);
|
||||
|
||||
__inline BOOL WINAPI PTC_CloseHandle(HANDLE hObject)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_CloseHandleIndex , dwAddress);
|
||||
bResult = (((PTC_tdCloseHandleFunctionPtr) dwAddress) (hObject));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* -------------- */
|
||||
/* SetFilePointer */
|
||||
/* -------------- */
|
||||
typedef DWORD (WINAPI *PTC_tdSetFilePointerFunctionPtr)(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);
|
||||
|
||||
__inline DWORD WINAPI PTC_SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
DWORD dwResult;
|
||||
|
||||
PTC_M_IndirectPush2(PTC_C_SetFilePointerIndex , dwAddress);
|
||||
dwResult = (((PTC_tdSetFilePointerFunctionPtr) dwAddress) (hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return dwResult;
|
||||
}
|
||||
|
||||
/* ---------------- */
|
||||
/* FlushFileBuffers */
|
||||
/* ---------------- */
|
||||
typedef BOOL (WINAPI *PTC_tdFlushFileBuffersFunctionPtr)(HANDLE hObject);
|
||||
|
||||
__inline BOOL WINAPI PTC_FlushFileBuffers(HANDLE hObject)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_FlushFileBuffersIndex , dwAddress);
|
||||
bResult = (((PTC_tdFlushFileBuffersFunctionPtr) dwAddress) (hObject));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ----------------------- */
|
||||
/* QueryPerformanceCounter */
|
||||
/* ----------------------- */
|
||||
typedef BOOL (WINAPI *PTC_tdQueryPerformanceCounterFunctionPtr)(LARGE_INTEGER *lpFrequency);
|
||||
|
||||
__inline BOOL WINAPI PTC_QueryPerformanceCounter(LARGE_INTEGER *lpFrequency)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_QueryPerformanceCounterIndex , dwAddress);
|
||||
bResult = (((PTC_tdQueryPerformanceCounterFunctionPtr) dwAddress) (lpFrequency));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ------------ */
|
||||
/* GetDriveType */
|
||||
/* ------------ */
|
||||
typedef UINT (WINAPI *PTC_tdGetDriveTypeFunctionPtr)(LPCTSTR lpRootPathName);
|
||||
|
||||
__inline UINT WINAPI PTC_GetDriveType(LPCTSTR lpRootPathName)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
UINT uiResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_GetDriveTypeIndex , dwAddress);
|
||||
uiResult = (((PTC_tdGetDriveTypeFunctionPtr) dwAddress) (lpRootPathName));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return uiResult;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------- */
|
||||
/* GetVolumeInformation */
|
||||
/* -------------------- */
|
||||
typedef BOOL (WINAPI *PTC_tdGetVolumeInformationFunctionPtr)(LPCTSTR lpRootPathName, LPTSTR lpVolumeNameBuffer, DWORD nVolumeNameSize,
|
||||
LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength,
|
||||
LPDWORD lpFileSystemFlags, LPTSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize);
|
||||
|
||||
__inline BOOL WINAPI PTC_GetVolumeInformation(LPCTSTR lpRootPathName, LPTSTR lpVolumeNameBuffer, DWORD nVolumeNameSize,
|
||||
LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength,LPDWORD lpFileSystemFlags,
|
||||
LPTSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectPush2(PTC_C_GetVolumeInformationIndex , dwAddress);
|
||||
bResult = (((PTC_tdGetVolumeInformationFunctionPtr) dwAddress) (lpRootPathName, lpVolumeNameBuffer, nVolumeNameSize,
|
||||
lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags,
|
||||
lpFileSystemNameBuffer, nFileSystemNameSize));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ---------------------- */
|
||||
/* GetLogicalDriveStrings */
|
||||
/* ---------------------- */
|
||||
typedef DWORD (WINAPI *PTC_tdGetLogicalDriveStringsFunctionPtr)(DWORD nBufferLength, LPTSTR lpBuffer);
|
||||
|
||||
__inline DWORD WINAPI PTC_GetLogicalDriveStrings(DWORD nBufferLength, LPTSTR lpBuffer)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
DWORD dwResult;
|
||||
|
||||
PTC_M_IndirectPush2(PTC_C_GetLogicalDriveStringsIndex , dwAddress);
|
||||
dwResult = (((PTC_tdGetLogicalDriveStringsFunctionPtr) dwAddress) (nBufferLength, lpBuffer));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return dwResult;
|
||||
}
|
||||
|
||||
|
||||
/* GetModuleFileName */
|
||||
|
||||
/* ----------- */
|
||||
/* GetFileSize */
|
||||
/* ----------- */
|
||||
typedef DWORD (WINAPI *PTC_tdGetFileSizeFunctionPtr)(HANDLE hFile, LPDWORD lpFileSizeHigh);
|
||||
|
||||
__inline DWORD WINAPI PTC_GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
DWORD dwResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_GetFileSizeIndex , dwAddress);
|
||||
dwResult = (((PTC_tdGetFileSizeFunctionPtr) dwAddress) (hFile, lpFileSizeHigh));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return dwResult;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------ */
|
||||
/* CreateToolhelp32Snapshot */
|
||||
/* ------------------------ */
|
||||
typedef HANDLE (WINAPI * PTC_tdCreateToolhelp32SnapshotFunctionPtr)(DWORD dwFlags, DWORD th32ProcessID);
|
||||
|
||||
__inline HANDLE WINAPI PTC_CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
HANDLE hResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_CreateToolhelp32SnapshotIndex , dwAddress);
|
||||
hResult = (((PTC_tdCreateToolhelp32SnapshotFunctionPtr) dwAddress) (dwFlags, th32ProcessID));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
/* -------------- */
|
||||
/* Process32First */
|
||||
/* -------------- */
|
||||
typedef BOOL (WINAPI * PTC_tdProcess32FirstFunctionPtr)(HANDLE hSnapshot, LPPROCESSENTRY32 lppe);
|
||||
|
||||
__inline BOOL WINAPI PTC_Process32First(HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectJmp2(PTC_C_Process32FirstIndex , dwAddress);
|
||||
bResult = (((PTC_tdProcess32FirstFunctionPtr) dwAddress) (hSnapshot, lppe));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ------------- */
|
||||
/* Process32Next */
|
||||
/* ------------- */
|
||||
typedef BOOL (WINAPI * PTC_tdProcess32NextFunctionPtr)(HANDLE hSnapshot, LPPROCESSENTRY32 lppe);
|
||||
|
||||
__inline BOOL WINAPI PTC_Process32Next(HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectJmp2(PTC_C_Process32NextIndex , dwAddress);
|
||||
bResult = (((PTC_tdProcess32NextFunctionPtr) dwAddress) (hSnapshot, lppe));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ------------- */
|
||||
/* Module32First */
|
||||
/* ------------- */
|
||||
typedef BOOL (WINAPI * PTC_tdModule32FirstFunctionPtr)(HANDLE hSnapshot, LPMODULEENTRY32 lpme);
|
||||
|
||||
__inline BOOL WINAPI PTC_Module32First(HANDLE hSnapshot, LPMODULEENTRY32 lpme)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectJmp2(PTC_C_Module32FirstIndex , dwAddress);
|
||||
bResult = (((PTC_tdModule32FirstFunctionPtr) dwAddress) (hSnapshot, lpme));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ------------ */
|
||||
/* Module32Next */
|
||||
/* ------------ */
|
||||
typedef BOOL (WINAPI * PTC_tdModule32NextFunctionPtr)(HANDLE hSnapshot, LPMODULEENTRY32 lpme);
|
||||
|
||||
__inline BOOL WINAPI PTC_Module32Next(HANDLE hSnapshot, LPMODULEENTRY32 lpme)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectJmp2(PTC_C_Module32NextIndex , dwAddress);
|
||||
bResult = (((PTC_tdModule32NextFunctionPtr) dwAddress) (hSnapshot, lpme));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ------------- */
|
||||
/* EnumProcesses */
|
||||
/* ------------- */
|
||||
typedef BOOL (WINAPI * PTC_tdEnumProcessesFunctionPtr)(DWORD * lpidProcess,DWORD cb,DWORD * cbNeeded);
|
||||
|
||||
__inline BOOL WINAPI PTC_EnumProcesses(DWORD * lpidProcess,DWORD cb,DWORD * cbNeeded)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_EnumProcessesIndex , dwAddress);
|
||||
bResult = (((PTC_tdEnumProcessesFunctionPtr) dwAddress) (lpidProcess, cb, cbNeeded));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ------------------ */
|
||||
/* EnumProcessModules */
|
||||
/* ------------------ */
|
||||
typedef BOOL (WINAPI * PTC_tdEnumProcessModulesFunctionPtr)(HANDLE hProcess,HMODULE *lphModule,DWORD cb,LPDWORD lpcbNeeded);
|
||||
|
||||
__inline BOOL WINAPI PTC_EnumProcessModules(HANDLE hProcess,HMODULE *lphModule,DWORD cb,LPDWORD lpcbNeeded)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectPush2(PTC_C_EnumProcessModulesIndex , dwAddress);
|
||||
bResult = (((PTC_tdEnumProcessModulesFunctionPtr) dwAddress) (hProcess, lphModule, cb, lpcbNeeded));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ----------- */
|
||||
/* LoadLibrary */
|
||||
/* ----------- */
|
||||
typedef HINSTANCE (WINAPI *PTC_tdLoadLibraryFunctionPtr)(LPCTSTR lpLibFileName);
|
||||
|
||||
__inline HINSTANCE WINAPI PTC_LoadLibrary(LPCTSTR lpLibFileName)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
HINSTANCE hResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_LoadLibraryIndex , dwAddress);
|
||||
hResult = (((PTC_tdLoadLibraryFunctionPtr) (dwAddress)) (lpLibFileName));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
/* ----------- */
|
||||
/* FreeLibrary */
|
||||
/* ----------- */
|
||||
typedef BOOL (WINAPI *PTC_tdFreeLibraryFunctionPtr)(HMODULE hLibModule);
|
||||
|
||||
__inline BOOL WINAPI PTC_FreeLibrary(HMODULE hLibModule)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectJmp2(PTC_C_FreeLibraryIndex , dwAddress);
|
||||
bResult = (((PTC_tdFreeLibraryFunctionPtr) dwAddress) (hLibModule));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ANNECY OA - 21/07/99 { */
|
||||
|
||||
/* ---------------- */
|
||||
/* GetDiskFreeSpace */
|
||||
/* ---------------- */
|
||||
typedef BOOL (WINAPI *PTC_GetDiskFreeSpaceFunctionPtr)(LPCTSTR lpszFileName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpFreeClusters, LPDWORD lpClusters);
|
||||
__inline BOOL WINAPI PTC_GetDiskFreeSpace(LPCTSTR lpszFileName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpFreeClusters, LPDWORD lpClusters)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_IndirectJmp2(PTC_C_GetDiskFreeSpaceIndex , dwAddress);
|
||||
bResult = (((PTC_GetDiskFreeSpaceFunctionPtr) dwAddress) (lpszFileName, lpSectorsPerCluster, lpBytesPerSector, lpFreeClusters, lpClusters));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ---------------- */
|
||||
/* SetFileAttributs */
|
||||
/* ---------------- */
|
||||
typedef BOOL (WINAPI *PTC_SetFileAttributsFunctionPtr)(LPCTSTR lpszFileName, DWORD dwFileAttributes);
|
||||
__inline BOOL WINAPI PTC_SetFileAttributs(LPCTSTR lpszFileName, DWORD dwFileAttributes)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectJmp2(PTC_C_SetFileAttributsIndex , dwAddress);
|
||||
bResult = (((PTC_SetFileAttributsFunctionPtr) dwAddress) (lpszFileName, dwFileAttributes));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ---------------- */
|
||||
/* GetFileAttributs */
|
||||
/* ---------------- */
|
||||
typedef BOOL (WINAPI *PTC_GetFileAttributsFunctionPtr)(LPCTSTR lpszFileName);
|
||||
__inline BOOL WINAPI PTC_GetFileAttributs(LPCTSTR lpszFileName)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_GetFileAttributsIndex , dwAddress);
|
||||
bResult = (((PTC_GetFileAttributsFunctionPtr) dwAddress) (lpszFileName));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* -------------------------- */
|
||||
/* GetFileInformationByHandle */
|
||||
/* -------------------------- */
|
||||
typedef BOOL (WINAPI *PTC_GetFileInformationByHandleFunctionPtr)(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation);
|
||||
__inline BOOL WINAPI PTC_GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_GetFileInformationByHandleIndex , dwAddress);
|
||||
bResult = (((PTC_GetFileInformationByHandleFunctionPtr) dwAddress) (hFile, lpFileInformation));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ------------ */
|
||||
/* SetErrorMode */
|
||||
/* ------------ */
|
||||
typedef UINT (WINAPI *PTC_SetErrorModeFunctionPtr)(UINT uNewErrorMode);
|
||||
__inline UINT WINAPI PTC_SetErrorMode(UINT uNewErrorMode)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
UINT uiResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_SetErrorModeIndex , dwAddress);
|
||||
uiResult = (((PTC_SetErrorModeFunctionPtr) dwAddress) (uNewErrorMode));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return uiResult;
|
||||
}
|
||||
|
||||
/* ------------ */
|
||||
/* SetFileTime */
|
||||
/* ------------ */
|
||||
typedef BOOL (WINAPI *PTC_SetFileTimeFunctionPtr)(HANDLE hFile, CONST FILETIME* lpftCreation, CONST FILETIME* lpftLastAccess, CONST FILETIME* lpftLastWrite);
|
||||
__inline BOOL WINAPI PTC_SetFileTime(HANDLE hFile, CONST FILETIME* lpftCreation, CONST FILETIME* lpftLastAccess, CONST FILETIME* lpftLastWrite)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_SetFileTimeIndex , dwAddress);
|
||||
bResult = (((PTC_SetFileTimeFunctionPtr) dwAddress) (hFile, lpftCreation, lpftLastAccess, lpftLastWrite));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* ------------ */
|
||||
/* GetFileTime */
|
||||
/* ------------ */
|
||||
typedef BOOL (WINAPI *PTC_GetFileTimeFunctionPtr)(HANDLE hFile, LPFILETIME lpftCreation, LPFILETIME lpftLastAccess, LPFILETIME lpftLastWrite);
|
||||
__inline BOOL WINAPI PTC_GetFileTime(HANDLE hFile, LPFILETIME lpftCreation, LPFILETIME lpftLastAccess, LPFILETIME lpftLastWrite)
|
||||
{
|
||||
DWORD dwAddress = PTC_fn_dwGetAddressOfBuffer();
|
||||
BOOL bResult;
|
||||
|
||||
PTC_M_DirectPush2(PTC_C_GetFileTimeIndex , dwAddress);
|
||||
bResult = (((PTC_GetFileTimeFunctionPtr) dwAddress) (hFile, lpftCreation, lpftLastAccess, lpftLastWrite));
|
||||
PTC_M_EndGeneratedCode(dwAddress);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/* END ANNECY OA } */
|
||||
|
||||
|
||||
#pragma warning( default : 4055)
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
#define PTC_M_SetLabelAddress(lValue,label) __asm{ mov lValue,offset label }
|
||||
#define PTC_M_BeginLabel(function) PTC_Label_B_##function
|
||||
#define PTC_M_EndLabel(function) PTC_Label_E_##function
|
||||
#define PTC_M_DeclareBeginLabel(function) PTC_Label_B_##function:
|
||||
#define PTC_M_DeclareEndLabel(function) PTC_Label_E_##function:
|
||||
|
||||
#define PTC_M_AddFunctionCheckSum(index,function) \
|
||||
{ \
|
||||
PTC_M_SetLabelAddress(PTC_g_dwBeginLabelAddress[index*4] , PTC_M_BeginLabel(function)); \
|
||||
PTC_M_SetLabelAddress(PTC_g_dwEndLabelAddress[index*4] , PTC_M_EndLabel(function)); \
|
||||
}
|
||||
|
||||
#define PTC_M_AddFunctionDelete(index,function) \
|
||||
{ \
|
||||
PTC_M_SetLabelAddress(PTC_g_dwBeginLabelAddressDelete[index*4] , PTC_M_BeginLabel(function)); \
|
||||
PTC_M_SetLabelAddress(PTC_g_dwEndLabelAddressDelete[index*4] , PTC_M_EndLabel(function)); \
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
#endif /* PTC_SYSTEM_ACTIVED }*/
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
#endif /* _PTCFCTS_H_ }*/
|
94
Rayman_X/cpa/public/PTC/PTCMacro.h
Normal file
94
Rayman_X/cpa/public/PTC/PTCMacro.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/*///////////////////////////////////////////////////////////////////////////////*/
|
||||
/**/
|
||||
/* Inactive Protection Macro definition*/
|
||||
/**/
|
||||
/*///////////////////////////////////////////////////////////////////////////////*/
|
||||
/**/
|
||||
/* When Protection is inactive, the PTC_Function is define as Function*/
|
||||
/**/
|
||||
/*///////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
#ifndef _PTCMACRO_H_ /* {*/
|
||||
#define _PTCMACRO_H_
|
||||
|
||||
#ifndef PTC_SYSTEM_ACTIVED /* {*/
|
||||
|
||||
/*///////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
#define PTC_fn_vInit(x)
|
||||
#define PTC_fn_vDesInit()
|
||||
#define PTC_fn_bVerifyOneImportedFunctionPtr() TRUE
|
||||
#define PTC_fn_lGetRandom() 0L
|
||||
#define PTC_fn_lGetRandomRange(a,b) (a)
|
||||
|
||||
#define PTC_GetModuleHandle GetModuleHandle
|
||||
#define PTC_GetModuleHandleA GetModuleHandleA
|
||||
#define PTC_FlushInstructionCache FlushInstructionCache
|
||||
#define PTC_GetCurrentProcess GetCurrentProcess
|
||||
#define PTC_QueryPerformanceFrequency QueryPerformanceFrequency
|
||||
#define PTC_OpenEventA OpenEventA
|
||||
#define PTC_CreateEventA CreateEventA
|
||||
#define PTC_ResetEvent ResetEvent
|
||||
#define PTC_SetEvent SetEvent
|
||||
#define PTC_CreateFile CreateFile
|
||||
#define PTC_WriteFile WriteFile
|
||||
#define PTC_ReadFile ReadFile
|
||||
#define PTC_CloseHandle CloseHandle
|
||||
#define PTC_SetFilePointer SetFilePointer
|
||||
#define PTC_FlushFileBuffers FlushFileBuffers
|
||||
#define PTC_QueryPerformanceCounter QueryPerformanceCounter
|
||||
#define PTC_GetDriveType GetDriveType
|
||||
#define PTC_GetVolumeInformation GetVolumeInformation
|
||||
#define PTC_GetLogicalDriveStrings GetLogicalDriveStrings
|
||||
#define PTC_GetFileSize GetFileSize
|
||||
#define PTC_CreateToolhelp32Snapshot CreateToolhelp32Snapshot
|
||||
#define PTC_Process32First Process32First
|
||||
#define PTC_Process32Next Process32Next
|
||||
#define PTC_Module32First Module32First
|
||||
#define PTC_Module32Next Module32Next
|
||||
#define PTC_EnumProcesses EnumProcesses
|
||||
#define PTC_EnumProcessModules EnumProcessModules
|
||||
#define PTC_LoadLibrary LoadLibrary
|
||||
#define PTC_FreeLibrary FreeLibrary
|
||||
/* ANNECY OA - 21/07/99 { */
|
||||
#define PTC_GetDiskFreeSpace GetDiskFreeSpace
|
||||
#define PTC_SetFileAttributs SetFileAttributs
|
||||
#define PTC_GetFileAttributs GetFileAttributs
|
||||
#define PTC_GetFileInformationByHandle GetFileInformationByHandle
|
||||
#define PTC_SetErrorMode SetErrorMode
|
||||
#define PTC_SetFileTime SetFileTime
|
||||
#define PTC_GetFileTime GetFileTime
|
||||
/* END ANNECY OA } */
|
||||
|
||||
|
||||
|
||||
/*///////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
#define PTC_M_SetLabelAddress(lValue,label)
|
||||
#define PTC_M_BeginLabel(function)
|
||||
#define PTC_M_EndLabel(function)
|
||||
#define PTC_M_DeclareBeginLabel(function)
|
||||
#define PTC_M_DeclareEndLabel(function)
|
||||
|
||||
#define PTC_M_AddFunctionCheckSum(index,function)
|
||||
#define PTC_M_AddFunctionDelete(index,function)
|
||||
|
||||
#define PTC_fn_vInitChecksum()
|
||||
#define PTC_fn_vComputeAndWriteChecksumFile()
|
||||
#define PTC_fn_dwlGetCheckSum(dwBeginAddr,dwEndAddr)
|
||||
#define PTC_fn_vReadChecksumFile()
|
||||
#define PTC_fn_dwSearchExportedFunctionInEveryDLL(_szCryptedName) 0
|
||||
#define PTC_fn_dwSearchFunctionInImportedTableOfExe(_szCryptedName) 0
|
||||
|
||||
/*///////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
#define PTC_g_bTakeAddresses 0
|
||||
|
||||
#endif /* ! PTC_SYSTEM_ACTIVED }*/
|
||||
|
||||
#endif /* ! _PTCMACRO_H_ }*/
|
||||
|
||||
/*///////////////////////////////////////////////////////////////////////////////*/
|
||||
/* End Of File*/
|
||||
/*///////////////////////////////////////////////////////////////////////////////*/
|
63
Rayman_X/cpa/public/PTC/PTC_abc.h
Normal file
63
Rayman_X/cpa/public/PTC/PTC_abc.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
#ifndef _PTC_ABC_H_ // {
|
||||
#define _PTC_ABC_H_
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
/* Function Names code */
|
||||
|
||||
#define PTC_C_GetModuleHandleAName "\x82\x24\x4C\x29\x10\xE5\xF6\x1C\x38\x59\x93\xB9\xC5\xEB\x0B\x59\x4F\x86\xB3\xB1\xC0"
|
||||
#define PTC_C_GetModuleHandleWName "\xEE\xB4\x0D\x29\x10\xE1\xB3\x7A\x77\x59\x14\x1B\x08\xEF\xD0\x9F\x96\x4E\x3C\x3B\xFD"
|
||||
#define PTC_C_FlushInstructionCacheName "\x8A\x00\x42\x2C\x15\xD0\x0C\x3B\x47\x6A\x69\x7C\x9F\xAE\xDA\xEB\xE7\x06\x39\x2D\x62\x2D\x79\xA9\x9C\xC7"
|
||||
#define PTC_C_GetCurrentProcessName "\x9D\x44\x22\x2E\x11\xA0\xD6\xB5\x90\xAE\x9F\x93\x6E\x87\x65\x31\x5F\x38\x50\x26\x20\x14"
|
||||
#define PTC_C_QueryPerformanceFrequencyName "\xF4\xF1\x61\x6F\x19\x94\x6A\x60\x63\x4C\x25\x28\x23\x0B\x14\xF3\xFA\xC4\xDB\xA2\xBA\xAB\x87\xA0\x86\x70\x52\x5F\x34\x2C"
|
||||
#define PTC_C_OpenEventAName "\x25\xA5\x4D\x42\x0A\x0F\x09\x0B\x11\x41\x3F\x47\x5D\x4E\x90"
|
||||
#define PTC_C_OpenEventWName "\x16\x49\x27\x47\x0A\x1C\x1D\x16\xFB\xD2\xB3\x96\x7B\x43\x14"
|
||||
#define PTC_C_CreateEventAName "\xB1\xE3\xDE\x31\x0C\x51\xF5\x8D\x62\xFC\xC4\x31\x0F\xAF\x71\x16\xFA"
|
||||
#define PTC_C_CreateEventWName "\x29\x28\xC9\x64\x0C\x94\xF0\x50\xB9\x19\x8F\xA4\x3A\x9E\xFC\x67\xEF"
|
||||
#define PTC_C_ResetEventName "\x8D\xBF\x0F\x44\x0A\x7A\x02\xDF\xA8\x84\x2E\x08\xF4\xB6\x6B"
|
||||
#define PTC_C_SetEventName "\xC7\x03\x20\x5A\x08\x17\x1F\xCA\x7B\x64\x07\xF8\xB4"
|
||||
#define PTC_C_CreateFileAName "\x07\x9D\x5F\x6E\x0B\xE5\xDF\xE1\xAA\xA4\x88\xB8\x96\x60\x7C\x65"
|
||||
#define PTC_C_CreateFileWName "\xB2\x8B\x15\x17\x0B\x7A\x97\xB8\xA2\x99\xB6\x83\x8A\x89\xAE\xAA"
|
||||
#define PTC_C_WriteFileName "\x37\xFE\x0F\x06\x09\xE0\xBC\xB8\xC8\xE6\xDC\xDC\xE4\xFA"
|
||||
#define PTC_C_ReadFileName "\x13\x51\xD1\x3B\x08\x16\xCD\x5B\xEC\xD2\x39\xD8\x55"
|
||||
#define PTC_C_CloseHandleName "\xEE\xF1\xF4\x2A\x0B\xA0\x59\x00\xE6\xBA\x3D\x32\x13\xB3\x89\x66"
|
||||
#define PTC_C_SetErrorModeName "\x34\xFD\x9E\x46\x0C\xE2\xF8\x6D\x98\x13\x73\xB6\x1B\x84\xDE\x3D\x98"
|
||||
#define PTC_C_GetFileInformationByHandleName "\x2B\xB8\xC2\x75\x1A\x2A\x35\x85\xC2\x18\x62\xCA\x1B\x49\xB0\xE4\x4E\x9C\xCD\x31\x83\xB2\x20\x7F\xAF\xE7\x45\x7F\xF8\x37\x5D"
|
||||
#define PTC_C_GetDiskFreeSpaceAName "\x90\x5A\xB3\x33\x11\xAD\x2B\xAA\x60\xAB\x39\xA9\x6E\xA8\x1B\xCB\x19\xC2\x37\xA1\x3F\x8B"
|
||||
#define PTC_C_SetFileAttributsAName "\x8F\xB9\x1E\x0D\x11\x79\x50\x72\x8F\x8B\xBB\xA5\xB6\xD4\xF7\x04\xFA\x2E\x2C\x4E\x60\x37"
|
||||
#define PTC_C_GetFileAttributsAName "\xD1\x7F\xCD\x50\x11\x09\x48\xD6\x61\xDB\x35\xD9\x5A\xC4\x41\xC0\x26\xCA\x34\xB2\x30\xDF"
|
||||
#define PTC_C_GetDiskFreeSpaceWName "\xBF\x4B\xAB\x63\x11\xCB\x35\x7A\xF0\x29\x5F\xB7\xB2\x28\x65\xB9\xF7\x62\xA1\xEF\x41\x9B"
|
||||
#define PTC_C_SetFileAttributsWName "\xE2\x31\x29\x6E\x11\x44\x05\xAD\x9A\x06\xEA\x78\x73\xFF\xCE\x8B\x27\x09\xA9\x61\x19\xB8"
|
||||
#define PTC_C_GetFileAttributsWName "\x3F\x55\x10\x77\x11\x51\xF8\x96\x6B\xD7\x53\x19\x86\x38\xBF\x68\x0A\x8A\x24\xC2\x6C\xD1"
|
||||
#define PTC_C_GetFileTimeName "\x35\x7A\xDB\x6F\x0B\x72\x9C\x17\x47\x00\x45\xC8\x09\xA8\xF4\x78"
|
||||
#define PTC_C_SetFileTimeName "\xB0\xE6\x51\x55\x0B\x65\x5F\x36\x46\x47\x28\x17\x54\x1F\x17\x37"
|
||||
#define PTC_C_SetFilePointerName "\xA0\x37\xD4\x1E\x0E\x04\xA4\x4F\xF3\xB6\x65\x26\xC5\x88\x40\xF5\xB1\x8A\x33"
|
||||
#define PTC_C_FlushFileBufferName "\x38\x29\x74\x38\x0F\xA7\xB9\x0C\x36\x69\x83\x00\x41\x64\xAF\xEC\x2B\x57\x80\xDB"
|
||||
#define PTC_C_QueryPerformanceCounterName "\xAC\xDE\x3C\x64\x17\x3B\x1F\xE7\xD8\xB3\x5A\x67\x38\x24\xD5\xB8\x87\x6B\x54\x29\x0F\xC9\x95\x77\x44\x36\x0F\xD8"
|
||||
#define PTC_C_GetDriveTypeAName "\xB4\xA4\x1F\x01\x0D\x97\x93\xC4\xF4\x0A\x0F\x4A\x5B\xA4\x9F\xC8\xD3\x19"
|
||||
#define PTC_C_GetDrivrTypeWName "\x26\x7C\x8F\x7A\x0D\x61\x48\x48\x81\x78\xA8\xAE\xAF\xB6\xEC\xEC\x2A\x3D"
|
||||
#define PTC_C_GetVolumeInformationAName "\xD8\x66\x9D\x13\x15\xF9\x91\x0A\x78\x29\x92\x33\xA9\x5B\xB5\x44\xE8\x59\x00\x8B\xED\x8A\x05\xB5\x20\xBF"
|
||||
#define PTC_C_GetVolumeInformationWName "\x0C\x44\x66\x04\x15\x0F\x9F\x10\x44\xDF\x3E\x99\xE3\x3D\xC3\x0A\x84\xEF\x44\xB1\xE7\x5C\xB3\x1B\x9C\xC7"
|
||||
#define PTC_C_GetLogicalDriveStringsAName "\xC1\xAE\x18\x42\x17\xAA\x6E\x37\x41\xFA\xD8\xA4\x88\x60\x05\xB7\xBF\x90\x77\x40\x08\xFB\xBB\xAC\x83\x52\x24\xEC"
|
||||
#define PTC_C_GetLogicalDriveStringsWName "\xE9\x7E\x74\x50\x17\x22\x08\x3B\x67\x8A\x96\xD8\xE2\x28\x1F\x4B\x81\xB0\xC5\xFC\x32\x33\x59\x88\x85\xD2\xEA\xEA"
|
||||
#define PTC_C_GetFileSizeName "\x72\xB0\xB1\x79\x0B\x69\x6F\xAA\xE2\x33\x48\x7B\xF5\x0B\x36\x6B"
|
||||
#define PTC_C_CreateToolhelp32SnapshotName "\x32\xCE\xA9\x4F\x18\xBF\x4A\x8D\x07\x54\xBB\x24\x69\xA3\x1C\x58\xCB\x0C\x68\x83\x76\xAF\xCE\x51\x98\xEF\x30\xAF\xF4"
|
||||
#define PTC_C_Process32FirstName "\xC4\xCA\xC9\x0D\x0E\x5E\x32\xE1\xB1\x83\x29\xE5\x59\x0C\x4E\xC3\x92\x45\x00"
|
||||
#define PTC_C_Process32NextName "\x8B\xDC\x56\x7C\x0D\x17\x0B\xF2\xC0\x8C\x74\x46\x58\xC9\x07\xB8\x85\x6B"
|
||||
#define PTC_C_Module32FirstName "\x46\x63\xF0\x13\x0D\x74\x4F\x13\xFF\xC9\x9D\xCC\xB0\x83\x1D\xF9\xDD\xB9"
|
||||
#define PTC_C_Module32NextName "\x88\x82\x59\x16\x0C\x57\xD8\x04\x44\xA2\xDA\xD3\x25\xCC\xD6\x28\x5B"
|
||||
#define PTC_C_EnumProcessesName "\xED\x81\xD0\x31\x0D\xB1\x99\x23\xD6\x42\x01\x95\x58\xD9\x86\x25\xD6\x6B"
|
||||
#define PTC_C_EnumProcessModulesName "\x18\x10\x72\x76\x12\x6D\x72\x85\x8D\x98\x7E\x7F\x5F\x4D\x5F\x6B\x6D\x67\x4C\x45\x5C\x4D\x3F"
|
||||
#define PTC_C_LoadLibraryAName "\x2E\xBC\x5A\x6E\x0C\x1E\xCD\xDB\x9E\xCE\x7B\x7C\x70\x4B\x40\x23\x43"
|
||||
#define PTC_C_LoadLibraryWName "\x61\xA9\x90\x5A\x0C\x46\x5D\xBD\xE4\xFE\x33\x68\xBE\xF9\x12\x55\x61"
|
||||
#define PTC_C_FreeLibraryName "\x1E\xF2\x37\x57\x0B\xD2\x90\x51\x55\xFC\xFD\x06\xC0\xA1\x80\x65"
|
||||
#define PTC_C_Kernel32_dllName "\x15\x16\x8A\x6D\x0C\x72\x85\xAB\xE6\xEC\x22\xE8\xFE\xB5\x7E\xAD\xAC"
|
||||
#define PTC_C_User32_dllName "\xC0\xD0\x79\x74\x0A\x45\x70\x8F\x89\x37\x43\x3C\xA7\xA4\x89"
|
||||
#define PTC_C_PSAPI_dllName "\xC9\x92\xB7\x3F\x09\x8B\x02\x88\x0D\x6C\x3F\x7B\xF1\x67"
|
||||
#define PTC_C_ADVAPI32_dllName "\xCD\xD1\x6C\x21\x0C\x5D\xEF\xEA\x86\x82\x28\xF9\x4B\x24\x37\x7C\xC1"
|
||||
#define PTC_C_GDI32_dllName "\x98\x0C\x2A\x67\x09\xE3\xF9\x7F\x88\xDA\x8B\xA6\x6F\x10"
|
||||
#define PTC_C_VERSION_dllName "\x1B\x5B\x87\x51\x0B\x28\x8B\xD8\xCD\x0D\x7D\x54\x88\xDA\x32\x4A"
|
||||
#define PTC_C_WINMM_dllName "\xA6\x22\xEB\x26\x09\x1B\x92\x9C\x40\x49\x0B\x8A\x53\x3C"
|
||||
|
||||
/* ----------------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
#endif // _PTC_ABC_H_ }
|
93
Rayman_X/cpa/public/PTC/PTC_pub.h
Normal file
93
Rayman_X/cpa/public/PTC/PTC_pub.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/*///////////////////////////////////////////////////*/
|
||||
/**/
|
||||
/* */
|
||||
/* ------------------------------------------------*/
|
||||
/**/
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/**/
|
||||
/*///////////////////////////////////////////////////*/
|
||||
/**/
|
||||
/* Version 1.0 : */
|
||||
/**/
|
||||
/*///////////////////////////////////////////////////*/
|
||||
#ifndef __PTC_PUB__H /* {*/
|
||||
#define __PTC_PUB__H
|
||||
|
||||
#ifdef PTC_SYSTEM_ACTIVED /* {*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Global Pointer Table for imported System Functions*/
|
||||
#define PTC_C_FCTARRAYSIZE 50
|
||||
#define PTC_C_DLLARRAYSIZE 10
|
||||
#define PTC_C_CODESIZE 1124
|
||||
#define PTC_C_NAMESIZE 45
|
||||
#define PTC_C_ChecksumTableSize 50
|
||||
|
||||
typedef struct PTC_tdstImportedFunction_
|
||||
{
|
||||
char szName[PTC_C_NAMESIZE];
|
||||
DWORD dwAddress;
|
||||
long lOwnerDLLIndex;
|
||||
long lOtherDLLIndex[5];
|
||||
} PTC_tdstImportedFunction;
|
||||
|
||||
extern PTC_tdstImportedFunction PTC_ga_stImportedFunctions[];
|
||||
extern DWORD *PTC_ga_dwLinkedDLLImageBase;
|
||||
extern char PTC_ga_szLinkedDLLName[][PTC_C_NAMESIZE];
|
||||
extern DWORD PTC_g_dwLinkedDLLNumber;
|
||||
extern DWORD PTC_g_dwImportedFunctionsNumber;
|
||||
|
||||
extern char PTC_g_szCurrentName[PTC_C_NAMESIZE];
|
||||
extern char PTC_g_szDLLCurrentName[PTC_C_NAMESIZE];
|
||||
|
||||
extern char PTC_ga_cGeneratedCode[PTC_C_CODESIZE];
|
||||
extern long PTC_g_lCurrentRandom;
|
||||
|
||||
/* Checksum */
|
||||
extern DWORD PTC_g_dwBeginLabelAddress[PTC_C_ChecksumTableSize];
|
||||
extern DWORD PTC_g_dwEndLabelAddress[PTC_C_ChecksumTableSize];
|
||||
extern DWORD PTC_g_dwChecksum[PTC_C_ChecksumTableSize];
|
||||
extern BOOL PTC_g_bTakeAddresses;
|
||||
extern DWORD PTC_g_dwBeginLabelAddressDelete[PTC_C_ChecksumTableSize];
|
||||
extern DWORD PTC_g_dwEndLabelAddressDelete[PTC_C_ChecksumTableSize];
|
||||
/*////////////////////////////////////////////////*/
|
||||
/*////////////////////////////////////////////////*/
|
||||
|
||||
void PTC_fn_vInit(BOOL _bFirstTime);
|
||||
void PTC_fn_vDesInit();
|
||||
BOOL PTC_fn_bVerifyOneImportedFunctionPtr();
|
||||
DWORD PTC_fn_dwSearchExportedFunctionInEveryDLL(char *_szCryptedName);
|
||||
DWORD PTC_fn_dwSearchFunctionInImportedTableOfExe(char *_szCryptedName);
|
||||
|
||||
/*////////////////////////////////////////////////*/
|
||||
|
||||
void PTC_fn_vInitChecksum();
|
||||
void PTC_fn_vComputeAndWriteChecksumFile();
|
||||
void PTC_fn_vReadChecksumFile();
|
||||
/*////////////////////////////////////////////////*/
|
||||
/*////////////////////////////////////////////////*/
|
||||
|
||||
#endif /* PTC_SYSTEM_ACTIVED }*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __PTC_PUB__H }*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user