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 


Multi-level pointers in AutoAssemble Script!!

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

Joined: 14 Apr 2023
Posts: 10
Location: earth

PostPosted: Fri Apr 14, 2023 1:13 am    Post subject: Multi-level pointers in AutoAssemble Script!! Reply with quote

Hello, i'm new here and new to cheat engine..sorry if i've posted in wrong forum! So my porblem is alittle bit complicated and i've searched evey inch in youtube and even asked the OpenAI with no luck..
All i want is to have a pointer that points to an address but in ASM script..
i've already tried different methods :

1. tried debugging (for ex. Yaw) and made an AOB script that takes the base
of the structure that contains the values i want.. yes finally i made what iwanted always i've created my own pointers with my own offsets but sadly i've encountered alot of different problems (shared instruction code, ESI structure values are changing sometimes, sometimes when i follow the structure ESI+30 i find it changed to a p->XXXXX, and sometimes script is not enabling as i made it "assert" so it can't just find the AOB)..
long story short i've decided to use pointers instead on my scripts..
the idea is simple (grab the pointer make a symbol for it) and i've already done this but the problem this time that when i have script enabled and i die in the game, the address of my X coordinate changes when i watch the same pointer but the one not in the script.. while this ASM script doesn't fetch the new address the symbol i've made stores the old address WHY!!?

my code:
[code]
[ENABLE]
globalalloc(cave,2000)
createthread(cave)
label(pXcam pYcam pZcam pPitch pYaw pZoom)
registersymbol(pXcam pYcam pZcam pPitch pYaw pZoom)


[[[["AssassinsCreed_Dx10.exe"+025B9830]+1A0]+8]+34]+10:
pXcam:

[[[["AssassinsCreed_Dx10.exe"+025B9830]+1A0]+8]+34]+14:
pYcam:

[[[["AssassinsCreed_Dx10.exe"+025B9830]+1A0]+8]+34]+18:
pZcam:

[[[["AssassinsCreed_Dx10.exe"+0159E948]+C]+0]+6C]+804:
pPitch:

[[[["AssassinsCreed_Dx10.exe"+0159E948]+C]+0]+6C]+110:
pYaw:

[[[["AssassinsCreed_Dx10.exe"+0159E948]+C]+0]+6C]+808:
pZoom:

cave:
ret

[DISABLE]

unregistersymbol(pXcam pYcam pZcam pPitch pYaw pZoom)
[/code]
this is what happening :
so i added a manual address [pXcam] it stores the value of cam-x
when i die in the game the address stays the same (doesn't grab the new address) but it only updates the address when i Toggle DISABLED and ENABLE it again and this hits me hard as i'm planning to make a trainer and don't want to toggle off/on the base pointers script every time i finish a mission or die!
any IDEA?
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Fri Apr 14, 2023 9:30 am    Post subject: Reply with quote

A script only executes once on enable, so it is performing exactly as it should.
You will want to do something else if you want it to continually update.

There are a lot of options. You can set a timer to automatically update the addresses, you can set the pointers into cheat engine as a record for a pointer and then reference the record, you can find what writes one of those instructions and use the structure itself to update the pointers as needed, and there are a bunch of other ways but these three solve your issue the easiest.
Back to top
View user's profile Send private message
alihlko
Newbie cheater
Reputation: 0

Joined: 14 Apr 2023
Posts: 10
Location: earth

PostPosted: Fri Apr 14, 2023 9:09 pm    Post subject: Reply with quote

cooleko wrote:
A script only executes once on enable, so it is performing exactly as it should.
You will want to do something else if you want it to continually update.

There are a lot of options. You can set a timer to automatically update the addresses, you can set the pointers into cheat engine as a record for a pointer and then reference the record, you can find what writes one of those instructions and use the structure itself to update the pointers as needed, and there are a bunch of other ways but these three solve your issue the easiest.


oh got it but still don't understand why the script doen't update itself while the structure base with offsets updates the address i mean they are both scripts.. why one doesn't refresh the address while the structure pointers does (when i use them as symboly+offset).

*just another question i've already asked it but seems like it was not clear enough..why when i use the structure base (symbol+offset) and add it as a record in cheat engine sometimes the offsets value change its place so i get some other value for example (pCameraStructure+10) it sometimes show the right yaw value but some other times points to other value.. and when i check the ESI+10 in Diessec Structure tool i see the same value in ESI+10 while it was YAW's value... WHY IT CHANGES SOMETIMES?
i love this method of creating offsets but it disappoints me alot of times while i did every thing in the right way..
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Sat Apr 15, 2023 11:23 pm    Post subject: Reply with quote

The script, by design, can only execute when it is enabled in this instance. Unlike an AOB scan which inserts the code in the game on an enable, so would run every time the game executed that section of code, this code would run exactly once, when you enabled it. That means your pointers is rolled up into a single value at that address it is assigned. Upon execution, that pointer no longer exists in the AA script.

The record having a structure base + offset is actually being referenced as the pointer chain every 500ms (unless you changed the defaults).

If the structure is bugging out on you, then either the 'structure' isn't static as you expected or the base address changed, allowing another instruction to reuse the memory. If you are using the crazy pointers, that is likely the issue, they are correct most of the time but not always.
Back to top
View user's profile Send private message
alihlko
Newbie cheater
Reputation: 0

Joined: 14 Apr 2023
Posts: 10
Location: earth

PostPosted: Sun Apr 16, 2023 8:31 pm    Post subject: Reply with quote

cooleko wrote:
The script, by design, can only execute when it is enabled in this instance. Unlike an AOB scan which inserts the code in the game on an enable, so would run every time the game executed that section of code, this code would run exactly once, when you enabled it. That means your pointers is rolled up into a single value at that address it is assigned. Upon execution, that pointer no longer exists in the AA script.

The record having a structure base + offset is actually being referenced as the pointer chain every 500ms (unless you changed the defaults).

If the structure is bugging out on you, then either the 'structure' isn't static as you expected or the base address changed, allowing another instruction to reuse the memory. If you are using the crazy pointers, that is likely the issue, they are correct most of the time but not always.



Oh, exatly what needed to understand directly to the point. Thank you for the informations.
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