Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add background info about hooking #293

Open
budak7273 opened this issue May 4, 2024 · 0 comments
Open

Add background info about hooking #293

budak7273 opened this issue May 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@budak7273
Copy link
Member

budak7273 commented May 4, 2024

The hooking SML is using is just c/c++ function hooking, as Unreal Engine is c++. Theoretically, that can be used on any executable, but you need to know the location of functions in memory, which is difficult.
For general c++ executables, and UE games, you only have a .exe, which provides no information about where functions are located, so to figure that out you need very good reverse engineering skills, and it needs to be done on an exe by exe basis, so if the game updates, everything breaks.
What's different about Satisfactory is that it provides PDBs, which normally are used to determine the call stack when a crash happens, but they can also be used in the other direction, to find a function address based on the name. That's what SML v1 used. The trouble there is that many functions may be stripped, or inlined, which makes C++ modding in general harder, but also hooking, as methods might suddenly disappear and be embedded into the place they are called from.
With some Update, at our request, Coffee Stain enabled modular build, which means each Unreal Engine module is a dll on its own. This means that all functions are exported, so their address can be natively found by the linker, and also that no function can be inlined.
Modular builds also enable the native Unreal Engine mod support (i.e., loading mod plugins from the Mods folder)
TL;DR; Yes, it can be applied to other games, but only if they supply PDBs or use a modular build, otherwise you can't reliably do it

https://discord.com/channels/555424930502541343/601030071221878784/1236300128932069417

@budak7273 budak7273 converted this from a draft issue May 4, 2024
@budak7273 budak7273 added the enhancement New feature or request label May 4, 2024
@budak7273 budak7273 changed the title Add backgroun info about hooking Add background info about hooking May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant