-
Автор темы
- #1
Main.cpp:
#include "Setup.hpp"
BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwCallReason, LPVOID pReserved )
{
DisableThreadLibraryCalls(hInstance);
if (dwCallReason == DLL_PROCESS_ATTACH)
CreateThread(nullptr, 0, LPTHREAD_START_ROUTINE(C_SetUp::Instance), HMODULE(hInstance), 0, nullptr);
return true;
}
Setup.cpp:
#include "Setup.hpp"
#include "Hooks.hpp"
#include "Render.hpp"
#include "Features/Visuals/Chams.hpp"
#include "Config/Configs.hpp"
#include "Multithread/threading.h"
#include "Tools/Tools.hpp"
#include "Features/Lua/Clua.h"
#include "Features/Inventory/inventorychanger.h"
#include "Features/Inventory/steam/steam_api.h"
#include "Features/Misc/Sound.hpp"
void C_SetUp::Instance( HINSTANCE hInstance )
{
while ( !GetModuleHandleA( _S( "serverbrowser.dll" ) ) )
Sleep( 100 );
// init sdk
SetupModuleList( );
SetupInterfaceList( );
SetupAddressList( );
SetupConvarList( );
SetupImGui( );
// multi-thread
MultiThread::InitThreads();
//MessageBoxA(NULL, "6", "6", MB_OK);
CreateDirectory(_S("Null\\"), NULL);
CreateDirectory(_S("Null\\scripts\\"), NULL);
//MessageBoxA(NULL, "7", "7", MB_OK);
c_lua::get().initialize();
//MessageBoxA(NULL, "8", "8", MB_OK);
g_Config->Setup();
LPCWSTR modules[]{ L"client.dll", L"engine.dll", L"server.dll", L"studiorender.dll", L"materialsystem.dll" };
long long patch = 0x69690004C201B0;
for (auto base : modules) WriteProcessMemory(GetCurrentProcess(), g_Tools->FindPattern(GetModuleHandleW(base), "55 8B EC 56 8B F1 33 C0 57 8B 7D 08"), &patch, 5, 0);
//MessageBoxA(NULL, "9", "9", MB_OK);
// setup menu
g_Menu->Initialize();
//MessageBoxA(NULL, "10", "10", MB_OK);
// setup render
g_Render->Initialize();
//MessageBoxA(NULL, "11", "11", MB_OK);
// create materials
g_Chams->CreateMaterials();
//MessageBoxA(NULL, "12", "12", MB_OK);
// scan netvars
g_NetvarManager->Instance();
//MessageBoxA(NULL, "13", "13", MB_OK);
std::this_thread::sleep_for(std::chrono::milliseconds(8000));
//MessageBoxA(NULL, "14", "14", MB_OK);
// setup hooks
SetupHooks();
//MessageBoxA(NULL, "Hooks", "Hooks", MB_OK);
//setup sounds
setup_sounds();
FreeLibraryAndExitThread(hInstance, 0);
}
Setup.hpp:
#pragma once
#include "SDK/Globals.hpp"
class C_SetUp
{
public:
static void Instance( HINSTANCE hModule );
static void SetupAddressList( );
static void SetupModuleList( );
static void SetupInterfaceList( );
static void SetupConvarList( );
static void SetupHooks( );
static void SetupImGui( );
};