本文整理匯總了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();
}