forked from M-r-J-o-h-n/Rust-External-Cheat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CheatManager.cpp
75 lines (60 loc) · 1.5 KB
/
CheatManager.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "CheatManager.h"
#include "cexception.h"
#include "EntityUpdator.h"
#include "GOM.h"
#include "Globals.h"
#include <thread>
using DirectX::XMFLOAT4X4;
using Cheat::Vector2;
using Cheat::Vector3;
using Cheat::Vector4;
Rust::CheatManager::CheatManager()
: m_previousInGame(false)
{
}
Rust::CheatManager::~CheatManager()
{
}
void Rust::CheatManager::exec()
{
//if in game
try {
if (!m_previousInGame && IsinGame()) {
Rust::EntityUpdator::UpdateLocalPlayerAndCameraData();
m_previousInGame = true;
}
else if (m_previousInGame && !IsinGame()) {
m_previousInGame = false;
}
m_visual.BeginDraw();
m_visual.DrawOtherVisuals();
//do something with tagged object
try {
Rust::Globals::hack_data.TaggedObject.mutex.lock();
m_visual.DrawTaggedObject();
m_aimbot.exec();
m_misc.exec();
Rust::Globals::hack_data.TaggedObject.mutex.unlock();
}
catch (Cheat::MemoryManager::MemException& ex) {
Rust::Globals::hack_data.TaggedObject.mutex.unlock();
}
//do something with active object when you can
try {
Rust::Globals::hack_data.ActiveObjects.mutex.lock();
m_visual.DrawActiveObject();
Rust::Globals::hack_data.ActiveObjects.mutex.unlock();
}
catch (Cheat::MemoryManager::MemException& ex) {
Rust::Globals::hack_data.TaggedObject.mutex.unlock();
}
m_visual.EndDraw();
}
catch (Cheat::cexception& ex) {
throw ex;
}
}
bool Rust::CheatManager::IsinGame()
{
return true;
}