Exemple #1
0
 private static Boolean Is_Ldarg_C(VirtualOpCode ins, Code code)
 {
     // Ldarg_C delegates will reference the arguments field in their Ldfld, which sets them apart from
     // other very similar delegates
     return(ins.Matches(ins.ModifyPattern(Pattern_Ldarg_C, Code.Ldc_I4, code)) &&
            ((FieldDef)ins.DelegateMethod.Body.Instructions[2].Operand).MDToken == ins.VType.ArgumentsField.MDToken);
 }
		private static Boolean Is_Ldarg_C(VirtualOpCode ins, Code code)
		{
			// Ldarg_C delegates will reference the arguments field in their Ldfld, which sets them apart from
			// other very similar delegates
			return ins.Matches(ins.ModifyPattern(Pattern_Ldarg_C, Code.Ldc_I4, code))
				&& ((FieldDef)ins.DelegateMethod.Body.Instructions[2].Operand).MDToken == ins.VType.ArgumentsField.MDToken;
		}
Exemple #3
0
 private static Boolean Is_Stloc_C(VirtualOpCode ins, Code code)
 {
     return(ins.MatchesEntire(ins.ModifyPattern(Pattern_Stloc_C, Code.Ldc_I4, code)) &&
            Helpers.FindOpCodePatterns(                 // Check called method against Pattern_Helper_Stloc_C
                ((MethodDef)ins.DelegateMethod.Body.Instructions[2].Operand).Body.Instructions,
                Pattern_Helper_Stloc_C
                ).Count > 0);
 }
Exemple #4
0
 private static Boolean Is_Ldloc_C(VirtualOpCode ins, Code code)
 {
     return(ins.MatchesEntire(ins.ModifyPattern(Pattern_Ldloc_C, Code.Ldc_I4, code)) &&
            ((FieldDef)ins.DelegateMethod.Body.Instructions[2].Operand).MDToken == ins.VType.LocalsField.MDToken);
 }
		private static Boolean Is_Ldc_I4_C(VirtualOpCode ins, Code code)
		{
			return ins.MatchesEntire(ins.ModifyPattern(Pattern_Ldc_I4_C, Code.Ldc_I4, code));
		}
		private static Boolean Is_Ldloc_C(VirtualOpCode ins, Code code)
		{
			return ins.MatchesEntire(ins.ModifyPattern(Pattern_Ldloc_C, Code.Ldc_I4, code))
				&& ((FieldDef)ins.DelegateMethod.Body.Instructions[2].Operand).MDToken == ins.VType.LocalsField.MDToken;
		}
		private static Boolean Is_Stloc_C(VirtualOpCode ins, Code code)
		{
			return ins.MatchesEntire(ins.ModifyPattern(Pattern_Stloc_C, Code.Ldc_I4, code))
				&& Helpers.FindOpCodePatterns( // Check called method against Pattern_Helper_Stloc_C
					 ((MethodDef)ins.DelegateMethod.Body.Instructions[2].Operand).Body.Instructions,
					 Pattern_Helper_Stloc_C
				   ).Count > 0;
		}
Exemple #8
0
 private static Boolean Is_Ldc_I4_C(VirtualOpCode ins, Code code)
 {
     return(ins.MatchesEntire(ins.ModifyPattern(Pattern_Ldc_I4_C, Code.Ldc_I4, code)));
 }