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 


DebugActiveProcess for a single thread?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Mon Oct 01, 2007 5:08 pm    Post subject: DebugActiveProcess for a single thread? Reply with quote

Two problems:

1) I need to be able to debug a single thread inside of the process debugging it (1 thread is the debugger/1 thread is the debuggee). I haven't been able to find a way to achieve this (If only DebugActiveThread() existed. Sad ). Looked through the React OS source and pages of google searches and no luck. I would think this is possible though because of the fact that it is the threads that run everything separately.

2) Building off of the last question: Is there anyway to fool the processor into single-stepping a single thread instead of the whole process?

I suppose if I can't get it to work I can just create a dummy process for this, but that is just messy.

Ring 0 or Ring 3 answers accepted.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Oct 01, 2007 5:26 pm    Post subject: Reply with quote

1: DebugActiveProcess suspends all threads of the process. Including the debugger. Also, each time a even happens, all threads suspended....

2: That is by default. You are only setting the single step flag in the debugger thread context. Of course, each time it's paused, all other threads will be paused as well.

I recommend a dummy process, or write your own int1 handler, and on breakpoint let the thread that causes it go into a waitforevent state

_________________
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
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Mon Oct 01, 2007 5:39 pm    Post subject: Reply with quote

Dark Byte wrote:
1: DebugActiveProcess suspends all threads of the process. Including the debugger. Also, each time a even happens, all threads suspended....


Dang, I was hoping there was a way to stop all the other threads pausing each time there was an exception generated.

Dark Byte wrote:
2: That is by default. You are only setting the single step flag in the debugger thread context. Of course, each time it's paused, all other threads will be paused as well.


I suppose I should have been clearer as to that aspect. I knew that the exception caused all of the threads to pause. A different way of phrasing it would be: How do I stop the other threads from pausing when I set the trap flag? I suppose my answer to that though would be writing my own int1 handler like you said. I think I am going to use a dumby process first and in a later build I will add the int1 handler.

Thanks for the reply.

Edit: After reading an article on hooking int1 it seems easier than I thought. I am just going to do that.
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 programming 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