/// <summary> /// Disassemble Binary Code. /// </summary> /// <remarks> /// Convenient method to disassemble binary code with the assumption that the address of the first /// instruction in the collection of bytes to disassemble is 0x1000. Equivalent to calling /// <c>NativeCapstone.Disassemble(handle, code, 0x1000, count)</c>. /// </remarks> /// <param name="handle"> /// A Capstone handle. Should not be a null reference. /// </param> /// <param name="code"> /// A collection of bytes representing the binary code to disassemble. Should not be a null reference. /// </param> /// <param name="count"> /// The number of instructions to disassemble. A 0 indicates all instructions should be disassembled. /// </param> /// <returns> /// A native instruction handle. /// </returns> /// <exception cref="System.InvalidOperationException"> /// Thrown if the binary code could not be disassembled. /// </exception> // public static SafeNativeInstructionHandle Disassemble(SafeCapstoneHandle handle, byte[] code, int count) { // var instructionHandle = NativeCapstone.Disassemble(handle, code, 0x1000, count); // return instructionHandle; // } /// <summary> /// Disassemble All Binary Code. /// </summary> /// <param name="handle"> /// A Capstone handle. Should not be a null reference. /// </param> /// <param name="code"> /// A collection of bytes representing the binary code to disassemble. Should not be a null reference. /// </param> /// <param name="startingAddress"> /// The address of the first instruction in the collection of bytes to disassemble. /// </param> /// <returns> /// A native instruction handle. /// </returns> /// <exception cref="System.InvalidOperationException"> /// Thrown if the binary code could not be disassembled. /// </exception> public static SafeNativeInstructionHandle DisassembleAll(SafeCapstoneHandle handle, byte[] code, ulong startingAddress) { var instructionHandle = NativeCapstone.Disassemble(handle, code, 0, startingAddress); return(instructionHandle); }
/// <summary> /// Disassemble Binary Code. /// </summary> /// <remarks> /// Convenient method to disassemble binary code with the assumption that the address of the first /// instruction in the collection of bytes to disassemble is 0x1000. Equivalent to calling /// <c>NativeCapstone.Disassemble(handle, code, 0x1000, count)</c>. /// </remarks> /// <param name="handle"> /// A Capstone handle. Should not be a null reference. /// </param> /// <param name="code"> /// A collection of bytes representing the binary code to disassemble. Should not be a null reference. /// </param> /// <param name="count"> /// The number of instructions to disassemble. A 0 indicates all instructions should be disassembled. /// </param> /// <returns> /// A native instruction handle. /// </returns> /// <exception cref="System.InvalidOperationException"> /// Thrown if the binary code could not be disassembled. /// </exception> public static SafeNativeInstructionHandle Disassemble(SafeCapstoneHandle handle, byte[] code, int count) { var instructionHandle = NativeCapstone.Disassemble(handle, code, 0x1000, count); return(instructionHandle); }