diff options
-rw-r--r-- | src/tools/r2rdump/CoreDisTools.cs | 16 | ||||
-rw-r--r-- | src/tools/r2rdump/R2RDump.cs | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/tools/r2rdump/CoreDisTools.cs b/src/tools/r2rdump/CoreDisTools.cs index a8d4f07a37..a3739c0e5e 100644 --- a/src/tools/r2rdump/CoreDisTools.cs +++ b/src/tools/r2rdump/CoreDisTools.cs @@ -20,36 +20,34 @@ namespace R2RDump }; [DllImport("coredistools.dll")] - [return: MarshalAs(UnmanagedType.I8)] - public static extern long InitBufferedDisasm(TargetArch Target); + public static extern IntPtr InitBufferedDisasm(TargetArch Target); [DllImport("coredistools.dll")] - public static extern void DumpCodeBlock(long Disasm, ulong Address, IntPtr Bytes, int Size); + public static extern void DumpCodeBlock(IntPtr Disasm, ulong Address, IntPtr Bytes, int Size); [DllImport("coredistools.dll")] - [return: MarshalAs(UnmanagedType.I8)] - public static extern long GetOutputBuffer(); + public static extern IntPtr GetOutputBuffer(); [DllImport("coredistools.dll")] public static extern void ClearOutputBuffer(); [DllImport("coredistools.dll")] - public static extern void FinishDisasm(long Disasm); + public static extern void FinishDisasm(IntPtr Disasm); - public unsafe static string GetCodeBlock(long Disasm, int Address, int Offset, byte[] image, int Size) + public unsafe static string GetCodeBlock(IntPtr Disasm, int Address, int Offset, byte[] image, int Size) { fixed (byte* p = image) { IntPtr ptr = (IntPtr)(p + Offset); DumpCodeBlock(Disasm, (ulong)Address, ptr, Size); } - IntPtr pBuffer = (IntPtr)GetOutputBuffer(); + IntPtr pBuffer = GetOutputBuffer(); string buffer = Marshal.PtrToStringAnsi(pBuffer); ClearOutputBuffer(); return buffer; } - public static long GetDisasm(Machine machine) + public static IntPtr GetDisasm(Machine machine) { TargetArch target = TargetArch.Target_Host; switch (machine) diff --git a/src/tools/r2rdump/R2RDump.cs b/src/tools/r2rdump/R2RDump.cs index bb457cab19..be5c893196 100644 --- a/src/tools/r2rdump/R2RDump.cs +++ b/src/tools/r2rdump/R2RDump.cs @@ -22,7 +22,7 @@ namespace R2RDump private IReadOnlyList<int> _runtimeFunctions = Array.Empty<int>(); private IReadOnlyList<string> _sections = Array.Empty<string>(); private bool _diff; - private long _disassembler; + private IntPtr _disassembler; private bool _types; private bool _unwind; private bool _gc; |