 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
PtitSerpent How do I cheat?
Reputation: 0
Joined: 17 Jun 2020 Posts: 9 Location: France, Normandy
|
Posted: Wed Jun 17, 2020 7:03 am Post subject: How to do a script which change a value and freeze it |
|
|
Hi all,
Sorry to bother you with this simple question, but i don't really understand how to script this little thing...
I want to make a trainer for the game "Witch Hunt", and i want to activate a "no reload" function on my weapon.
I found a pointer which is equal to "0" or "1". This pointer is exactly what i need to do the trick (if I freeze the value to "1", then i can shoot without reloading).
Now i want to make my trainer, but I don't know how to bind a script to my button, and I don't know how to do this little script.
I just need to change the value to "1" and freeze it, i think it's not really hard to do but i don't know where to go ^^
Can someone help me ?
Thank you
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3349
|
Posted: Thu Jun 18, 2020 3:32 am Post subject: |
|
|
Sure thing, seems you've done the hard part already.
Add the pointer to the address list and see what sets it to 0 or checks for a 1.
Then, use an AA template to either NOP the instruction or set it to 1.
Note: if enemies use it, they'll benefit from this, too - if that happens, you will need to build in a player check.
You can make a trainer from an AA script, but you can also assign hotkeys in the address list. AA scripts are easier to maintain and edit. Up to you.
Good luck!
|
|
| Back to top |
|
 |
PtitSerpent How do I cheat?
Reputation: 0
Joined: 17 Jun 2020 Posts: 9 Location: France, Normandy
|
Posted: Thu Jun 18, 2020 7:36 am Post subject: |
|
|
Thanks for your reply
So i tried to use my pointer to make my script, here are my steps :
- Right-click on my pointer and choose "Find out what writes to this address"
- Select "Find what writes the address pointed at by this pointer" (the first option didn't find anything)
- In-game, I shot one bullet
- An event was found, so i click on "Show disassembler"
- In "Tools", i select "Auto Assemble"
- Here, i create an AOB Injection template and i replace the line of code which remove my bullet (here that's mov [rax+0000022C],ecx)
- A little code for disabling my script and that's good to go (just a copy of the previous instruction, in red)
- Next "File -> Assign to current cheat table"
Nice, if I activate my script, it works !!!
But if I close the game, disable my script, and restart the game, it doesn't work anymore
What's my problem here ? my pointer is correct but the address in the instruction is wrong ? Or something else ?
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3349
|
Posted: Thu Jun 18, 2020 12:13 pm Post subject: |
|
|
First off, congrats!
If you close the game, you need to attach CE to the process again and enable the script as well.
|
|
| Back to top |
|
 |
PtitSerpent How do I cheat?
Reputation: 0
Joined: 17 Jun 2020 Posts: 9 Location: France, Normandy
|
Posted: Thu Jun 18, 2020 1:41 pm Post subject: |
|
|
Yep I did this, obviously , but it didn't work :/
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3349
|
Posted: Fri Jun 19, 2020 5:25 am Post subject: |
|
|
In that case, I think the code may be at a different location at each game start and you need to turn your script into what we call an AOB script.
It means that rather having an instruction replaced at a fixed address, you do an AOB scan - which will try to find the correct instruction and once found, you replace the instruction at that location.
|
|
| Back to top |
|
 |
PtitSerpent How do I cheat?
Reputation: 0
Joined: 17 Jun 2020 Posts: 9 Location: France, Normandy
|
Posted: Fri Jun 19, 2020 5:38 am Post subject: |
|
|
I'll try to find how to do this thanks
In Auto Assembler window, i found out that the "Injection Point" is not the same when i restart the game.
Ex :
| Code: |
aobscan(INJECT,89 88 2C 02 00 00 48 8B 46 10 0F) // should be unique
alloc(newmem,$1000,163BDC04)
|
Here, the "163BDC04" will change.
So is your statement correct ? The game change the location of this instruction each time I restart ?
The code below is what i use to activate the "No reload" cheat :
| Code: |
[ENABLE]
aobscan(INJECT,89 88 2C 02 00 00 48 8B 46 10 0F) // should be unique
alloc(newmem,$1000,163BDC04)
label(code)
label(return)
newmem:
code:
mov [rax+0000022C],1
jmp return
INJECT:
jmp newmem
nop
return:
registersymbol(INJECT)
[DISABLE]
INJECT:
db 89 88 2C 02 00 00
unregistersymbol(INJECT)
dealloc(newmem)
|
The code below is my instruction :
| Code: | | mov [rax+0000022C],1 |
I've just changed the "eax" to "1" (with that i always have an ammo in my rifle.
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3349
|
Posted: Fri Jun 19, 2020 6:52 am Post subject: |
|
|
Replace "163BDC04" wiith "INJECT", that will take care of the address changes.
Other than that, it should work now every time, as long as the AOB signature is unique and it is found.
Pretty solid work for someone with just 3 posts, congrats!
Here you will find some more templates - including the ones I use. *shameless advertisement*
And this hack here inserts more instructions into the comments - makes future updates somewhat easier, especially in case of dynamically generated code.
|
|
| Back to top |
|
 |
PtitSerpent How do I cheat?
Reputation: 0
Joined: 17 Jun 2020 Posts: 9 Location: France, Normandy
|
Posted: Fri Jun 19, 2020 7:52 am Post subject: |
|
|
| Csimbi wrote: | Replace "163BDC04" wiith "INJECT", that will take care of the address changes.
Other than that, it should work now every time, as long as the AOB signature is unique and it is found. |
You're a beast, it works like a charm !
| Csimbi wrote: |
Pretty solid work for someone with just 3 posts, congrats! |
It's really kind of you , but I'm a web developer so I already have some useful skills to quickly understand
| Csimbi wrote: | Here you will find some more templates - including the ones I use. *shameless advertisement*
And this hack here inserts more instructions into the comments - makes future updates somewhat easier, especially in case of dynamically generated code. |
Thanks for those links , I need more training for using it but I'm keeping it close at hand
I can make a wonderful trainer with that now !
|
|
| 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
|
|