[HELP] Pointer calculation halts process when path is lost
So I have a function that calculates a pointer offset path called every so often. The problem is, the path gets lost at times (and is shown as ??????) in CE. When this happens while a calculation is happening it freezes.
And no, I cannot find a more reliable pointer or call the funtion only once.
How can I make it so the function knows when to stop before adding the next offset?
Code:
DWORD WINAPI adr1() {
//cout << "initializing adr3 calc\n";
pdwAddress = *(DWORD *)(gameBase + 0x01665308);
pdwAddress = *(DWORD*)(pdwAddress + 0x2c);
pdwAddress = *(DWORD*)(pdwAddress + 0x6c);
pdwAddress = *(DWORD*)(pdwAddress + 0x4);
pdwAddress = *(DWORD*)(pdwAddress + 0x8);
pdwAddress = *(DWORD*)(pdwAddress + 0x8);
pdwAddress = *(DWORD*)(pdwAddress + 0x24);
pdwAddress = *(DWORD*)(pdwAddress + 0x20);
pdwAddress = *(DWORD*)(pdwAddress + 0x0);
pdwAddress = *(DWORD*)(pdwAddress + 0x0);
//pdwAddress = *(DWORD*)(pdwAddress + 0xDC);
return 0;
}