-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntityEntry.cpp
More file actions
64 lines (46 loc) · 1.12 KB
/
Copy pathEntityEntry.cpp
File metadata and controls
64 lines (46 loc) · 1.12 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
#include "pch.h"
#include "EntityEntry.h"
EntityEntry::EntityEntry(int count, PlayerEnt* localPlayer)
{
_entityCount = count;
_localPlayer = localPlayer;
}
EntityEntry::EntityEntry(int count, uintptr_t* dmAdd, PlayerEnt* localPlayer)
{
_entityCount = count;
dmAddress = dmAdd;
_localPlayer = localPlayer;
}
EntityEntry::~EntityEntry()
{
}
std::vector<PlayerEnt*> EntityEntry::getPlayers()
{
uintptr_t enityListAddress = *dmAddress;
std::vector<PlayerEnt*> playerEnts;
unsigned int i = 0;
while (i < (unsigned)_entityCount && dmAddress != nullptr && *dmAddress != 0)
{
try
{
PlayerEnt* entPtr = *(PlayerEnt**)(enityListAddress + sizeof(int) * i);
i++;
if (entPtr == 0 && i != 1) break;
if ((int)entPtr < 0) continue;
if ((int)entPtr>>25 == 0 || (int)entPtr >> 29 > 0) continue;
uintptr_t* vTableAdd = * (uintptr_t**)entPtr;
if ( (uintptr_t)vTableAdd == 0x4E4A98 || (uintptr_t)vTableAdd == 0x4E4AC0)
{
if (*(uintptr_t*)entPtr != *(uintptr_t*)_localPlayer)
{
playerEnts.push_back(entPtr);
}
}
}
catch (const std::exception&)
{
continue;
}
}
return playerEnts;
}