Page 1 of 1
Question for a dev
Posted: Sat Dec 20, 2003 11:41 am
by crazyjim
I'm developing a general macro tool for any game.
I need the ability to:
A) Spoof a keypress to directx
B) Spoof the mouse to directx
I've spent over 20 hours browsing the net for information. Many people seem to have the same question, but no answers.
Thank you,
Jim
Posted: Sat Dec 20, 2003 11:58 am
by MQSEQ
Get the code and read it. It's pretty basic to figure out how they are doing it since the majority of the code is doing the same thing but for a different command. But the hard part is to make a generalized macro since each game is done different, for example DixertX vs. non DirextX.
Posted: Sat Dec 20, 2003 1:34 pm
by Space-Boy
hate to mention it here, but xylobot.... yep yep it works well for this purpose, download it, rip it apart and figure out how it works to make yer own =) could work
I have code for non directx
Posted: Sat Dec 20, 2003 3:15 pm
by crazyjim
keybd_event works, and I have mouse spoofing too.
Its directx that really is giving me issues. If someone could help me out, I could even pay them.
The person I got the keybd_event info from, I paid $25
I figure $40 would be fair if someone got me code that could access directx for mouse and keyboard.
I'm going mad on this, I really spent close to 30 hours just looking through the internet for help.
Posted: Sat Dec 20, 2003 4:24 pm
by eq_freak
Your answer is in the second post in this thread
If you use C++ you can use microsofts detours library to hook the directx functions. As for how, look at the source for macroquest.
If you dont use C++, good luck on finding an alternative solution :)
A generic no offsets required solution(for DirectX8, but you could add similar for other versions) could go something like this:
Step 1: Hook the Direct3DCreate8 function
Step 2: In the Direct3DCreate8 hook, Install the hook for IDirect3D8::CreateDevice
Step 3: Remove the Direct3DCreate8 hook
Step 4: In the IDirect3D8::CreateDevice hook, install GetDeviceData hook
Step 5: Remove the IDirect3D8::CreateDevice hook
Now you should have a GetDeviceData hook in place where you can manipulate keyboard/mouse buffers MQ-style. You can also do other fun stuff, like hooking EndScene and draw stuff on the screen every frame, or SetRenderState for quake wall-hack style effects.
Posted: Sun Dec 21, 2003 3:30 am
by zedisdeadbaby
detours is a useful thing to learn, but keybd_event is the quickest and easiest way to get a keypress in EQ. maybe check if EQ is in the foreground first though.