Crie um Header.h Com Nome de " ChamsRGB.h "
dentro dela adicione esse codigo:
Código:
Depois Inclua a header.h na base.cpp ou hack.cpp
e adicione isso aqui:
Código:
Depois vá na Header main.cpp ou Base.cpp adicione esse codigo:
Código:
Em Algumas Bases Por da Um erro Dizendo que ainda não foi definido a " StartRoutine " Ai Vc coloca em Cima da Hook o Code abaixo
adicione esse codigo:
Código:
E por ultimo vamos nas cores e os tipos de chams
adicione esse codigo em Files.h ou Hack.cpp ou Itens.h
Código:
E por ultimo um exemplo de como adicionar no menu item Observe como é:
dentro dela adicione esse codigo:
Código:
- Código:
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
// NUMPAD1 => Types of chams.
// NUMPAD2 => Types of colors for front and back.
// LEFT and Right => Change colors.
// Change here the version of your Combat Arms => CABR or CAEU or CANA or CAKR
#define CABR
// Actual Address: 06/03/2012
#ifdef CABR
// Combat Arms Brazil
#define GameStatus 0x377F0DDC // Endereços Velhos..
#define DIPEngine 0x006A086A // Endereços Velhos..
#endif
#ifdef CAEU
// Combat Arms Europe
#define GameStatus 0x37806FC4 // Endereços Velhos..
#define DIPEngine 0x006A3E0A // Endereços Velhos..
#endif
#ifdef CANA
// Combat Arms North American
#define GameStatus 0x37806FC4 // Endereços Velhos..
#define DIPEngine 0x006A3E1A // Endereços Velhos..
#endif
#ifdef CAKR
// Combat Arms Korean
#define GameStatus 0x3774C6F0 // Endereços Velhos..
#define DIPEngine 0x006A358A // Endereços Velhos..
#endif
DWORD retDIPEngine = (DIPEngine + 0x8);
INT chams;
INT color1;
INT color2;
INT color3;
INT color4;
INT indexcolor;
//#define Red D3DCOLOR_ARGB( 255, 255, 000, 000 )
//#define Green D3DCOLOR_ARGB( 255, 000, 255, 000 )
//#define Blue D3DCOLOR_ARGB( 255, 000, 000, 255 )
//#define Black D3DCOLOR_ARGB( 255, 000, 000, 000 )
VOID SetLightChams(LPDIRECT3DDEVICE9 pDevice, FLOAT A, FLOAT R, FLOAT G, FLOAT B)
{
D3DMATERIAL9 pMaterial;
ZeroMemory(&pMaterial, sizeof(D3DMATERIAL9));
pDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
//Ambient
pMaterial.Ambient.a = (A/255);
pMaterial.Ambient.r = (R/255);
pMaterial.Ambient.g = (G/255);
pMaterial.Ambient.b = (B/255);
//Diffuse
pMaterial.Diffuse.a = (A/255);
pMaterial.Diffuse.r = (R/255);
pMaterial.Diffuse.g = (G/255);
pMaterial.Diffuse.b = (B/255);
//Specular
pMaterial.Specular.a = (A/255);
pMaterial.Specular.r = (R/255);
pMaterial.Specular.g = (G/255);
pMaterial.Specular.b = (B/255);
pDevice->SetMaterial(&pMaterial);
}
__declspec( naked ) HRESULT WINAPI DIPMidfunction( )
{
static LPDIRECT3DDEVICE9 pDevice;
static INT BaseVertexIndex;
static UINT MinVertexIndex, NumVertices, startIndex, primCount;
__asm
{
MOV ECX, DWORD PTR DS:[EAX]
MOV EDX, DWORD PTR DS:[ECX + 0x148]
MOV DWORD PTR DS:[pDevice], EAX;
MOV ECX, DWORD PTR DS:[EBP + 0x18]
MOV DWORD PTR DS:[BaseVertexIndex], ECX
MOV ECX, DWORD PTR DS:[EBP + 0x8]
MOV DWORD PTR DS:[MinVertexIndex], ECX
MOV ECX, DWORD PTR DS:[EBP + 0x10]
MOV DWORD PTR DS:[NumVertices], ECX
MOV ECX, DWORD PTR DS:[EBP + 0xC]
MOV DWORD PTR DS:[startIndex], ECX
MOV ECX, DWORD PTR DS:[EBP + 0x14]
MOV DWORD PTR DS:[primCount], ECX
PUSHAD
}
if( chams ) {
pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
if( chams == 1 ) {
if( color1 == 1 ) SetLightChams( pDevice, 255, 255, 000, 000 );
if( color1 == 2 ) SetLightChams( pDevice, 255, 000, 255, 000 );
if( color1 == 3 ) SetLightChams( pDevice, 255, 000, 000, 255 );
if( color1 == 4 ) SetLightChams( pDevice, 255, 000, 000, 000 );
if( color1 == 5 ) SetLightChams( pDevice, 255, 255, 000, 255 );
if( color1 == 6 ) SetLightChams( pDevice, 255, 255, 255, 255 );
if( color1 == 7 ) SetLightChams( pDevice, 255, 255, 255, 000 );
if( color1 == 8 ) SetLightChams( pDevice, 255, 150, 000, 255 );
}
if( chams == 2 ) {
pDevice->SetRenderState( D3DRS_LIGHTING, D3DZB_TRUE );
pDevice->SetRenderState( D3DRS_SHADEMODE, D3DSHADE_FLAT );
pDevice->SetRenderState( D3DRS_FOGENABLE, D3DZB_FALSE );
if( color2 == 1 ) pDevice->SetRenderState( D3DRS_AMBIENT, Red );
if( color2 == 2 ) pDevice->SetRenderState( D3DRS_AMBIENT, Green );
if( color2 == 3 ) pDevice->SetRenderState( D3DRS_AMBIENT, Blue );
if( color2 == 4 ) pDevice->SetRenderState( D3DRS_AMBIENT, Black );
}
if( chams > 2 ) {
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, D3DZB_TRUE );
pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVDESTCOLOR );
if( chams == 3 ) pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_INVSRCCOLOR );
if( chams == 4 ) pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA );
}
pDevice->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount );
pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
if( chams == 1 ) {
if( color3 == 1 ) SetLightChams( pDevice, 255, 255, 000, 000 );
if( color3 == 2 ) SetLightChams( pDevice, 255, 000, 255, 000 );
if( color3 == 3 ) SetLightChams( pDevice, 255, 000, 000, 255 );
if( color3 == 4 ) SetLightChams( pDevice, 255, 000, 000, 000 );
if( color3 == 5 ) SetLightChams( pDevice, 255, 255, 000, 255 );
if( color3 == 6 ) SetLightChams( pDevice, 255, 255, 255, 255 );
if( color3 == 7 ) SetLightChams( pDevice, 255, 255, 255, 000 );
if( color3 == 8 ) SetLightChams( pDevice, 255, 150, 000, 255 );
}
if( chams == 2 ) {
if( color4 == 1 ) pDevice->SetRenderState( D3DRS_AMBIENT, Red );
if( color4 == 2 ) pDevice->SetRenderState( D3DRS_AMBIENT, Green );
if( color4 == 3 ) pDevice->SetRenderState( D3DRS_AMBIENT, Blue );
if( color4 == 4 ) pDevice->SetRenderState( D3DRS_AMBIENT, Black );
}
if( chams > 2 ) {
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, D3DZB_TRUE );
pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVDESTCOLOR );
if( chams == 3 ) pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_INVSRCCOLOR );
if( chams == 4 ) pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA );
}
} else {
pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
}
__asm
{
POPAD
JMP retDIPEngine
}
}
void *DetourCreate( BYTE *src, const BYTE *dst, const int len )
{
BYTE *jmp = ( BYTE * )malloc( len + 5 );
DWORD dwBack;
VirtualProtect( src, len, PAGE_EXECUTE_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;
for( int i = 5; i < len; i++ )
src[i] = 0x90;
VirtualProtect( src, len, dwBack, &dwBack );
return ( jmp - len );
}
VOID Hook( VOID )
{
while( TRUE ) {
if( *(BYTE *)GameStatus == 1 ) {
Detours( (PBYTE)DIP, (PBYTE)DIPMidfunction, 8 );
if(chams) indexcolor = !indexcolor;
}
else
memcpy( (VOID *)DIP, (CONST VOID *)(PBYTE)"\x8B\x08\x8B\x91\x48\x01\x00\x00", 8 );
Sleep(100);
}
}
BOOL CheckModules( VOID )
{
if( GetModuleHandleA("d3d9.dll") != NULL
&& GetModuleHandleA("CShell.dll") != NULL
&& GetModuleHandleA("ClientFX.fxd") != NULL )
return TRUE;
return FALSE;
}
DWORD WINAPI StartRoutine( LPVOID )
{
while( !CheckModules( ) )
Sleep(100);
Hook( );
return 0;
}
Depois Inclua a header.h na base.cpp ou hack.cpp
e adicione isso aqui:
Código:
- Código:
#include "ChamsRGB.h"
Depois vá na Header main.cpp ou Base.cpp adicione esse codigo:
Código:
- Código:
CreateThread(NULL, NULL,(LPTHREAD_START_ROUTINE)StartRoutine, NULL, NULL, NULL);
Em Algumas Bases Por da Um erro Dizendo que ainda não foi definido a " StartRoutine " Ai Vc coloca em Cima da Hook o Code abaixo
adicione esse codigo:
Código:
- Código:
DWORD WINAPI StartRoutine( LPVOID ) ;
E por ultimo vamos nas cores e os tipos de chams
adicione esse codigo em Files.h ou Hack.cpp ou Itens.h
Código:
- Código:
[center][color=#4e4e4e][font=Courier
New]char* Opt_Chams5[] = { "[Des]","[RGB]", "[Wall]", "[Ghost]",
"[Phantom]" };[/font][/color][/center]
[center][color=#4e4e4e][font=Courier
New]char* Opt_CorRGB[] = { "[Des]","[Red]", "[Green]", "[Blue]",
"[Black]", "[Pink]", "[Branco]", "[Yellow]", "[Roxo]"
}[/font][/color][/center]
E por ultimo um exemplo de como adicionar no menu item Observe como é:
AdicionarItem(" Chams D3D", Opt_Chams5, &chams, 5, MENUITEM);
AdicionarItem(" Cor 1", Opt_CorRGB, &color1, 9, MENUITEM);
AdicionarItem(" Cor 2", Opt_CorRGB, &color3, 9, MENUITEM);
Creditos:
Noob
Gellin
We11ingtow
Ussr´s
srDIEGO