πŸ‘ Cpatch NoDelay

Posts 1–12 of 12 Β· Page 1 of 1
πŸ‘ Cpatch NoDelay
I made this tutorial so i desided to share something i learn ^^

Credits to my partner @kevin..


CPatch.h
Code:
#include "stdafx.h"
/*stdafx is where we have our defualt headers, if you don't have or use stdafx then add you includes: #include <headers> here*/

#pragma once

class cPatch
{
private:
DWORD ADR;
BYTE    OFF_BYTES[255];
BYTE ON_BYTES[255];
int     SIZE;
enum    PATCHSTATUS
{
NORMAL,
PATCHED,
};
int     STATUS;

void*    memcpy_s(void* pvAddress, const void* pvBuffer, size_t stLen);
public:
cPatch(DWORD pAdr,BYTE* pByte,int pSize);
void Patch();
void Restore();
};

CPatch.cpp
Code:
#include "CPatch.h"



void* cPatch::memcpy_s(void *pvAddress, const void *pvBuffer, size_t stLen)
{
MEMORY_BASIC_INFORMATION mbi;
VirtualQuery( ( void* )pvAddress, &mbi, sizeof( mbi ) );
VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect );
void* pvRetn = memcpy( ( void* )pvAddress, ( void* )pvBuffer, stLen );
VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect );
FlushInstructionCache( GetCurrentProcess( ), ( void* )pvAddress, stLen );
return pvRetn;
}

cPatch::cPatch(DWORD pAdr,BYTE* pByte,int pSize)
{
STATUS    =    NORMAL;
SIZE    =    pSize;
ADR     =    pAdr;

for(int i = 0; i < pSize; i++)
{
OFF_BYTES[i]    =    0x00;
ON_BYTES[i]     =    pByte[i];
}
}

void cPatch::Patch()
{
if( STATUS==NORMAL )
{
BYTE *pOFF_BYTES = (BYTE*)ADR;
for( int i = 0; i < SIZE; i++ )
{
OFF_BYTES[i] = pOFF_BYTES[i];
}
memcpy_s((void*)ADR,(const void*)ON_BYTES,SIZE);
STATUS=PATCHED;
}
}
void cPatch::Restore()
{
if(STATUS==PATCHED)
{
memcpy_s((void*)ADR,(const void*)OFF_BYTES,SIZE);
STATUS=NORMAL;
}
}

stdafx.h
Code:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//


#pragma once


#include "targetver.h"


#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>






// TODO: reference additional headers your program requires here


stdafx.cpp
Code:
// stdafx.cpp : source file that includes just the standard includes
// arttest.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information


#include "stdafx.h"


// TODO: reference any additional headers you need in STDAFX.H
// and not in this file



targetver.h
Code:
#pragma once


// Including SDKDDKVer.h defines the highest available Windows platform.


// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.


#include <SDKDDKVer.h>


Main.cpp
Code:
#include "stdafx.h
"#include <windows.h>
#include "CPatch.h"




#define ADR_Playerpointer     0x00
#define ADR_Serverpointer     0x00
#define ADR_NoDelay           0x00




BYTE NOP[8] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };






cPatch cNodelay(ADR_NoDelay, NOP, 2);






DWORD *ongame = (DWORD*)ADR_Playerpointer;
DWORD *outgame = (DWORD*)ADR_Serverpointer;






void NoDelay()
{
 if (GetAsyncKeyState(VK_LBUTTON))
 {
 
 cNodelay.Patch();
 }
 else
 {
 cNodelay.Restore();
 }
}






void HackThread()
{
 for (;;)
 {
  if (*ongame)
 {
  NoDelay()
 }
  if (*outgame)
 {


 }
 Sleep(200);
 }
}


BOOL __stdcall DllMain(HINSTANCE hDll, DWORD dwReason, LPVOID)
{
 if (dwReason == DLL_PROCESS_ATTACH)
 {
 CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0);
 MessageBoxA(NULL, " Coderz ", "Made By", MB_OK);
 }
 return TRUE;
}
Nice share
Thanks for sharing. But you dont need a Bypass now to use your hack?
Quote Originally Posted by Hindi93 View Post
Thanks for sharing. But you dont need a Bypass now to use your hack?
if you want to make your hack using asm use cpatch to make it undetected...
Quote Originally Posted by WhiteHat PH View Post

if you want to make your hack using asm use cpatch to make it undetected...
cpatch cannot help to make asm be undetected, if you use asm opk and other addys that are detected even though you will use cpatch it will detected after a minute,
well after you posted this i cannot even use other asm hacks like auto ammo anymore
Quote Originally Posted by kevin0152 View Post
well after you posted this i cannot even use other asm hacks like auto ammo anymore
true story.
Well seems im lucky i happen to find an alternative which make it possible for me to use my asm hacks again.
yup. some of asm addies are work's in cpatch it depends to your on/off bytes ...
in cpatch you do not need offbytes as it saves the off bytes in advance
Posts 1–12 of 12 Β· Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us