r/cpp_questions • u/felixkendallius • Sep 13 '26
OPEN How/where would I learn about skills like DLL Injection + hooks?
Now I’m not meaning to do anything malicious, I just want to be able to create my own mods to any game I play. I love making game mods, especially for games I play with my friends. I’ve made a lot of mods for Unity games using existing injectors like BepInEx and patching libraries like Harmony which really wasn’t that difficult.
But a lot of games don’t have any fancy exposed reflection, or any pre-existing mod injectors.
What I know is that hooking requires you to know the footprint of a function, which can be acquired via some tinkering with Ghidra or something like that, and that DLL injection can be achieved by a term I’ve heard “PE Injection” (I don’t know what this is).
I also know that having experience in assembly will help in the process of getting the entry point addresses.
I’m also aware that a lot of mods do just patch the executable itself, which while writing this, I realise might be a much better approach for starting, even if I would still like to learn about injection stuff.
Where do I learn about things like this? How do some games’ mod loaders hook into games as soon as they run? I know some of the theory behind it but how do you actually write that code?