Add Windows Mono scanner: readMtgaCardsMono + readMtgaInventoryMono#5
Open
dan-blanchard wants to merge 3 commits intomtgatool:mainfrom
Open
Add Windows Mono scanner: readMtgaCardsMono + readMtgaInventoryMono#5dan-blanchard wants to merge 3 commits intomtgatool:mainfrom
dan-blanchard wants to merge 3 commits intomtgatool:mainfrom
Conversation
Bypasses the broken PAPA walker by scanning Arena's heap directly for the card-collection Dictionary<int,int>. Identifies it via the hash==key invariant for DefaultEqualityComparer<int>. Returns ~4300 cards in <1s. Requires sudo for task_for_pid. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scans for ClientPlayerInventory using class-pointer-set pre-filter plus value plausibility and activity-score ranking. Returns wildcards, gold, gems, and vault progress. Key discovery: vaultProgress is an 8-byte double (not int32), storing the UI percentage directly (e.g. 58.9%). Ground-truth verified against Arena's UI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ports collection and inventory readers to Mono runtime on Windows. Verified against Windows Arena in Parallels VM: 4300 cards and inventory values match macOS IL2CPP output exactly. Card collection uses direct Entry[] pattern scan at stride 16. Inventory uses gold+gems-anchored search with vault f64 roundness filter (1e-10 tolerance). Includes VirtualQueryEx heap enumeration and bulk ReadProcessMemory for performance. 8 tests included. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
964b93b to
c5e19eb
Compare
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.
Ports the card collection and inventory readers to work against Arena's Mono runtime on Windows. Verified against a live Windows Arena install in a Parallels VM, with output matching the macOS IL2CPP results exactly (same account, cloud-synced).
Depends on #3 and #6 for the macOS scanner infrastructure and napi dispatch pattern.
What works
Key differences from the IL2CPP scanners
Card collection: Uses direct Entry[] pattern scan at stride 16 (scanning for consecutive `hash==key` entries) instead of finding the Dictionary wrapper object. More robust when Dictionary field offsets are uncertain.
Inventory: Gold+gems-anchored search with a vault f64 roundness filter. Real vault percentages from C# have IEEE 754 representation error ~1e-13 when multiplied by 10. Random bytes that happen to decode as floats in [5, 100] have errors orders of magnitude larger.
Mono object headers: Standalone heap objects (Dictionary, Array) have the same 16-byte header as IL2CPP. But embedded value-type structs (like `ClientPlayerInventory` inside the wrapper) have NO header, so their fields start 8 bytes earlier.
Platform support
Testing
🤖 Generated with Claude Code