I'm just trying to make a relogger for my bot in C++. However, I seem to be failing at this memory read with one offset :\. Right now I'm just trying to read the fields before i try changing them. This is the login name and password for the intro screen. I'm just posting the snippits of where I believe it's going wrong.
I'm using these addresses
username = [0x10D7914] + 0x50
pass = [0x10D7914] + 0xC8
Anyways, here's my offset reading function
Code:
DWORD GetUserNameAddy(HANDLE hProcess){
DWORD userNameAddy, buf;
if(ReadProcessMemory(hProcess, (LPCVOID)(0x010D7914), &buf, sizeof(buf), NULL)==0){
std::cout<<"Error reading first pointer on name\n";
return 0;
}
if(ReadProcessMemory(hProcess, (LPCVOID)(buf+0x50), &userNameAddy, sizeof(userNameAddy), NULL)==0){
std::cout<<"Error reading offset on name\n";
return 0;
}
return userNameAddy;
}
this is where I'm trying to use it
Code:
DWORD userNameAddy = GetUserNameAddy(hProcess);
if (userNameAddy == 0 || userPassAddy == 0) {
std::cout<<"Error with functions\n";
}
while(!(GetAsyncKeyState(VK_END) & 0x8000)){
if(ReadProcessMemory(hProcess, (LPCVOID)userNameAddy, &userName, sizeof(userName), NULL)==0){
std::cout<<"Could not read user Name Addy! Error:" << GetLastError() << "\n" ;
}else{
std::cout << "User Name : " << userName << "\n";
}
Sleep(500);
}
It seems to work up until my final memory read. I'm not sure though so please let me know what I'm doing wrong!