Posted: Sat Feb 04, 2017 2:11 pm Post subject: Calling DirectX Functions
I have a doubt.
To call directX functions within a game, The hack needs to be an inject DLL in the game, or need not be injected into the game.
I want to start creating chams, Wireframe. But I have not much idea nor looking at tutorials. _________________
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
Posted: Sat Feb 04, 2017 3:40 pm Post subject:
Your best bet is hooking things to do stuff like this.
For wireframe, if you just want to make the entire game wireframed, then you just mainly need to hook SetRenderState and override/force D3DRS_FILLMODE to the wireframe value.
For chams, or if you want to apply wireframe to models (players/enemies/etc.) only, then you are going to need to do more. You will need to hook the drawing commands such as:
- DrawIndexedPrimitive
- DrawIndexedPrimitiveUP
- DrawPrimitive
- DrawPrimitiveUP
Depending on which the game uses to draw its things. You will need to compare info based on the call to determine what is what as well, such as the number of primitives and stride.
There are thousands of examples of doing things like this around the net, plenty of open source information for D3D hooking and doing chams/wireframe/etc. _________________
we'd like to provide help, but you've not explained at all what you're trying to do (screenshots, or videos of your work, or detailed explanation would help). Then again, if you say you can never compile something, then it means you're trying to compile someone's source to obtain a DLL you can inject into a game. That game being an online game. Correct?
While the code is old and somewhat messy the general idea applies still. The method covered in that topic would apply to Direct3D8 and Direct3D9. If your target is Direct3D10/11/12 the things required to be hooked/wrapped change because of the API has changed greatly since v9.
You can also do the hooks in multiple other ways rather than doing a full wrapper:
- You could use VMT hooks after finding the device pointer.
- You could create a proxy DLL.
- You could hook a games rendering function directly and just add onto it.
And so on. The way you approach it is best up to you and how it would best suit the target. (Things to factor in would be if there is an anti-cheat etc.) _________________
SunBeam I am asking about this is because I have a doubt. I do not know how to speak English, the tutorials are always in English, and the translations sometimes get wrong interpretations.
What matters is what I want to do, if you want to help me, thank you, if I can help someone, I'll help.
The only thing I asked is if to create these hacks as "chams" I have to create a dll or application, do you need an image to answer a question like this??
Since it is so interested, yes it is a source code that someone created. I do not know anything about directX, and I do not intend to learn about it if I can not compile a script that uses directX function.
If I just wanted the dll for a game, I would not be downloading a source code, I would download it to the dll itself.
I want to learn about this, unfortunately without being able to compile any script that involves directX has no way. _________________
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
Posted: Sat Feb 04, 2017 6:19 pm Post subject:
Filipe_Br wrote:
SunBeam What is your problem, if I am asking about this is because I have a doubt. I do not know how to speak English, the tutorials are always in English, and the translations sometimes get wrong interpretations.
What matters is what I want to do, if you want to help me, thank you, if I can help someone, I'll help.
The only thing I asked is if to create these hacks as "chams" I have to create a dll or application, do you need an image to answer a question like this??
Since it is so interested, yes it is a source code that someone created. I do not know anything about directX, and I do not intend to learn about it if I can not compile a script that uses directX function.
If I just wanted the dll for a game, I would not be downloading a source code, I would download it to the dll itself.
I want to learn about this, unfortunately without being able to compile any script that involves directX has no way.[/b]
What game are you looking to alter and test things with? What version of Direct3D does it use if you know off hand? If not it can usually be found via Google pretty easily. For stuff like this, I would suggest targeting a single player game first, that has no protections so you can get an understanding of the basics of how Direct3D works and understand what is going on in the code you plan to work with.
As a means of good examples, UnknownCheats has a ton of Direct3D related code and information for game hacking that would help with the varying versions of Direct3D you may encounter.
Newer games today mostly make use of DX11 or 12. Some still use DX9 while 10 is not used too much. So if you do decide to start learning pick which version you want to focus on and if your target starting point is going to be older games or newer ones.
Keep in mind discussion for online game hacking is not allowed here so if your target is multiplayer I'd suggest looking at a different target to start with. _________________
Filipe_Br: "Chams" is usually a term used in online shooters, where the DirectX hack allows you to see through solid walls. This term has later on been widely spread, denoting DX injectable DLLs where you could do more than just seeing through walls. As you're saying even yourself, it's someone else's source code (and you've probably watched a video or two, where the author shows what to do and how it works for him; but not for you, cuz, as you put it, it didn't compile for you, even though you followed a tutorial). And you clearly saw ALL DirectX hacks are wrappers, thus DLLs. And the only way you'd work with a DLL for DirectX hooking is injecting it in the game's process (so it can do the HOOKING).
Yes "chams" is usually created for online games. "Usually" not always.
I know how to generate a .dll and .exe applications.
How can I tweak the features if I do not know how to compile script that uses "directX", and what good is studying the documentation, unmotivated because it can not compile a ready code. _________________
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
Posted: Sat Feb 04, 2017 6:45 pm Post subject:
I was referring to the other thread I just locked because you wouldn't drop things and kept going off topic like you are now doing here (partially). No idea how STN landed up getting brought into this.
This is a programming section where people are free to ask questions pertaining to programming. Which is exactly what Filipe_Br did. His topic is related to Direct3D programming / hacking. Simply because the general purpose of chams is seen and done in multiplayer does not automatically deem his topic invalid.
Plenty of people do multiplayer style FPS cheats in single player aspects. Not everything that involves Direct3D hacking is done for the sole purpose of online games.
Not everyone grasps things instantly either so him asking questions and getting some assistance to help him is nothing wrong and completely valid for this section. I have no plans on handing him code outside of the link I gave above which is a tutorial explaining things to some degree. The intention here is to help him understand Direct3D and what needs to be done to do what he wants to do regardless of the context of the game being single player or multiplayer. _________________
Using Cheat Engine I was able to create this menu for Assassin's Creed: Black Flag. It's not my code, it's mostly Dark Byte's and many other people I've seen posting in the LUA section. Keep in mind I DON'T KNOW LUA CODING AT ALL (I didn't at the time I had the idea of using it in tables; I partially do now). I've simply taken snippets off, studied what they do, decided if they're useful or not for what I plan to do and then compiled the huge ass script that is called a "d3dhook menu" that does the below:
Then I attempted to do the same thing in Assassin's Creed 2 (Black Flag is Assassin's Cred 4). Now, 2 uses DirectX 9 and simply put, game crashes when you attempt to hook DX via Cheat Engine. I then asked Dark Byte about it and he said I should start from the SVN (where the C++ code for the DX hook is) and compile it in debug-mode, then study why and where it crashes.
He didn't say anything extra, but that. I did what he said, got the stuff, downloaded DirectX SDK (you need this as well, in case you wonder why compiling fails) and attempted to compile the source. Well, guess what: it didn't work. All errors and warnings. Not to mention the project was built with a different version of Visual Studio I didn't have, so I ended up getting/using that instead.
I was later on able to get it to compile (same as you, without much knowledge, but some rudimentary logic) and to this day I still don't know why a DX9 game crashes when Cheat Engine attempts to hook Direct3D. And I've not posted it here "cuz I had a doubt", but I did explain the whole process above, as you should've done yourself to begin with: I did this, that, didn't work; I even tried this and that, here's proof; then ask us to help.
Another off-topic to make a point.
BR,
Sun
P.S.: atom0s, then I apologize. The phrasing led me to believe you're thinking of a specific someone that instigated me to pick at you I just remembered an old beef you might still have with him even today. My bad.
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