TDMP-Team / TDMP-Launcher

2 stars 1 forks source link

feat: Move DLL injection responsibility out of launcher into separate C++ library #26

Open gnalvesteffer opened 1 year ago

gnalvesteffer commented 1 year ago

Solves https://github.com/TDMP-Team/TDMP-Launcher/issues/24

This change moves the implementation details of DLL injection out of the launcher (C#), into a separate native DLL (C++), which is arguably the right tool/language for the job, avoiding the mess that is the hackery of using C# and many PInvokes to accomplish injection. This also allows us to easily launch Teardown from any path, (not just what Steam points to), which allows users to make a copy of their Teardown folder just for TDMP purposes if they want. Additionally with this native injector, we will now start Teardown suspended so that functions like WinMain can be modified/hooked before execution early in the process' lifecycle. The Injection Delay is also removed with this change,

This introduces a new C++ DLL project to the solution, which has its build output placed in the TeardownMultiplayerLauncher project's output folder, ensuring that the injector is distributed alongside the launcher.

gnalvesteffer commented 1 year ago

Found an issue where the launcher isn't detecting the Teardown process to wait for it to exit while displaying the busy screen in the UI. Looking into it.

EDIT: Solved.

gnalvesteffer commented 1 year ago

Looking into an issue where TDMP doesn't seem to initialize when injected.