public static Boolean Is(TypeDef typeDef) { try { var cryptoStreamDef = new CryptoStreamDefV2(typeDef); // Check if the crypt method has a ldc.i4 instruction return(cryptoStreamDef.CryptMethod.Body.Instructions.FirstOrDefault( instr => instr.IsLdcI4()) != null); } catch { return(false); } }
public static Boolean Is(TypeDef typeDef) { try { var cryptoStreamDef = new CryptoStreamDefV2(typeDef); // Check if the crypt method has a ldc.i4 instruction return cryptoStreamDef.CryptMethod.Body.Instructions.FirstOrDefault( instr => instr.IsLdcI4()) != null; } catch { return false; } }