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 


[Delphi] Help with Breakpoint (Change register at ... )

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

Joined: 24 Jun 2007
Posts: 37

PostPosted: Thu Sep 17, 2009 8:18 pm    Post subject: [Delphi] Help with Breakpoint (Change register at ... ) Reply with quote

Hi, i need help with this =x

I saw in CE "Change register at this location" , it can change a register without add any byte on memory... (great job).

I decided to try to do the same, i read some articles about it here, but i could not. I did:

CreateProcess or DebugActiveProcess (Debug_process). Change virtual protect (with VirtualProtectEx) on memory address for Page_guard (i tried page_noaccess too, didnt work), create a loop on WaitDebugEvent to get exceptions, but this dont work fine... When the program starts i get a exception (Exception_page_guard) , only this time... after no more.

Can someone help me? tell me what the possible errors. If you wanna see my source, i post.

Sorry english, Thanks.

_________________

Newbie cheater ;]
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Fri Sep 18, 2009 1:31 am    Post subject: Reply with quote

Im pretty sure Cheat Engine uses Debug Registers for that, check out SetThreadContext api's
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

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

PostPosted: Fri Sep 18, 2009 4:41 am    Post subject: Reply with quote

after each Exception_page_guard you have to set the page back to page_guard

and yes, you can also use hardware breakpoints

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

Joined: 24 Jun 2007
Posts: 37

PostPosted: Fri Sep 18, 2009 8:40 am    Post subject: Reply with quote

thanks , but i dont know what is wrong...

look:

Code:


CreateProcess - > Debug_process

After...
Address := $44D952;

VirtualProtectEx(pi.hProcess,Ptr(Address),1,page_guard,Old);

  while WaitForDebugEvent(Dbg, 1000) do
  begin

    case dbg.dwDebugEventCode of
   
      Exception_debug_event:
      Begin
        case Dbg.Exception.ExceptionRecord.ExceptionCode of
     
        exception_guard_page:
        Begin
         // when i set VPEx(Page_guard+page_readonly) on Exception_breakpoint here have 1 exception...
        // for test, showmessage();
        end;


        exception_breakpoint:
        Begin
      // Get 1 exception, if a set VirtualProtectEx(pi.hProcess,Ptr(Address),1,page_guard + page_readonly,Old) then
      // after Exception_debug_event register 1 exception too... but only this time.
      // if i dont seet page_guard + page_readonly it dont register nothing more.
        end;

      end;

  ContinueDebugEvent(Dbg.dwProcessId, Dbg.dwThreadId,DBG_CONTINUE);

 end;



i dont know why it dont works :\

_________________

Newbie cheater ;]
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

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

PostPosted: Fri Sep 18, 2009 10:06 am    Post subject: Reply with quote

try also setting it in exception_breakpoint

or better, before each continuedebugevent call just set the protection of that page just to be sure

also, problem with page_guard could be that your own readprocessmemory call is restoring it

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

Joined: 24 Jun 2007
Posts: 37

PostPosted: Fri Sep 18, 2009 4:36 pm    Post subject: Reply with quote

i am trying... but dont works... (im newbie ._.')

i tested VirtualProtectex... set page_readonly and tried change memory value, dont change (Ok it works).

But when i set page_guard dont have any exception. any idea?

Thanks Dark byte.

About my RPM is restoring it, maybe, but i dont how test/edit it.

_________________

Newbie cheater ;]
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