Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Problem with reading pointers with multi offsets.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Dracons
Newbie cheater
Reputation: 0

Joined: 08 Nov 2016
Posts: 16

PostPosted: Tue Mar 21, 2017 12:18 pm    Post subject: Problem with reading pointers with multi offsets. Reply with quote

Hello,

I am writing this post, because I have a problem in reading pointers with multi offsets.
I am able to read pointer with 1 offset, but now I would really like to learn how to read them even if pointer has few offsets.

The code that I was using for reading offset with 1 pointer is here:
Code:
var
  GameHandle : Cardinal;
  BaseAddress : int64;
  Address : Int64;
  Bytesread: SIZE_T;
  puffer : DWORD;
  Window : cardinal;
  PID : cardinal;
 
begin
  Window := FindWindow(nil,'Okno');
  GetWindowThreadProcessId(Window,PID);
  GameHandle := OpenProcess(PROCESS_VM_READ,false,PID);
  if GameHandle > 0 then
  begin
    BaseAddress := GetBasePointerOfModule(PID, 'Okno.exe');
    Address := BaseAddress + $00579640;
    ReadProcessMemory(GameHandle, ptr(Address), @puffer, sizeof(puffer), Bytesread);
    Label7.Caption := inttostr(Round(memreaddouble(strtoint(('$') + IntToHex((puffer + $6c), 8)))));   


Now the code with I am trying is here:
Code:
var
  GameHandle : Cardinal;
  BaseAddress : int64;
  Address : Int64;
  Bytesread: SIZE_T;
  Pointer1: Int64;
  puffer : DWORD;
  Window : cardinal;
  PID : cardinal;
 
begin
  Window := FindWindow(nil,'Okno');
  GetWindowThreadProcessId(Window,PID);
  GameHandle := OpenProcess(PROCESS_VM_READ,false,PID);
  if GameHandle > 0 then
  begin
    BaseAddress := GetBasePointerOfModule(PID, 'Okno.exe');
    Address := BaseAddress + $00579640;
    ReadProcessMemory(GameHandle, ptr(Address), @puffer, sizeof(puffer), Bytesread);
Pointer1:=(IntToHex((puffer), 8));
hpptr1 := IntToHex((StrToInt64('$' + Pointer1) + $6c), 8);
hpptr2 := IntToHex((StrToInt64('$' + hpptr1) + $7f0), 8);
hpptr3 := IntToHex((StrToInt64('$' + hpptr2) + $b0), 8);
hpptr4 := IntToHex((StrToInt64('$' + hpptr3) + $5e8), 8);
 
Edit1.Text := ('Pointer1:       ' + (Pointer1));
Edit2.Text := ('hpptr1:       ' + (hpptr1));
Edit3.Text := ('hpptr2:       ' + (hpptr2));
Edit4.Text := ('hpptr3:       ' + (hpptr3));
Edit5.Text := ('hpptr4:       ' + (hpptr4));
Edit6.Text := inttostr(Round(memreaddouble(strtoint(('$') + ((hpptr4)))))); 

That's the screenshot from CE:
htt ps:// zapodaj.net/images/b50d490a0508b.png
Unfortunately it is not working and I don't have any more ideas of how to fix it.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 137

Joined: 25 Jan 2006
Posts: 7284
Location: 127.0.0.1

PostPosted: Tue Mar 21, 2017 4:51 pm    Post subject: Reply with quote

You have to read the memory of each pointer from the remote process. You can't just convert things via IntToHex in the local process, it is not going to read the pointer at all.

Each step of the pointer needs to be pulled from the remote process since you are not injected from what you have shown above.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites