Results 1 to 2 of 2
  1. #1
    Coders (+)_'s Avatar
    Join Date
    Jan 2010
    Location
    Earth
    Posts
    455

    Arrow D3D No Smoke & Flash & Sky

    Here is one way to do No Smoke and Flash And Sky,
    If you have not found the Model Rec for smoke this can find it.
    You can use it to log the model rec but it does already work.

    Uses model space coordinates.

    Code:
    #include <windows.h>
    #include <vector>
    #include <string>
    
    #include <d3d9.h>
    #pragma comment(lib, "d3d9.lib")
    
    #include <d3dx9.h>
    #pragma comment(lib, "d3dx9.lib")
    
    #define NO_SKY_FLASH ( Stride == 32 && NumVertices == 4 )
    
    #define DotProduct(x,y)			((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
    #define VectorSubtract(a,b,c)	((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
    #define VectorAdd(a,b,c)		((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2])
    #define VectorCopy(a,b)			((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2])
    #define	VectorScale(v, s, o)	((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s))
    #define	VectorMA(v, s, b, o)	((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s))
    
    HRESULT (WINAPI* pReset)(LPDIRECT3DDEVICE9, 
    	D3DPRESENT_PARAMETERS*);
    
    HRESULT (WINAPI* pEndScene)
    	(LPDIRECT3DDEVICE9);
    
    HRESULT (WINAPI* pDIP)(LPDIRECT3DDEVICE9, 
    	D3DPRIMITIVETYPE, INT, UINT, 
    		UINT, UINT, UINT);
    
    typedef struct _STREAMDATA{
       D3DVECTOR SData;
       float Buff[5];
    }STREAMDATA,*PSTREAMDATA;
    
    typedef struct _BASETEX {
    	DWORD BaseTexture;
    }BASETEX,*PBASETEX;
    
    std::vector<BASETEX> BASETEXIN;
    std::vector<BASETEX> BASETEXOUT;
    
    LPDIRECT3DINDEXBUFFER9 iBuff = NULL;
    LPDIRECT3DBASETEXTURE9 Btex = NULL;
    LPDIRECT3DDEVICE9 pDevice = NULL;
    LPD3DXFONT pFont = NULL;
    D3DVIEWPORT9 Viewport;
    
    DWORD dwCreateDevice = NULL;
    DWORD dwProtect = NULL;
    PDWORD pVTable = NULL;
    D3DRECT RectA,RectB;
    UINT OffsetToLock = 0;
    UINT SizeToLock = 0;
    UINT HighestVertex = 0;
    BYTE *iData = NULL;
    BYTE *StrData = NULL;
    WORD *iBuffer = NULL;
    PSTREAMDATA SData = NULL;
    D3DVECTOR *Vect = NULL;
    
    D3DVECTOR vecTmp;
    
    D3DVECTOR vecXh;
    D3DVECTOR vecYh;
    D3DVECTOR vecZh;
    
    D3DVECTOR vecXl;
    D3DVECTOR vecYl;
    D3DVECTOR vecZl;
    
    BASETEX BTEX;
    
    // Chaser343 MoonBase
    FLOAT WINAPI GetDistance
    ( PFLOAT LocationA, PFLOAT LocationB )
    {
    	float DistanceX		= 
    		LocationA[0] - LocationB[0];
    	float DistanceY		= 
    		LocationA[1] - LocationB[1];
    	float DistanceZ		= 
    		LocationA[2] - LocationB[2];
    
    	return (float)sqrt( ( DistanceX * DistanceX ) 
    		+ ( DistanceY * DistanceY ) 
    		+ ( DistanceZ * DistanceZ ) );
    }
    
    HRESULT WINAPI DIP( LPDIRECT3DDEVICE9 pDevice9, D3DPRIMITIVETYPE Type, 
    	INT BaseIndex, UINT MinIndex, UINT NumVertices, 
    		UINT StartIndex, UINT PCount )
    {
    	LPDIRECT3DVERTEXBUFFER9 Stream_Data = NULL;
    	UINT Offset = 0;
    	UINT Stride = 0;
    
    	if( pDevice9->GetStreamSource
    		( 0, &Stream_Data, &Offset, &Stride) == S_OK )
    		Stream_Data->Release();
    
    	if( NO_SKY_FLASH )
    		pDevice9->SetTexture( 0, NULL );
    
    	if( Stride == 48 )
    	{
    		BOOL presentIn = FALSE;
    		BOOL presentOut = FALSE;
    
    		pDevice9->GetTexture( 0, &Btex );
    
    		for( UINT i = 0;i < BASETEXIN.size();i++ )
    			if(BASETEXIN[i].BaseTexture == (DWORD)Btex)
    				presentIn = TRUE;
    
    		for( UINT j = 0;j < BASETEXOUT.size();j++ )
    			if(BASETEXOUT[j].BaseTexture == (DWORD)Btex)
    				presentOut = TRUE;
    
    		if( presentIn == TRUE 
    			&& presentOut == FALSE )
    		{
    			pDevice9->SetTexture( 0, NULL );
    			return D3D_OK;
    		}
    		if( presentOut == FALSE 
    			&& presentIn == FALSE )
    		{
    			if( pDevice9->GetIndices( &iBuff ) == S_OK )
    			{
    				OffsetToLock = StartIndex * sizeof(unsigned short);
    				SizeToLock = NumVertices * sizeof(unsigned short);
    
    				if( iBuff->Lock( OffsetToLock, SizeToLock, 
    					(void **)&iData, D3DLOCK_DONOTWAIT | 
    						D3DLOCK_READONLY) == S_OK )
    				{
    					iBuffer = (WORD*)iData;
    
    					for( UINT i = 0; i < NumVertices; i++ )
    					{
    						if (*iBuffer > HighestVertex)
    						{
    							HighestVertex = *iBuffer;
    						}
    						iBuffer++;
    					}
    
    					iBuff->Unlock( );
    
    					OffsetToLock = (BaseIndex + MinIndex)*Stride;
    					SizeToLock = (HighestVertex - MinIndex)*Stride;
    
    					if( Stream_Data->Lock( OffsetToLock, SizeToLock, 
    						(void **)&StrData, D3DLOCK_DONOTWAIT | 
    							D3DLOCK_READONLY) == S_OK)
    					{
    						SData = (PSTREAMDATA)StrData;
    						vecTmp.x = ((D3DVECTOR*)(SData))->x;
    						vecTmp.y = ((D3DVECTOR*)(SData))->y;
    						vecTmp.z = ((D3DVECTOR*)(SData))->z;
    
    						VectorCopy( &vecTmp, &vecXh );
    						VectorCopy( &vecTmp, &vecYh );
    						VectorCopy( &vecTmp, &vecZh );
    
    						VectorCopy( &vecTmp, &vecXl );
    						VectorCopy( &vecTmp, &vecYl );
    						VectorCopy( &vecTmp, &vecZl );
    
    						for( UINT i = 1; i < NumVertices; i++ )
    						{
    							Vect = (D3DVECTOR*)SData;
    
    							if (Vect->x > vecXh.x)
    								VectorCopy( Vect, &vecXh );
    
    							if (Vect->x < vecXl.x)
    								VectorCopy( Vect, &vecXl );
    
    							if (Vect->y > vecYh.y)
    								VectorCopy( Vect, &vecYh );
    
    							if (Vect->y < vecYl.y)
    								VectorCopy( Vect, &vecYl );
    
    							if (Vect->z > vecZh.z)
    								VectorCopy( Vect, &vecZh );
    
    							if (Vect->z < vecZl.z)
    								VectorCopy( Vect, &vecZl );
    
    							SData++;
    						}
    
    						Stream_Data->Unlock( );
    					}
    				}
    				iBuff->Release( );
    			}				
    
    			float vecDistX = GetDistance( (PFLOAT)&vecXh, (PFLOAT)&vecXl );
    			float vecDistY = GetDistance( (PFLOAT)&vecYh, (PFLOAT)&vecYl );
    			float vecDistZ = GetDistance( (PFLOAT)&vecZh, (PFLOAT)&vecZl );
    
    			if( vecDistZ > 200.0f && 
    				vecDistZ < 500.0f )
    			{   
    				BTEX.BaseTexture = (DWORD)Btex;
    				BASETEXIN.push_back( BTEX );
    			}
    			else
    			{
    				BTEX.BaseTexture = (DWORD)Btex;
    				BASETEXOUT.push_back( BTEX );
    			}
    		}
    	}
    
    	return pDIP( pDevice9, Type, BaseIndex, MinIndex, 
    		NumVertices, StartIndex, PCount );
    }
    
    HRESULT WINAPI RESET( LPDIRECT3DDEVICE9 pDevice9, 
    	D3DPRESENT_PARAMETERS* PParameters )
    {
    	return pReset( pDevice9, PParameters );
    }
    
    HRESULT WINAPI ENDSCENE( LPDIRECT3DDEVICE9 pDevice9 )
    {
        pDevice9->GetViewport( &Viewport );
    
    	DWORD ScrX = Viewport.Width / 2; 
        DWORD ScrY = Viewport.Height / 2; 
    
    	{RectA.x1 = ScrX - 4;}	{RectA.y1 = ScrY - 1;}
    	{RectA.x2 = ScrX + 3;}	{RectA.y2 = ScrY;}
    
    	{RectB.x1 = ScrX - 1;}	{RectB.y1 = ScrY - 4;}
    	{RectB.x2 = ScrX;}		{RectB.y2 = ScrY + 3;}
    
        pDevice9->Clear( 1, &RectA, D3DCLEAR_TARGET, 
    		D3DCOLOR_ARGB( 255, 20, 255, 20 ), 0,  0 );
    
        pDevice9->Clear( 1, &RectB, D3DCLEAR_TARGET, 
    		D3DCOLOR_ARGB( 255, 20, 255, 20 ), 0,  0 ); 
    
    	return pEndScene( pDevice9 );
    }
    
    VOID WINAPI THREAD( VOID )
    {
    	*(PDWORD)&pEndScene	= pVTable[42];
    	*(PDWORD)&pReset	= pVTable[16];
    	*(PDWORD)&pDIP		= pVTable[82];
    
    	while( 1 )
    	{
    		pVTable[42] = (DWORD)ENDSCENE;
    		pVTable[16] = (DWORD)RESET;
    		pVTable[82] = (DWORD)DIP;
    		Sleep( 100 );
    	}
    }
    
    VOID WINAPI UNHOOK( VOID )
    {
    	pVTable[16] = dwCreateDevice;
    
    	VirtualProtect( (PVOID)&pVTable[16], 
    		4, dwProtect, &dwProtect );
    
    	pVTable = (PDWORD)*(PDWORD)pDevice;
    
    	CreateThread( NULL ,NULL, 
    		(LPTHREAD_START_ROUTINE)THREAD, 
    			NULL, NULL,NULL );
    }
    
    __declspec(naked )
    VOID WINAPI CREATEDEVICE( VOID )
    {
    	__asm
    	{
    		{PUSH EBP}
    		{MOV EBP,ESP}
    		{PUSH [EBP+0x20]} {PUSH [EBP+0x1C]}
    		{PUSH [EBP+0x18]} {PUSH [EBP+0x14]}
    		{PUSH [EBP+0x10]} {PUSH [EBP+0xC]}
    		{PUSH [EBP+0x08]} {CALL [dwCreateDevice]}
    		{MOV EDX,[EBP+0x20]} {MOV EDX,[EDX]}
    		{MOV [pDevice],EDX}  {PUSH EAX} 
    		{CALL UNHOOK}		 {POP EAX}
    		{POP EBP}
    		{RETN 0x1C}
    	}
    }
    
    BOOL WINAPI DllMain( HMODULE hModule, 
    	DWORD dwReason, LPVOID lpvReserved )
    {
    	if( dwReason == DLL_PROCESS_ATTACH )
    	{
    		DisableThreadLibraryCalls( hModule );
    
    		LPDIRECT3D9 LPD3D9 = Direct3DCreate9
    			( D3D_SDK_VERSION );
    
    		if( LPD3D9 != NULL )
    		{
    			pVTable  = (PDWORD)*(PDWORD)LPD3D9;
    			LPD3D9->Release();
    
    			VirtualProtect( (PVOID)&pVTable[16], 
    				4, 0x40, &dwProtect );
    
    			dwCreateDevice = pVTable[16];
    			pVTable[16] = (DWORD)CREATEDEVICE;
    		}
    
    	}
    	return TRUE;
    }



  2. #2
    Senior Member Anonymous>:('s Avatar
    Join Date
    Oct 2009
    Location
    France
    Posts
    179

    Re: D3D No Smoke & Flash & Sky

    Good evening.
    Can please provides us the executable? I dont know a shit about coding.
    __________________________________________________ __________________________________________



    MarshalsFanDu31@Gmail.Com

    My playlist =) ( click )

Similar Threads

  1. D3D No FLash for COD4 :$
    By (+)_ in forum D3D
    Replies: 0
    Last Post: February 23rd, 2013, 12:33
  2. need help with hacking a flash game
    By srbindokoske in forum Client Hooks
    Replies: 1
    Last Post: January 3rd, 2010, 17:24
  3. Hello. Flash Game Aimbot
    By Slainte in forum Introduce Yourself
    Replies: 0
    Last Post: June 15th, 2009, 20:35
  4. [CODE]COD1 Weapon Flash Removal
    By buffalo in forum Client Hooks
    Replies: 6
    Last Post: December 28th, 2008, 00:24
  5. make my name flash
    By daniel57 in forum Call of Duty 2 Cheats
    Replies: 4
    Last Post: April 24th, 2008, 21:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •