Nightmare HotKey 2.0

Posts 17 of 7 · Page 1 of 1
Nightmare HotKey 2.0
Nightmare HotKey 2.0

• Code does not crash and lag;
• Tested in windows 7 - 64 bits;
• To use it in CAEU, CABR or CAKO, you only need change the adresses;
• The Code is without errors and bugs.

Features:

NUMPAD0 - Rapid Fire
NUMPAD1 - NoFog
NUMPAD2 - NX Chams
NUMPAD3 - Pickup
NUMPAD4 - NoSpread
NUMPAD5 - Fps
NUMPAD6 - NameTags
NUMPAD7 - NoRecoil
NUMPAD8 - WeaponRange
NUMPAD9 - SuperBullets/ShootThroughWalls


Scan 1
Scan 2


Code:
/***********Nightmare HotKey 2.0************************************************/


/***********Créditos************************************************************/
/******Nightmare, luizimloko, TokolocoSK, Gordon', Entourage, Gellin************/
/*******************************************************************************/

#include <windows.h>
#include <stdio.h>
#include <d3dx9.h>
#pragma comment( lib, "nod3dx9.lib" )

//Addresses CANA
#define DeviceGame      0x009118A0
#define GlassWalls      0x0057301A
#define DIPEngine       0x006A3E1A
#define DrawPrimitive   0x00805974
#define LTClientEXE     0x00486030
#define LTClientDLL     0x37814EB8
#define GameStatus      0x3782A118
#define EspName1        0x37306A79
#define EspName2        0x37306AFF
#define NoRecoil        0x373B619C
#define NoReload        0x37433034
#define SuperBullets    0x3742DB7D
#define WeaponRange1    0x374332B9
#define WeaponRange2    0x37433639
#define PlayerRandom    0x37860678
#define RapidFire       0x37433D35
#define WeaponManager   0x3785C8FC
#define PlayerByIndex   0x371561F0



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

