Merge branch 'master' into goliath

This commit is contained in:
de4dot 2011-12-31 15:07:35 +01:00
commit f2115b77bb
2 changed files with 16 additions and 0 deletions

View File

@ -876,6 +876,14 @@ namespace de4dot.blocks {
return res;
}
public static bool compareFieldReferenceAndDeclaringType(FieldReference a, FieldReference b) {
if (!compareFieldReference(a, b))
return false;
if (a == null)
return true;
return compareTypes(a.DeclaringType, b.DeclaringType);
}
public static bool compareFieldReference(FieldReference a, FieldReference b) {
if (ReferenceEquals(a, b))
return true;

View File

@ -72,6 +72,14 @@ namespace de4dot.code.deobfuscators {
}
}
public static byte[] des3Decrypt(byte[] data, byte[] key, byte[] iv) {
using (var des3 = TripleDES.Create()) {
using (var transform = des3.CreateDecryptor(key, iv)) {
return transform.TransformFinalBlock(data, 0, data.Length);
}
}
}
public static string getExtension(ModuleKind kind) {
switch (kind) {
case ModuleKind.Dll: