forked from mingyuemao04/EAC---Selfleak
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheac.hpp
More file actions
147 lines (142 loc) · 3.66 KB
/
eac.hpp
File metadata and controls
147 lines (142 loc) · 3.66 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#pragma once
#include "header.hpp"
namespace eac
{
static std::uint16_t handlerCallbacks{};
static std::uint16_t reportAttemps{};
static std::uint16_t kickAttemps{};
static boolean findReportBytes(void* packet, std::size_t size)
{
boolean validReport = false;
for (std::int16_t i = 0; i < size; i++)
{
std::uint32_t byte = *reinterpret_cast<std::uint32_t*>(&packet + i);
if (byte == 0xD7)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 1));
if (byte == 0x8D)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 2));
if (byte == 0x94)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 3));
if (byte == 0x80)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 4));
if (byte == 0x92)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 5));
if (byte == 0x99)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 6));
if (byte == 0x2A)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 7));
if (byte == 0x5E)
{
validReport = true;
reportAttemps++;
break;
}
}
}
}
}
}
}
}
}
if (validReport) report_packet = packet;
return validReport;
}
static boolean findKickBytes(void* packet, std::size_t size)
{
boolean validKick = false;
for (std::int16_t i = 0; i < size; i++)
{
std::uint32_t byte = *reinterpret_cast<std::uint32_t*>(&packet + i);
if (byte == 0x28)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 1));
if (byte == 0x23)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 2));
if (byte == 0x2A)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 3));
if (byte == 0x24)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 4));
if (byte == 0x23)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 5));
if (byte == 0x24)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 6));
if (byte == 0x26)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 7));
if (byte == 0x2A)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 8));
if (byte == 0x44)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 9));
if (byte == 0x40)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 10));
if (byte == 0x6B)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 11));
if (byte == 0x56)
{
byte = *reinterpret_cast<std::uint32_t*>(&packet + (i + 16));
if (byte == 0x6E)
{
validKick = true;
kickAttemps++;
break;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if (validKick) kick_packet = packet;
return validKick;
}
static void hookCallBackEvent(void* client, void* packet, void* size,
void* arg4, void* arg5)
{
if (client != nullptr)
{
eac_client = client;
handlerCallbacks++;
/*
* Ghetto handler
*/
if (findReportBytes(packet, size_t(size)))
{
spoofcall_internal(std::printf, "report packet Found inside of EAC module");
return;
}
else if (findKickBytes(packet, size_t(size)))
{
spoofcall_internal(std::printf, "game kick packet Found inside of EAC module");
return;
}
else
{
return;
}
}
}
}