Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


What are Chams?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun Sep 14, 2008 5:30 pm    Post subject: What are Chams? Reply with quote

Title says it all. As far as I can tell it's like coloring the players in the game. But is it part of the game or is what an external program does?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Fuzz
Grandmaster Cheater
Reputation: 0

Joined: 12 Nov 2006
Posts: 531

PostPosted: Sun Sep 14, 2008 5:49 pm    Post subject: Reply with quote

It has to do with DirectX hooking
_________________
Back to top
View user's profile Send private message AIM Address
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun Sep 14, 2008 5:56 pm    Post subject: Reply with quote

As in the program hooks the DirectX rendering function and makes it render out the shape but just in a solid color(s)?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jackyyll
Expert Cheater
Reputation: 0

Joined: 28 Jan 2008
Posts: 143
Location: here

PostPosted: Sun Sep 14, 2008 6:07 pm    Post subject: Reply with quote

I think chams are just the clothes they wear...
Back to top
View user's profile Send private message AIM Address MSN Messenger
Fuzz
Grandmaster Cheater
Reputation: 0

Joined: 12 Nov 2006
Posts: 531

PostPosted: Sun Sep 14, 2008 6:26 pm    Post subject: Reply with quote

oib111 wrote:
As in the program hooks the DirectX rendering function and makes it render out the shape but just in a solid color(s)?


Something like that. I've honestly never looked into it. Just read small bits when i was looking up hooking.

_________________
Back to top
View user's profile Send private message AIM Address
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sun Sep 14, 2008 7:48 pm    Post subject: Reply with quote

AFAIK, chams are the polygon identifiers or something like that. You find the chams of the polygons in each of the hit zones of the models and hook something in directx. In the hook, you'd check to see if what's getting rendered is one of the chams and if so, you'd change the color that gets rendered.
I haven't looked into this, so I'm probably off. I'm pretty sure there sources available if anyone wanted to look into it.

_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Mon Sep 15, 2008 2:25 am    Post subject: Reply with quote

If you're talking about a DX hack for a FPS, chams make player models a bright colour depending on thier team. You can also see them through walls.
Back to top
View user's profile Send private message MSN Messenger
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Mon Sep 15, 2008 9:03 pm    Post subject: Reply with quote

My understanding was that Chams were the effect of replacing the texture of an object (players) with a solid/simple colored texture. The textures used themselves can be referred to as chams too (my purple chams are prettier... etc).

Lots of people use chams to refer to wallhacks as well, but that is irritating since they are unrelated hacks. You can have chams without wallhacks.

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Tue Sep 16, 2008 3:45 pm    Post subject: Reply with quote

DirectX VTable hook using the games device pointer:

Yes, this code is copy + pasted from a forum, click here to see the full link: http://forum.gamedeception.net/showthread.php?t=11101

Code:
#include <Windows.h>
#include <d3d9.h>
#include <detours.h>

#pragma comment (lib, "d3d9.lib")

IDirect3DDevice9 * pGameDevice;

/*
FEARMP.exe
00501838   8B3D F06F5700    MOV EDI,DWORD PTR DS:[576FF0] //Device Pointer
0050183E   8B4C24 14        MOV ECX,DWORD PTR SS:[ESP+14]
00501842   53               PUSH EBX
00501843   8B5C24 10        MOV EBX,DWORD PTR SS:[ESP+10]
00501847   55               PUSH EBP
00501848   8B2F             MOV EBP,DWORD PTR DS:[EDI]
0050184A   8BC3             MOV EAX,EBX
0050184C   E8 CFFBFFFF      CALL FEARMP.00501420
00501851   8B5424 18        MOV EDX,DWORD PTR SS:[ESP+18]
00501855   8B4C24 28        MOV ECX,DWORD PTR SS:[ESP+28]
00501859   50               PUSH EAX
0050185A   8B4424 28        MOV EAX,DWORD PTR SS:[ESP+28]
0050185E   52               PUSH EDX
0050185F   8B5424 28        MOV EDX,DWORD PTR SS:[ESP+28]
00501863   2BC8             SUB ECX,EAX
00501865   51               PUSH ECX
00501866   50               PUSH EAX
00501867   52               PUSH EDX
00501868   8BC3             MOV EAX,EBX
0050186A   E8 91F3FFFF      CALL FEARMP.00500C00
0050186F   50               PUSH EAX
00501870   57               PUSH EDI
00501871   FF95 48010000    CALL DWORD PTR SS:[EBP+148] //call to DrawIndexedPrimitive
*/
/**************************************************************************************************/

////////////////
///BeginScene///
////////////////
typedef HRESULT(WINAPI* BeginScene_)(LPDIRECT3DDEVICE9 pDevice);
BeginScene_ pBeginScene;
HRESULT WINAPI nBeginScene(LPDIRECT3DDEVICE9 pDevice)
{
   _asm NOP;
   HRESULT hRet = pBeginScene(pDevice);
   
   return hRet;
}

