int main() {
DWORD pID;
char moduleName[] = "samp.dll";
HWND hGameWindow = FindWindow(NULL, L"GTA:SA:MP");
GetWindowThreadProcessId(hGameWindow, &pID);
HANDLE pGta = OpenProcess(PROCESS_VM_READ, FALSE, pID);
DWORD pSamp = GetModuleBaseAddress(pID, L"samp.dll");
cout << "samp.dll addr: " << hex << pSamp << endl;
char nickname[24] = { " " };
ReadProcessMemory(pGta, (LPCVOID)(pSamp + OFFSET_NICKNAME), &nickname, sizeof(nickname), NULL);
DWORD dwAddress;
ReadProcessMemory(pGta, (LPCVOID)(pSamp + 0x21A0F8), &dwAddress, 4, 0);
cout << "dwAdress : " << dwAddress << endl;
ReadProcessMemory(pGta, (LPCVOID)(dwAddress + 0x3CD), &dwAddress, 4, 0);
cout << "dwAdres : " << dwAddress << endl;
DWORD dwPlayers;
ReadProcessMemory(pGta, (LPCVOID)(dwAddress + 0x18), &dwPlayers, 4, 0); //stPlayerPool
cout << "dwPlayers : " << dwPlayers << endl;
cout << endl << endl;
uint32_t ulMaxPlayerID;
ReadProcessMemory(pGta, (LPCVOID)(dwPlayers), &ulMaxPlayerID, sizeof(uint32_t), 0); //ulMaxPlayerID
cout << "ulMaxPlayerID : " << ulMaxPlayerID << endl;
uint16_t sLocalPlayerID;
ReadProcessMemory(pGta, (LPCVOID)(dwPlayers + sizeof(uint32_t)), &sLocalPlayerID, sizeof(uint16_t), 0); //sLocalPlayerID
cout << "sLocalPlayerID : " << sLocalPlayerID << endl;
//0x2a
stRemotePlayer* pRemotePlayer[SAMP_MAX_PLAYERS];
ReadProcessMemory(pGta, (LPCVOID)(dwPlayers + 0x2a), &pRemotePlayer, 4, 0);
cout << "pRemotePlayer : " << pRemotePlayer << endl;
cout << "nick : " << pRemotePlayer[5]->strPlayerName << endl;
}