mirror of https://github.com/x64dbg/GleeBug
Implement GetDebuggedDLLBaseAddress
This commit is contained in:
parent
5bc2e682e9
commit
0356726f20
|
|
@ -112,7 +112,7 @@ __declspec(dllexport) PROCESS_INFORMATION* TITCALL TitanGetProcessInformation()
|
||||||
return emu.TitanGetProcessInformation();
|
return emu.TitanGetProcessInformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
__declspec(dllexport) ULONG_PTR TITCALL ImporterGetRemoteAPIAddressEx(const char* szDLLName, const char* szAPIName)
|
static ULONG_PTR DbgValFromString(const char* expr)
|
||||||
{
|
{
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
#define X64DBG_DLL L"x64dbg.dll"
|
#define X64DBG_DLL L"x64dbg.dll"
|
||||||
|
|
@ -121,25 +121,27 @@ __declspec(dllexport) ULONG_PTR TITCALL ImporterGetRemoteAPIAddressEx(const char
|
||||||
#endif // _WIN64
|
#endif // _WIN64
|
||||||
static auto hModule = GetModuleHandleW(X64DBG_DLL);
|
static auto hModule = GetModuleHandleW(X64DBG_DLL);
|
||||||
#undef X64DBG_DLL
|
#undef X64DBG_DLL
|
||||||
|
|
||||||
if (hModule)
|
|
||||||
{
|
|
||||||
static auto DbgValFromString = (ULONG_PTR(*)(const char*))GetProcAddress(hModule, "DbgValFromString");
|
static auto DbgValFromString = (ULONG_PTR(*)(const char*))GetProcAddress(hModule, "DbgValFromString");
|
||||||
if (DbgValFromString)
|
return DbgValFromString ? DbgValFromString(expr) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
__declspec(dllexport) ULONG_PTR TITCALL ImporterGetRemoteAPIAddressEx(const char* szDLLName, const char* szAPIName)
|
||||||
{
|
{
|
||||||
char expr[1024] = "";
|
char expr[1024] = "";
|
||||||
_snprintf_s(expr, _TRUNCATE, "\"%s\":%s", szDLLName, szAPIName);
|
_snprintf_s(expr, _TRUNCATE, "\"%s\":%s", szDLLName, szAPIName);
|
||||||
return DbgValFromString(expr);
|
return DbgValFromString(expr);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
__declspec(dllexport) ULONG_PTR TITCALL GetDebuggedFileBaseAddress()
|
__declspec(dllexport) ULONG_PTR TITCALL GetDebuggedFileBaseAddress()
|
||||||
{
|
{
|
||||||
return emu.GetDebuggedFileBaseAddress();
|
return emu.GetDebuggedFileBaseAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__declspec(dllexport) ULONG_PTR TITCALL GetDebuggedDLLBaseAddress()
|
||||||
|
{
|
||||||
|
return DbgValFromString("mod.main()");
|
||||||
|
}
|
||||||
|
|
||||||
__declspec(dllexport) bool TITCALL DumpProcess(HANDLE hProcess, LPVOID ImageBase, const char* szDumpFileName, ULONG_PTR EntryPoint)
|
__declspec(dllexport) bool TITCALL DumpProcess(HANDLE hProcess, LPVOID ImageBase, const char* szDumpFileName, ULONG_PTR EntryPoint)
|
||||||
{
|
{
|
||||||
// Just fails https://github.com/x64dbg/testplugin/blob/4ceae85ca8e8b63ff155495311c2c4b92febce99/test.cpp#L289, so not worth implementing
|
// Just fails https://github.com/x64dbg/testplugin/blob/4ceae85ca8e8b63ff155495311c2c4b92febce99/test.cpp#L289, so not worth implementing
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue