|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
RegretNeedsHelp How do I cheat? Reputation: 0
Joined: 08 May 2023 Posts: 5
|
Posted: Mon May 08, 2023 4:59 pm Post subject: How do I automatically get the Current Address of a pointer? |
|
|
I have this script here for my trainer
RewardBox = getAddressList().getMemoryRecordByDescription("RewardBoxBitfield").CurrentAddress
and it works with bitfields to toggle on and off certain flags, essentially I can open the reward box whenever. When the reward box is unloaded/reloaded by me leaving the map and entering to spawn it again, my trainer doesn't get the new address. Toggling a flag brings back a larger number than usual. How would I automatically get the new address without executing the trainer script again? by the way I am using pointers
_________________
To make bread one must make thyself - Sun Tzu |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Mon May 08, 2023 10:19 pm Post subject: |
|
|
You could register a symbol based on the final address in the pointer chain and then use that as a reference to the address. The other option is to use a copy injection script to pull the address from a register and assign the address to an allocated section of memory.
Code: |
aobscan(aob_symbol, process, aob_bytes)
alloc(newmem,$1000,aob_symbol
alloc(my_symbol,4/8) -- delete as appropriate. 4 is for 32-bit, 8 for 64-bit
...
newmem:
push rax // Store value in rax
mov rax,my_symbol // Move address of my_symbol into rax
mov [rax],register_which_holds_pointer_address // Move value of register into rax
pop rax // Restore rax
...
registersymbol(aob_symbol)
registersymbol(my_symbol)
...
|
Of course, a lot of code here has been omitted, but this will give you an idea of how to achieve it.
|
|
Back to top |
|
|
RegretNeedsHelp How do I cheat? Reputation: 0
Joined: 08 May 2023 Posts: 5
|
Posted: Tue May 09, 2023 3:11 pm Post subject: |
|
|
LeFiXER wrote: | You could register a symbol based on the final address in the pointer chain and then use that as a reference to the address. The other option is to use a copy injection script to pull the address from a register and assign the address to an allocated section of memory.
Code: |
aobscan(aob_symbol, process, aob_bytes)
alloc(newmem,$1000,aob_symbol
alloc(my_symbol,4/8) -- delete as appropriate. 4 is for 32-bit, 8 for 64-bit
...
newmem:
push rax // Store value in rax
mov rax,my_symbol // Move address of my_symbol into rax
mov [rax],register_which_holds_pointer_address // Move value of register into rax
pop rax // Restore rax
...
registersymbol(aob_symbol)
registersymbol(my_symbol)
...
|
Of course, a lot of code here has been omitted, but this will give you an idea of how to achieve it. |
Thank you for the help but I also seemed to have unironically solved my own issue in a shorter manner, I couldn't reply to myself yet, but I made that RewardBox a local variable, and put it inside the checkbox(sender) function where I would check if the ToggleScript were activated. This also fixed my problems with "performing a bitwise operation on a nil value" where half the time I launch the trainer it connects all the values, and the other half of the time I get an error.
TLDR: I put made all the variables to the addresses local, and moved them to their proper function call, so their value is only read and updated when I click the specific boxes.
_________________
To make bread one must make thyself - Sun Tzu |
|
Back to top |
|
|
|
|
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
|
|