I stored all the values as DWORD_PTR object but when reading the values of the pointers its not read the values
#include <windows.h>
#include <vector>
using namespace std;
HANDLE proc = GetCurrentProcess();
class Object{
public:
DWORD_PTR address;
Object(DWORD_PTR address):address(address){}
template<typename T>
T rpm() {
T data;
ReadProcessMemory(proc, reinterpret_cast<LPVOID>(address), &data, sizeof(T), 0);
return data;
}
};
int main(){
int a = 5;
string b = "somestr1";
string c = "somestr2";
vector<DWORD_PTR> mylist;
mylist.push_back((DWORD_PTR)&c);
mylist.push_back((DWORD_PTR)&a);
mylist.push_back((DWORD_PTR)&b);
cout<<Object(mylist[0]).rpm<string>()<<endl;
cout<<Object(mylist[1]).rpm<int>()<<endl;
CloseHandle(proc);
}``` l can get the first item by calling rpm but cant get the second item there is no error just prints nothing.
kaan karakoc#6124 was kicked.