Results 1 to 3 of 3
  1. #1
    paradoxcod4's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    8

    CodeHook Chams Source Code

    Code:
    bool bGenerateShaders = true;
    
    IDirect3DPixelShader9 * re_Red;
    IDirect3DPixelShader9 * re_Green;
    
    HRESULT GenerateShader(IDirect3DDevice9 *pD3Ddev, IDirect3DPixelShader9 **pShader, float r, float g, float b, float a)
    {
    	char szShader[256];
    	ID3DXBuffer *pShaderBuf = NULL;
    	sprintf(szShader, "ps_3_0\ndef c0, %f, %f, %f, %f\nmov oC0, c0", r, g, b, a);
    	D3DXAssembleShader(szShader, sizeof(szShader), NULL, NULL, 0, &pShaderBuf, NULL);
    
    	if(FAILED(cod4_device->device->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)))
    		return E_FAIL;
    
    	return S_OK;
    }
    
    void (*oDrawXModelSkinnedCached)( int a1, xModel_t a2, int a3 );
    void nDrawXModelSkinnedCached( int a1, xModel_t a2, int a3 )
    {
    	if(bGenerateShaders) {
    		GenerateShader( cod4_device->device, &re_Red, 255, 0, 0, 255);
    		GenerateShader( cod4_device->device, &re_Green, 0, 255, 0, 255);
    		bGenerateShaders = false;
    	}
    
    	xModel_t * Skin   = NULL;
    
    	__asm mov Skin, eax
    
    	cod4_device->device->SetRenderState(D3DRS_LIGHTING, FALSE);
    	cod4_device->device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
    	cod4_device->device->SetPixelShader(re_Red);
    
            oDrawXModelSkinnedCached( a1, a2, a3 );
    
    	cod4_device->device->SetPixelShader(re_Green);
    	cod4_device->device->SetRenderState(D3DRS_LIGHTING, FALSE);
    	cod4_device->device->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
    
    	oDrawXModelSkinnedCached( a1, a2, a3 );
    
    	__asm mov eax, Skin
    
    	cod4_device->device->SetPixelShader(NULL);
    Code:
    DetourFunction((PBYTE)0x646870, (PBYTE)nDrawXModelSkinnedCached);
    _asm mov [oDrawXModelSkinnedCached], eax
    Code:
    typedef struct {
        char szUnknown0[230];
    } xModel_t;
    
    typedef struct{
        IDirect3DDevice9* device;
    } cod4_device_t;
    
    cod4_device_t * cod4_device = (cod4_device_t *)0xCC9A408;
    Attached Thumbnails Attached Thumbnails
    glasst.png  

    Last edited by paradoxcod4; 11-27-2012 at 01:01 PM.

  2. #2
    vistamtigamami's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    5
    Cool source just complied it works perfect

  3. #3
    tributoo2's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    2
    My Mood
    Yeehaw
    Hey i have a bad compuer so i cant install visual studio 2010 and I need some include files to compile it, pls can u upload the dll? or say me where i can find the include files because i have been searching for months but i did not find nothing.

Similar Threads

  1. [Source Code] CoD4 Chams Source Code
    By JoEyHaX in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 7
    Last Post: 08-17-2012, 05:00 AM
  2. [Release] Color Chams - Source Code -
    By Aeir in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 19
    Last Post: 04-08-2012, 10:15 PM
  3. [Request] D3D Chams Source Code C++ 2010
    By enverheckir in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 6
    Last Post: 12-14-2011, 08:17 AM
  4. [Release] Chams Source Code
    By D3t0N4t3 in forum WarRock Hack Source Code
    Replies: 10
    Last Post: 03-10-2011, 06:29 AM
  5. [Kinda Release]AVA Chams Source Code
    By noleash in forum Alliance of Valiant Arms (AVA) Coding / Source Code
    Replies: 14
    Last Post: 11-30-2010, 03:14 PM