Results 1 to 5 of 5
  1. #1
    Dylan's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Location
    Nowhere
    Posts
    1,893
    Reputation
    359
    Thanks
    1,988
    My Mood
    Sleepy

    Color Chams: Source Code

    Code:
    UINT m_Stride;
    D3DPRIMITIVETYPE Type; 
    INT BaseVertexIndex; 
    UINT MinVertexIndex; 
    UINT NumVertices; 
    UINT startIndex;
    UINT primCount;
    
    	#define RED2			D3DCOLOR_ARGB(100, 255, 000, 000)
    DWORD dwOldZEnable = D3DZB_TRUE;
    	LPDIRECT3DTEXTURE9 White2,Red2,Green2,Blue2,Black2,Purple2,Grey2,Yellow2,Orange2;
    	LPDIRECT3DVERTEXBUFFER9 StreamData;
    UINT OffsetInBytes;
    
    		
    
    
    typedef HRESULT (WINAPI* tPresent)(LPDIRECT3DDEVICE9 pDevice,CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion);
    tPresent oPresent;
    
    typedef HRESULT (WINAPI* tReset)(LPDIRECT3DDEVICE9 pDevice,D3DPRESENT_PARAMETERS* Parametri);
    tReset oReset;
    
    typedef HRESULT (WINAPI* oDrawIndexedPrimitive) ( LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount );
    oDrawIndexedPrimitive pDrawIndexedPrimitive;
    
    
    void CreateDev(DWORD * dwVTable){
    LPDIRECT3D9 pD3d9 = NULL;
    LPDIRECT3DDEVICE9 pD3DDevice = NULL;
    pD3d9 = Direct3DCreate9(D3D_SDK_VERSION);
    if(pD3d9 == NULL){
    return;
    }
    D3DPRESENT_PARAMETERS pPresentParms;
    ZeroMemory(&pPresentParms,sizeof(pPresentParms));
    pPresentParms.Windowed = TRUE;
    pPresentParms.BackBufferFormat = D3DFMT_UNKNOWN;
    pPresentParms.SwapEffect = D3DSWAPEFFECT_DISCARD;
    if(FAILED(pD3d9->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,GetDesktopWindow(),D3DCREATE_SOFTWARE_VERTEXPROCESSING,&pPresentParms,&pD3DDevice))){
    return;
    }
    DWORD * dwTable = ( DWORD* )pD3DDevice;
    dwTable = ( DWORD* ) dwTable[0];
    dwVTable[0] = dwTable[16];
    dwVTable[1] = dwTable[17];
    }
    
    void *Salta(BYTE *src,const BYTE *dst,const int len){
    BYTE *jmp = (BYTE*)malloc(len+5);
    DWORD dwback;
    VirtualProtect(src, len, PAGE_READWRITE, &dwback);
    memcpy(jmp, src, len); jmp += len;
    jmp[0] = 0xE9;
    *(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
    src[0] = 0xE9;
    *(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
    VirtualProtect(src, len, dwback, &dwback);
    return (jmp-len);
    }
    
    
    HRESULT WINAPI hkReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* Parametri){
    _asm NOP;
    
    d3dfont->OnLostDevice();
    
    HRESULT hTorna = oReset(pDevice, Parametri);
    
    if(SUCCEEDED(hTorna)){
    d3dfont->OnResetDevice();
    }
    return hTorna;
    }
    class cHelper
    	{
    	public:
    		DWORD FindDevice(DWORD Len);
    		VOID HideDLL(HINSTANCE hModule);
    		void EraseHeader(HINSTANCE hModule);
    		VOID StarLog(HMODULE hDll);
    		VOID __cdecl cHelper::WriteLog (const char *fmt, ...);
    		CHAR* Decrypt(const char* plaintext);
    		CHAR* Encrypt(const char* plaintext);
    		CHAR * GetTime();
    		BOOL CheckVersion();
    		INT URLGetPage(char *link, char *buffer, int maxsize);
    		BOOL cHelper::_cCompareHost( char *HostName );
    	private:
    		CHAR * GetDirectoryFile(char *filename);
    	};
    
    
    DWORD cHelper::FindDevice(DWORD Len)
    {
        DWORD dwObjBase = 0;
    		
    	dwObjBase = (DWORD)LoadLibrary("D3D9.DLL");
        while (dwObjBase++ < dwObjBase + Len)
        {
            if ( (*(WORD*)(dwObjBase + 0x00)) == 0x06C7
              && (*(WORD*)(dwObjBase + 0x06)) == 0x8689
              && (*(WORD*)(dwObjBase + 0x0C)) == 0x8689
    		  ) { dwObjBase += 2; break; }
        }
        return( dwObjBase );
    }
    HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
    {
    	
    	
    //THIS IS TO DRAW BASIC CHAMS - 
    	
    	if(pDevice->GetStreamSource(0,&StreamData,&OffsetInBytes,&m_Stride) == D3D_OK) 
    	{
    		StreamData->Release();
    
    	}
    //the chams --> white ok? 
    if(IsIngame() &&cBox[24].OnOff == 1)
    						{
    								if( (m_Stride == 36) || (m_Stride == 32) || (m_Stride == 44))
    		{
    			
    			pDevice->SetRenderState(D3DRS_ZENABLE, 0);
    			 pDevice->SetTexture(0,Red2);
    			 	pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
    			pDevice->SetRenderState(D3DRS_ZENABLE, 1);
    			pDevice->SetTexture(0,Red2);
    								}
    
    								
    
    }
    
    
    return pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
    
    }
    
    DWORD cDetours::CreateDIP_JMP_EAX( DWORD  SrcVA, DWORD  DstVA, DWORD  Size )
    {
    
    	DWORD DetourVA, dwProtect, i;
    
    #define SIZEOF_MOVEAX_JMPEAX 6
    
    	if ( SrcVA && DstVA && Size >= SIZEOF_MOVEAX_JMPEAX )
    	{
    		DetourVA = (DWORD) VirtualAlloc( 
    			NULL, Size + SIZEOF_MOVEAX_JMPEAX, 
    			MEM_COMMIT, PAGE_EXECUTE_READWRITE );
    
    		if ( DetourVA && VirtualProtect( (VOID*)SrcVA, Size, PAGE_EXECUTE_READWRITE, &dwProtect ) )
    		{
    			for ( i=0; i < Size; i++ ) {
    				*(BYTE*)( DetourVA + i ) = *(BYTE*)( SrcVA + i );
    			}
    			
    			*(BYTE*)( DetourVA + Size + 0 ) = 0xB8;
    			*(DWORD*)( DetourVA + Size + 1 ) = ( SrcVA + Size );
    			*(WORD*)( DetourVA + Size + 5 ) = 0xE0FF;
    
    			*(BYTE*)( SrcVA + 0 ) = 0xB8;
    			*(DWORD*)( SrcVA + 1 ) = ( DstVA );
    			*(WORD*)( SrcVA + 5 ) = 0xE0FF;
    
    			VirtualProtect( (VOID*)SrcVA, Size, dwProtect, &dwProtect );
    
    			VirtualProtect( (VOID*)DetourVA, Size + 
    				SIZEOF_MOVEAX_JMPEAX, PAGE_EXECUTE_READ, &dwProtect );
    
    	    	return DetourVA;
    		}
    		Sleep(3);
    	}
    	return (0);
    }
    DWORD dwVTable[82] = {0};
    HRESULT WINAPI hkPresent(LPDIRECT3DDEVICE9 pDevice,CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion){
    _asm PUSHAD;
    menu->RenderMenu(pDevice);
    menu->********(pDevice);
    //menu->TeleKillFull();
    
    menu->Ghostmode1(pDevice);
    _asm POPAD;
    return oPresent(pDevice, pSourceRect,  pDestRect,  hDestWindowOverride,  pDirtyRegion);
    }
    
    
    DWORD WINAPI Wait(LPVOID lpArgs){
    DWORD dwD3D9 = NULL;
    while(!dwD3D9){
    Sleep(20);
    dwD3D9 = (DWORD)GetModuleHandleA("d3d9.dll");
    }
    
    	PDWORD VTable;
    	cHelper *cHelpers;
        *(DWORD*)&VTable = *(DWORD*)cHelpers->FindDevice(0x128000);
    
        if(VTable == NULL)
    	{
    		MessageBox(NULL,"D3DDevice Pointer Not Found!",0,MB_ICONSTOP);
            ExitProcess(0);
    	}
    
    	
    
    CreateDev( dwVTable );
    oReset = ( tReset ) cDetour->CreateJMP_REL(( DWORD ) dwVTable[0], ( DWORD ) &hkReset ,5);
    oPresent = ( tPresent )cDetour->CreateJMP_REL(( DWORD ) dwVTable[1], ( DWORD ) &hkPresent ,5);
    pDrawIndexedPrimitive=(oDrawIndexedPrimitive)cDetour->CreateJMP_EAX((DWORD)dwVTable[82],(DWORD)myDrawIndexedPrimitive,5);
    
    while(1)
    {
        if(memcmp((void *)VTable[82], (void *)"\x8B\xFF", 2) == 0 )
    	{
    		pDrawIndexedPrimitive=(oDrawIndexedPrimitive)cDetour->CreateDIP_JMP_EAX((DWORD)VTable[82],(DWORD)myDrawIndexedPrimitive,12);
    	}
        Sleep(500);
    }
    
    return 0;
    }
    BOOL APIENTRY DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved ){
    if ( dwReason == DLL_PROCESS_ATTACH ){
    	
    CreateThread( NULL, NULL, &Wait, NULL, NULL, NULL );
    //CreateThread(NULL, NULL,(LPTHREAD_START_ROUTINE)TELEKILL, NULL, NULL, NULL);
    }
    return TRUE;
    Credits: AlphaVampire

    NewsForce December 2015 - April 2016
    Premium Member April 2013 - Current
    MPGH Member March 2013 - Current



  2. #2
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    6,285
    Reputation
    435
    Thanks
    3,715
    My Mood
    Doh
    all i see are errors...i'm not saying this should be C+P'able, but still

    edit:
    i'm retarded -_-"

    been too long lol
    Last edited by supercarz1991; 04-14-2013 at 07:04 PM.

    commando: You're probably the best non-coder coder I know LOL


  3. #3
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    831
    Reputation
    44
    Thanks
    401
    My Mood
    Twisted
    This is extremly shitty o.0
    1. Its a SIMPLE all over spreaded DIP VTable 82 hook, nothing rare or special.
    2. There is so much unused code, this shit will seriously not help anyone lol.

    Progress with my game - "Disbanded"
    • Fixed FPS lag on spawning entities due to the ent_preload buffer!
    • Edit the AI code to get some better pathfinding
    • Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
    • Added a new silencer for ALL weapons. Also fixed the rotation bugs
    • Added a ton of new weapons and the choice to choose a silencer for every weapon
    • Created a simple AntiCheat, noobs will cry like hell xD
    • The name will be Disbanded, the alpha starts on the 18th august 2014



    Some new physics fun (Serversided, works on every client)



    My new AI
    https://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    https://www.youtube.com/watch?v=Na2kUdu4d_k

  4. The Following 3 Users Say Thank You to Ch40zz-C0d3r For This Useful Post:

    arun823 (04-15-2013),[MPGH]Flengo (04-15-2013),Genesis (04-15-2013)

  5. #4
    Cryptonic's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    United Provinces of Canada
    Posts
    1,313
    Reputation
    44
    Thanks
    190
    My Mood
    Bored
    Why does no one use these chams anymore? They were the best

  6. #5
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,177
    My Mood
    Inspired
    Maybe you should release something useful, not full of errors and preferably not leeched

    This will not work, even if you get past the incomplete code and errors.

    /Closed
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  7. The Following User Says Thank You to Flengo For This Useful Post:

    _Debug_ (04-15-2013)

Similar Threads

  1. [Release] Color Chams - Source Code -
    By Aeir in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 19
    Last Post: 04-08-2012, 09:15 PM
  2. [Request] D3D Chams Source Code C++ 2010
    By enverheckir in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 6
    Last Post: 12-14-2011, 07:17 AM
  3. [Release] Chams Source Code
    By D3t0N4t3 in forum WarRock Hack Source Code
    Replies: 10
    Last Post: 03-10-2011, 05:29 AM
  4. [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, 02:14 PM