本文整理汇总了C#中Mono.Cecil.AssemblyDefinition.FindMethods方法的典型用法代码示例。如果您正苦于以下问题:C# AssemblyDefinition.FindMethods方法的具体用法?C# AssemblyDefinition.FindMethods怎么用?C# AssemblyDefinition.FindMethods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.AssemblyDefinition
的用法示例。
在下文中一共展示了AssemblyDefinition.FindMethods方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IdentifyHurpFuscator
public static ISignature IdentifyHurpFuscator(AssemblyDefinition asmDef, out bool found)
{
foreach (var mDef in asmDef.FindMethods(m => m.HasBody))
{
if (mDef.Parameters.Count == 2 &&
mDef.Body.Variables.Count == 9 &&
mDef.ReturnType.ToString().ToLower().Contains("string") &&
mDef.Body.Instructions.GetOpCodeCount(OpCodes.Callvirt) == 7)
{
found = true;
return new Signatures.HurpFuscatorSignature1_0();
}
if(mDef.Parameters.Count == 1 &&
mDef.Body.Variables.Count == 7 &&
mDef.ReturnType.ToString().ToLower().Contains("string") &&
mDef.Body.Instructions.GetOpCodeCount(OpCodes.Callvirt) == 7 &&
mDef.Body.Instructions.GetOpCodeCount(OpCodes.Ldstr) == 2)
{
found = true;
return new Signatures.HurpFuscatorSignature1_1();
}
}
found = false;
return new Signatures.UnidentifiedSignature();
}
示例2: IdentifyCodeWall
private static ISignature IdentifyCodeWall(AssemblyDefinition asmDef, out bool found)
{
found = false;
if (asmDef.FindMethods(
mDef =>
mDef.Body.Instructions.GetOpCodeCount(OpCodes.Xor) == 6 &&
mDef.Body.Instructions.GetOpCodeCount(OpCodes.Ldc_I4) == 3).Count >= 1)
{
found = true;
return new CodeWallSignature();
}
return new UnidentifiedSignature();
}