mirror of https://github.com/x64dbg/TitanEngine
Move Windows APIs into TitanEngine.h for DbgEng compatibility
This commit is contained in:
parent
947ad6107f
commit
32bdf1580a
|
|
@ -461,3 +461,23 @@ __declspec(dllexport) bool TITCALL MemoryWriteSafe(HANDLE hProcess, LPVOID lpBas
|
|||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
__declspec(dllexport) SIZE_T TITCALL MemoryQuerySafe(HANDLE hProcess, LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength)
|
||||
{
|
||||
return VirtualQueryEx(hProcess, lpAddress, lpBuffer, dwLength);
|
||||
}
|
||||
|
||||
__declspec(dllexport) LPVOID TITCALL MemoryAllocSafe(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
|
||||
{
|
||||
return VirtualAllocEx(hProcess, lpAddress, dwSize, flAllocationType, flProtect);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL MemoryFreeSafe(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
|
||||
{
|
||||
return !!VirtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL MemoryProtectSafe(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect)
|
||||
{
|
||||
return !!VirtualProtectEx(hProcess, lpAddress, dwSize, flNewProtect, lpflOldProtect);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,3 +141,68 @@ __declspec(dllexport) HANDLE TITCALL TitanOpenThread(DWORD dwDesiredAccess, bool
|
|||
{
|
||||
return EngineOpenThread(dwDesiredAccess, bInheritHandle, dwThreadId);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL TitanCloseHandle(HANDLE hEngineHandle)
|
||||
{
|
||||
return EngineCloseHandle(hEngineHandle);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL ProcessIsWow64(HANDLE hProcess, PBOOL isWow64)
|
||||
{
|
||||
return !!IsWow64Process(hProcess, isWow64);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL TitanTerminateProcess(HANDLE hProcess, DWORD exitCode)
|
||||
{
|
||||
return !!TerminateProcess(hProcess, exitCode);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL TitanDebugBreakProcess(HANDLE hProcess)
|
||||
{
|
||||
return !!DebugBreakProcess(hProcess);
|
||||
}
|
||||
|
||||
__declspec(dllexport) HANDLE TITCALL TitanCreateRemoteThread(HANDLE hProcess, LPTHREAD_START_ROUTINE start, LPVOID argument, DWORD creationFlags, LPDWORD threadId)
|
||||
{
|
||||
return CreateRemoteThread(hProcess, nullptr, 0, start, argument, creationFlags, threadId);
|
||||
}
|
||||
|
||||
__declspec(dllexport) DWORD TITCALL TitanSuspendThread(HANDLE hThread)
|
||||
{
|
||||
return SuspendThread(hThread);
|
||||
}
|
||||
|
||||
__declspec(dllexport) DWORD TITCALL TitanResumeThread(HANDLE hThread)
|
||||
{
|
||||
return ResumeThread(hThread);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL TitanTerminateThread(HANDLE hThread, DWORD exitCode)
|
||||
{
|
||||
return !!TerminateThread(hThread, exitCode);
|
||||
}
|
||||
|
||||
__declspec(dllexport) DWORD TITCALL TitanGetThreadId(HANDLE hThread)
|
||||
{
|
||||
return GetThreadId(hThread);
|
||||
}
|
||||
|
||||
__declspec(dllexport) int TITCALL TitanGetThreadPriority(HANDLE hThread)
|
||||
{
|
||||
return GetThreadPriority(hThread);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL TitanSetThreadPriority(HANDLE hThread, int priority)
|
||||
{
|
||||
return !!SetThreadPriority(hThread, priority);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL TitanGetThreadTimes(HANDLE hThread, LPFILETIME creation, LPFILETIME exit, LPFILETIME kernel, LPFILETIME user)
|
||||
{
|
||||
return !!GetThreadTimes(hThread, creation, exit, kernel, user);
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL TitanQueryThreadCycleTime(HANDLE hThread, PULONG64 cycleTime)
|
||||
{
|
||||
return !!QueryThreadCycleTime(hThread, cycleTime);
|
||||
}
|
||||
|
|
@ -55,6 +55,10 @@ ConvertFileOffsetToVA
|
|||
ConvertFileOffsetToVAEx
|
||||
MemoryReadSafe
|
||||
MemoryWriteSafe
|
||||
MemoryQuerySafe
|
||||
MemoryAllocSafe
|
||||
MemoryFreeSafe
|
||||
MemoryProtectSafe
|
||||
GetPE32Data
|
||||
GetPE32DataW
|
||||
GetPE32DataFromMappedFile
|
||||
|
|
@ -389,6 +393,19 @@ GetActiveProcessId
|
|||
GetActiveProcessIdW
|
||||
EnumProcessesWithLibrary
|
||||
TitanOpenProcess
|
||||
TitanCloseHandle
|
||||
ProcessIsWow64
|
||||
TitanTerminateProcess
|
||||
TitanDebugBreakProcess
|
||||
TitanCreateRemoteThread
|
||||
TitanSuspendThread
|
||||
TitanResumeThread
|
||||
TitanTerminateThread
|
||||
TitanGetThreadId
|
||||
TitanGetThreadPriority
|
||||
TitanSetThreadPriority
|
||||
TitanGetThreadTimes
|
||||
TitanQueryThreadCycleTime
|
||||
EngineFakeMissingDependencies
|
||||
EngineDeleteCreatedDependencies
|
||||
EngineCreateMissingDependencies
|
||||
|
|
|
|||
|
|
@ -75,6 +75,10 @@ __declspec(dllexport) ULONG_PTR TITCALL ConvertFileOffsetToVA(ULONG_PTR FileMapV
|
|||
__declspec(dllexport) ULONG_PTR TITCALL ConvertFileOffsetToVAEx(ULONG_PTR FileMapVA, DWORD FileSize, ULONG_PTR ImageBase, ULONG_PTR AddressToConvert, bool ReturnType);
|
||||
__declspec(dllexport) bool TITCALL MemoryReadSafe(HANDLE hProcess, LPVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesRead);
|
||||
__declspec(dllexport) bool TITCALL MemoryWriteSafe(HANDLE hProcess, LPVOID lpBaseAddress, LPCVOID lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesWritten);
|
||||
__declspec(dllexport) SIZE_T TITCALL MemoryQuerySafe(HANDLE hProcess, LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
|
||||
__declspec(dllexport) LPVOID TITCALL MemoryAllocSafe(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
|
||||
__declspec(dllexport) bool TITCALL MemoryFreeSafe(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
|
||||
__declspec(dllexport) bool TITCALL MemoryProtectSafe(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect);
|
||||
// TitanEngine.Realigner.functions:
|
||||
__declspec(dllexport) bool TITCALL FixHeaderCheckSum(char* szFileName);
|
||||
__declspec(dllexport) bool TITCALL FixHeaderCheckSumW(wchar_t* szFileName);
|
||||
|
|
@ -355,6 +359,19 @@ __declspec(dllexport) long TITCALL GetActiveProcessId(char* szImageName);
|
|||
__declspec(dllexport) long TITCALL GetActiveProcessIdW(wchar_t* szImageName);
|
||||
__declspec(dllexport) void TITCALL EnumProcessesWithLibrary(char* szLibraryName, void* EnumFunction);
|
||||
__declspec(dllexport) HANDLE TITCALL TitanOpenProcess(DWORD dwDesiredAccess, bool bInheritHandle, DWORD dwProcessId);
|
||||
__declspec(dllexport) bool TITCALL TitanCloseHandle(HANDLE hEngineHandle);
|
||||
__declspec(dllexport) bool TITCALL ProcessIsWow64(HANDLE hProcess, PBOOL isWow64);
|
||||
__declspec(dllexport) bool TITCALL TitanTerminateProcess(HANDLE hProcess, DWORD exitCode);
|
||||
__declspec(dllexport) bool TITCALL TitanDebugBreakProcess(HANDLE hProcess);
|
||||
__declspec(dllexport) HANDLE TITCALL TitanCreateRemoteThread(HANDLE hProcess, LPTHREAD_START_ROUTINE start, LPVOID argument, DWORD creationFlags, LPDWORD threadId);
|
||||
__declspec(dllexport) DWORD TITCALL TitanSuspendThread(HANDLE hThread);
|
||||
__declspec(dllexport) DWORD TITCALL TitanResumeThread(HANDLE hThread);
|
||||
__declspec(dllexport) bool TITCALL TitanTerminateThread(HANDLE hThread, DWORD exitCode);
|
||||
__declspec(dllexport) DWORD TITCALL TitanGetThreadId(HANDLE hThread);
|
||||
__declspec(dllexport) int TITCALL TitanGetThreadPriority(HANDLE hThread);
|
||||
__declspec(dllexport) bool TITCALL TitanSetThreadPriority(HANDLE hThread, int priority);
|
||||
__declspec(dllexport) bool TITCALL TitanGetThreadTimes(HANDLE hThread, LPFILETIME creation, LPFILETIME exit, LPFILETIME kernel, LPFILETIME user);
|
||||
__declspec(dllexport) bool TITCALL TitanQueryThreadCycleTime(HANDLE hThread, PULONG64 cycleTime);
|
||||
__declspec(dllexport) HANDLE TITCALL TitanOpenThread(DWORD dwDesiredAccess, bool bInheritHandle, DWORD dwThreadId);
|
||||
// TitanEngine.TLSFixer.functions:
|
||||
__declspec(dllexport) bool TITCALL TLSBreakOnCallBack(LPVOID ArrayOfCallBacks, DWORD NumberOfCallBacks, LPVOID bpxCallBack);
|
||||
|
|
|
|||
Loading…
Reference in New Issue