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 


Pointer+Address+Offset

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

Joined: 18 Sep 2016
Posts: 32

PostPosted: Sat Jul 29, 2017 4:10 am    Post subject: Pointer+Address+Offset Reply with quote

so i want to edit a pointer like this in c++



But when i do it like that



And compile, press in game F12, the game crashes with other address, and didnt edit anything. What i am doing wrong? Or how to do it properly?[/img]
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 345

Joined: 09 May 2003
Posts: 20120
Location: The netherlands

PostPosted: Sat Jul 29, 2017 4:28 am    Post subject: Reply with quote

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

you need to dereference luBase+213740 to a pointer first and add 3e0 to that

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
Kewun
Cheater
Reputation: 0

Joined: 18 Sep 2016
Posts: 32

PostPosted: Sat Jul 29, 2017 4:58 am    Post subject: Reply with quote

still getting game crash
i did

*(INT*)(*(DWORD*)(luBase+*(DWORD*)(0x0213740+0x3E0))) = 999;


dereference, i dont know how to do it, and yes i readed everything that you posted in that link but i dont understand..
Back to top
View user's profile Send private message
FreeER
Master Cheater
Reputation: 13

Joined: 09 Aug 2013
Posts: 364

PostPosted: Sat Jul 29, 2017 10:38 am    Post subject: Reply with quote

pseudocode
Code:
//  dereference luBase+213740
baseAddress = readPointer(luBase+0x0213740) // *(void*)(...)

offsets = {..., 0x3E0} // ... represents values for multi-level pointers

// read through pointer/offset chain
address = baseAddress
for i=0, offsets.length-1 // skip last offset
  address = readPointer(address+offsets[i]) // *(void*)(...)

// add last offset (0x3E0) and read as final type
value = readType(address+offsets[offsets.length-1], DWORD) // *(DWORD*)address

// readInteger(readPointer(luBase+0x0213740) + 0x3E0)
// DWORD value = *(DWORD*)((*(void*)luBase+0x0213740)+0x3E0)


Personally, I'd highly recommend you make a function or two that will do the work for you.
Back to top
View user's profile Send private message
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