/**************************************************************************************************/

//////////////
///EndScene///
//////////////
typedef HRESULT(WINAPI* EndScene_)(LPDIRECT3DDEVICE9 pDevice);
EndScene_ pEndScene;
HRESULT WINAPI nEndScene(LPDIRECT3DDEVICE9 pDevice)
{   
   _asm NOP;
   HRESULT hRet = pEndScene(pDevice);

   return hRet;
}

/**************************************************************************************************/

//////////////////////////
///DrawIndexedPrimitive///
//////////////////////////
typedef HRESULT(WINAPI* DrawIndexedPrimitive_)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,
                                   UINT NumVertices, UINT StartIndex, UINT PrimitiveCount);
DrawIndexedPrimitive_ pDrawIndexedPrimitive;
HRESULT WINAPI nDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,
                           UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{   
   _asm NOP;
   HRESULT hRet = pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
         
   return hRet;
}

/**************************************************************************************************/

/////////////////////
///SetStreamSource///
/////////////////////
typedef HRESULT(WINAPI* SetStreamSource_)(LPDIRECT3DDEVICE9 pDevice, UINT StreamNumber, IDirect3DVertexBuffer9 * pStreamData, UINT OffsetInBytes, UINT Stride);
SetStreamSource_ pSetStreamSource;
HRESULT WINAPI nSetStreamSource(LPDIRECT3DDEVICE9 pDevice, UINT StreamNumber, IDirect3DVertexBuffer9 * pStreamData, UINT OffsetInBytes, UINT Stride)
{   
   _asm NOP;
   HRESULT hRet = pSetStreamSource(pDevice, StreamNumber, pStreamData, OffsetInBytes, Stride);

   return hRet;
}

/**************************************************************************************************/

///////////
///Reset///
///////////
typedef HRESULT(WINAPI* Reset_)(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters);
Reset_ pReset;
HRESULT WINAPI nReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
{
   _asm NOP;
   HRESULT hRet = pReset(pDevice, pPresentationParameters);

   return hRet;
}

/**************************************************************************************************/


DWORD dwWait(LPVOID lpArgs)
{
   
   DWORD FearBase = NULL;

   for (;FearBase == NULL;Sleep(100))           
      FearBase = (DWORD)GetModuleHandle("FEARMP.exe");  //get base address for FEARMP.exe
   
   for(;pGameDevice == NULL; Sleep(500))  //do this to allow the game to get spun up, if we don't, pGameDevice will always equal 0x00000000(Necessary for injection on game launch)
   {
      DWORD dwProtect;
      VirtualProtect((void*)(FearBase + 0x176FF0), 4, PAGE_EXECUTE_READWRITE, &dwProtect);
      memcpy(&pGameDevice, (void*)(FearBase + 0x176FF0), 4);
      VirtualProtect((void*)(FearBase + 0x176FF0), 4, dwProtect, NULL);
   }
         
      
   DWORD* pdwNewDevice = (DWORD*)pGameDevice;
   pdwNewDevice = (DWORD*)pdwNewDevice[0];  //turn our pointer into an array for the vtable
   
   
   //Hook accordingly 
   //Note: Requires MS Detours v1.5
   //For further indexes, consult the d3d9.h
   pReset = (Reset_)DetourFunction((PBYTE)pdwNewDevice[16],(PBYTE)nReset);
   pBeginScene = (BeginScene_)DetourFunction((PBYTE)pdwNewDevice[41],(PBYTE)nBeginScene);
   pEndScene = (EndScene_)DetourFunction((PBYTE)pdwNewDevice[42],(PBYTE)nEndScene);
   pDrawIndexedPrimitive = (DrawIndexedPrimitive_)DetourFunction((PBYTE)pdwNewDevice[82],(PBYTE)nDrawIndexedPrimitive);
   pSetStreamSource = (SetStreamSource_)DetourFunction((PBYTE)pdwNewDevice[100],(PBYTE)nSetStreamSource);
   
   return 0;
}

bool WINAPI DllMain(HMODULE hMod, DWORD dwReason, LPVOID lpReserved)
{
   if(dwReason == DLL_PROCESS_ATTACH)
   {
            
      CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)dwWait, NULL, NULL, NULL);
      
      return true;
   }
   
   return false;
}

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Tue Sep 16, 2008 3:50 pm    Post subject: Reply with quote

Thanks Smile
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Tue Sep 16, 2008 3:59 pm    Post subject: Reply with quote

oib111 wrote:
Thanks Smile


Another tut:
http://www.mpgh.net/forum/31-c_c/28467-d3d9_chams_tutorial.html

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites