Originally Posted by
potatosoup7
might as well just grind pots in exalt till it comes out to max the new characters that will be needed lol
wonder if could just make a simple hacked client with just autonexus to start getting experience in o3
c++ windows only (due to DLLMain + Sleep)
Code:
void* m_pLocalPlayerPointer = nullptr;
void* m_pCacheEntityOriginal = nullptr;
void* __fastcall m_pCacheEntityDetour(void * ECX, void * EDX)
{
if (ECX)//check if the ecx/entity/this is valid/not a nullptr
{
if (*(bool*)(std::uintptr_t(ECX) + 0x3A))//check if the entity is local player (0x3A = m_nIsLocalPlayerOffset)
{
m_pLocalPlayerPointer = ECX;//if its the localplayer, make the localplayer pointer point to it
}
}
return ((void*(__thiscall*)(void*))(m_pCacheEntityOriginal))(ECX);//remember to call the games original function
}
int m_nAutonexusValue = 20;//0 - 100
//set default autonexus value to 20
char m_strNexusKey = 'R';//set the nexus key
void m_pCheckHealthThread()
{
while (true)//make the thread run forever/the programs lifetime
{
if (m_pLocalPlayerPointer)//check if our localplayer pointer is valid/not a nullptr
{
int m_nMaxHealth = *(int*)(std::uintptr_t(m_pLocalPlayerPointer) + 0x1C4);//get local player max health (0x1C4 = m_nMaxHealthOffset)
int m_nHealth = *(int*)(std::uintptr_t(m_pLocalPlayerPointer) + 0x1C8);//get local player health (0x1C8 = m_nHealthOffset)
int m_nHealthPercentage = 100.f * (float(m_nHealth) / float(m_nMaxHealth));//0 - 100
if (m_nHealthPercentage < m_nAutonexusValue)//we have less health % than the minimum allowed, nexus
{
m_pHoldKeyDown(m_strNexusKey, 20);//hold the nexus key down for 20 ms
}
}
Sleep(5);//check every 5 ms, any less will probably put too much of a strain on cpu for something so simple
}
}
BOOL WINAPI DLLMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)//The DLL Main Entry
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
void* m_pCacheEntityFunction = (void*)DIA4A::UIUtilities::FindPatternIDA("GameAssembly.dll", "48 89 7C 24 18 55 48 8B EC 48 81 EC 80 ? ? ? 80 3D ? 8D 33 02");//find the cache entity function with a pattern
m_pDetourFunction(m_pCacheEntityFunction, m_pCacheEntityDetour, m_pCacheEntityOriginal);//detour it to make the game call our function instead of its own
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)m_pCheckHealthThread, NULL, NULL, NULL);//start the thread that is to check our health
}
break;
case DLL_PROCESS_DETACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}