diff --git a/de4dot.code/deobfuscators/DeobUtils.cs b/de4dot.code/deobfuscators/DeobUtils.cs index 552f0bc8..a6cbdfe9 100644 --- a/de4dot.code/deobfuscators/DeobUtils.cs +++ b/de4dot.code/deobfuscators/DeobUtils.cs @@ -19,6 +19,7 @@ using System; using System.IO; +using System.Security.Cryptography; using Mono.Cecil; namespace de4dot.code.deobfuscators { @@ -62,5 +63,13 @@ namespace de4dot.code.deobfuscators { } return true; } + + public static byte[] decrypt(byte[] data, byte[] key, byte[] iv) { + using (var aes = new RijndaelManaged { Mode = CipherMode.CBC }) { + using (var transform = aes.CreateDecryptor(key, iv)) { + return transform.TransformFinalBlock(data, 0, data.Length); + } + } + } } }