Ejemplo n.º 1
0
 public string GetResolvedOperandString(Operand op, bool hex)
 {
     if (this.Reference != null)
     {
         if (op.Type == OperandType.JumpTarget)
         {
             // Find external reference
             Label label = this.Reference as Label;
             if (label != null)
             {
                 return(label.Name);
             }
             else
             {
                 if (this.ExternalReference != null)
                 {
                     return(this.ExternalReference.Method.Name);
                 }
                 else
                 {
                     return(op.ToString(hex));
                 }
             }
         }
         else if (op.Type == OperandType.BranchTarget)
         {
             // Find label
             Label label = this.Reference as Label;
             return(label.Name);
         }
         else if (op.Type == OperandType.MemoryAccess)
         {
             // Find memory reference ??
             return(op.ToString(hex));
         }
         else
         {
             return(op.ToString(hex));
         }
     }
     else
     {
         return(op.ToString(hex));
     }
 }
Ejemplo n.º 2
0
        public string GetOperandsString()
        {
            if (this.Operands == null)
            {
                return(string.Empty);
            }
            StringBuilder sb = new StringBuilder();

            for (int n = 0; n < this.Operands.Length; n++)
            {
                Operand op   = this.Operands[n];
                bool    last = (n == this.Operands.Length - 1);
                sb.AppendFormat(" {0}{1}", op.ToString(), last ? "" : ",");
            }
            return(sb.ToString());
        }
Ejemplo n.º 3
0
 public string GetResolvedOperandString( Operand op, bool hex )
 {
     if( this.Reference != null )
     {
         if( op.Type == OperandType.JumpTarget )
         {
             // Find external reference
             Label label = this.Reference as Label;
             if( label != null )
             {
                 return label.Name;
             }
             else
             {
                 if( this.ExternalReference != null )
                     return this.ExternalReference.Method.Name;
                 else
                     return op.ToString( hex );
             }
         }
         else if( op.Type == OperandType.BranchTarget )
         {
             // Find label
             Label label = this.Reference as Label;
             return label.Name;
         }
         else if( op.Type == OperandType.MemoryAccess )
         {
             // Find memory reference ??
             return op.ToString( hex );
         }
         else
             return op.ToString( hex );
     }
     else
         return op.ToString( hex );
 }