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 


Developing Chams
Goto page 1, 2, 3, 4, 5, 6  Next
 
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: Thu Jul 30, 2009 12:42 am    Post subject: Developing Chams Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Thu Jul 30, 2009 1:17 am    Post subject: Reply with quote

Slightly related, aimbot info
http://theoklibrary.org/showthread.php?t=386
sorry Confused

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

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Thu Jul 30, 2009 1:34 am    Post subject: Reply with quote

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
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: Thu Jul 30, 2009 1:39 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Thu Jul 30, 2009 1:52 am    Post subject: Reply with quote

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
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: Thu Jul 30, 2009 1:56 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Thu Jul 30, 2009 2:01 am    Post subject: Reply with quote

That, or you can just make a logger.
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: Thu Jul 30, 2009 2:09 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Thu Jul 30, 2009 2:33 am    Post subject: Reply with quote

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
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: Thu Jul 30, 2009 11:52 am    Post subject: Reply with quote

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 Confused
_________________


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
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Thu Jul 30, 2009 1:47 pm    Post subject: Reply with quote

Hook-hop-nig.

(It's actually called a trampoline)
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: Thu Jul 30, 2009 2:15 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Thu Jul 30, 2009 3:05 pm    Post subject: Reply with quote

Nope that's fine.
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Thu Jul 30, 2009 3:29 pm    Post subject: Reply with quote

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
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: Thu Jul 30, 2009 3:59 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2, 3, 4, 5, 6  Next
Page 1 of 6

 
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