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 


Help Creating Script

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

Joined: 16 Jul 2017
Posts: 2

PostPosted: Sat Jan 06, 2018 9:24 pm    Post subject: Help Creating Script Reply with quote

I need a help creating a script to show unit labels in missions without them enabled by default. The value is stored as a byte (1 on and 0 off)
and moves when loading a new mission or restarting the game. Pointer Scan always comes up empty and i already tried comparing pointermaps.

Here is the function that turns them on, this is static and always in the same place. Each line is for a different unit type( air, ground, sea ETC).
Code:


Visualizer.dll+A22E2 - 88 88 2C010000        - mov [rax+0000012C],cl
Visualizer.dll+A22E8 - 88 88 2B010000        - mov [rax+0000012B],cl
Visualizer.dll+A22EE - 88 88 29010000        - mov [rax+00000129],cl
Visualizer.dll+A22F4 - 88 88 28010000        - mov [rax+00000128],cl
Visualizer.dll+A22FA - 88 88 2A010000        - mov [rax+0000012A],cl


So i guess its moving cl into RAX + the offset, to make it 1 and turn it on.

mov [rax+00000129],cl is for air units for example.
so when its turned on it looks like this
Code:

10216BC99 - 01 01                 - add [rcx],eax

and when its turned off
Code:

10216BC99 - 00 00                 - add [rax],al


so whats the best way to handle this, could i make a script that points me to [rax+00000129] on the cheat table and i could just change it?

or a script that injects into [rax+00000129] ?
game is 64bit if thats important
Im lost, some one please help Embarassed
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater
Reputation: 31

Joined: 09 Aug 2013
Posts: 757

PostPosted: Sun Jan 07, 2018 10:14 am    Post subject: Reply with quote

hook Visualizer.dll+A22E2 and copy RAX

eg.
Code:
[ENABLE]
globalalloc(newmem,$1000,Visualizer.dll+A22E2)

label(return)
label(labelBase)
registerSymbol(labelBase)

newmem:
  mov [labelBase], rax
  mov [rax+0000012C],cl // original code overwritten by jmp
  jmp return

labelBase:
  dq 0

Visualizer.dll+A22E2:
  jmp newmem
  nop
return:

[DISABLE]
Visualizer.dll+A22E2:
  db 88 88 2C 01 00 00


Then you could create pointers using labelBase and the offsets in the code (remember to make them 1 byte) or even a script to set all of them at once, or use a pointer and set the type to 8 byes and use the dropdown list to set up arbitrary groups eg. air+sea (hopefully there's some padding between other values so the 3 extra bytes won't matter, but if you have issues use 2 pointers, 1 set to 4 bytes and the other 1 byte for the extra value or use multiple scripts instead of a dropdown list, it just wouldn't be as convenient).
Back to top
View user's profile Send private message
14tennine
How do I cheat?
Reputation: 0

Joined: 16 Jul 2017
Posts: 2

PostPosted: Sun Jan 07, 2018 11:37 am    Post subject: not working Reply with quote

My last edit since i can't double post, just wanted to say thanks.
Did some digging and finally got it working, just had to modify the script a bit
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