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 


Using lua to hook directx?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Exempt
Newbie cheater
Reputation: 0

Joined: 15 Aug 2012
Posts: 10

PostPosted: Wed Aug 15, 2012 3:38 pm    Post subject: Using lua to hook directx? Reply with quote

I've been using the D3D starter kit to learn a bit about how the directX hooks work but I was looking for something a little smaller to deal with. I'm currently able to inject my dll into a game that detours it's decrypt function so I get all the information from packets that I need but I'm like to be able to draw a few things on the screen. The game is a directx9 game.

If it possible to use lua to create hooks like this? I'm using c++ with lua.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25296
Location: The netherlands

PostPosted: Wed Aug 15, 2012 11:32 pm    Post subject: Reply with quote

If you add the functions that do it to lua, then yes

Cheat Engine for example has added some d3dhook functions to lua, that when called hook directx9 (10 and 11) and will show gui objects or other stuff as the user wishes, but that's because it makes use of cheat engine's d3dhook.

Meaning that lua is just an interface you can use to call your own functions.

If you're interested in some CElua examples: Then check http://forum.cheatengine.org/viewtopic.php?t=552281 and http://forum.cheatengine.org/viewtopic.php?t=553143

and ce's d3dhook source. (it's part C++, part delphi, and the interface is lua)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Exempt
Newbie cheater
Reputation: 0

Joined: 15 Aug 2012
Posts: 10

PostPosted: Thu Aug 16, 2012 1:41 am    Post subject: Reply with quote

As much as I love CE I do not want to learn CELua. I'm mainly doing this to learn some c++/lua. I've got a good grasp of hooking and stuff but alot of me issue is with newer stuff like threading to me I guess. I run my main code in a different thread then my packet decrypt hook, then I also have to hook directx all of that together is messing me up a bit. I do have it somewhat working I'll just have to keep at it. Thanks.

Edit:
If you had a constant stream of data coming in from a packet how would you store the data for use in other parts of your program?

Right now I'm using a map to store data structures similar to these. It works ok but I'm probably missing a better way.
Code:
struct player
{
    int x;
    int y;
    int hp;
    int mp;
};
struct groundItem
{
    int x;
    int y;
    int id;
};
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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