Repository navigation
Commit 652de3c
osx - Patch every matching PLT/lazy-bind entry, not just the first (#112)
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.
Co-authored-by: Taylor McNutt <mu-th-ur-6000@MU-TH-UR.local>1 parent 1e6dee2 commit 652de3c
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
985 | 985 | | |
986 | 986 | | |
987 | 987 | | |
| 988 | + | |
988 | 989 | | |
989 | 990 | | |
990 | 991 | | |
| |||
1015 | 1016 | | |
1016 | 1017 | | |
1017 | 1018 | | |
1018 | | - | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
1019 | 1025 | | |
1020 | 1026 | | |
1021 | 1027 | | |
| |||
1030 | 1036 | | |
1031 | 1037 | | |
1032 | 1038 | | |
| 1039 | + | |
| 1040 | + | |
1033 | 1041 | | |
1034 | 1042 | | |
1035 | 1043 | | |
| |||
0 commit comments