View previous topic :: View next topic |
Author |
Message |
feure How do I cheat?
Reputation: 0
Joined: 08 May 2016 Posts: 3
|
Posted: Fri Mar 22, 2019 7:07 pm Post subject: How to change one cheat entry based on another? |
|
|
So I have a cheat entry as a byte, and I want it to change to a specific value, dependent on the value of another byte cheat entry.
For example;
If A = 01 then B = 05
If A = 02 then B = 06
end
What the easiest way to achieve this with scripting and ensure it updates as the gam runs? thanks
|
|
Back to top |
|
 |
OldCheatEngineUser Whateven rank
Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Fri Mar 22, 2019 7:41 pm Post subject: |
|
|
can A go higher than 2? can A go lower than 1?
or do you want B to be whatever in A+4?
are A and B pointers? registered symbol? memory-location referenced by an instruction?
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
 |
feure How do I cheat?
Reputation: 0
Joined: 08 May 2016 Posts: 3
|
Posted: Fri Mar 22, 2019 7:49 pm Post subject: |
|
|
A and B can go from 00 to FF.
+4 is just an arbitrary example - want to be able to specify according to needs .
A and B are values in an address offset from a pointer.
|
|
Back to top |
|
 |
OldCheatEngineUser Whateven rank
Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Fri Mar 22, 2019 8:38 pm Post subject: |
|
|
it will be more efficient to use lua in this case, unless you are hooking the instruction then assembly is the choice.
since i cant write a single line in lua, i will do it in assembly.
the spawned thread will never return, and it might cause a crash upon disabling the script. (unless you specify a termination condition)
Code: | [enable]
alloc(newmem,$100)
createthread(newmem)
newmem:
lea esi,[[[[[["gamename.exe"+XXXXX]+offset1]+offset2]+offset3]+offset4]+offset5] // A // replace me (pointer)
lea edi,[[[[[["gamename.exe"+XXXXX]+offset1]+offset2]+offset3]+offset4]+offset5] // B // replace me (pointer)
mov al,byte [edi]
mov dl,byte [esi]
jmp short B_equal_A_plus_4 // jump where you want
B_plus_4: // B = B +4
add al,4
adc al,0
mov byte [edi],al
jmp short newmem
B_equal_A_plus_4: // B = A+4
add dl,4
adc dl,0
mov byte [edi],dl
jmp short newmem
[disable]
dealloc(newmem) |
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
 |
|