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 


Offsets don't add up?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
The Dab
Cheater
Reputation: 0

Joined: 22 May 2017
Posts: 25

PostPosted: Sun Sep 10, 2017 2:59 pm    Post subject: Offsets don't add up? Reply with quote

So I found a pointer for my game, from there I found the playerbase, So then I take the value of the playerbase, and add both offsets, however it does not add up to the address of my original value, why is this?

Preffered Imagebase = 0x400000
Player Base Address = 0x4843f4
Player Base Value (in hex) = 0x690078
Offset 1 = 0x1F8
Offset 2 = 0x48
(example)Ammo Address = 0x695888

My thoughts


Code:
PlayerBaseValue + Offset1 + Offset2 = AmmoAddress


However this is not the case, how do I add up the address's and offsets to equal the Ammo Address?
Back to top
View user's profile Send private message
ParkourPenguin
Grandmaster Cheater Supreme
Reputation: 54

Joined: 06 Jul 2014
Posts: 1814
Location: Arcadian Suburbia

PostPosted: Sun Sep 10, 2017 3:37 pm    Post subject: Reply with quote

http://forum.cheatengine.org/viewtopic.php?t=422516
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
The Dab
Cheater
Reputation: 0

Joined: 22 May 2017
Posts: 25

PostPosted: Sun Sep 10, 2017 3:53 pm    Post subject: Reply with quote

ParkourPenguin wrote:
http://forum.cheatengine.org/viewtopic.php?t=422516


Unless, I am missing something this still leaves me with the same problem. Adding the offsets to the address will not give me my ammo address, I need this for a c++ trainer btw if that makes a difference.
Back to top
View user's profile Send private message
FreeER
Master Cheater
Reputation: 12

Joined: 09 Aug 2013
Posts: 345

PostPosted: Sun Sep 10, 2017 5:44 pm    Post subject: Reply with quote

You don't just add the offsets together, for each offset you have to read from memory.

addr = base+baseoffset
addr = readPointer(addr)+offset1
addr = readPointer(addr)+offset2
...
value = readProperType(addr)
Back to top
View user's profile Send private message
The Dab
Cheater
Reputation: 0

Joined: 22 May 2017
Posts: 25

PostPosted: Mon Sep 11, 2017 3:59 pm    Post subject: Reply with quote

FreeER wrote:
You don't just add the offsets together, for each offset you have to read from memory.

addr = base+baseoffset
addr = readPointer(addr)+offset1
addr = readPointer(addr)+offset2
...
value = readProperType(addr)


So ReadProcessMemory for every single offset that is added?
Back to top
View user's profile Send private message
FreeER
Master Cheater
Reputation: 12

Joined: 09 Aug 2013
Posts: 345

PostPosted: Mon Sep 11, 2017 4:06 pm    Post subject: Reply with quote

Yep, um... I've actually got an example in C++ I created awhile back for someone else based on the tutorial

https://github.com/FreeER/CE-Examples/blob/master/C%2B%2B/tutorial-step8.cpp or https://www.dropbox.com/s/t1y1wn2ho1feaii/tutorial-step8.cpp?dl=0
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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