entityPtr = *(base + i * stride + 0x10);

std::vector<uintptr_t> getEntityAddresses() {
std::vector<uintptr_t> addresses;
addresses.reserve(1024);
HMODULE hModule = GetModuleHandle(nullptr);
if (!hModule) return addresses;
uintptr_t modGameAssembly = reinterpret_cast<uintptr_t>(hModule);
uintptr_t entityManager = 0;
if (!safeReadPointer(reinterpret_cast<void*>(modGameAssembly + EntityListPtr), &entityManager)) {
return addresses;
}
uintptr_t base = 0;
int stride = 0;
int count = 0;
if (!safeReadPointer(reinterpret_cast<void*>(entityManager + 0x7C), &base) ||
!safeReadValue(reinterpret_cast<void*>(entityManager + 0x80), &stride) ||
!safeReadValue(reinterpret_cast<void*>(entityManager + 0x84), &count)) {
return (addresses);
}
if (!base || stride <= 0 || stride > 1024 || count <= 0 || count > 4096) {
return (addresses);
}
for (int i = 0; i < count; i++) {
uintptr_t slotAddr = base + static_cast<size_t>(i) * stride;
uintptr_t entityPtr = 0;
if (!safeReadPointer(reinterpret_cast<void*>(slotAddr + 0x10), &entityPtr)) {
continue;
}
if (entityPtr == 0 ||
entityPtr == 0x1 ||
entityPtr < 0x10000 ||
(entityPtr & 0xFFFF000000000000) != 0) {
continue;
}
if (!IsBadReadPtr(reinterpret_cast<void*>(entityPtr), sizeof(void*))) {
addresses.push_back(entityPtr);
}
}
return (addresses);
}
void __fastcall FUN_009fb640(int param_1)
{
double dVar1;
int *piVar2;
int iVar3;
int iVar4;
int iVar5;
int local_c;
int local_8;
local_c = 0;
*(undefined1 *)(param_1 + 0x158) = 1;
local_8 = 0;
dVar1 = *(double *)(*(int *)(param_1 + 0x154) + 0x118);
FUN_008441b0(0);
iVar4 = local_8;
iVar3 = local_c;
while( true ) {
if (*(int *)(param_1 + 0x84) == 0) {
iVar5 = 0;
}
else {
iVar5 = (*(int *)(param_1 + 0x84) + -1) * *(int *)(param_1 + 0x80) + *(int *)(param_1 + 0x7c);
}
if ((iVar4 == 0) && (iVar3 == iVar5)) break;
piVar2 = *(int **)(iVar4 + 0x10);
FUN_006de950();
if (*(double *)(piVar2 + 0x22) < dVar1) {
local_c = piVar2[10];
local_8 = piVar2[0xb];
FUN_006b8ef0(&local_c);
}
if (((uint)piVar2[0xf] >> 4 & 1) != 0) {
(**(code **)(*piVar2 + 0x44))();
(**(code **)(*piVar2 + 0x48))();
}
}
*(undefined1 *)(param_1 + 0x158) = 0;
return;
}

