forked from M-r-J-o-h-n/Rust-External-Cheat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Globals.cpp
30 lines (24 loc) · 959 Bytes
/
Globals.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "Globals.h"
#include "System.h"
#include "XorString.hpp"
//이렇게 cpp 파일에 정의를 해줘야 스태틱 변수들이 생성된다.
Rust::HackSetting Rust::Globals::hack_setting;
Rust::GameState Rust::Globals::game_state;
Rust::SystemData Rust::Globals::system_data;
Rust::HackData Rust::Globals::hack_data;
bool Rust::Globals::CheatRunning = true;
void Rust::Globals::Init()
{
XorWS(RustClient, L"RustClient.exe");
XorWS(UnityPlayer, L"UnityPlayer.dll");
XorWS(Rust, L"Rust");
hack_data.RustMemory = new Cheat::ExternalMemoryManager(XorWString(RustClient));
hack_data.RustMemory->ChangeBaseAddressOfModule((PWCHAR)XorWString(UnityPlayer));
auto hwnd = Cheat::System::GetHWND((PWCHAR)XorWString(Rust));
RECT rect = { 0 };
GetWindowRect(hwnd, &rect);
system_data.GameWindowRect = rect;
system_data.width = rect.right - rect.left;
system_data.height = rect.bottom - rect.top;
Rust::Globals::game_state.inGame = true;
}