Writing a [DISABLE] script

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
jmh
Cheater
Cheater
Posts: 31
Joined: Sun Dec 30, 2018 7:19 pm
Reputation: 20

Writing a [DISABLE] script

Post by jmh »

I am using mono dissection if that matters. I have written a script that nop outs a jl command. The original jl command is
CraftingWindowController:OnCraftButtonClicked+11f - jl CraftingWindowController:OnCraftButtonClicked+26b

The address resolves to different bytes every time the game is started. How do I get the address in my script so that I can restore it when the option is disabled?

Thanks,
JMH

User avatar
Chucky
Expert Cheater
Expert Cheater
Posts: 76
Joined: Thu Mar 08, 2018 4:01 pm
Reputation: 29

Re: Writing a [DISABLE] script

Post by Chucky »

Use readmem: [Link]

User avatar
SunBeam
Administration
Administration
Posts: 4932
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 4630

Re: Writing a [DISABLE] script

Post by SunBeam »

Your game uses Unity, thus IL, thus code compiled when needed. The reason these are not always constants..
CraftingWindowController:OnCraftButtonClicked+11f - jl CraftingWindowController:OnCraftButtonClicked+26b
..is the compiled code might use optimizations.

1) Try to write down that piece of code on every 5-6 runs of the game and see what and how it changes when you check it out in Memory View.

2) Check my script for BattleTech; I'm using a method to get to the prologue of the function (where it starts), then scanning for stuff inside the function to pin-point the location of my hook ;) Might work for you as well.

User avatar
Csimbi
RCE Fanatics
RCE Fanatics
Posts: 933
Joined: Sat Apr 29, 2017 9:04 pm
Reputation: 1320

Re: Writing a [DISABLE] script

Post by Csimbi »

jmh wrote:
Thu Jan 03, 2019 2:45 pm
I am using mono dissection if that matters. I have written a script that nop outs a jl command. The original jl command is
CraftingWindowController:OnCraftButtonClicked+11f - jl CraftingWindowController:OnCraftButtonClicked+26b

The address resolves to different bytes every time the game is started. How do I get the address in my script so that I can restore it when the option is disabled?

Thanks,
JMH
Why would you bother with that?
Just save a copy of the original code and restore that on disable.
That's my take on it anyway.
Saves a lot of headaches and works on all code, not just jumps.

Post Reply

Who is online

Users browsing this forum: No registered users