コード例 #1
0
 private bool Matches(ProcessorState state)
 {
     for (int i = 0; i < RegisterValues.Length; ++i)
     {
         Constant v = state.GetRegister(RegisterValues[i].Register);
         if (v == null || v == Constant.Invalid)
         {
             return(false);
         }
         if (v.ToUInt32() != RegisterValues[i].Value)
         {
             return(false);
         }
     }
     if (StackValues != null && StackValues.Length > 0)
     {
         for (int i = 0; i < StackValues.Length; ++i)
         {
             var c = state.GetStackValue(StackValues[i].Offset) as Constant;
             if (c == null || c == Constant.Invalid)
             {
                 return(false);
             }
             if (c.ToUInt32() != StackValues[i].Value)
             {
                 return(false);
             }
         }
     }
     return(true);
 }
コード例 #2
0
ファイル: SystemService.cs プロジェクト: zan00789/reko
 public bool Matches(ProcessorState state)
 {
     if (state == null &&
         ((RegisterValues != null && RegisterValues.Length > 0) ||
          (StackValues != null && StackValues.Length > 0)))
     {
         return false;
     }
     for (int i = 0; i < RegisterValues.Length; ++i)
     {
         Constant v = state.GetRegister(RegisterValues[i].Register);
         if (v == null || v == Constant.Invalid)
             return false;
         if (v.ToUInt32() != RegisterValues[i].Value)
             return false;
     }
     if (StackValues != null && StackValues.Length > 0)
     {
         for (int i = 0; i < StackValues.Length; ++i)
         {
             var c = state.GetStackValue(StackValues[i].Offset) as Constant;
             if (c == null || c == Constant.Invalid)
                 return false;
             if (c.ToUInt32() != StackValues[i].Value)
                 return false;
         }
     }
     return true;
 }