HotKey Base

Posts 1–15 of 32 · Page 1 of 3
HotKey Base

Hey Guys
this is a simple HotKeyBase HaveFun
now you can make your own hack
Code:
#include <windows.h>
#include <d3dx9.h>

#pragma message( "[www.MPGh.me] HotKeyBase CopyRight (C) \nE-Mail : Noobmem@hotmail0.com" )

typedef HRESULT ( WINAPI* oPresent ) ( LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion);
oPresent pPresent;

bool IsGameReadyForHook()
{
	if( GetModuleHandleA( "d3d9.dll"     ) != NULL 
		&& GetModuleHandleA( "ClientFX.fxd" ) != NULL 
		&& GetModuleHandleA( "CShell.dll"   ) != NULL )
		return true;
	return false;
}
void Memoria( void* pvAddress, void* pvBuffer, size_t len )
{
	if( *(BYTE*)pvAddress == *(BYTE*)pvBuffer )
		return;

	memcpy( ( void* )pvAddress, ( void* )pvBuffer, len );
}

bool bDataCompare(const BYTE* pData, const BYTE* bMask, const char* szMask) 
{ 
    for(;*szMask;++szMask,++pData,++bMask) 
        if(*szMask=='x' && *pData!=*bMask )  
            return false; 
    return (*szMask) == NULL; 
} 


DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask) 
{ 
    for(DWORD i=0; i < dwLen; i++) 
		if(bDataCompare( (BYTE*)( dwAddress+i ),bMask,szMask) ) 
            return (DWORD)(dwAddress+i); 
     
    return 0; 
}

// Kef... it's hard name xD
DWORD VTable(int index)
{
	DWORD* devicePtr = 0;
	
	DWORD hD3D9 = NULL;
	
	while(hD3D9 == NULL){
		Sleep(100);
		try
		{
		hD3D9 = (DWORD)GetModuleHandleA("d3d9.dll");}
		catch(...)
		{
			hD3D9 = NULL;
		}}

	DWORD addy = FindPattern(hD3D9, 0x1280000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
	Memoria (&devicePtr, (void*)(addy+2), 4);

	if(devicePtr == NULL){
		return 0;}

	return devicePtr[index];

}
void CPush(const char* cmd)
{
	_asm
	{
		PUSH cmd
		MOV EAX, 0x0485E40
		CALL EAX
		ADD ESP, 0x4
	}
}
void main() 
{

	CPush("ShowFps 1");
}

HRESULT WINAPI gellPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, 
						   CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
	_asm pushad;
	main();
	_asm popad;
	return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}

void *DetourCreate( BYTE *src, const BYTE *dst )
{
	int len = 5;

	BYTE *jmp = (BYTE*)malloc( len+5 );
	DWORD dwBack;
	VirtualProtect( src, len, PAGE_EXECUTE_READWRITE, &dwBack );
	memcpy( jmp, src, len );	
	jmp += len;
	jmp[0] = 0xE9;
	*(DWORD*)( jmp+1 ) = (DWORD)( src+len - jmp ) - 5;
	src[0] = 0xE9;
	*(DWORD*)( src+1 ) = (DWORD)( dst - src ) - 5;
	VirtualProtect( src, len, dwBack, &dwBack );

	return( jmp-len );
}

void Hook(void)
{
	DWORD dwPresent  = VTable(17);
	pPresent    = (oPresent)DetourCreate(( PBYTE)dwPresent, ( PBYTE )gellPresent);
}

DWORD WINAPI dwD3D9Thread(LPVOID)
{
	while( !IsGameReadyForHook() )
		Sleep(100);
	Hook();
	return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
	DisableThreadLibraryCalls(hDll);
	if ( dwReason == DLL_PROCESS_ATTACH )
	{
		CreateThread(NULL, NULL, dwD3D9Thread, NULL, NULL, NULL);
	}
	return TRUE;
}

Creetiz :
Gellin
Gordon`
kotentopf
@ton
@Zippolino
U Make C+P ?
Quote Originally Posted by S0aD View Post
U Make C+P ?
Yep because it's too fast :P
Quote Originally Posted by Alessandro10 View Post
Nice C+P
lol
as you like
change some things about it...don't make it straight c & p change some addies etc...
Quote Originally Posted by PashaAmd View Post
change some things about it...don't make it straight c & p change some addies etc...
well maybe you can do that instead getting other people to do it for you lazy ass..
#define Fucking_dumbass
Quote Originally Posted by DeadLinez View Post
well maybe you can do that instead getting other people to do it for you lazy ass..
#define Fucking_dumbass
what are you talking about i'm not OP
noob
Is the hook patched?
Quote Originally Posted by ac1d_buRn View Post
Is the hook patched?
it's work Perfect without any crashing
Quote Originally Posted by mo3ad001 View Post
it's work Perfect without any crashing
i will be the judge of that right now

EDIT: Tested and DC'd with my base.
FOR FUCK SAKES
Quote Originally Posted by ac1d_buRn View Post


i will be the judge of that right now

EDIT: Tested and DC'd with my base.
FOR FUCK SAKES
lol...


My views on this thread^^
Poor acid
Posts 1–15 of 32 · Page 1 of 3
This thread is closed for replies.

Tags for this Thread

None

Talk with us