summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'csgo-loader/csgo-client/Security/RuntimeSecurity.cpp')
-rw-r--r--csgo-loader/csgo-client/Security/RuntimeSecurity.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp b/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp
index bff53f8..96e22bc 100644
--- a/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp
+++ b/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp
@@ -6,30 +6,26 @@ Security::RuntimeSecurityPtr Protection = std::make_unique<Security::RuntimeSecu
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))
- ExitProcess(0);
+ /*
+ 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))
+ ExitProcess(0);
- HMODULE ReturnModule = (HMODULE)Query.AllocationBase;
+ HMODULE ReturnModule = (HMODULE)Query.AllocationBase;
- if (ReturnModule != GetModuleHandleA(0))
- ExitProcess(0);
+ if (ReturnModule != GetModuleHandleA(0))
+ ExitProcess(0);
- return oMessageBox(Window, Message, Caption, Type);
- }
+ return oMessageBox(Window, Message, Caption, Type);
+ }
+ */
bool RuntimeSecurity::Start()
{
- if(MH_Initialize() != MH_OK)
- return false;
-
- MH_CreateHook(&MessageBoxA, Hooked_MessageBox, (void **)&oMessageBox);
- MH_EnableHook(&MessageBoxA);
-
return true;
}
} \ No newline at end of file