Posted: Wed Aug 15, 2012 3:38 pm Post subject: Using lua to hook directx?
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.
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
Posted: Wed Aug 15, 2012 11:32 pm Post subject:
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.
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;
};
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