| 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?
|
Posted: Thu Jul 30, 2009 12:42 am Post subject: Developing Chams |
|
|
I was wondering how chams works. I'm guessing you'd have to take control of the IDirect3D9, IDirect3DDevice9, and IDirect3DTexture9 interfaces. But I'm a bit confused as to how you would know when a player is being modeled, when they're behind a wall, and how you let calls to functions you don't care about be handled by the game and other calls be handled by you if you took control over the entire device?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Thu Jul 30, 2009 1:34 am Post subject: |
|
|
lol chams.
Basically, you're hooking DrawIndexedPrimitive which is used to draw the player models, and before actually drawing..you set your ZBuffer to disabled (or enabled to false), which gives your model no z-axis, hence why you can see it through any other layer that has depth.
The actual chams part is the SetTexture(0,color); part.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 30, 2009 1:39 am Post subject: |
|
|
I knew someone would lol at chams. Also, wouldn't a game use mesh's for player models? And wouldn't hooking DrawIndexedPrimitive require taking control of the IDirect3DDevice9 interface. And how would I know if it's trying to draw a player model and not something else?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Thu Jul 30, 2009 1:52 am Post subject: |
|
|
| oib111 wrote: | | I knew someone would lol at chams. Also, wouldn't a game use mesh's for player models? And wouldn't hooking DrawIndexedPrimitive require taking control of the IDirect3DDevice9 interface. And how would I know if it's trying to draw a player model and not something else? |
1) I guess it's possible..
2) No, you can hook specific functions out of the vtable if you want.
3) That's why you do stride checks.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 30, 2009 1:56 am Post subject: |
|
|
It seems a hell of a lot easier to use meshes. And, unless someone already figured out the stride, I'm going to need to do some reverse engineering aren't I?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Thu Jul 30, 2009 2:01 am Post subject: |
|
|
| That, or you can just make a logger.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 30, 2009 2:09 am Post subject: |
|
|
I don't know what that is but I want to say it's a program that logs the stride for each model being rendered?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Thu Jul 30, 2009 2:33 am Post subject: |
|
|
There is a program like that (but it's only for unprotected games).
But you can write your own logger. (actually there are public little scripts for them)
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 30, 2009 11:52 am Post subject: |
|
|
Ok. But I'd have to figure out which stride corresponds to the player models. And I just realized, if I hooked DrawIndexedPrimitive, which is what the game is using to draw the player model, and I replaced it with some code for chams, I'd have no way of calling the real DrawIndexedPrimitive
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Thu Jul 30, 2009 1:47 pm Post subject: |
|
|
Hook-hop-nig.
(It's actually called a trampoline)
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 30, 2009 2:15 pm Post subject: |
|
|
You mean skipping the first five bytes? Something like:
| Code: |
DWORD myFunc = (DWORD)GetProcAddress(LoadLibrary("someDLL.dll"), "someFunc")+5;
_declspec(naked) HRESULT Func(parameters) {
_asm {
push ebp
mov ebp, esp
jmp dword ptr ds:[myFunc]
}
}
|
Wouldn't it be a bit different since DrawIndexedPrimitive is a method for an interface?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Thu Jul 30, 2009 3:05 pm Post subject: |
|
|
| Nope that's fine.
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Thu Jul 30, 2009 3:29 pm Post subject: |
|
|
| oib111 wrote: | | Also, wouldn't a game use mesh's for player models? |
Meshes will probably end up in a call to DrawIndexedPrimitive as well.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 30, 2009 3:59 pm Post subject: |
|
|
So something like this:
| Code: |
DWORD myDIP = (DWORD)GetProcAddress(LoadLibrary("d3d9.dll"), "DrawIndexedPrimitive")+5;
_declspec(naked) HRESULT DIP(D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount) {
_asm {
push ebp
mov ebp, esp
jmp dword ptr ds:[myDIP];
}
}
|
Tombama, you mean that DrawSubset ends up calling DrawIndexedPrimitive, right?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|