Solved D3D MENU not showing up when injected.

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

ajayHD

Newbie
Full Member
Jul 16, 2015
9
84
0
I was following fleeps tutorial on DIRECTX Menu hack and wallhack and chams. To make the wall hack you need a menu and fleep linked the completed template in the description. i downloaded it and It builds fine so i wanted to test it so i opened up a d3d9 application and injected it said "injection successful" however no matter how hard i pressed the INSERT key the menu would not open up. I have tried this on other D3d9 apps but to no avail. I haven't changed anything from this source file maybe i was supposed to if thats the case could someone direct me to what i must change to the menu will open up.
Thanks
 

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,187
12,638
76
Since this question has been brought up hundreds of times during the last 2 years at least regarding the same tutorial and source I am going to put this here.

The source hooks direct3dcreate9, which is USUALLY called only ONCE by the game, right. Looking at the deadlocking DllMain of Fleeps code, you can see the code doesn't give a jack shit whether d3d9.dll has been actually loaded or not, it will still attempt to hook it. This leaves you with a couple of scenarious:

1) You inject "too late" - d3d9.dll is loaded and direct3dcreate9 gets hooked, but it was already called earlier and you didnt catch it so game d3d calls never reach your hooks.
2) You inject "too early" - d3d9.dll isn't loaded and the code attempts to hook nothing.
3) You inject at "just about right" time - d3d9.dll is loaded but direct3dcreate9 hasnt been called yet. Odds of that? depends on the game, but i'd say you're in crap more or less most of the time.


So what do you do? Well, First prevent dllMain from deadlocking. Then write a thread that looks for d3d9.dll, if it's find, attempt to detour. And auto inject asap.

I like how this issue regarding this tutorial was never properly addressed for years by nobody :D
 

BenjaminMartin

Fleep Tier Donator
Nobleman
Sep 11, 2017
66
1,033
2
I would highly recommend anyone following this tutorial in 2018 to use guidedHacks injector. You also need to compile the project yourself in visual studio. Using other precompiled .dll versions have failed for me. Download the 2004 directXSDK lib+include from Fleep's main thread and link it in visual studio.

You also need to retarget solution in visual studio and include like a legacy library in the linker options so that the old snPrintf and compiler errors satisfied.
C++: Unresolved external symbol _sprintf and _sscanf in Visual Studio 2015

Also sometimes restarting computer magically fixes problems. I had to reinstall game too once. Just message me if you're still having issues
 
Last edited:
  • Like
Reactions: tigertank

thepecher

Newbie
Full Member
May 3, 2017
6
52
0
Since this question has been brought up hundreds of times during the last 2 years at least regarding the same tutorial and source I am going to put this here.

The source hooks direct3dcreate9, which is USUALLY called only ONCE by the game, right. Looking at the deadlocking DllMain of Fleeps code, you can see the code doesn't give a jack shit whether d3d9.dll has been actually loaded or not, it will still attempt to hook it. This leaves you with a couple of scenarious:

1) You inject "too late" - d3d9.dll is loaded and direct3dcreate9 gets hooked, but it was already called earlier and you didnt catch it so game d3d calls never reach your hooks.
2) You inject "too early" - d3d9.dll isn't loaded and the code attempts to hook nothing.
3) You inject at "just about right" time - d3d9.dll is loaded but direct3dcreate9 hasnt been called yet. Odds of that? depends on the game, but i'd say you're in crap more or less most of the time.


So what do you do? Well, First prevent dllMain from deadlocking. Then write a thread that looks for d3d9.dll, if it's find, attempt to detour. And auto inject asap.

I like how this issue regarding this tutorial was never properly addressed for years by nobody :D
Hey there C5 , thanks for clearing that up.
I fixed it by using another injector and auto injecting it on start up.
So even though it works now i know its not the right way.
Could you maybe explain me how the injection process works? I am pretty new to game hacking so i am still struggling to understand things.
What is a hook and what is hooking?

Secondly, you give a solution but how would you implement that? Create your own injector or hook something else than direct3dcreate9? What do you mean by detouring? I have a C background so all this is still a bit blurry for me.
What im getting is this: Loop untill i find that d3d9.dll is loaded and then inject as fast as possible?

I hope you (or someone else) can help me,
Thanks in advance

