Results 1 to 4 of 4
  1. #1
    Dead3nd's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    4
    My Mood
    Bitchy

    c++ fatal error HELP!!

    When I compile Nightmares hot key hack I get this error

    1>c:\users\Blocked\documents\visual studio 2010\projects\blocked\blocked\dllmain.cpp(10): fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory


    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(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; 
    }
    
    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_INSERT)&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_HOME)&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;
    }



    Can someone help me???

  2. #2
    NotRealPro's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    43
    Reputation
    10
    Thanks
    1
    Download the D3d9 sdk and add it to your include directory's

  3. #3
    Dead3nd's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    4
    My Mood
    Bitchy
    Quote Originally Posted by NotRealPro View Post
    Download the D3d9 sdk and add it to your include directory's
    I am trying now.

  4. #4
    Xipher's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Location
    Melbourne, AU.
    Posts
    1,784
    Reputation
    472
    Thanks
    1,688
    My Mood
    Innocent
    Any luck with the result?

Similar Threads

  1. [Help Request] Fatal Error
    By darkloquis in forum Combat Arms BR Coding Help
    Replies: 2
    Last Post: 11-12-2011, 07:10 AM
  2. [Help Request] error LNK2001 | fatal error LNK1120
    By johwsouza in forum Combat Arms BR Coding Help
    Replies: 6
    Last Post: 10-17-2011, 08:25 PM
  3. [Help Request] CANA Error Help!!!
    By ParkII in forum Combat Arms Brazil Help
    Replies: 5
    Last Post: 08-06-2011, 10:51 AM
  4. [Help Request] MSVCR100 error help profire
    By x8xbcdhx8x in forum Combat Arms Help
    Replies: 5
    Last Post: 06-11-2011, 07:44 PM
  5. Help Game Frezes and Give Fatal Error
    By pr0h4x0r in forum Call of Duty Black Ops Help
    Replies: 1
    Last Post: 11-13-2010, 04:27 PM