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 


Using Addresses found with Scripts In The Addresses Table

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

Joined: 09 Feb 2023
Posts: 31

PostPosted: Mon Mar 10, 2025 5:34 am    Post subject: Using Addresses found with Scripts In The Addresses Table Reply with quote

Hello Cheat Engine Community,

I am currently working on a project where I need to monitor a dynamically changing address within Cheat Engine. I've set up an Auto Assembler (AA) script that allocates memory and registers a symbol, ValuePointer, which correctly reflects the address I am interested in. The script updates ValuePointer as expected during runtime, and I can verify that the memory allocated for ValuePointer contains the correct address, changing in sync with the target address.

The Issue:

While the script functions correctly, I encounter a problem when attempting to add ValuePointer to the address table manually. Despite ValuePointer holding the correct address during execution, adding it to the address table manually didn't work.

What I've Tried:

Using define Directive: I have used the define(ValuePointer, newmem+800) directive in my AA script to ensure ValuePointer is treated as a constant. This allows the script to compile without errors, and ValuePointer updates correctly during runtime.

Direct Memory Allocation: Allocated memory for ValuePointer and ensured it holds the dynamic address, which updates as expected during the program's execution.

Request for Assistance:

I am seeking guidance on how to properly add ValuePointer to the address table so that it reflects the value at the dynamically changing address during runtime. Instead of searching for pointers whether it's manual or by pointer scanner. Specifically:

Is there a method to add a symbol like ValuePointer to the address table such that it displays the value at the address it points to, updating dynamically as the address changes?

Are there alternative approaches or best practices within Cheat Engine to monitor and display values at dynamically changing addresses in the address table?

I appreciate any insights or suggestions from the community on how to resolve this issue.

Thank you for your assistance.


Code:
[ENABLE]

aobscanmodule(INJECT,Tutorial-x86_64.exe,89 46 18 48 8D 4D F8) // should be unique
alloc(newmem,$1000,INJECT)
define(ValuePointer,newmem+800)
label(code)
label(return)

newmem:

code:
 push eax
 lea eax,[rsi+18]
 mov [ValuePointer],eax
 pop eax
   mov [rsi+18],eax
   lea rcx,[rbp-08]
 jmp return

INJECT:
  jmp newmem
  nop 2
return:
registersymbol(INJECT)
registersymbol(ValuePointer)
ValuePointer:
  dd 00 00 00 00

[DISABLE]

INJECT:
  db 89 46 18 48 8D 4D F8

unregistersymbol(INJECT)
unregistersymbol(ValuePointer)
dealloc(newmem)



Screenshot 2025-03-10 153307.png
 Description:
 Filesize:  20.96 KB
 Viewed:  8267 Time(s)

Screenshot 2025-03-10 153307.png



Screenshot 2025-03-10 153109.png
 Description:
 Filesize:  12.36 KB
 Viewed:  8267 Time(s)

Screenshot 2025-03-10 153109.png



Screenshot 2025-03-10 152702.png
 Description:
 Filesize:  16.94 KB
 Viewed:  8267 Time(s)

Screenshot 2025-03-10 152702.png


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

Joined: 06 Jul 2014
Posts: 4695

PostPosted: Mon Mar 10, 2025 2:41 pm    Post subject: This post has 1 review(s) Reply with quote

If you're using ChatGPT or some equivalent, stop.
If English isn't your first language, you're fine.

I don't know if that `define` syntax works with `registersymbol`. Normally "ValuePointer" would be a label or an alloc.

Addresses in 64-bit processes are 8 bytes. `eax` is a 4-byte register- you should've used `rax` instead.

`dd 00 00 00 00` writes 4 4-byte values into memory at that address. You might've been thinking of `db 00 00 00 00` which writes 4 1-byte values into memory. That'd still be wrong since addresses are 8 bytes- use `dq 0` instead to write 1 8-byte value into memory.

You don't need to use `lea` to adjust the offset in the code injection. That can be done later.

Don't use "INJECT" for the aobscan symbol. If two or more scripts use the same symbol, bad things will happen if you disable those scripts.

Code:
[ENABLE]
aobscanmodule(Step8ChangeValue,Tutorial-x86_64.exe,89 46 18 48 8D 4D F8)
alloc(newmem,$1000,Step8ChangeValue)
label(ValuePointer)
label(return)

newmem:
  mov [ValuePointer],rsi
  mov [rsi+18],eax
  lea rcx,[rbp-08]
  jmp return

newmem+800:
ValuePointer:
  dq 0

Step8ChangeValue:
  jmp newmem
  nop 2
return:

registersymbol(Step8ChangeValue)
registersymbol(ValuePointer)

[DISABLE]

Step8ChangeValue:
  db 89 46 18 48 8D 4D F8

unregistersymbol(Step8ChangeValue)
unregistersymbol(ValuePointer)
dealloc(newmem)


Click "Add address manually", check the "Pointer" checkbox, base address is ValuePointer (no square brackets), only offset is 18.

Click + drag the new ValuePointer memory record onto the script memory record to append it as a child. Then right click the script memory record -> Group config -> Hide children when deactivated

The game needs to run the code in order for your code injection to do anything. In this case, you need to click the "Change Value" button in step 8 of the tutorial for "ValuePointer" to point to the correct address.

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

Joined: 09 Feb 2023
Posts: 31

PostPosted: Mon Mar 10, 2025 10:41 pm    Post subject: Reply with quote

thanks man, that has solved it. and yeah English is not my first language.
I was awake for more than 24 hours and totally exhausted but didn't want to go to bed before I conclude this. I was fighting with ChatGPT to discover why it was not working. and when I couldn't reach to a solution so I asked it to summarize and give me a post because I was not able to form a sentence . I barely pasted it and crashed. the thing is I didn't know you can use 'label' and 'registersymbol' simultaneously for the same constant/variable. Thought the former is for local script and the latter is for global declaration.

thanks you again for the tips, it will make my life easier. I have a few days off and I'm spending them with CE to refresh and get new knowledge .
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 Gamehacking 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