Repository navigation
macOS support, part 2: find the match hook on Apple Silicon - #35
Merged
Merged
Conversation
Lets the capture hook FM's match update on Apple Silicon Macs running the community macOS BepInEx IL2CPP package. Windows behaviour is unchanged: its code paths run exactly as before, and the macOS logic is in separate files behind MacNative.IsMacOS checks. New files: - MacHookResolver: the arm64 GAME_MATCH signature, finding game_plugin through dyld, scanning its executable ranges, and checking the hook entry (macOS has no VirtualQuery). The macOS game copy is re-signed by the BepInEx package, so its hash never matches and the signature is the way in. - NativeDetourHandle: the create / trampoline / apply steps the hook already uses. On Windows it is BepInEx's INativeDetour itself (WindowsNativeDetour). The macOS package has no INativeDetour, so there it is a MonoMod.Core detour through BepInEx's Il2CppDetourFactory (MacNativeDetour). INativeDetour is only referenced in WindowsNativeDetour, so the plugin still loads on macOS. Existing files, one-line platform checks only: - GameMatchTickHook: detour field type, game_plugin lookup and detour creation. - GamePluginBuildCatalog: TryResolveAob, IsFunctionEntry and GetModulePath hand over to the macOS code on macOS. - GameMatchTickSignature: a MacArm64 signature next to the list. - HookInstallDiagnostics: ValidateEntry hands over on macOS.
osnsyc
approved these changes
Nov 23, 2026
osnsyc
left a comment
Owner
There was a problem hiding this comment.
Confirmed the hook works correctly on Windows.
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.
Windows behaviour is unchanged: its code paths run exactly as before. The macOS logic is in new files behind
MacNative.IsMacOSchecks, as you suggested.New files
MacHookResolver: the arm64 GAME_MATCH signature, findinggame_pluginthrough dyld, scanning its code, and checking the hook entry (macOS has noVirtualQuery). The macOS game copy is re-signed by the BepInEx package, so its hash never matches and the signature is the way in.NativeDetourHandle: the same create / trampoline / apply steps the hook already uses.INativeDetouritself (WindowsNativeDetour, a thin wrapper).INativeDetour, so there it's a MonoMod.Core detour through BepInEx'sIl2CppDetourFactory(MacNativeDetour).INativeDetouris only referenced inWindowsNativeDetour, so the plugin still loads on macOS.Existing files
One-line platform checks only, in
GameMatchTickHook,GamePluginBuildCatalog,GameMatchTickSignatureandHookInstallDiagnostics.Testing
GAME_MATCH Advance hook installed for AOB fallback (macOS arm64) buildINativeDetourcalls as before, through a thin wrapper. A quick check on your side would be great.Next: the macOS offsets for 27.1 (part 3).