#define WORLD 0x0x413DE80
#define NETWORK 0xEF6EA0
#define OFF_NETWORK_ID 0x6FC
#define OFF_WORLD_BULLET_TABLE 0xE08
#define OFF_NEAR_ENTITY_TABLE 0x0F48
#define OFF_FAR_ENTITY_TABLE 0x1090
#define OFF_SLOW_ENTITY_TABLE 0x2010
#define OFF_FAST_ENTITY_TABLE 0x1D68
#define OFF_ITEM_ENTITY_TABLE 0x2060
int32_t NearTableSize;
VMMDLL_MemReadEx(DMA_HANDLE, processInfo.pid, memDZSA.worldAddress + OFF_NEAR_ENTITY_TABLE + 0x8, (PBYTE)&NearTableSize, sizeof(NearTableSize), &dwReadCache, VMMDLL_FLAG_NOCACHE);
std::cout << std::dec << NearTableSize << std::endl;
// uint64_t FarTableSize = read<uint32_t>(memDZSA.worldAddress + OFF_FAR_ENTITY_TABLE + 0x8);
int32_t FarTableSize;
VMMDLL_MemReadEx(DMA_HANDLE, processInfo.pid, memDZSA.worldAddress + OFF_FAR_ENTITY_TABLE + 0x8, (PBYTE)&FarTableSize, sizeof(FarTableSize), &dwReadCache, VMMDLL_FLAG_NOCACHE);
std::cout << std::dec << FarTableSize << std::endl;
for (int i = 0; i < NearTableSize; i++)
{
// uint64_t EntityTable = read<uint64_t>(memDZSA.worldAddress + OFF_NEAR_ENTITY_TABLE);
uint64_t SlowEntityTable;
VMMDLL_MemReadEx(DMA_HANDLE, processInfo.pid, memDZSA.worldAddress + OFF_NEAR_ENTITY_TABLE, (PBYTE)&SlowEntityTable, sizeof(SlowEntityTable), &dwReadCache, VMMDLL_FLAG_NOCACHE);
if (!SlowEntityTable) continue;
// uint64_t Entity = read<uint64_t>(EntityTable + (i * 0x8));
uint64_t Entity;
VMMDLL_MemReadEx(DMA_HANDLE, processInfo.pid, SlowEntityTable - 0x8 + (i * 0x8 /*0x18?*/), (PBYTE)&Entity, sizeof(Entity), &dwReadCache, VMMDLL_FLAG_NOCACHE);
if (!Entity) continue;
uint64_t ifp;
VMMDLL_MemReadEx(DMA_HANDLE, processInfo.pid, Entity + 0x160, (PBYTE)&ifp, sizeof(ifp), &dwReadCache, VMMDLL_FLAG_NOCACHE);
uint64_t ifp2;
VMMDLL_MemReadEx(DMA_HANDLE, processInfo.pid, ifp + 0xF0, (PBYTE)&ifp2, sizeof(ifp2), &dwReadCache, VMMDLL_FLAG_NOCACHE);
std::string _typename = ReadArmaString(ifp2);
std::cout << _typename << std::endl;
// checking if player even networked
// uintptr_t networkId = read<uintptr_t>(Entity + 0x6fc /*OFF_NETWORK*/);
uintptr_t networkId;
VMMDLL_MemReadEx(DMA_HANDLE, processInfo.pid, Entity + 0x6fc /*OFF_NETWORK*/, (PBYTE)&networkId, sizeof(networkId), &dwReadCache, VMMDLL_FLAG_NOCACHE);
if (networkId == 0) continue;
player_t Player{};
Player.NetworkID = networkId;
Player.TableEntry = SlowEntityTable;
Player.EntityPtr = Entity;
// adds info to the vector
tmp.push_back(Player);
std::cout << "pushed" << std::endl;
}
}