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 


AA untoggle script on {$except}

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
SirCabby
Newbie cheater
Reputation: 0

Joined: 31 Aug 2020
Posts: 15

PostPosted: Fri Sep 11, 2020 11:43 pm    Post subject: AA untoggle script on {$except} Reply with quote

So I've been working on a script that runs in a separate thread. Between levels the pointers get reset and are unresolvable until the next level loads. During this time my thread can throw an exception while trying to read those pointer values. This is fine, the thread dies and the game doesn't crash, however the checkbox on the script remains checked and the user won't know that it stopped working until it's too late. Retoggling it manually off/on will get it working again.

So my assumption is that I have 2 options:

1) Write some asm or lua that is able to tell the address / script to untoggle. I found some threads on this, but the only asm example I saw would keep the script from being able to turn on at all (by writing to unwritable memory address). From my limited CE LUA understanding, the LUA code would trigger before the asm so I can't inject random lua to the middle of the asm I have so far in the {$except} block. So is this path a dead end unless I convert to lua?

2) Write my script in a way that it doesn't crash on multi-level pointers being broken. I saw a video on multi-level pointers where the auther was doing cmp's on the address values to 0 before traversing deeper. You end up with a lot of:
Code:
mov edx,[edx+38]
cmp edx,0
je loop //reset to beginning of loop and try again


That seems like a lot of boilerplate to the code, maybe it would work but when I attempted this I either had a bug or it still failed in my example.

Any answers or advice greatly appreciated.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25820
Location: The netherlands

PostPosted: Sat Sep 12, 2020 12:14 am    Post subject: Reply with quote

1:instead of killing itself let the thread just wait for a few seconds and then try again from the start.

e.g call sleep and afterwards jump to the thread start address

2: Let the thread on normal run continuously increase a value (call it heartbeat) and in ce lua use a timer to see if the value has been increased
If not, disable the entry

(also, how does disabling your entry work? Do you even check the state before disabling it? Because freeing the memory of a thread that is still running can crash the game)

3: look at the lua code injection template

_________________
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
View user's profile Send private message MSN Messenger
SirCabby
Newbie cheater
Reputation: 0

Joined: 31 Aug 2020
Posts: 15

PostPosted: Sat Sep 12, 2020 3:11 pm    Post subject: Reply with quote

great ideas, tyvm
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