void *addr1 = g_SigMngr.ResolveSig(laddr, CEntList_Pattern, CEntList_PatternBytes);//, 2, &addr1, &addr2);
if (addr1)
{
FindEntListFuncs((char *)addr1);
}
//extracting the entlist
void FindEntListFuncs(char *addr)
{
char *new_addr = NULL;
memcpy(&g_EntList, (addr + CEntList_gEntList), sizeof(char *));
memcpy(&new_addr, (addr + CEntList_FindEntity - sizeof(char *)), sizeof(char *));
new_addr += (unsigned long)addr + CEntList_FindEntity;
memcpy(&g_FindEntity, &new_addr, sizeof(char *));
g_pEntityList = g_EntList;
}
//LINUX
//no idea on if this is up to date
//_ZN12CCSGameRules12IsThereABombEv 0077B520
#define CEntList_Pattern "\x53\x31\xC0\x83\xEC\x18\x89\x44\x24\x04\xBA\x2A\x2A\x2A\x2A\x31\xDB\x89\x54\x24\x08\xC7\x04\x24\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A"
#define CEntList_PatternBytes 32
//bytes into the function for the op mov stack, <imm offset> (00997A80)
//gEntList
#define CEntList_gEntList 24
//bytes into the function for the op after call <imm> (test eax, eax)
//_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc
#define CEntList_FindEntity 33
windows
#define CEntList_Pattern "\x53\x68\x2A\x2A\x2A\x2A\x6A\x00\xB9\x2A\x2A\x2A\x2A\x32\xDB\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\xB0\x01\x5B\xC3"
#define CEntList_PatternBytes 28
//bytes into the function for the op mov ecx, <imm offset>
#define CEntList_gEntList 9
//bytes into the function for the op after call <imm> (test eax, eax)
#define CEntList_FindEntity 20