| View previous topic :: View next topic |
| Author |
Message |
NooBpluSS Cheater
Reputation: 0
Joined: 24 Jun 2007 Posts: 37
|
Posted: Thu Sep 17, 2009 8:18 pm Post subject: [Delphi] Help with Breakpoint (Change register at ... ) |
|
|
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 |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Fri Sep 18, 2009 1:31 am Post subject: |
|
|
| Im pretty sure Cheat Engine uses Debug Registers for that, check out SetThreadContext api's
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25984 Location: The netherlands
|
Posted: Fri Sep 18, 2009 4:41 am Post subject: |
|
|
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 |
|
 |
NooBpluSS Cheater
Reputation: 0
Joined: 24 Jun 2007 Posts: 37
|
Posted: Fri Sep 18, 2009 8:40 am Post subject: |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25984 Location: The netherlands
|
Posted: Fri Sep 18, 2009 10:06 am Post subject: |
|
|
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 |
|
 |
NooBpluSS Cheater
Reputation: 0
Joined: 24 Jun 2007 Posts: 37
|
Posted: Fri Sep 18, 2009 4:36 pm Post subject: |
|
|
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 |
|
 |
|