Launcher for injecting loader without Steam#66
Draft
Pizzabelly wants to merge 1 commit into
Draft
Conversation
Contributor
Author
|
I fixed including the icon in the solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This serves as an alternative way to get a DLL loaded early enough for all of the hooking in the loader to work, as discussed in #63. It uses the common1
CreateRemoteThread()with the address ofLoadLibraryA()DLL injection method. With the adjustment of callingCreateProcessA()withCREATE_SUSPENDEDthenResumeThread()after the injection. I figure this is safer and more predictable, especially because we want the DLL injected before the process starts.The launcher code is made to be compatible with
/NODEFAULTLIB(IgnoreAllDefaultLibrariesin the vcproj) in order to minimize the exe size. Which comes out to ~9.5KB and about half of that is for the 32x32 icon.I've tested this on Windows 11 and Proton 11.0. It can either be run manually from the
MonsterHunterWorld.exefolder or as a Steam launch option.It could also be utilized to load an arbitrary DLL as the loader, like
SharpPluginLoader.dll. That would require using the launcher, though. Which is bad for the most common case of Windows + Steam.Windows (%command% is only there to make Steam not ignore the launch command):
Linux/Proton:
Footnotes
https://en.wikipedia.org/wiki/DLL_injection (Entry 3 in 'Approaches on Microsoft Windows') ↩