summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-client/Security
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-12-28 21:35:18 +1300
committerboris <wzn@moneybot.cc>2018-12-28 21:35:18 +1300
commit81a3987fc17f99d2092018ac266882f4533cc27e (patch)
treef351344ee454f081d97ce2ed55bce7d2698c62ef /csgo-loader/csgo-client/Security
parentc486baddbe064c0c78d9ea45361adf917f3c6842 (diff)
aaaaaaaaaaaaaaaaaaaaa
Diffstat (limited to 'csgo-loader/csgo-client/Security')
-rw-r--r--csgo-loader/csgo-client/Security/RuntimeSecurity.cpp32
-rw-r--r--csgo-loader/csgo-client/Security/RuntimeSecurity.hpp15
-rw-r--r--csgo-loader/csgo-client/Security/SyscallManager.cpp2
3 files changed, 23 insertions, 26 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
diff --git a/csgo-loader/csgo-client/Security/RuntimeSecurity.hpp b/csgo-loader/csgo-client/Security/RuntimeSecurity.hpp
index 2ef601d..671f67b 100644
--- a/csgo-loader/csgo-client/Security/RuntimeSecurity.hpp
+++ b/csgo-loader/csgo-client/Security/RuntimeSecurity.hpp
@@ -60,20 +60,18 @@ namespace Security
{
protected:
// Applies necessary API hooks.
- void ApplyApiHooks_Internal();
+ bool ApplyApiHooks();
// Patches common debugging functions to crash the program.
- void PatchDebugFunctions_Internal();
+ void PatchDebugFunctions();
// Dispatches security threads.
- void DispatchSecurityThreads_Internal();
+ void DispatchSecurityThreads();
// The following functions are used in security threads to run checks.
- bool CheckForVirtualMachine_Internal();
+ bool CheckForVirtualMachine();
- bool CheckForDebugger_Internal();
-
- bool CheckForApiHooks_Internal();
+ bool CheckForDebugger();
public:
// Initializes the runtime security system.
@@ -81,6 +79,9 @@ namespace Security
// Retrieves the current Hardware ID for the system.
HardwareIdentifier GetHardwareId();
+
+ // ...
+ MEMORY_BASIC_INFORMATION QueryMemory(void *Address);
};
// Readability
diff --git a/csgo-loader/csgo-client/Security/SyscallManager.cpp b/csgo-loader/csgo-client/Security/SyscallManager.cpp
index 0104dae..bab2d5f 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()
{