ghost recon anti ban(punk buster block)
this is the source i used to on punk buster (bf3, codbo2, codmw3, and most games on steam)
this is not to bypass it is undetected by punkbuster
Code:
void SetBreak(DWORD address1,DWORD address2,DWORD address3,DWORD address4)
{
HANDLE thSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, NULL);
THREADENTRY32 te;
te.dwSize = sizeof(THREADENTRY32);
Thread32First(thSnap, &te);
do
{
if(te.th32OwnerProcessID != GetCurrentProcessId())continue;
if(te.th32ThreadID != GetCurrentThreadId())
{
HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, te.th32ThreadID);
SuspendThread(hThread);
__try
{
CONTEXT ctx;
ct*****ntextFlags = CONTEXT_DEBUG_REGISTERS;
GetThreadContext(hThread, &ctx);
if(address1!=0)
{
ctx.Dr0 = address1;
ctx.Dr7 |= 0x1;
}
if(address2!=0)
{
ctx.Dr1 = address2;
ctx.Dr7 |= 0x4;
}
if(address3!=0)
{
ctx.Dr2 = address3;
ctx.Dr7 |= 0x10;
}
if(address4!=0)
{
ctx.Dr3 = address4;
ctx.Dr7 |= 0x40;
}
ct*****ntextFlags = CONTEXT_DEBUG_REGISTERS;
SetThreadContext(hThread, &ctx);
}
__except(EXCEPTION_EXECUTE_HANDLER){};
ResumeThread(hThread);
CloseHandle(hThread);
}
}
while(Thread32Next(thSnap, &te));
}
Code:
LONG CALLBACK ExceptionHandler(EXCEPTION_POINTERS *pInfo)
{
if( (DWORD)pInfo->ExceptionRecord->ExceptionAddress == 0xAdress draw2D)
{
{
// Draw Visual
for( int i = 0; i < 64 ; i++ )
{
if(pClient[i].Team != pClient[cg->clientNum].Team || pCleint[i].Team == TEAM_F)
{
if( pEnt[i].isAlive == 1 && pEnt[i].clientNum != cg->clientNum )
{
if( pEnt[i].currentValid && pClient[i].infoValid && pClient[i].Team != TEAM_SPECT )
{
// Draw Esp
}
}
}
}
}
pInfo->ContextRecord->Esp-=4;//push EBP (1)
*(DWORD*)pInfo->ContextRecord->Esp = pInfo->ContextRecord->Ebp;//push EBP (2)
pInfo->ContextRecord->Eip+=1;
return EXCEPTION_CONTINUE_EXECUTION;
}
this will bypass punkbuster games only!!!!!!
(HOPE I WONT GET BANNED FOR THIS)