 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
h3x1c Master Cheater
Reputation: 17
Joined: 27 Apr 2013 Posts: 306
|
Posted: Mon Aug 15, 2016 4:29 pm Post subject: Can we toggle flags in a CE script w/out using instructions? |
|
|
In the disassembler, you can right-click on an instruction's address and set a breakpoint to toggle a flag to whatever state you want upon execution of that instruction. Is there a way to mimic this behavior in a CE script?
To note, I consider myself advanced on the topic of using a plethora of instructions (PUSHF/POPF, LAHF/SAHF, CL*, ST*, etc.) to modify flag bits, so this question is purely in the scope of learning if CE has another way of doing it via scripting capabilities. (The question is probably more closely related to if CE can set breakpoints via a script, and if so, how would you do that and specify a flag to set upon execution of that instruction.)
Thanks!
_________________
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Mon Aug 15, 2016 4:39 pm Post subject: |
|
|
Yes, CE can set breakpoint using scripts.
With debug_setBreakpoint you can setup a breakpoint, and a custom function, or use the globally defined callback
Code: |
function debugger_onBreakpoint()
--if you handled it, return 1, else return 0
end
|
in a breakpoint handler for a you then have access to the EFLAGS register (or RFLAGS in 64-bit)
using binary operations you can manipulate it.
https://en.wikipedia.org/wiki/FLAGS_register
e.g to set ZF: EFLAGS=EFLAGS | (1 << 6)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
h3x1c Master Cheater
Reputation: 17
Joined: 27 Apr 2013 Posts: 306
|
Posted: Mon Aug 15, 2016 4:44 pm Post subject: |
|
|
Neat. Thanks, DB!
_________________
|
|
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
|
|