internal static extern IntPtr Disassemble( [In] SafeCapstoneContextHandle pHandle, [In] byte[] pCode, [In] IntPtr codeSize, [In] ulong startingAddress, [In] IntPtr count, [Out] out IntPtr /* cs_insn * */ instruction);
/// <summary>This is a required override. The method invokes the Capstone /// provided native function that will release the handle.</summary> /// <returns>True on successfull handle release, false otherwise.</returns> /// <remarks>TODO : if the handle is not properly released by the native /// library, we should consider throwing an exception instead of returning /// a boolean. This is almost certainly an unex^pected condition that require /// some kind of fix.</remarks> protected override bool ReleaseHandle() { // We must use a local variable in order to be able to use the ref modifier // on Close call. SafeCapstoneContextHandle mySelf = this; if (IntPtr.Zero == mySelf.handle) { throw new InvalidOperationException(); } CapstoneImport.Close(ref mySelf).ThrowOnCapstoneError(); // We need to reset the handle by ourselves. this.handle = IntPtr.Zero; return(true); }
internal static extern int CountOperands( [In] SafeCapstoneContextHandle pHandle, [In] IntPtr /* cs_insn * */ insn, [In] uint op_type);
internal static extern bool BelongsToGroup( [In] SafeCapstoneContextHandle pHandle, [In] IntPtr /* cs_insn * */ insn, [In] uint group_id);
internal static extern CapstoneErrorCode Close( [In, Out, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeCapstoneContextHandle.RefMarshaler))] ref SafeCapstoneContextHandle pHandle);
internal static extern string RegistryName( [In] SafeCapstoneContextHandle pHandle, [In] uint registryId);
internal static extern CapstoneErrorCode SetOption( [In] SafeCapstoneContextHandle pHandle, [In] DisassembleOptionType option, [In] IntPtr value);
internal static extern string InstructionName( [In] SafeCapstoneContextHandle pHandle, [In] uint instructionId);
internal static extern bool IsRegisterWrite( [In] SafeCapstoneContextHandle pHandle, [In] IntPtr /* cs_insn * */ insn, [In] uint reg_id);
internal static extern string GroupName( [In] SafeCapstoneContextHandle pHandle, [In] uint groupId);
internal static extern int GetOperandIndex( [In] SafeCapstoneContextHandle pHandle, [In] IntPtr /* cs_insn * */ insn, [In] uint op_type, [In] uint position);
internal static extern CapstoneErrorCode GetLastError( [In] SafeCapstoneContextHandle pHandle);
internal static extern SafeNativeInstructionHandle AllocateInstruction( [In] SafeCapstoneContextHandle pHandle);
internal static extern bool DisassembleIteratively( [In] SafeCapstoneContextHandle pHandle, [In, Out] ref IntPtr /* uint8_t ** */ code, [In, Out] ref IntPtr codeSize, [In, Out] ref ulong address, [In] SafeNativeInstructionHandle /* cs_insn * */ insn);