Use aesDecrypt() method
This commit is contained in:
parent
eb63c27fc9
commit
6b629f20c7
|
@ -155,12 +155,7 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
|||
if (encryptedDataResource == null || key == null || iv == null)
|
||||
throw new ApplicationException("Can't decrypt resource");
|
||||
|
||||
using (var aes = new RijndaelManaged { Mode = CipherMode.CBC }) {
|
||||
using (var transform = aes.CreateDecryptor(key, iv)) {
|
||||
var encryptedData = encryptedDataResource.GetResourceData();
|
||||
return transform.TransformFinalBlock(encryptedData, 0, encryptedData.Length);
|
||||
}
|
||||
}
|
||||
return DeobUtils.aesDecrypt(encryptedDataResource.GetResourceData(), key, iv);
|
||||
}
|
||||
|
||||
public byte[] encrypt(byte[] data) {
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using Mono.Cecil;
|
||||
using Mono.Cecil.Cil;
|
||||
using de4dot.blocks;
|
||||
|
@ -249,13 +248,7 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
|||
else
|
||||
throw new ApplicationException("Unknown string decrypter version");
|
||||
|
||||
byte[] decryptedStringData;
|
||||
using (var aes = new RijndaelManaged { Mode = CipherMode.CBC }) {
|
||||
using (var transform = aes.CreateDecryptor(info.key, info.iv)) {
|
||||
decryptedStringData = transform.TransformFinalBlock(encryptedStringData, 0, encryptedStringData.Length);
|
||||
}
|
||||
}
|
||||
return Encoding.Unicode.GetString(decryptedStringData);
|
||||
return Encoding.Unicode.GetString(DeobUtils.aesDecrypt(encryptedStringData, info.key, info.iv));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user