samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Tue Jul 29, 2008 12:17 pm Post subject: |
|
|
For a pointer, you have to read the value at the address of the base, then add the offset to that value, and read from there.
Edit: Whoops, I thought it was reading a pointer
| Code: |
BOOL bSetPointer( DWORD dwAddress, DWORD dwOffset, DWORD dwPtrValue )
{
DWORD dwNewAddress = 0;
SIZE_T nBytesRead = 0;
//get base
if( !ReadProcessMemory( hProcess, dwAddress, &dwNewAddress, 4, &nBytesRead ) || (nBytesRead != 4) ) return FALSE;
//add the offset
dwAddress += dwOffset;
//set the pointer
if( !WriteProcessMemory( hProcess, dwAddress, &dwPtrValue, 4, &nBytesRead ) || (nBytesRead != 4) ) return FALSE;
return TRUE;
}
|
_________________
|
|