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 


Quick Question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Sat Aug 07, 2010 2:25 pm    Post subject: Quick Question Reply with quote

I want to create a trainer that instead of a window, it draws itself to the game's window.
So I've hooked EndPaint so my drawings are last and finally called the original EndPaint, but for some reason it doesn't seem to work. all I did was a simple TextOut which appeared like once or twice in all of my tries.
Perhaps I need to perform the drawings elsewhere?

Thanks.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Sat Aug 07, 2010 5:08 pm    Post subject: Reply with quote

Does the game use a specific rendering engine? For example:
- Direct3D
- OpenGL

If so, you could hook those instead and render using them.
You will get much better performance doing it that way.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Sat Aug 07, 2010 6:21 pm    Post subject: Reply with quote

I thought of that, because it uses Allegro... but I found nothing, not even calls to UpdateWindow/RedrawWindow. The library has a function update_display but I don't know how refreshes the screen, probably WM_PAINT message?
It also doesn't use any Sleep which might give me a hint where to look for the update function, nor GetTickCount/timeGetTime or CRT time/clock, which it imports as-well...

Anyway, I think I'd just choose another game, I'm only doing this to study, not to accomplish anything specific.
Should I still use the EndPaint hook or shall I use some other method?

Thanks.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Sat Aug 07, 2010 7:11 pm    Post subject: This post has 1 review(s) Reply with quote

Allegro is open source which you can find here:
http://alleg.sourceforge.net/

According to their site, it uses DirectX (or GDI/OpenGL depending on the extension(s) used) to do it's rendering:

Quote:
Windows graphics drivers using DirectX in fullscreen and windowed modes, plus routines for drawing onto GDI device contexts.


After looking at their source though, it appears they use DirectDraw rather then any current version of Direct3D. You will need to hook that rather then Direct3D then.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Sat Aug 07, 2010 7:33 pm    Post subject: Reply with quote

I'll choose another game, I guess. thanks for the help, though...
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