Page 1 of 6 123 ... LastLast
Results 1 to 15 of 81
  1. #1
    boi2gangsta's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    90
    Reputation
    10
    Thanks
    21
    My Mood
    In Love

    [Code] Shaded chams

    Well AVA is mainly a shader game so to do a good looking cham, you would have to chameleon the shaders

    *should also work in other shaded base games

    GenerateShader - credits to CallMeEclipse
    *fixed up to prevent crashing
    Code:
    HRESULT GenerateShader( IDirect3DDevice9 *pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b, bool setzBuf )
    {
        char szShader[ 256 ];
        ID3DXBuffer *pShaderBuf = NULL;
    
        sprintf( szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
        if( D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL ) == D3D_OK )
            pDevice->CreatePixelShader( ( const DWORD* )pShaderBuf->GetBufferPointer(), pShader );
        else
            return E_FAIL;
    
        return S_OK;
    }
    Generating the shaders:
    Code:
    define these at the top or wherever:
    IDirect3DPixelShader9 *Blah, *Blahh;
    
    in Endscene:
    GenerateShader( pDevice, &Blah, 255, 0 , 0, true);
    GenerateShader( pDevice, &Blahh, 0, 0, 255, true);
    Doing the chams with shaded pixels:
    Code:
    In DIP:
    if(Stride)
    {
    DWORD dwOldZEnable = D3DZB_TRUE; 
    pDevice->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable); 
    pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
    pDevice->SetPixelShader( Blah );   
    DIP( ............ );
    pDevice->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);
    pDevice->SetPixelShader( Blahh);
    }
    Done. You should have some shaded chams now.

    Ohh & I'm also working on a public, so far no kicks or errors.
    Chams should look like below
    Last edited by boi2gangsta; 06-22-2010 at 07:47 AM.
    CcLiCk Members:

    [img]http://************.com/sig/002/KillDatShet.jpg[/img]

    [img]http://************.com/sig/018/Vi3TKidKev.jpg[/img]

    [img]http://************.com/sig/006/OMGxP.jpg[/img]

  2. The Following 11 Users Say Thank You to boi2gangsta For This Useful Post:

    alrochix (01-27-2011),brancarr (09-12-2010),cheeks123 (01-25-2011),Drake (06-22-2010),haloistaken100 (08-18-2010),Lasanhaxxx (08-16-2010),luudaigiang (06-23-2010),o-improvise-o (08-15-2010),rayan813 (08-17-2010),Shayte1 (09-10-2010),Stifmeister (07-02-2010)

  3. #2
    dspek's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    1
    that crosshair looks sexy lol
    and nice job!

  4. #3
    boi2gangsta's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    90
    Reputation
    10
    Thanks
    21
    My Mood
    In Love
    ahah, thanks. sh00ter999 for crosshair ;]
    CcLiCk Members:

    [img]http://************.com/sig/002/KillDatShet.jpg[/img]

    [img]http://************.com/sig/018/Vi3TKidKev.jpg[/img]

    [img]http://************.com/sig/006/OMGxP.jpg[/img]

  5. #4
    Toshie's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    In a dark place
    Posts
    6,286
    Reputation
    48
    Thanks
    391
    where would you put this code in?

  6. #5
    Drake's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Belgium,Oost-Vlaanderen
    Posts
    12,681
    Reputation
    1801
    Thanks
    4,855
    Quote Originally Posted by tosh102 View Post
    where would you put this code in?
    Learn to make hacks and then u will know it .
    Last edited by Drake; 06-22-2010 at 10:42 PM.

  7. #6
    7RIGGA's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    1
    My Mood
    Sleepy
    you should see if you can join the AO team

  8. #7
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,652
    Reputation
    795
    Thanks
    3,543
    thanks for sharing! +1

  9. The Following User Says Thank You to /b/oss For This Useful Post:

    Drake (06-22-2010)

  10. #8
    ronon6's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    193
    Reputation
    10
    Thanks
    24
    My Mood
    Angry
    WOOT i love chams like tht.

  11. #9
    AznNicholas's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    Will it actually work if you get this code compiled?
    Shouldn't you need to bypass GG?

  12. #10
    Johnny Wolf's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Italy
    Posts
    310
    Reputation
    10
    Thanks
    15
    My Mood
    Buzzed
    omg another coder for AVA omfg yay!

  13. #11
    dordort's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    28
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by AznNicholas View Post
    Will it actually work if you get this code compiled?
    Shouldn't you need to bypass GG?
    Stop talking bullshit if you don't know what your'e dam talking about. The GG its not belong to the hacks because we use the method of a DLL injecting, that has nothing to do with the GG. If it was a trainer that made by Cheat Engine, or Cheat Engine itself, that's something else.

  14. #12
    AznNicholas's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by dordort View Post
    Stop talking bullshit if you don't know what your'e dam talking about. The GG its not belong to the hacks because we use the method of a DLL injecting, that has nothing to do with the GG. If it was a trainer that made by Cheat Engine, or Cheat Engine itself, that's something else.
    Huh?
    GG is there for a reason and it have protection against DIP hooking.
    I think you're the one who don't know what you're talking about.
    If this code will just work like that, then I believe everyone would be hacking by now.

  15. #13
    boi2gangsta's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Posts
    90
    Reputation
    10
    Thanks
    21
    My Mood
    In Love
    No, this will not work if you just compiled it like that. Learn some C++.
    & you'd have to detour or vtable your base to get it undetected.
    CcLiCk Members:

    [img]http://************.com/sig/002/KillDatShet.jpg[/img]

    [img]http://************.com/sig/018/Vi3TKidKev.jpg[/img]

    [img]http://************.com/sig/006/OMGxP.jpg[/img]

  16. #14
    dordort's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    28
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by boi2gangsta View Post
    Well AVA is mainly a shader game so to do a good looking cham, you would have to chameleon the shaders

    *should also work in other shaded base games

    GenerateShader - credits to CallMeEclipse
    *fixed up to prevent crashing
    Code:
    HRESULT GenerateShader( IDirect3DDevice9 *pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b, bool setzBuf )
    {
        char szShader[ 256 ];
        ID3DXBuffer *pShaderBuf = NULL;
    
        sprintf( szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
        if( D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL ) == D3D_OK )
            pDevice->CreatePixelShader( ( const DWORD* )pShaderBuf->GetBufferPointer(), pShader );
        else
            return E_FAIL;
    
        return S_OK;
    }
    Generating the shaders:
    Code:
    define these at the top or wherever:
    IDirect3DPixelShader9 *Blah, *Blahh;
    
    in Endscene:
    GenerateShader( pDevice, &Blah, 255, 0 , 0, true);
    GenerateShader( pDevice, &Blahh, 0, 0, 255, true);
    Doing the chams with shaded pixels:
    Code:
    In DIP:
    if(Stride)
    {
    DWORD dwOldZEnable = D3DZB_TRUE; 
    pDevice->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable); 
    pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
    pDevice->SetPixelShader( Blah );   
    DIP( ............ );
    pDevice->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);
    pDevice->SetPixelShader( Blahh);
    }
    Done. You should have some shaded chams now.

    Ohh & I'm also working on a public, so far no kicks or errors.
    Chams should look like below
    Nice try, but your code fix for crashing does not work. It still crashes when opening AVA, Exactly as the original code. This is the full code for VC 2008, with your changes in it. Look around and try to fix it because it does not work, It still getting crashed immediately when opening AVA.

    **- Do not tell me to try changing the compile mode (Debug Dll / Release Dll) Because I have already tried both of them, and the same - Game is getting crashed immediately when opening AVA.

    Code:
    #include <windows.h>
    
    #include <d3d9.h>
    #pragma comment(lib, "d3d9.lib")
    
    #include <d3dx9.h>
    #pragma comment(lib, "d3dx9.lib")
    #include <time.h>
    #include <stdlib.h>
    #include <fstream>
    #include <vector>    
    #include <D3dx9tex.h>
    #include <stdio.h> 
    #include <time.h>
    #include <tchar.h>
    #include <iostream>
    #pragma warning(disable:4996)//to disable the sprintf warning in VC++ 2008
    //-----------//
    bool fCall = true;
    bool Chams = false;
    IDirect3DPixelShader9 *Front, *Back;
    
    
    
    
    HRESULT GenerateShader( IDirect3DDevice9 *pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b, bool setzBuf )
    {
        char szShader[ 256 ];
        ID3DXBuffer *pShaderBuf = NULL;
    
        sprintf( szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
        if( D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL ) == D3D_OK )
            pDevice->CreatePixelShader( ( const DWORD* )pShaderBuf->GetBufferPointer(), pShader );
        else
            return E_FAIL;
    
        return S_OK;
    }
    
    //=====================================================================================
    
    typedef HRESULT (WINAPI* CreateDevice_Prototype)        (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
    typedef HRESULT (WINAPI* Reset_Prototype)               (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
    typedef HRESULT (WINAPI* EndScene_Prototype)            (LPDIRECT3DDEVICE9);
    typedef HRESULT (WINAPI* DrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
    
    CreateDevice_Prototype         CreateDevice_Pointer         = NULL;
    Reset_Prototype                Reset_Pointer                = NULL;
    EndScene_Prototype             EndScene_Pointer             = NULL;
    DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer = NULL;
    
    HRESULT WINAPI Direct3DCreate9_VMTable    (VOID);
    HRESULT WINAPI CreateDevice_Detour        (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
    HRESULT WINAPI Reset_Detour               (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
    HRESULT WINAPI EndScene_Detour            (LPDIRECT3DDEVICE9);
    HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
    
    DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching(LPVOID);
    PDWORD Direct3D_VMTable = NULL;
    
    //=====================================================================================
    
    BOOL WINAPI DllMain(HINSTANCE hinstModule, DWORD dwReason, LPVOID lpvReserved)
    {
      if(dwReason == DLL_PROCESS_ATTACH)
      {
        DisableThreadLibraryCalls(hinstModule);
    
        if(Direct3DCreate9_VMTable() == D3D_OK)
        return TRUE;
      }
    
      return FALSE;
    }
    
    //=====================================================================================
    
    HRESULT WINAPI Direct3DCreate9_VMTable(VOID)
    {
      LPDIRECT3D9 Direct3D_Object = Direct3DCreate9(D3D_SDK_VERSION);
    
      if(Direct3D_Object == NULL)
      return D3DERR_INVALIDCALL;
      
      Direct3D_VMTable = (PDWORD)*(PDWORD)Direct3D_Object;
      Direct3D_Object->Release();
    
      DWORD dwProtect;
    
      if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
      {
        *(PDWORD)&CreateDevice_Pointer = Direct3D_VMTable[16];
        *(PDWORD)&Direct3D_VMTable[16] = (DWORD)CreateDevice_Detour;
    
        if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
        return D3DERR_INVALIDCALL;
      }
      else
      return D3DERR_INVALIDCALL;
    
      return D3D_OK;
    }
    
    //=====================================================================================
    
    HRESULT WINAPI CreateDevice_Detour(LPDIRECT3D9 Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND FocusWindow, 
                        DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* PresentationParameters, 
                        LPDIRECT3DDEVICE9* Returned_pDevice)
    {
      HRESULT Returned_Result = CreateDevice_Pointer(Direct3D_Object, Adapter, DeviceType, FocusWindow, BehaviorFlags, 
                                                  PresentationParameters, Returned_pDevice);
       
      DWORD dwProtect;
    
      if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), PAGE_READWRITE, &dwProtect) != 0)
      {
        *(PDWORD)&Direct3D_VMTable[16] = *(PDWORD)&CreateDevice_Pointer;
        CreateDevice_Pointer           = NULL;
    
        if(VirtualProtect(&Direct3D_VMTable[16], sizeof(DWORD), dwProtect, &dwProtect) == 0)
        return D3DERR_INVALIDCALL;
      }
      else
      return D3DERR_INVALIDCALL;
    
      if(Returned_Result == D3D_OK)
      {
        Direct3D_VMTable = (PDWORD)*(PDWORD)*Returned_pDevice;
    
        *(PDWORD)&Reset_Pointer                = (DWORD)Direct3D_VMTable[16];
        *(PDWORD)&EndScene_Pointer             = (DWORD)Direct3D_VMTable[42];
        *(PDWORD)&DrawIndexedPrimitive_Pointer = (DWORD)Direct3D_VMTable[82];
    
        if(CreateThread(NULL, 0, VirtualMethodTableRepatchingLoopToCounterExtensionRepatching, NULL, 0, NULL) == NULL)
        return D3DERR_INVALIDCALL;
      }
        
      return Returned_Result;
    }
    
    //=====================================================================================
    
    HRESULT WINAPI Reset_Detour(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* PresentationParameters)
    {
      return Reset_Pointer(pDevice, PresentationParameters);
    }
    
    //=====================================================================================
    
    HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE9 pDevice)
    {
      return EndScene_Pointer(pDevice);
    }
    
    //=====================================================================================
    
    HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseIndex, 
                                               UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
    {
      LPDIRECT3DVERTEXBUFFER9 Stream_Data;
      UINT Offset = 0;
      UINT Stride = 0;
    
      if(pDevice->GetStreamSource(0, &Stream_Data, &Offset, &Stride) == D3D_OK)
      Stream_Data->Release();
    
      if(fCall)
      {
      GenerateShader( pDevice, &Front, 255, 0 , 0, true);
      GenerateShader( pDevice, &Back, 0, 0, 255, true);
      fCall = false;
      }
    
      if ( GetAsyncKeyState ( VK_NUMPAD1 ) &1 )
        {
             Chams = !Chams;
        }  
    
      if(Chams && (Stride == 32 && StartIndex == 0))
      {
            DWORD dwOldZEnable = D3DZB_TRUE; 
            pDevice->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable); 
            pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
            pDevice->SetPixelShader( Front );
            DrawIndexedPrimitive_Pointer(pDevice, Type, BaseIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
            pDevice->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);
            pDevice->SetPixelShader( Back );
      }
    
      return DrawIndexedPrimitive_Pointer(pDevice, Type, BaseIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
    }
    
    //=====================================================================================
    
    DWORD WINAPI VirtualMethodTableRepatchingLoopToCounterExtensionRepatching(LPVOID Param)
    {
      UNREFERENCED_PARAMETER(Param); 
    
      while(1)
      {
        Sleep(100);
    
        *(PDWORD)&Direct3D_VMTable[42] = (DWORD)EndScene_Detour;
        *(PDWORD)&Direct3D_VMTable[82] = (DWORD)DrawIndexedPrimitive_Detour;
        *(PDWORD)&Direct3D_VMTable[16] = (DWORD)Reset_Detour;
      }
    
      return 1;
    }
    Last edited by dordort; 06-23-2010 at 09:08 AM.

  17. #15
    AznNicholas's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    The above full source code is gone through vtable.
    Does that mean it will work?

Page 1 of 6 123 ... LastLast

Similar Threads

  1. Need source code for chams hack
    By TheCamels8 in forum C++/C Programming
    Replies: 10
    Last Post: 06-14-2010, 06:49 PM
  2. Need source code for chams hack
    By TheCamels8 in forum WarRock Hack Source Code
    Replies: 5
    Last Post: 06-11-2010, 10:00 PM
  3. Chams codes.
    By juanrineytor in forum Combat Arms Discussions
    Replies: 9
    Last Post: 11-11-2009, 11:43 AM
  4. Chams Color Coding Tutorial
    By 420Suicide in forum Combat Arms Hacks & Cheats
    Replies: 9
    Last Post: 12-28-2008, 10:19 AM
  5. Cham Colors And Their Codes
    By Zhellbound in forum Combat Arms Hacks & Cheats
    Replies: 4
    Last Post: 11-10-2008, 09:21 AM