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 


Copying structure children to table as pointers

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

Joined: 16 Dec 2018
Posts: 41

PostPosted: Sun Jan 06, 2019 11:13 am    Post subject: Copying structure children to table as pointers Reply with quote

I've created a base pointer to a useful structure that I'd like to keep an eye on in my table. Mono has given the children very useful names. However, when I add all of the children to my list, they end up as static addresses. I'd like these all to be pointers that use my base pointer and maintain their offsets as shown in the structure.

The quantity of children and the constant mouse clicks/movements required to adjust each address to a pointer make this a monotonous manual task.

Is there a more automated way to bulk edit these or a more intelligent way to bring them into my table?



Added Structure Addresses are only Static.png
 Description:
 Filesize:  226.24 KB
 Viewed:  1610 Time(s)

Added Structure Addresses are only Static.png


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jan 06, 2019 12:04 pm    Post subject: Reply with quote

Lua:
Code:
local parent = AddressList.getMemoryRecordByDescription'Player Base Ptr'

assert(parent.Count > 0 and parent.OffsetCount == 1)

local baseAddr = readPointer(parent.Address) + parent.Offset[0]

for i = 0, parent.Count - 1 do
  local child = parent.Child[i]
  local childAddr = getAddressSafe(child.Address)
  -- if address is interpretable and it isn't already a pointer and it's within the structsize
  if childAddr and child.OffsetCount == 0
     and childAddr >= baseAddr and childAddr - baseAddr < 0x100 then
    child.Address = parent.Address
    child.OffsetCount = 1
    child.Offset[0] = childAddr - baseAddr
  end
end

_________________
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
ymiu
Cheater
Reputation: 0

Joined: 16 Dec 2018
Posts: 41

PostPosted: Sun Jan 06, 2019 1:13 pm    Post subject: Reply with quote

Epic =) You've just opened my eyes to a lot of new concepts...
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