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 


Need Help On Using Pointers in Auto Assembler Script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Idonthavausernam
How do I cheat?
Reputation: 0

Joined: 09 Feb 2025
Posts: 1

PostPosted: Sun Feb 09, 2025 10:36 pm    Post subject: Need Help On Using Pointers in Auto Assembler Script Reply with quote

Hey y’all,
I’m trying to create a script in NFS Most Wanted 2012 (NFS13.exe) that changes the color of police cars. The game uses one dynamic address for each police unit, therefore requiring a pointer to work.
And this is the pointer of the first police unit:
Offset 1: 1DB0
Offset 2: A1314
Base Address: 10EC5F0

And this my code:
Code:

[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(changeColor)

newmem:
changeColor:
    mov eax, [10EC5F0]
    mov eax, [eax + 1DB0]
    mov eax, [eax + A1314]

    mov [eax+30], (float)1.0      // Red
    mov [eax+34], (float)1.0      // Green
    mov [eax+38], (float)1.0      // Blue

    // Metallic finish
    mov [eax+60], (float)0.005
    mov [eax+64], (float)0.005
    mov [eax+68], (float)0.005

    // Gloss and Matte Finish
    mov [eax+7C], (float)0.25     // Gloss
    mov [eax+80], (float)0.02     // Gloss
    mov [eax+9C], (float)0.5      // Matte finish (optional)

originalcode:
    movsd xmm0, [eax+30]          // Load the original color value to pass through
    jmp exit

exit:
    jmp returnhere

// Crown Vic direct memory address
10EC5F0:
jmp newmem
returnhere:

[DISABLE]
dealloc(newmem)
10EC5F0:
movsd xmm0, [eax+30]  // Restore original color


The error says that this line cannot be compiled
Code:
mov eax, [eax + 1DB0]

-This pointer ALWAYS works.
- I tried combining the base address and both offsets into one line.
-Whether or not if I add “NFS13.exe”+, it still doesn’t work.

Any help would be appreciated.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 149

Joined: 06 Jul 2014
Posts: 4619

PostPosted: Mon Feb 10, 2025 1:56 am    Post subject: Reply with quote

Idonthavausernam wrote:
Code:
mov eax, [eax + 1DB0]
Don't put spaces around `+`

You should be using `game.exe+...` for the base address. Just because it doesn't seem to change for you doesn't mean it can't.

_________________
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
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