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 


Debug Register breakpoint weir behaviour.

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

Joined: 09 Apr 2006
Posts: 29

PostPosted: Sun Oct 01, 2006 6:52 am    Post subject: Debug Register breakpoint weir behaviour. Reply with quote

Hi there Very Happy ,

I don't know why in order for debug register to work I must restart CE if I restart the debuggee.

CE debug register breakpoint working perfectly only for the first time, if I closed the application and restart, and reattached, I saw the debug breakpoint still appear in memory browser, but the register doesn't change at the breakpoint, no matter how I delete the breakpoint and enable it back, it is still not working, it is only working after I restart CE and reattached to the debuggee.

The following debug traces in DebugView are captured for the first time.
Going to enable the debugger to set a change reg breakpoint on ProcessID 2532(9e4) for debugreg0

This is one caused by me. Changing the registers
2=246
eax=1
ebx=0
EIP=40251a
PEFLAGS=AE4B0DD4
EFLAGS=246
-------
DR_7.L0=1
DR_7.L1=1
DR_7.L2=1
DR_7.L3=1
DR_6.B0=1
DR_6.B1=0
DR_6.B2=0
DR_6.B3=0
BP number = 0
Changing EDX from 1234 to 5555
Setting the resume flag and continue.


I only saw one line of debug trace if I reattached to the restart application after reenable the same breakpoint:

Going to enable the debugger to set a change reg breakpoint on ProcessID 1752(6d8) for debugreg0

Seem like breakpoint int 1 doesn't trigger on second attached. And why breakpoint still exist in second instance.

Appreciate anybody if can guide me where to look for in the source code that needed changes.
Back to top
View user's profile Send private message
yoyoyip
Cheater
Reputation: 0

Joined: 09 Apr 2006
Posts: 29

PostPosted: Tue Oct 03, 2006 3:40 pm    Post subject: Reply with quote

Code:
procedure TDebugevents.setbreakpoints;
var i: integer;
begin
  debugregs.ContextFlags:=CONTEXT_DEBUG_REGISTERS;
  debugregs.Dr7:=reg0set or reg1set or reg2set or reg3set;

  debugregs.Dr0:=breakpoints[0];
  debugregs.dr1:=breakpoints[1];
  debugregs.dr2:=breakpoints[2];
  debugregs.Dr3:=breakpoints[3];

  for i:=0 to length(threadlist)-1 do
  begin
    suspendthread(threadlist[i]);
    setthreadcontext(threadlist[i],debugregs);
    resumethread(threadlist[i]);
  end;
end;


threadlist still kept the old threads eventhough we attached to new process, it failed to set the debug register correctly for the new thread.
Problem solved after retrieving new thread list from the newly attached process.
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