internal DumpInfo(OpCode op, bool simplify) { Value = op.Size == 1 ? op.Value.ToString("X2") + "h" : op.Value.ToString("X4") + "h"; Name = op.Name; Size = (op.Size + "+" + op.GetOperandSize()).Replace("+0", ""); OperandType = op.OperandType.ToString().Replace("Inline", "").Replace("None", "").Replace("Short", ""); StackPop = fixpoppush(op.StackBehaviourPop.ToString(), "pop"); StackPush = fixpoppush(op.StackBehaviourPush.ToString(), "push"); FlowControl = op.FlowControl.ToString(); OpCodeType = op.OpCodeType.ToString(); if (simplify) { OperandType = OperandType.Replace("Inline", "").Replace("None", "").Replace("Short", ""); StackPop = fixpoppush(StackPop, "pop"); StackPush = fixpoppush(StackPush, "push"); FlowControl = op.OpCodeType == System.Reflection.Emit.OpCodeType.Nternal ? "zMeta" : op.FlowControl.ToString().Replace("Cond_Branch", "Branch_Cond").Replace("Next", "").Replace("Meta", "xMeta"); } }
public static int GetInstructionSize(this OpCode op) { return(op.Size + op.GetOperandSize()); }