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 


help with hardware breakpoint

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

Joined: 19 Sep 2011
Posts: 16

PostPosted: Sat Jan 21, 2012 9:43 am    Post subject: help with hardware breakpoint Reply with quote

i'm newbie and, i need make a dll for change EAX at breakpoint in a adress, i tryied to code, but did not work

see


Code:

procedure Debug;
var
  Event: DEBUG_EVENT;
  Adress: Pointer;
  Thread: THandle;
  Context: TContext;
begin
  Adress:=Pointer($004932A3);
  Thread:=GetCurrentThread;
  repeat
    WaitForDebugEvent(Event,INFINITE);
    if (Event.Exception.ExceptionRecord.ExceptionCode=EXCEPTION_SINGLE_STEP) then begin
      if (Event.Exception.ExceptionRecord.ExceptionAddress=Adress) then begin
        if (Thread=OpenThread(THREAD_ALL_ACCESS, false, Event.dwThreadId)) then begin
          Context.ContextFlags:= CONTEXT_FULL;
          GetThreadContext(Thread, Context);
          Form1.Memo1.Lines.Add(inttostr(DWORD(Event.Exception.ExceptionRecord.ExceptionAddress)));
          CloseHandle(Thread);
        end;
      end;
    end;
    ContinueDebugEvent(Event.dwProcessId, Event.dwThreadId, DBG_CONTINUE);
  until
  3=4;
end;


what is the problem? help me please guys c'mon
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Sat Jan 21, 2012 9:49 am    Post subject: Reply with quote

a dll may not use the Debug api

If you intent on using a dll try an exception handler instead

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
sonexa
Newbie cheater
Reputation: 0

Joined: 19 Sep 2011
Posts: 16

PostPosted: Sat Jan 21, 2012 9:49 am    Post subject: Reply with quote

where I can read about it?
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Mon Jan 23, 2012 7:36 pm    Post subject: Reply with quote

sonexa wrote:
where I can read about it?

Register a vectored exception handler using AddVectoredExceptionHandler, and then modify the debug registers in every thread using SetThreadContext.

See chapter 17.2 in volume 3B of the Intel developer manuals for further details.
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