diff options
| author | boris <wzn@moneybot.cc> | 2018-12-27 22:42:05 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-27 22:42:05 +1300 |
| commit | 0c194bc8046cb3ecb4e4d0577f36a1d3bde58d11 (patch) | |
| tree | c27c5e71dba4db816cd9ad601a997b974377187e /csgo-loader/csgo-client/Security/RuntimeSecurity.cpp | |
| parent | 45adf172a76fc46ca6ca10e17fd534d4f35896c0 (diff) | |
bap
Diffstat (limited to 'csgo-loader/csgo-client/Security/RuntimeSecurity.cpp')
| -rw-r--r-- | csgo-loader/csgo-client/Security/RuntimeSecurity.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp b/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp new file mode 100644 index 0000000..305a44f --- /dev/null +++ b/csgo-loader/csgo-client/Security/RuntimeSecurity.cpp @@ -0,0 +1,29 @@ +#include <Security/RuntimeSecurity.hpp>
+#include <UserExperience/UserInterface.hpp>
+
+// Global accessor to security instance.
+Security::RuntimeSecurityPtr Protection = std::make_unique<Security::RuntimeSecurity>();
+
+namespace Security
+{
+ decltype(&MessageBoxA) oMessageBox;
+ int __stdcall Hooked_MessageBox(HWND Window, char *Message, char *Caption, uint32_t Type)
+ {
+ MEMORY_BASIC_INFORMATION Query;
+ if(!VirtualQuery(_ReturnAddress(), &Query, sizeof MEMORY_BASIC_INFORMATION))
+ ERROR_ASSERT("[00DF:00002C00] An integrity check failed.");
+
+ 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 |
