mirror of https://github.com/infosecn1nja/C3.git
Exclude RtlPcToFileHeader hook from x86 builds
Exception info on x86 is absolute rather than relative (as x64) so exception creation doesn't require this call. Additionally Win8.1 SDK doesn't export `RtlPcToFileHeader` in kernel32.lib for static linking, which causes linking to faildependabot/npm_and_yarn/Src/WebController/UI/websocket-extensions-0.1.4
parent
f0e7ece23d
commit
ba5617a5e1
|
@ -28,7 +28,8 @@ namespace MWR::Loader
|
|||
DWORD m_SizeOfTheDll;
|
||||
} moduleData;
|
||||
|
||||
PVOID RtlPcToFileHeaderHook(PVOID pc, PVOID* baseOfImage)
|
||||
#if defined _M_AMD64
|
||||
void* RtlPcToFileHeaderHook(PVOID pc, PVOID* baseOfImage)
|
||||
{
|
||||
if (pc > (void*)moduleData.m_DllBaseAddress and pc < (void*)(moduleData.m_DllBaseAddress + moduleData.m_SizeOfTheDll))
|
||||
{
|
||||
|
@ -40,11 +41,14 @@ namespace MWR::Loader
|
|||
return RtlPcToFileHeader(pc, baseOfImage);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void* GetHookAddress(const char* dllName, const char* funcName)
|
||||
{
|
||||
#if defined _M_AMD64
|
||||
if (_stricmp(dllName,"kernel32.dll") == 0 && strcmp(funcName, "RtlPcToFileHeader") == 0)
|
||||
return (void*)RtlPcToFileHeaderHook;
|
||||
#endif
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue