diff options
| author | boris <wzn@moneybot.cc> | 2018-12-28 19:24:40 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-28 19:24:40 +1300 |
| commit | c486baddbe064c0c78d9ea45361adf917f3c6842 (patch) | |
| tree | d7bfb4e8c4c10e82992a016330c5a46625ba7a7e | |
| parent | 882ef7d46578d99608f4af9bfb73d83b23208eae (diff) | |
added basic hook detection
yeah my vs was fucked up today ):
| -rw-r--r-- | csgo-loader/csgo-client/Security/RuntimeSecurity.cpp | 8 | ||||
| -rw-r--r-- | csgo-loader/csgo-client/Security/SyscallManager.cpp | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp b/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp index 305a44f..bff53f8 100644 --- a/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp +++ b/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp @@ -9,9 +9,15 @@ namespace Security decltype(&MessageBoxA) oMessageBox;
int __stdcall Hooked_MessageBox(HWND Window, char *Message, char *Caption, uint32_t Type)
{
+ // TODO: Replace this with a Syscall so we cannot get hooked.
MEMORY_BASIC_INFORMATION Query;
if(!VirtualQuery(_ReturnAddress(), &Query, sizeof MEMORY_BASIC_INFORMATION))
- ERROR_ASSERT("[00DF:00002C00] An integrity check failed.");
+ ExitProcess(0);
+
+ HMODULE ReturnModule = (HMODULE)Query.AllocationBase;
+
+ if (ReturnModule != GetModuleHandleA(0))
+ ExitProcess(0);
return oMessageBox(Window, Message, Caption, Type);
}
diff --git a/csgo-loader/csgo-client/Security/SyscallManager.cpp b/csgo-loader/csgo-client/Security/SyscallManager.cpp index bab2d5f..0104dae 100644 --- a/csgo-loader/csgo-client/Security/SyscallManager.cpp +++ b/csgo-loader/csgo-client/Security/SyscallManager.cpp @@ -81,7 +81,7 @@ namespace Wrapper }
// Sick macros, retard.
-#define GetRvaPointer(Rva) (Buffer + GetRawOffsetByRva(SectionHeader, SectionCount, FileSize, Rva))
+ #define GetRvaPointer(Rva) (Buffer + GetRawOffsetByRva(SectionHeader, SectionCount, FileSize, Rva))
bool SyscallManager::Start()
{
|
