Posted: Sun Jan 06, 2019 11:13 am Post subject: Copying structure children to table as pointers
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?
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.
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