if (!safeReadPointer(reinterpret_cast<void*>(slotAddr + 0x10), &entityPtr)) {
continue;
}
if (entityPtr == 0 ||
entityPtr == 0x1 ||
entityPtr < 0x10000 ||
(entityPtr & 0xFFFF000000000000) != 0) {
continue;
}
if (!IsBadReadPtr(reinterpret_cast<void*>(entityPtr), sizeof(void*))) {
addresses.push_back(entityPtr);
}
bool safeReadPointer(const void* address, uintptr_t* value) {
if (!value) return false;
*value = 0;
if (!isValidMemoryAddress(address, sizeof(uintptr_t))) {
return false;
}
if (IsBadReadPtr(address, sizeof(uintptr_t))) {
return false;
}
*value = *reinterpret_cast<const uintptr_t*>(address);
return *value != 0;
}
bool isValidName(const std::string& name) {
if (name.empty() || name.length() < 2 || name.length() > 64) {
return (false);
}
size_t printableCount = 0;
for (char c : name) {
if (isprint(static_cast<unsigned char>(c))) {
printableCount++;
}
else if (c != '\t' && c != '\n' && c != '\r') {
return (false);
}
}
if ((printableCount * 100 / name.length()) < 70) {
return (false);
}
if (name.find('/') != std::string::npos) return true;
return (true);
}
bool isValidPosition(const Vector3& pos) {
if (!isfinite(pos.x) || !isfinite(pos.y) || !isfinite(pos.z)) {
return (false);
}
const float MAX_COORD = 100000.0f;
const float MIN_COORD = -100000.0f;
return (pos.x >= MIN_COORD && pos.x <= MAX_COORD &&
pos.y >= MIN_COORD && pos.y <= MAX_COORD &&
pos.z >= MIN_COORD && pos.z <= MAX_COORD);
}
bool readEntityPosition(uintptr_t entityPtr, Vector3* position) {
if (!position) return (false);
*position = { 0, 0, 0 };
uintptr_t p1 = 0;
if (!safeReadPointer(reinterpret_cast<void*>(entityPtr + 0xC4), &p1)) {
return (false);
}
uintptr_t p2 = 0;
if (!safeReadPointer(reinterpret_cast<void*>(p1 + 0x4), &p2)) {
return (false);
}
return safeReadValue(reinterpret_cast<void*>(p2 + 0x80), position);
}
std::string readEntityName(uintptr_t entityPtr) {
uintptr_t nameBase = 0;
if (safeReadPointer(reinterpret_cast<void*>(entityPtr + 0x54), &nameBase)) {
uintptr_t namePtr = 0;
if (safeReadPointer(reinterpret_cast<void*>(nameBase + 0x4C), &namePtr)) {
std::string name = readString(reinterpret_cast<char*>(namePtr));
if (!name.empty()) {
return name;
}
}
}
uintptr_t namePtr = 0;
if (safeReadPointer(reinterpret_cast<void*>(entityPtr + 0x1D0), &namePtr)) {
std::string name = readString(reinterpret_cast<char*>(namePtr));
if (!name.empty()) {
return name;
}
}
return "";
}
std::vector<uintptr_t> getEntityAddresses() {
std::vector<uintptr_t> addresses;
addresses.reserve(1024);
HMODULE hModule = GetModuleHandle(nullptr);
if (!hModule) return addresses;
uintptr_t modGameAssembly = reinterpret_cast<uintptr_t>(hModule);
uintptr_t entityManager = 0;
if (!safeReadPointer(reinterpret_cast<void*>(modGameAssembly + EntityListPtr), &entityManager)) {
return addresses;
}
uintptr_t base = 0;
int stride = 0;
int count = 0;
if (!safeReadPointer(reinterpret_cast<void*>(entityManager + 0x7C), &base) ||
!safeReadValue(reinterpret_cast<void*>(entityManager + 0x80), &stride) ||
!safeReadValue(reinterpret_cast<void*>(entityManager + 0x84), &count)) {
return (addresses);
}
if (!base || stride <= 0 || stride > 1024 || count <= 0 || count > 4096) {
return (addresses);
}
for (int i = 0; i < count; i++) {
uintptr_t slotAddr = base + static_cast<size_t>(i) * stride;
uintptr_t entityPtr = 0;
if (!safeReadPointer(reinterpret_cast<void*>(slotAddr + 0x10), &entityPtr)) {
continue;
}
if (entityPtr == 0 ||
entityPtr == 0x1 ||
entityPtr < 0x100000 ||
(entityPtr & 0xFFFF000000000000) != 0) {
continue;
}
if (!IsBadReadPtr(reinterpret_cast<void*>(entityPtr), sizeof(void*))) {
addresses.push_back(entityPtr);
}
}
return (addresses);
}
bool isValidMemoryAddress(const void* ptr, size_t size) {
if (!ptr) return false;
uintptr_t addr = reinterpret_cast<uintptr_t>(ptr);
if (addr < 0x10000 || addr > 0x7FFFFFFF) {
return false;
}
MEMORY_BASIC_INFORMATION mbi = {};
SIZE_T result = VirtualQuery(ptr, &mbi, sizeof(mbi));
if (result == 0) return false;
if (mbi.State != MEM_COMMIT) return false;
DWORD readableFlags = PAGE_READONLY | PAGE_READWRITE |
PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE;
if (!(mbi.Protect & readableFlags)) return false;
uintptr_t endAddr = addr + size - 1;
uintptr_t regionEnd = reinterpret_cast<uintptr_t>(mbi.BaseAddress) + mbi.RegionSize - 1;
return endAddr <= regionEnd;
}
bool safeReadPointer(const void* address, uintptr_t* value) {
if (!value) return false;
*value = 0;
if (!address) {
return true;
}
__try {
*value = *reinterpret_cast<const uintptr_t*>(address);
return true;
}
__except (EXCEPTION_EXECUTE_HANDLER) {
return false;
}
}
std::string readString(char* ptr, size_t maxLen) {
if (!ptr || !isValidMemoryAddress(ptr, 1)) {
return "";
}
std::string result;
result.reserve(maxLen);
for (size_t i = 0; i < maxLen; i++) {
if (!isValidMemoryAddress(ptr + i, 1)) {
break;
}
if (IsBadReadPtr(ptr + i, 1)) {
break;
}
char c = ptr[i];
if (c == '\0') break;
if (c < 32 || c > 126)
{
if (c != '\t' && c != '\n' && c != '\r') {
break;
}
}
result += c;
}
return result;
}
uintptr_t GetAddress(HANDLE hProcess, uintptr_t base, const std::vector<uintptr_t>& offsets) {
uintptr_t address = base;
for (size_t i = 0; i + 1 < offsets.size(); ++i) {
uint32_t tmp = 0;
if (!ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(address + offsets[i]), &tmp, sizeof(tmp), nullptr) || tmp == 0) {
return 0;
}
address = tmp;
}
return offsets.empty() ? address : (address + offsets.back());
}
bool ReadValue(HANDLE hProcess, uintptr_t address, const std::string& type, void* out) {
SIZE_T bytesRead;
if (type == "float") {
return ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(address), out, sizeof(float), &bytesRead) && bytesRead == sizeof(float);
} else if (type == "uint") {
return ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(address), out, sizeof(uint32_t), &bytesRead) && bytesRead == sizeof(uint32_t);
} else if (type == "double") {
return ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(address), out, sizeof(double), &bytesRead) && bytesRead == sizeof(double);
} else if (type == "int") {
return ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(address), out, sizeof(int32_t), &bytesRead) && bytesRead == sizeof(int32_t);
}
return false;
}
std::string ReadString(HANDLE hProcess, uintptr_t address, size_t maxLen) {
std::vector<char> buffer(maxLen);
SIZE_T bytesRead;
if (!ReadProcessMemory(hProcess, reinterpret_cast<LPCVOID>(address), buffer.data(), maxLen, &bytesRead)) {
return {};
}
size_t len = 0;
while (len < bytesRead && buffer[len] != '\0') ++len;
return std::string(buffer.data(), len);
}
std::vector<Entity> GetAllEntities(HANDLE hProcess, uintptr_t world) {
std::vector<Entity> entities;
if (!world) return entities;
uintptr_t nodeInfo = GetAddress(hProcess, world, {0x7C});
if (!nodeInfo) return entities;
uint32_t baseAddr = 0;
ReadValue(hProcess, nodeInfo, "uint", &baseAddr);
if (!baseAddr) return entities;
uint32_t size = 0, step = 0;
uintptr_t sizeAddr = GetAddress(hProcess, nodeInfo, {0x8});
ReadValue(hProcess, sizeAddr, "uint", &size);
uintptr_t stepAddr = GetAddress(hProcess, nodeInfo, {0x4});
ReadValue(hProcess, stepAddr, "uint", &step);
std::vector<uintptr_t> nodes;
for (uint32_t i = 0; i < size; ++i) {
uintptr_t addr = baseAddr + i * step;
while (addr) {
uint32_t next = 0;
if (!ReadValue(hProcess, addr, "uint", &next)) break;
if (next != 1) nodes.push_back(addr);
addr = next & ~1u;
}
}
for (auto node : nodes) {
uintptr_t ent = GetAddress(hProcess, node, {0x10, 0xC4, 0x4, 0x0});
if (!ent) continue;
uintptr_t nameAddr = GetAddress(hProcess, ent, {0x58, 0x64, 0x0});
auto name = ReadString(hProcess, nameAddr, 96);
if (name.empty()) continue;
uintptr_t posAddr = GetAddress(hProcess, ent, {0x58, 0xC4, 0x4, 0x80});
float x=0,y=0,z=0;
ReadValue(hProcess, posAddr, "float", &x);
ReadValue(hProcess, posAddr+4, "float", &y);
ReadValue(hProcess, posAddr+8, "float", &z);
float scale = 0;
ReadValue(hProcess, posAddr+0x74, "float", &scale);
int level = 0;
uintptr_t lvlAddr = GetAddress(hProcess, ent, {0x58, 0xC4, 0x54, 0x120});
ReadValue(hProcess, lvlAddr, "int", &level);
int death = 0;
uintptr_t deathAddr = GetAddress(hProcess, ent, {0x58, 0x0});
ReadValue(hProcess, deathAddr, "int", &death);
double health = 0;
uintptr_t healthAddr = GetAddress(hProcess, ent, {0x58, 0xC4, 0x84, 0x80});
ReadValue(hProcess, healthAddr, "double", &health);
entities.push_back({name, x, y, z, scale, level, death, health});
}
std::cout << "\n[Info] Base: 0x" << std::hex << baseAddr << " Size: " << std::dec << size << " Step: " << step << std::endl;
std::cout << "[Info] Total entities found: " << entities.size() << std::endl;
return entities;
}
std::vector<Entity> GetAllEntities() {
std::vector<Entity> entities;
uintptr_t base = (uintptr_t)GetModuleHandle(NULL);
if (!base) return entities;
uintptr_t world = *(uintptr_t*)(base + EntityListPtr);
if (!world) return entities;
uintptr_t nodeInfo = *(uintptr_t*)(world + 0x7C);
if (!nodeInfo) return entities;
uintptr_t baseAddr = nodeInfo;
if (!baseAddr) return entities;
uint32_t step = *(uint32_t*)(world + 0x80);
uint32_t size = *(uint32_t*)(world + 0x84);
printf("step : %d\n", step);
int badreadNode = 0;
Vector3 pos = { 0, 0, 0 };
for (uint32_t i = 0; i < size; ++i) {
uintptr_t node = baseAddr + i * step;
while (node) {
if (IsBadReadPtr((void*)node, sizeof(uintptr_t)))
{
printf("badread");
break;
}
uintptr_t next = *(uintptr_t*)node;
if (next != 0x00000001)
{
printf("node : 0x%X | next : 0x%X\n", node, next);
uintptr_t ent = *(uintptr_t*)(node + 0x10);
if (!ent) break;
uintptr_t namePtr1 = ent + 0x64;
if (!namePtr1 || IsBadReadPtr((void*)namePtr1, sizeof(uintptr_t))) break;
uintptr_t nameAddr = *(uintptr_t*)(namePtr1);
if (!nameAddr || IsBadReadPtr((void*)nameAddr, sizeof(uintptr_t))) break;
std::string name = readString(reinterpret_cast<char*>(nameAddr), 96);
uintptr_t posPtr1 = ent + 0xC4;
if (!posPtr1 || IsBadReadPtr((void*)posPtr1, sizeof(uintptr_t))) break;
uintptr_t posPtr2 = *(uintptr_t*)(posPtr1);
if (!posPtr2 || IsBadReadPtr((void*)posPtr2, sizeof(uintptr_t))) break;
uintptr_t posPtr3 = posPtr2 + 0x4;
if (!posPtr3 || IsBadReadPtr((void*)posPtr3, sizeof(uintptr_t))) break;
uintptr_t posPtr4 = *(uintptr_t*)(posPtr3);
if (!posPtr4 || IsBadReadPtr((void*)posPtr4, sizeof(uintptr_t))) break;
pos = *reinterpret_cast<Vector3*>(posPtr4 + 0x80);
entities.push_back({ name, pos, ent, node });
}
node = next & ~1u;
if (node == (next & ~1u)) break;
}
}
printf("size : %d | entities size : %d\n", size, entities.size());
printf("---------------------------\n");
return entities;
}
node = next & ~1u;
if (node == (next & ~1u)) break;