summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-client/Client.cpp
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2019-01-01 14:35:30 +1300
committerboris <wzn@moneybot.cc>2019-01-01 14:35:30 +1300
commitb9702fe8541e61f27f5c788dc72feaefe5abfc0d (patch)
tree292f12cc1cbf6088cd68fa81fd85cb44711c47ec /csgo-loader/csgo-client/Client.cpp
parent009357a5f18ecf2ce8df42f5931c4c45181833c6 (diff)
eeeeeeeeeeeeeeek
Diffstat (limited to 'csgo-loader/csgo-client/Client.cpp')
-rw-r--r--csgo-loader/csgo-client/Client.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/csgo-loader/csgo-client/Client.cpp b/csgo-loader/csgo-client/Client.cpp
index 8c90f66..c41856c 100644
--- a/csgo-loader/csgo-client/Client.cpp
+++ b/csgo-loader/csgo-client/Client.cpp
@@ -3,14 +3,10 @@
/*
TODO:
- Finish off security on client:
- - Hook OpenProcess, ExitProcess, WSARecv, WSASend and check if function is OOB. [DONE]
- - Use VM check that Nave gave me.
- Run a thread to check for blacklisted drivers periodically (also blacklist VBox)
- Run a thread to check if there is more than X threads running in the loader.
- Add dump protection (closes csgo.exe if a handle is detected, probably explorer shellcode)
- Add HWID generation
- - Hook DbgBreakPoint and DbgUiRemoteBreakin (instead of bytepatching, some debuggers will check that) [DONE]
- - Don't forget about the security callback; leave implementation up to Nave. [DONE]
- Apply Themida macros inside important functions:
- Apply mutation on Security hooks and main function.
@@ -25,7 +21,9 @@
- This will probably be the easiest thing to do.
- Finish off injection wrapper:
- - Allocate a 4KB page for trampoline imports (4096/6) { E8 ? ? ? ? C3 }
+ - Allocate a 4KB page for trampoline imports (4096/6) { E9 ? ? ? ? C3 }
+ - Actually, allocate every memory page as a bunch of consecutive 4kb sections
+ - Trampoline for imports
- Everything is already laid out, tbh.
- Have the loader inject a .DLL :^)
@@ -35,28 +33,31 @@
- Adapt the server to work with your backend.
*/
+
+#pragma optimize("", off)
+
int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow)
{
WRAP_IF_DEBUG(Utils::OpenConsole());
- // Autistic workaround for Hooked_OpenProcess crashing
- // when Device->CreateDevice is invoked...
- std::atomic<bool> UserInterfaceReady = false;
+ ///////////////////////////////////////////////////////////////
+
+ WRAP_IF_RELEASE(MUTATE_START);
+ WRAP_IF_RELEASE(STR_ENCRYPT_START);
+
+ ///////////////////////////////////////////////////////////////
// Create a thread to handle UI.
- std::thread WindowThread([&UserInterfaceReady]
+ std::thread WindowThread([]
{
// Create a window, initialise DirectX context.
if(!UserInterface->Start())
ERROR_ASSERT("[000F:00001C00] Failed to initialize. Please contact an administrator.");
-
- // Signal initialization.
- UserInterfaceReady = true;
-
+
UserInterface->RunUiFrame();
}); WindowThread.detach();
- while(!UserInterfaceReady) { Sleep(1); }
+ while(!UserInterface->m_Data.m_Ready) { Sleep(1); }
// Initialize the runtime protection system.
WRAP_IF_RELEASE(
@@ -83,4 +84,13 @@ int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow)
// TODO: Add game selection.
while(1) { if(GetAsyncKeyState(VK_END) & 0x8000) break; Sleep(1); }
-} \ No newline at end of file
+
+ ///////////////////////////////////////////////////////////////
+
+ WRAP_IF_RELEASE(STR_ENCRYPT_END);
+ WRAP_IF_RELEASE(MUTATE_END);
+
+ ///////////////////////////////////////////////////////////////
+}
+
+#pragma optimize("", on) \ No newline at end of file