(If anyone feels helpfull, here are some concepts i'd like some short explanation on:
Hook
Hooking
D3d calls
)
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
Hey there C5 , thanks for clearing that up.
I fixed it by using another injector and auto injecting it on start up.
So even though it works now i know its not the right way.
Could you maybe explain me how the injection process works? I am pretty new to game hacking so i am still struggling to understand things.
What is a hook and what is hooking?

Secondly, you give a solution but how would you implement that? Create your own injector or hook something else than direct3dcreate9? What do you mean by detouring? I have a C background so all this is still a bit blurry for me.
What im getting is this: Loop untill i find that d3d9.dll is loaded and then inject as fast as possible?

I hope you (or someone else) can help me,
Thanks in advance

(If anyone feels helpfull, here are some concepts i'd like some short explanation on:
Hook
Hooking
D3d calls
)
That's how you fucking necro! lol THANK YOU
Alright, so lets get to it.

So first of all, congrats on getting that code to work. Fucking feat in and of itself.

Basically the code hooks CreateD3dDevice9 to get the Device pointer, the Device pointer is like the almighty wizards staff of direct3d and you need it to call most of the drawing functions.
The issue here is, this function is called only once in the lifetime of the game, so if you missed it, you're shit out of luck.
Instead, you can hook another function such as EndScene, or Present. These functions are constantly being called during the lifetime of a game so you can hook whenever you'd like and it should work.

DLL Injection is a topic all on its own and there are several techniques. More often then not, it's a mixture of LoadLibrary and CreateRemoteThread.
Basically you inject a stub of code into the process, a call to LoadLibrary along with it's parameter, and call CreateRemoteThread on the stub you injected. This will make the game call load the module and call DllMain.

Hooking is basically the act is rerouting the flow of execution to your own code. With hooking you can change the behavior of functions or even extract information from the parameters passed to the function. You can change the return, or make the routine return prematurely. There's a lot of shit you can do with hooking because you basically have a piece of code being executed by the game.
 

thepecher

Newbie
Full Member
May 3, 2017
6
52
0
That's how you fucking necro! lol THANK YOU
Alright, so lets get to it.

So first of all, congrats on getting that code to work. Fucking feat in and of itself.

Basically the code hooks CreateD3dDevice9 to get the Device pointer, the Device pointer is like the almighty wizards staff of direct3d and you need it to call most of the drawing functions.
The issue here is, this function is called only once in the lifetime of the game, so if you missed it, you're shit out of luck.
Instead, you can hook another function such as EndScene, or Present. These functions are constantly being called during the lifetime of a game so you can hook whenever you'd like and it should work.

DLL Injection is a topic all on its own and there are several techniques. More often then not, it's a mixture of LoadLibrary and CreateRemoteThread.
Basically you inject a stub of code into the process, a call to LoadLibrary along with it's parameter, and call CreateRemoteThread on the stub you injected. This will make the game call load the module and call DllMain.

Hooking is basically the act is rerouting the flow of execution to your own code. With hooking you can change the behavior of functions or even extract information from the parameters passed to the function. You can change the return, or make the routine return prematurely. There's a lot of shit you can do with hooking because you basically have a piece of code being executed by the game.

Hey thanks a bunch for the reply, it really clears things up!
Would hooking any other function return the same "Device pointer", and is it always some sort of d3d object?

And to finish things up, knowing i know C and other OOP languages like Java(script) and knowing i kinda hopped right in thinking i'd figure it out by combining my knowledge on both C and OOP, do you have any c++ specific concepts you think i should look into before continuing?

As said before thanks a lot, understanding these key concepts is where its at.
Thepecher
 

tigertank

Full Member
Jun 28, 2018
31
228
0
I would highly recommend anyone following this tutorial in 2018 to use guidedHacks injector. You also need to compile the project yourself in visual studio. Using other precompiled .dll versions have failed for me. Download the 2004 directXSDK lib+include from Fleep's main thread and link it in visual studio.

You also need to retarget solution in visual studio and include like a legacy library in the linker options so that the old snPrintf and compiler errors satisfied.
C++: Unresolved external symbol _sprintf and _sscanf in Visual Studio 2015

Also sometimes restarting computer magically fixes problems. I had to reinstall game too once. Just message me if you're still having issues
Struggleing for two days now because i can't find the error. This solved it. Thank you very much!

As mentioned in the link, just include "legacy_stdio_definitions.lib" and it worked for me.

1531217168415.png
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Similar threads

Community Mods