forked from test0x101/EAC---Selfleak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
threading.hpp
68 lines (59 loc) · 1.61 KB
/
threading.hpp
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
#pragma once
#include "eac.hpp"
#include "cheat.hpp"
namespace threading
{
void(*undocumented_FN)( void*, void*,
void*, void*, void* );
void* read_memory_safe( void* address )
{
/*
* rubbish to convert from memory to the actual page
*/
void* virtualPage = *reinterpret_cast<void**>((reinterpret_cast<std::uintptr_t>(address) % 0x1000) /
16);
/*
* dependent on process bit (x64 or x32)
*/
void* merge = *reinterpret_cast<void**>( reinterpret_cast<std::uintptr_t>(virtualPage) - 64 );
return *reinterpret_cast<void**>(reinterpret_cast<std::uintptr_t>(merge) -
reinterpret_cast<std::uintptr_t>(address));
}
void undocumented_FN_Hook(void* arg1, void* arg2,
void* arg3, void* arg4, void* arg5)
{
/*
* at this point some type of game play clip was sent to EAC/BE so lets just not run the cheat.
*/
if (eac::reportAttemps > 5)
{
return spoofcall_internal(undocumented_FN, arg1, arg2, arg3, arg4, arg5);
}
if (be_enabled)
{
/*
*
* testing if BE is actually loaded or was silent loaded
*
*/
auto arg = read_memory_safe(arg5);
if (arg)
{
spoofcall_internal(std::printf, "cheat has detected a Battleye anomaly which can alter the expereince while using our service.");
}
}
/*
* cheat here
*/
if (!cheat::MyCanvas::Draw)
{
cheat::controller = cheat::stats->GetPlayerController(cheat::world, 0);
cheat::MyCanvas::Init(cheat::controller->MyHUD);
}
if (unload_cheat)
{
cheat::renderer->EndDrawCanvasToRenderTarget(cheat::world, cheat::MyCanvas::Context);
}
return spoofcall_internal(undocumented_FN, arg1, arg2, arg3, arg4, arg5);
}
}