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 


[bug?] windows dbg cant attach after unpause

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
reverser69
Expert Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 112

PostPosted: Sun May 26, 2024 4:23 pm    Post subject: [bug?] windows dbg cant attach after unpause Reply with quote

hi

i encountered a problem and I'm not sure if its a bug.
i pause the process using the button in "advanced options". then unpause and then i try to attach to that process using windows debugger.
by doing so, cheat engine shows "attach time out" infinitely.
i tried using "NtSuspendThread" and getting the same result.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 463

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

PostPosted: Sun May 26, 2024 4:41 pm    Post subject: Reply with quote

I can't reproduce it.

Perhaps it's a config on your system or something. Try pressing the print screen button on your keyboard. Does the whole system freeze for a minute ?

_________________
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
reverser69
Expert Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 112

PostPosted: Sun May 26, 2024 5:05 pm    Post subject: Reply with quote

tried and no freezing.


btw, is "CEP_PAUSE pause" is CE sdk the same as pausein advanced options?
maby using it will fix everything.


edit:
i guess i found it.
does CE check "peb->isbeingdebuged" to determine if the debugger successfully attached to the target?

i am trying to write a plugin. in it, i am using debugEvent callback to reset peb->isbeingdebuged flag. i think it creates an infinite loop.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 463

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

PostPosted: Mon May 27, 2024 12:05 am    Post subject: Reply with quote

CE doesn't but windows does

it won't send any debug events to CE when peb->isBeingDebugged is false

_________________
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
reverser69
Expert Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 112

PostPosted: Mon May 27, 2024 12:29 am    Post subject: Reply with quote

thanks for the confirmation.

i have another idea of using exported "pause" function.
is there any way of finding out if a process is already paused? if so call unpause?

edit:
i tried calling "unpause" exported function on an already un-touched process and everything seems good. is it a safe practice?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 463

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

PostPosted: Mon May 27, 2024 12:42 am    Post subject: Reply with quote

try experimenting with ntSuspendThread followed by ntResumeThread on the main thread.

if it returns 1+ it was frozen

_________________
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
reverser69
Expert Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 112

PostPosted: Mon May 27, 2024 1:28 am    Post subject: Reply with quote

well my idea was to suspend the app and resume it at other debug events to let the window debugger initialize.
when debugging in VS, this works. but when i execute the plugin normally, suspension interferes with debug events workflow. i think i cant do it this way.


another idea is to start patching peb at "EXIT_THREAD_DEBUG_EVENT" event.
with the theory of CE's 'Debugger thread' thread has done everything necessary and terminates before target application gets a chance to execute any code. am i correct?


is there any way (lua or c++) that i could use to determine if the debugger is done attaching and then start my patch?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 463

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

PostPosted: Mon May 27, 2024 3:40 am    Post subject: Reply with quote

the plugin system does support hooking into the waitfordebugevent function , you could watch that for what you need
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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