I’m trying to read a memory address in C++ and it keeps returning 3435973836.
I tried using the ReadProcessMemory() function and it should in theory return the value 9912 as thats the value thats listed under the address in Cheat Engine, however it just keeps returning 3435973836. The process id thats printed is correct so im not quite sure whats going wrong.
Code:
<code>DWORD pid, base,currentValue;
uintptr_t value;
pid = GetProcessID(L"Solara.exe");
base = GetModuleBaseAddress(pid,L"Solara.exe");
std::cout << pid << std::endl;
std::cout << std::hex << base << std::endl;
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, NULL, pid);
ReadProcessMemory(handle, (void*)(0x266BA21C5B8), ¤tValue, sizeof(INT64),NULL);
std::cout << std::dec << currentValue;
</code>
<code>DWORD pid, base,currentValue;
uintptr_t value;
pid = GetProcessID(L"Solara.exe");
base = GetModuleBaseAddress(pid,L"Solara.exe");
std::cout << pid << std::endl;
std::cout << std::hex << base << std::endl;
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, NULL, pid);
ReadProcessMemory(handle, (void*)(0x266BA21C5B8), ¤tValue, sizeof(INT64),NULL);
std::cout << std::dec << currentValue;
</code>
DWORD pid, base,currentValue;
uintptr_t value;
pid = GetProcessID(L"Solara.exe");
base = GetModuleBaseAddress(pid,L"Solara.exe");
std::cout << pid << std::endl;
std::cout << std::hex << base << std::endl;
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, NULL, pid);
ReadProcessMemory(handle, (void*)(0x266BA21C5B8), ¤tValue, sizeof(INT64),NULL);
std::cout << std::dec << currentValue;
New contributor
user26861282 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
5