BOOL IsGameReadyForHook(void)
{
	if(GetModuleHandle("d3d9.dll") != NULL 
	&& GetModuleHandle("ClientFX.fxd") != NULL 
	&& GetModuleHandle("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; 
}

DWORD Ngm_GetPointer(int Begin)
{
	DWORD *Device = ***(DWORD ****)DeviceGame;

	if(Device == NULL)
		return 0;

	return Device[Begin];
}

void __stdcall Ngm_ConsolePush( const char* Ngm_Command)
{
	DWORD* Ngm_Addr = ( DWORD* ) LTClientEXE;
	if(*(BYTE*)GameStatus == 1) 
	{
	__asm
	{
		Pushad;
		Push Ngm_Command
		call Ngm_Addr
		add esp, 0x4
		Popad;
		}
	}
}

//Variables
int cchams, cfog, cpick, cpickx1, cnames, crecoil, cspread,cspreadx1, cfps, cweaponrange, csuperbullets, crapidfire;
bool bfog, bchams, bpick, bspread, bfps, bnames, brecoil, bweaponrange, bsuperbullets, brapidfire;

void Ngm_Main(void) 
{
	if (GetAsyncKeyState(VK_NUMPAD1)&1) cfog = !cfog;
	if(cfog)
		{
			if(!bfog)
			{
				Ngm_ConsolePush("FogEnable    0.0");
				bfog = true;
			}
		}
		else
		{
			if(bfog)
			{
				Ngm_ConsolePush("FogEnable    1.0");
				bfog = false;
			}
		}

	
	if (GetAsyncKeyState(VK_NUMPAD2)&1) cchams = !cchams;
	if(cchams)
		{
			if(!bchams)
			{
				Ngm_ConsolePush("SkelModelStencil     1.0");
				bchams = true;
			}
		}
		else
		{
			if(bchams)
			{
				Ngm_ConsolePush("SkelModelStencil     0.0");
				bchams = false;
			}
		}

	if (GetAsyncKeyState(VK_NUMPAD3)&1) cpick = !cpick;
	if(cpick)
		{
			if(!bpick)
			{
				Ngm_ConsolePush("ActivationDistance   99999.0");
				bpick = true;
			}
		}
		else
		{
			if(bpick)
			{
				Ngm_ConsolePush("ActivationDistance   100.0");
				bpick = false;
			}
		}

	if (GetAsyncKeyState(VK_NUMPAD4)&1) cspread = !cspread;
	if(cspread)
		{
			if(!bspread)
			{
				Ngm_ConsolePush("PerturbRotationEffect   0.000000" );
				Ngm_ConsolePush("PerturbIncreaseSpeed   0.000000" );
				Ngm_ConsolePush("PerturbWalkPercent   0.000000" );
				Ngm_ConsolePush("PerturbFiringIncreaseSpeed   0.000000" );
				Ngm_ConsolePush("PerturbRecoil   0.000000" );
				Ngm_ConsolePush("FireMovePerturb   0.000000" );
				Ngm_ConsolePush("ZoomedFireMoveDuckPerturb   0.000000" );
				Ngm_ConsolePush("ZoomedFireMovePerturb   0.000000" );
				Ngm_ConsolePush("ZoomedFireDuckPerturb   0.000000" );
				bspread = true;
			}
		}
		else
		{
			if(bspread)
			{
				Ngm_ConsolePush("PerturbRotationEffect   3.000000" );
				Ngm_ConsolePush("PerturbIncreaseSpeed   3.000000" );
				Ngm_ConsolePush("PerturbWalkPercent   9.000000" );
				Ngm_ConsolePush("PerturbFiringIncreaseSpeed   0.500000" );
				Ngm_ConsolePush("PerturbRecoil   9.000000" );
				Ngm_ConsolePush("FireMovePerturb   9.000000" );
				Ngm_ConsolePush("ZoomedFireMoveDuckPerturb   9.000000" );
				Ngm_ConsolePush("ZoomedFireMovePerturb   9.000000" );
				Ngm_ConsolePush("ZoomedFireDuckPerturb   9.000000" );
				bspread = false;
			}
		}

	if (GetAsyncKeyState(VK_NUMPAD5)&1) cfps = !cfps;
	if(cfps)
		{
			if(!bfps)
			{
				Ngm_ConsolePush("ShowFps   1.0");
				bfps = true;
			}
		}
		else
		{
			if(bfps)
			{
				Ngm_ConsolePush("ShowFps   0.0");
				bfps = false;
			}
		}

	if (GetAsyncKeyState(VK_NUMPAD6)&1) cnames = !cnames;
	if ((*(BYTE *)GameStatus == 1) && cnames) {
			if(!bnames)
			{
				memcpy((void *)EspName1, (void *)(PBYTE)"\x90\x90", 2);
				memcpy((void *)EspName2, (void *)(PBYTE)"\x90\x90", 2);
				bnames = true;
			}
		}
		else
		{
			if(bnames)
			{
				memcpy((void *)EspName1, (void *)(PBYTE)"\x75\x05", 2);
				memcpy((void *)EspName2, (void *)(PBYTE)"\x75\x05", 2);
				bnames = false;
			}
		}

	if (GetAsyncKeyState(VK_NUMPAD7)&1) crecoil = !crecoil;
	if ((*(BYTE *)GameStatus == 1) && crecoil) {
			if(!brecoil)
			{
				memcpy((void *)NoRecoil, (void *)(PBYTE)"\x90\x90\x90\x90", 4);
				brecoil = true;
			}
		}
		else
		{
			if(brecoil)
			{
				memcpy((void *)NoRecoil, (void *)(PBYTE)"\xD9\x44\x24\x14", 4);
				brecoil = false;
			}
		}

	if (GetAsyncKeyState(VK_NUMPAD8)&1) cweaponrange = !cweaponrange;
	if ((*(BYTE *)GameStatus == 1) && cweaponrange) {
			if(!bweaponrange)
			{
				memcpy((void *)WeaponRange1, (void *)(PBYTE *)"\xB8\x00\x00\x00\x10\x90", 6);
				memcpy((void *)WeaponRange2, (void *)(PBYTE *)"\xB8\x00\x00\x00\x10\x90", 6);
				bweaponrange = true;
			}
		}
		else
		{
			if(bweaponrange)
			{
				memcpy((void *)WeaponRange1, (void *)(PBYTE *)"\x8B\x80\xD4\x02\x00\x00", 6);
				memcpy((void *)WeaponRange2, (void *)(PBYTE *)"\x8B\x80\xD4\x02\x00\x00", 6);
				bweaponrange = false;
			}
		}

	if (GetAsyncKeyState(VK_NUMPAD9)&1) csuperbullets = !csuperbullets;
	if ((*(BYTE *)GameStatus == 1) && csuperbullets) {
			if(!bsuperbullets)
			{
				memcpy((void *)SuperBullets, (void *)(PBYTE)"\x90\x90\x90", 3);
				bsuperbullets = true;
			}
		}
		else
		{
			if(bsuperbullets)
			{
				memcpy((void *)SuperBullets, (void *)(PBYTE)"\x0F\x94\xC0", 3);
				bsuperbullets = false;
			}
		}

	if (GetAsyncKeyState(VK_NUMPAD0)&1) crapidfire = !crapidfire;
	if ((*(BYTE *)GameStatus == 1) && crapidfire) {
			if(!brapidfire)
			{
				memcpy((void *)RapidFire, (void *)(PBYTE) "\x90\x90", 2);
				brapidfire = true;
			}
		}
		else
		{
			if(brapidfire)
			{
				memcpy((void *)RapidFire, (void *)(PBYTE) "\x74\x3E", 2);
				brapidfire = false;
				}
		}
}

HRESULT __stdcall gellPresent(LPDIRECT3DDEVICE9 pDevice, const RECT *pSourceRect,
const RECT *pDestRect, HWND hDestWindowOverride, const RGNDATA *pDirtyRegion)
{
	_asm pushad;
	Ngm_Main();
	_asm popad;
	return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}

void *Ngm_DetourCreate( BYTE *src, const BYTE *dst, const int len )
{
	unsigned int Ngm_Pointers[] = { 0xE9 };
	DWORD dwBack;
	BYTE *jmp = (BYTE*)malloc( len + 5 );
	VirtualProtect( src, len, PAGE_EXECUTE_READWRITE, &dwBack );
	memcpy( jmp, src, len );	
	jmp += len;
	jmp[0] = Ngm_Pointers[0];
	*(DWORD*)( jmp+1 ) = (DWORD)( src+len - jmp ) - 5;
	src[0] = Ngm_Pointers[0];
	*(DWORD*)( src+1 ) = (DWORD)( dst - src ) - 5;
	VirtualProtect( src, len, dwBack, &dwBack );
	return( jmp-len );
}

void Ngm_Hook(void)
{
     DWORD dwPresent  = Ngm_GetPointer (17);
     pPresent  = (oPresent)Ngm_DetourCreate(( PBYTE)dwPresent, ( PBYTE )gellPresent, 5);
}

DWORD __stdcall dwD3D9Thread(LPVOID)
{
	while( !IsGameReadyForHook() )
		Sleep(100);
	Ngm_Hook();
	return 0;
}

bool __stdcall DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
	DisableThreadLibraryCalls(hDll);
	if(dwReason == DLL_PROCESS_ATTACH) {
		//MessageBox(0, "Your Text", "Title", MB_OK);
		CreateThread(NULL, NULL,(LPTHREAD_START_ROUTINE)dwD3D9Thread, NULL, NULL, NULL);
	}
	return true;
}
@Drake
@flameswor10
@aeronyx
@BACKD00R
@Polo

Approve?
Nightmare HotKey_mpgh.net.zip322 KB · 270 downloads Scanning…
/Approved .
Version v3

Code:
#include <windows.h>
#include <d3dx9.h>

INT Addresses[] = { 0x00486030/*LTClientEXE*/, 0x3782A118/*GameStatus*/, 0x009118A0/*DeviceGame*/ }

typedef HRESULT (WINAPI *oPresent) (LPDIRECT3DDEVICE9 pDevice, const RECT *a, const RECT *b, HWND c, const RGNDATA *d);
oPresent pPresent;

BOOL IsGameReadyForHook(void)
{
	if(GetModuleHandle("d3d9.dll") != NULL 
	&& GetModuleHandle("ClientFX.fxd") != NULL 
	&& GetModuleHandle("CShell.dll") != NULL)
		return true;

	return false;
}

DWORD Ngm_GetPointer(int Start)
{
	DWORD *Device = ***(DWORD ****)Addresses[2];

	if(Device == NULL)
		return 0;

	return Device[Start];
}

void PushToConsole( const char* Command)
{
	DWORD *Adress = ( DWORD* ) Addresses[0];

	if(*(BYTE *)Addresses[1]) 
	{
		__asm
		{
			PUSHAD;
			PUSH Command
			CALL Address
			ADD ESP, 0x4
			POPAD;
		}
	}
}

//Variables
INT Hacker[100];

void myHacks(void) 
{
	if(GetAsyncKeyState(VK_NUMPAD1)&1) Hacker[0] =! Hacker[0];
	if(GetAsyncKeyState(VK_NUMPAD1)&1) Hacker[1] =! Hacker[1];
	if(GetAsyncKeyState(VK_NUMPAD1)&1) Hacker[2] =! Hacker[2];

	if(Hacker[0]) {
		PushToConsole("FogEnable 0.0");
	} else {
		PushToConsole("FogEnable 1.0");
	}

	if(Hacker[1]) {
		PushToConsole("SkelModelStencil 1.0");
	} else {
		PushToConsole("SkelModelStencil 0.0");
	}

	if(Hacker[2]) {
		PushToConsole("ActivationDistance 100000");
	} else {
		PushToConsole("ActivationDistance 100");
	}
}

HRESULT WINAPI gellPresent(LPDIRECT3DDEVICE9 pDevice, const RECT *a, const RECT *b, HWND c, const RGNDATA *d)
{
	__asm PUSHAD;
	myHacks();
	__asm POPAD;
	return pPresent(pDevice, a, b, c, d);
}

void *DetourCreate( BYTE *src, const BYTE *dst, const int len )
{
	UINT Pointer[] = { 0xE9 }; /* if not work try INT */

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

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

DWORD WINAPI dwD3D9Thread(LPVOID)
{
	while( !IsGameReadyForHook() )
		Sleep(100);
	Hook();
	return NULL;
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
	DisableThreadLibraryCalls(hDll);
	if(dwReason == DLL_PROCESS_ATTACH) {
		//MessageBox(0, "Your Text", "Title", MB_OK);
		CreateThread(NULL, NULL,(LPTHREAD_START_ROUTINE)dwD3D9Thread, NULL, NULL, NULL);
	}
	return true;
}
Nice release.
Quote Originally Posted by Dead3nd View Post
Help! I get an error saying fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory Can you help me pleas??
Project->Project Settings->VC Directories->Include Path-> "Include SDK"
Project->Project Settings->VC Directories->Library PAth -> "Library SDK"



Great Work Nightmare!!! Loving The 2.0
Nice update bro.

---------- Post added at 01:32 AM ---------- Previous post was at 12:34 AM ----------

Weird, whenever I compile and inject, it doesn't work. Solutions?
Posts 17 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?