public asmInstruction(x86_insn_t frominsn, long addr) { x86_oplist_t curop; m_insn = frominsn; m_addr = addr; //build operand list m_Operands = new List <asmOperand>((int)m_insn.operand_count); if (m_insn.operand_count != 0) { curop = (x86_oplist_t)Marshal.PtrToStructure(frominsn.operands, typeof(x86_oplist_t)); for (uint i = 0; i < m_insn.operand_count; i++) { m_Operands.Add(new asmOperand(curop.op)); if (i < (m_insn.operand_count - 1)) { curop = (x86_oplist_t)Marshal.PtrToStructure(curop.next, typeof(x86_oplist_t)); } } } }
internal static extern uint x86_disasm([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] buf, [MarshalAs(UnmanagedType.I4)] int buf_len, [MarshalAs(UnmanagedType.U4)] uint buf_rva, [MarshalAs(UnmanagedType.U4)] uint offset, out x86_insn_t insn);