Patch every matching PLT/lazy-bind entry, not just the first - #112
Open
mreastman wants to merge 1 commit into
Open
Patch every matching PLT/lazy-bind entry, not just the first#112mreastman wants to merge 1 commit into
mreastman wants to merge 1 commit into
Conversation
plthook_replace() on macOS stopped at the first symbol match and returned immediately. On arm64 builds we observed duplicate lazy-bind entries for the same imported symbol (e.g. two separate _dlsym slots in UnityPlayer.dylib). Only patching the first left the second, actually-called slot unhooked, so Doorstop's dlsym interception (used to redirect mono_jit_init_version on modern Unity/Mono builds) never fired and Chainloader never started -- silently, with no error. Continue iterating and patch every matching entry instead. Verified against Valheim's dedicated server binary (Unity 6000.0.61f1, arm64 native, no Rosetta): before this fix, Doorstop's own verbose log showed no successful hook of dlsym/mono_jit_init_version and BepInEx.Preloader.dll was never invoked. After, the full chain (dlsym hook -> mono domain init -> Preloader.dll load and invoke) completes successfully.
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.
plthook_replace()on macOS stopped at the first symbol match and returned immediately. On arm64 builds we observed duplicate lazy-bind entries for the same imported symbol (e.g. two separate_dlsymslots inUnityPlayer.dylib). Only patching the first left the second, actually-called slot unhooked, so Doorstop'sdlsyminterception (used to redirectmono_jit_init_versionon modern Unity/Mono builds) never fired and Chainloader never started -- silently, with no error.Continue iterating and patch every matching entry instead.
Verified against Valheim's dedicated server binary (Unity 6000.0.61f1, arm64 native, no Rosetta): before this fix, Doorstop's own verbose log showed no successful hook of
dlsym/mono_jit_init_versionandBepInEx.Preloader.dllwas never invoked. After, the full chain (dlsymhook -> mono domain init ->Preloader.dllload and invoke) completes successfully.🤖 Generated with Claude Code