Code:
// WoWTest2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "TokenPrivs.cpp"
#include "Find_Process.cpp"
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE hProcess;
DWORD pID;
if(FindProcess("World of Warcraft", pID) == -1)
{
std::cout << "Could not detect World of Warcraft, press ENTER to exit.";
std::cin.get();
return -1;
}
std::cout << "Detected World of Warcraft... Attempting to get debugging privs\n";
if(TokenPrivs() == false)
{
std::cout << "Could not raise to debugger privs. Press ENTER to exit.";
std::cin.get();
return -1;
}
std::cout << "Debugging privs obtained... Attaching to World of Warcraft\n";
AttachProcess(hProcess, pID);
DWORD ptrObjectManager, g_ClientConnect, BytesRead;
ReadProcessMemory(hProcess, (LPCVOID)0x0, (LPVOID)g_ClientConnect, 4, &BytesRead); //0x0; //0x980558,
std::cout << "Read from base address into g_ClientConnect: " << g_ClientConnect;
ReadProcessMemory(hProcess, (LPCVOID)(g_ClientConnect + 0x463C), (LPVOID)ptrObjectManager, 8, &BytesRead);
std::cout << "\nRead from g_ClientConnect into ObjectManager: " << ptrObjectManager;
/*ptrObjectManager returns 0 when I read 0x0 into g_ClientConnect (the rebased 0x980558 address). Reading
0x980558 into g_ClientConnect forces both to zero. This is the non-rebased address.*/
/*note: Occasinally this is showing g_ClientConnect as 0 as well*/
// ptrObjectManager Is now the pointer to my Object Manager according to Shynd
UINT64 LocalGUID; // Our GUID
ReadProcessMemory(hProcess, (LPCVOID)(ptrObjectManager+0xB8), (LPVOID)LocalGUID, 8, &BytesRead);
std::cout << "\nRead our GUID: " << LocalGUID;
DWORD CurrentObject, NextObject;
ReadProcessMemory(hProcess, (LPCVOID)(ptrObjectManager+0xB4), (LPVOID)CurrentObject, 4, &BytesRead);
// For a pointer to the start of the linked list. Current Object
NextObject = CurrentObject;
//Knok's while loop replica mixed with Shynd's
while(CurrentObject && (CurrentObject & 1) == 0) //while (curObj != 0 && (curObj & 1) == 0) shynd
{
UINT64 ObjectGUID;
DWORD LocalObject; // Our character in the Object Manager
ReadProcessMemory(hProcess, (LPCVOID)(CurrentObject + 0x30), (LPVOID)ObjectGUID, 8, &BytesRead);
if(LocalGUID == ObjectGUID)
{
std::cout << "\nWe found our self in the Object Manager!\nObject GUID: " << ObjectGUID;
LocalObject = CurrentObject;
float X, Y, Z;
ReadProcessMemory(hProcess, (LPCVOID)(CurrentObject + 0xBF0), (LPVOID)&X, 4, &BytesRead);
ReadProcessMemory(hProcess, (LPCVOID)(CurrentObject + 0xBF4), (LPVOID)&Y, 4, &BytesRead);
ReadProcessMemory(hProcess, (LPCVOID)(CurrentObject + 0xBF8), (LPVOID)&Z, 4, &BytesRead);
std::cout << "\nX: " << X << "\nY: " << Y << "\nZ: " << Z;
std::cin.get();
break;
}
NextObject = CurrentObject;
ReadProcessMemory(hProcess, (LPCVOID)(CurrentObject + 0x3C), (LPVOID)NextObject, 4, &BytesRead);
if(NextObject == CurrentObject)
{
std::cout << "\nError, NextObject == CurrentObject";
std::cin.get();
break;
}
}
std::cin.get();
return 0;
}
Our first attachment shows 0x0 (0x0 being rebased 0x980558 according to most recent info thread.)