-
Notifications
You must be signed in to change notification settings - Fork 33
Description
I'm the developer of a project called Cpp2IL which uses Capstone.NET to do a lot of heavy lifting regarding disassembly of ARMv7 and ARM64/ARMv8 binaries.
Your NativeDisassemblerHandle and NativeInstructionHandle class both inherit from SafeHandleZeroOrMinusOneIsInvalid, which is in the Microsoft.Win32 namespace, and thus probably should only be used on Windows. However, the library runs just fine on .NET 5 or 6 on Ubuntu too.
The problem, unfortunately, comes when running on Mac OS, where you get an exception like the following:
System.TypeLoadException: Could not load type 'Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid' from assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
at Gee.External.Capstone.CapstoneDisassembler`8..ctor(DisassembleArchitecture disassembleArchitecture, TDisassembleMode disassembleMode)
at Gee.External.Capstone.Arm64.CapstoneArm64Disassembler..ctor(Arm64DisassembleMode disassembleMode)
at Gee.External.Capstone.CapstoneDisassembler.CreateArm64Disassembler(Arm64DisassembleMode disassembleMode)
...snip...
On top of that I have had to add assembly resolve listeners to account for not just #27 (which is fine, I can just get users to install capstone from whatever package manager) but also the fact that, no matter how I compile my application, only the managed capstone.net assembly for Windows is added to the resulting application, rather than for the target operating system, and thus I have to manually load capstone from runtimes/win-x64/lib/netstandard2.0/Gee.External.Capstone.dll.
Otherwise, thank you for the library!