| View previous topic :: View next topic |
| Author |
Message |
sonexa Newbie cheater
Reputation: 0
Joined: 19 Sep 2011 Posts: 16
|
Posted: Sat Apr 28, 2012 10:08 am Post subject: looking for a coder |
|
|
| i'm looking for a coder, to place a breakpoint in an adress and when active change the EAX register, i'm pay with Paypal. |
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
|
| Back to top |
|
 |
sonexa Newbie cheater
Reputation: 0
Joined: 19 Sep 2011 Posts: 16
|
Posted: Sat Apr 28, 2012 11:16 am Post subject: |
|
|
| I've tried and failed, i need it in a dll |
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Sat Apr 28, 2012 11:23 am Post subject: |
|
|
| sonexa wrote: | | I've tried and failed, i need it in a dll |
See AddVectoredExceptionHandler. |
|
| Back to top |
|
 |
sonexa Newbie cheater
Reputation: 0
Joined: 19 Sep 2011 Posts: 16
|
Posted: Sat Apr 28, 2012 11:30 am Post subject: |
|
|
can you say what i need to do?
AddVectoredExceptionHanler>??>??>?? |
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Sat Apr 28, 2012 11:35 am Post subject: |
|
|
| sonexa wrote: | can you say what i need to do?
AddVectoredExceptionHanler>??>??>?? |
It depends on which type of breakpoint you wish to set. |
|
| Back to top |
|
 |
sonexa Newbie cheater
Reputation: 0
Joined: 19 Sep 2011 Posts: 16
|
Posted: Sat Apr 28, 2012 11:39 am Post subject: |
|
|
set the breakpoint at adress $000001
when active, change the EAX to $01
continue
what the breakpoint type i'll need? |
|
| Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Sat Apr 28, 2012 12:52 pm Post subject: |
|
|
| sonexa wrote: | set the breakpoint at adress $000001
when active, change the EAX to $01
continue
what the breakpoint type i'll need? |
Try a hardware breakpoint.
Untested example code:
| Code: | // Made by Innovation of CEF
#define dwAddress 0x00000001
#define dwReturnAddress ?
#define dwValue 0x00000001
#include <windows.h>
#include <tchar.h>
PVOID hVectoredExceptionHandler = NULL;
bool HardwareBreakpoint(__in bool bEnable)
{
DWORD dwProcessIdentifier = GetCurrentProcessId();
DWORD dwThreadIdentifier = GetCurrentThreadId();
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
if(hSnapshot != INVALID_HANDLE_VALUE)
{
THREADENTRY32 ThreadEntry32;
ThreadEntry32.dwSize = sizeof(THREADENTRY32);
if(Thread32First(hSnapshot, &ThreadEntry32))
{
CONTEXT Context;
Context.ContextFlags = CONTEXT_DEBUG_REGISTERS;
do
{
if((ThreadEntry32.th32OwnerProcessID == dwProcessIdentifier) && (ThreadEntry32.th32ThreadID != dwThreadIdentifier))
{
SuspendThread(ThreadEntry32.th32ThreadID);
GetThreadContext(ThreadEntry32.th32ThreadID, &Context);
if(bEnable)
{
Context.Dr0 = dwAddress;
Context.Dr7 |= 0x00000001;
Context.Dr7 &= 0xFFF0FFFD; // ~((1 << 1) | (15 << 16))
}
else
{
Context.Dr0 = 0;
Context.Dr7 &= 0xFFFFFFFC; // ~3
}
SetThreadContext(ThreadEntry32.th32ThreadID, &Context);
ResumeThread(ThreadEntry32.th32ThreadID);
}
}
while(Thread32Next(hSnapshot, &ThreadEntry32));
}
CloseHandle(hSnapshot);
return true;
}
return false;
}
__declspec(naked) void WINAPI OriginalInstruction()
{
__asm
{
/* Original Instruction */
mov eax, dwValue
jmp dword ptr ds:[dwReturnAddress]
}
}
LONG CALLBACK VectoredExceptionHandler(__in PEXCEPTION_POINTERS pExceptionPointers)
{
if((pExceptionPointers->ExceptionRecord->ExceptionCode == EXCEPTION_SINGLE_STEP) && (pExceptionPointers->ExceptionRecord->ExceptionAddress == dwAddress))
{
pExceptionPointers->ContextRecord->Eip = (DWORD)OriginalInstruction;
return EXCEPTION_CONTINUE_EXECUTION;
}
return EXCEPTION_CONTINUE_SEARCH;
}
DWORD WINAPI Main(__in PVOID pParameter)
{
hVectoredExceptionHandler = AddVectoredExceptionHandler(1, (PVECTORED_EXCEPTION_HANDLER)VectoredExceptionHandler);
if(hVectoredExceptionHandler != NULL)
{
if(HardwareBreakpoint(true))
{
return 0;
}
#ifdef _DEBUG
else
{
OutputDebugString(_T("[Error] Failed to install hardware breakpoint."));
}
#endif
}
#ifdef _DEBUG
else
{
OutputDebugString(_T("[Error] Failed to add vectored exception handler."));
}
#endif
return -1;
}
BOOL WINAPI DllMain(__in HMODULE hModule, __in DWORD dwReason, __in PVOID pReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hModule);
if(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Main, NULL, 0, NULL) != NULL)
{
return TRUE;
}
#ifdef _DEBUG
else
{
OutputDebugString(_T("[Error] Failed to create main thread."));
}
#endif
}
else if(dwReason == DLL_PROCESS_DETACH)
{
if(HardwareBreakpoint(false))
{
if((hVectoredExceptionHandler != NULL) && (RemoveVectoredExceptionHandler(hVectoredExceptionHandler) != 0))
{
return TRUE;
}
#ifdef _DEBUG
else
{
OutputDebugString(_T("[Error] Failed to remove vectored exception handler."));
}
#endif
}
#ifdef _DEBUG
else
{
OutputDebugString(_T("[Error] Failed to uninstall hardware breakpoint."));
}
#endif
}
return FALSE;
} |
It assumes that the first debug register is not already in use.
Last edited by Innovation on Fri May 25, 2012 10:57 pm; edited 9 times in total |
|
| Back to top |
|
 |
sonexa Newbie cheater
Reputation: 0
Joined: 19 Sep 2011 Posts: 16
|
Posted: Sat Apr 28, 2012 1:18 pm Post subject: |
|
|
| ok, i'll try port to delphi |
|
| Back to top |
|
 |
|