Repository navigation
Conversation
Pass16ScanMethodRefs maps GameAssemblyPath and adds each method's file offset to the start of the mapping. Those offsets are relative to the x86-64 image, which in a universal (fat) Mach-O binary starts at a slice offset rather than at the start of the file, so xref scanning decoded unrelated bytes and failed with ArgumentOutOfRangeException in XrefScannerLowLevel.ExtractTargetAddress. macOS Unity games ship such a universal GameAssembly.dylib (x86_64 + arm64). Locate the x86-64 slice when the file is universal and scan within it. Thin binaries are unaffected.
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.
Pass16ScanMethodRefsmapsGameAssemblyPathand adds each method's file offset to the start of the mapping. In a universal (fat) Mach-O those offsets are relative to the x86-64 image, which starts at a slice offset, not at the start of the file. Xref scanning therefore decodes unrelated bytes and fails inXrefScannerLowLevel.ExtractTargetAddresswithArgumentOutOfRangeException. macOS Unity games ship such a universalGameAssembly.dylib(x86_64 + arm64).The fix adds
MachOUniversalBinary.TryGetSlice, which parses fat/fat64 headers big-endian. When the file is universal, the scan is offset to the x86-64 slice and bounded by its size. Thin binaries are unaffected.Validation (generator harness against the Dofus 3.6.10.11 Cpp2IL output):
ArgumentOutOfRangeExceptiondotnet format --verify-no-changesis clean on the changed files. The only pre-existing whitespace finding is inReferenceCreator.cs, which this change does not touch.