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 


Attaching debugger

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

Joined: 22 Jun 2006
Posts: 98

PostPosted: Sat Jun 24, 2006 2:35 pm    Post subject: Attaching debugger Reply with quote

Hi,

Could someone explain how CE attaches its debugger? The UCE that I made could read/write to maple's memory without problem, but attaching debugger doesn't work.

From the sourcecode, It looks like CE created a debugger thread, and attaches this thread to other process' context. One thing that confused me though is that the debugger thread is implemented in usermode in pascal.

Before, I thought this had something to do with KeAttachProcess, but I realized the thread must be a kernel thread.

So, now, I am kinda lost in debugger.pas.. I haven't touched pascal for a few years.

Few specific question:
1. Is debug registers process specific or thread specific?
2. There is a variable debuggerthread2, what is this? From what I know, we could only attach 1 debugger.
3. Does gameguard found the debugger using signature detection or is it monitoring some kernel data structure?
4. What are the differences between the 2 TDebugger constructor?
5. What does TDebugger.execute do? It's such a huge procedure..

--- I'm posting this here because this is not bypass-specific, and posts in other forums get buried too quickly.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Jun 24, 2006 2:41 pm    Post subject: Reply with quote

there are 2 debuggers.
The standard usermode debugger (won't work for nprotected games)
and the kernelmode debugger (sometimes works)

The standard debugger uses variable debuggerthread, that is a normal usermode debugger, which uses the default windows debug api

the kerneldebugger uses debuggerthread2 , which is used for reading out the log when using "find out what accesses/writes to address xxx"
for changing registers only the processwatcher is used which watches the threads being created.
Besides that the kernel is told to watch for certain debug events, and when they happen it changes the registers without any usermode interaction

.execute in a thread object is the main thread code. It's the code that gets executed in the thread, in this case it's the debugger loop (see it like a windows message loop, waiting for a event and then acting on it, but then for a debugger)

_________________
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
whateve12
Advanced Cheater
Reputation: 0

Joined: 22 Jun 2006
Posts: 98

PostPosted: Sat Jun 24, 2006 2:52 pm    Post subject: Reply with quote

Thanks a lot for the fast reply, it really helps =)
Back to top
View user's profile Send private message
whateve12
Advanced Cheater
Reputation: 0

Joined: 22 Jun 2006
Posts: 98

PostPosted: Sun Jun 25, 2006 2:43 am    Post subject: Reply with quote

I finally managed to attach the kernel debugger to change register on breakpoint. Turns out, gameguard was hooking ioctl and intercepted some commands.

Now, I guess the only problem left is to figure out why the handler (GeneralHandler IIRC) wasn't called on breakpoint. It worked on a test program, but not on maple. What could be going on here?

edit: solved... turns out the function name was the problem. I expected something more elaborate from gameguard -_-
Back to top
View user's profile Send private message
whateve12
Advanced Cheater
Reputation: 0

Joined: 22 Jun 2006
Posts: 98

PostPosted: Tue Jul 04, 2006 9:41 pm    Post subject: Reply with quote

I have another question on debug register:

What happens to the debug registers when a process is terminated? If breakpoints are process specific, how come CE still holds the breakpoints even after the opened process is already terminated?

Also, other process opened by CE seems to 'inherit' all breakpoints from the previous process. (But the breakpoints doesn't seem to work.) This is weird indeed, and easily fixed by a reboot.

It might just because of incorrect source editing though, I'll have to check this using release version of CE.

Edit: nevermind, I forgot about DR7
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source 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