[C++] Read Value

06/02/2020 19:53 smkk6#1
hi i am trying to read a pointer to offsets
and when i use 1 offset work nice also when i try add more don't work
Code:
DWORD temp;
int curhp;
ReadProcessMemory(handle, (LPCVOID)(ModuleBaseAddress + 0x476ABC), &temp, sizeof(temp), NULL);
ReadProcessMemory(handle, (LPCVOID)(temp + 0x4C), &temp, sizeof(temp), NULL); // -----> Work nice 
ReadProcessMemory(handle, (LPCVOID)(temp + 0x75), &curhp, sizeof(curhp), NULL); // -------> When i try add more 


cout << "Current HP: " << temp << "-- |  " << curhp << endl;
Sleep(100);
system("CLS");
Image Look : [Only registered and activated users can see links. Click Here To Register...]
06/02/2020 20:34 IceTrailer#2
#moved

Try this code:
(old code, should work but untested for now)
Code:
#include <vector>
#include <Windows.h>

int getValue(DWORD address, const std::vector<DWORD>& offsets = std::vector<DWORD>()) {
	DWORD result;
	for (auto offset : offsets) {
		result += offset;
		result = *(DWORD*)result;
	}
	return (int)result;
}
07/08/2020 21:46 immun1ty#3
try

Code:
DWORD temp;
int curhp;
int curhp1;
ReadProcessMemory(handle, (LPCVOID)(ModuleBaseAddress + 0x476ABC), &temp, sizeof(temp), NULL);
ReadProcessMemory(handle, (LPCVOID)(temp + 0x4C), &curhp, sizeof(curhp1), NULL); // -----> Work nice 
ReadProcessMemory(handle, (LPCVOID)(temp + 0x75), &curhp1, sizeof(curhp1), NULL); // -------> When i try add more 


cout << "Current HP: " << curhp << "-- |  " << curhp << endl;
Sleep(100);
system("CLS");
12/07/2020 18:50 kraneqq#4
readprocessmemory is just a function that puts the dword pointer in your &var.

to read the actual value just derefrence that result