| View previous topic :: View next topic |
| Author |
Message |
natanreis1 Cheater
Reputation: 1
Joined: 01 Apr 2008 Posts: 44 Location: Somewhere over the rainbow
|
Posted: Fri Dec 12, 2008 12:09 pm Post subject: [help]SetThreadContext |
|
|
im using this script to edit memory but i want to Hack using SetThreadContext or Hardware Breakpoints
Procedure InjectPinTyper(Address:Cardinal; nCase:ShortInt); export;
const aInject:Array [0..2] of byte = ($0F, $83, $6C);//Modifies 1 BYTE, 85 to 83
aEject:Array [0..2] of byte = ($0F, $86, $6C);
Access = PROCESS_VM_WRITE or PROCESS_VM_OPERATION;
Begin
hWindow:=FindWindow('Class',Nil);
if hWindow=0 then
showmessage('Start the "Game"');
if hWindow<>0 then
case nCase of
1: //Inject PT
Try
GetWindowThreadProcessId(hWindow, @PID);
hProcess:=OpenProcess(Access, FALSE, PID);
WriteProcessMemory(hProcess, Ptr(Address), @aInject, sizeof(aInject), lpBytes);
CloseHandle(hProcess);
except
ShowMessageFmt('GetLastError Code: %.d', [IntToStr(GetLastError())]);
End;
2: //Eject PT
Try
GetWindowThreadProcessId(hWindow, @PID);
hProcess:=OpenProcess(Access, FALSE, PID);
WriteProcessMemory(hProcess, Ptr(Address), @aEject, sizeof(aEject), lpBytes);
CloseHandle(hProcess);
except
ShowMessageFmt('GetLastError Code: %.d', [IntToStr(GetLastError())]);
End;
End;
End;
Last edited by natanreis1 on Sun Jan 30, 2011 7:37 pm; edited 1 time in total |
|
| Back to top |
|
 |
Xeleron Grandmaster Cheater
Reputation: 0
Joined: 05 Jan 2008 Posts: 652
|
|
| Back to top |
|
 |
natanreis1 Cheater
Reputation: 1
Joined: 01 Apr 2008 Posts: 44 Location: Somewhere over the rainbow
|
Posted: Fri Dec 12, 2008 12:58 pm Post subject: |
|
|
| matthew2010 wrote: | maybe this can help you
|
i already searched
|
|
| Back to top |
|
 |
p99 Master Cheater
Reputation: 0
Joined: 21 Jan 2007 Posts: 271
|
Posted: Fri Dec 12, 2008 1:08 pm Post subject: |
|
|
How about looking at the CE source...
_________________
|
|
| Back to top |
|
 |
natanreis1 Cheater
Reputation: 1
Joined: 01 Apr 2008 Posts: 44 Location: Somewhere over the rainbow
|
Posted: Fri Dec 12, 2008 1:13 pm Post subject: |
|
|
setthreadcontext is very complicated.
can someone give me a example?
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Fri Dec 12, 2008 4:52 pm Post subject: |
|
|
Use SuspendThread to suspend all threads.
Use GetTHreadContext To Retrieve the context from a thread.
Modify the debug registers (DR0-DR3) to the address of violation.
Set DR7 to to on access.
Replace the context into the thread using SetThreadContext.
Watch for the access command when the command runs through.
Set the zf flag to 1.
Resume the thread that has accessed.
I got the first parts but I can't really get a listener for detecting access. How you do that has something to do with DR6... But Idk...
|
|
| Back to top |
|
 |
natanreis1 Cheater
Reputation: 1
Joined: 01 Apr 2008 Posts: 44 Location: Somewhere over the rainbow
|
Posted: Fri Dec 12, 2008 8:35 pm Post subject: |
|
|
| dnsi0 wrote: | Use SuspendThread to suspend all threads.
Use GetTHreadContext To Retrieve the context from a thread.
Modify the debug registers (DR0-DR3) to the address of violation.
Set DR7 to to on access.
Replace the context into the thread using SetThreadContext.
Watch for the access command when the command runs through.
Set the zf flag to 1.
Resume the thread that has accessed.
I got the first parts but I can't really get a listener for detecting access. How you do that has something to do with DR6... But Idk... |
thanks man u helped me a lot
|
|
| Back to top |
|
 |
|