diff --git a/de4dot.code/deobfuscators/CodeVeil/StringDecrypter.cs b/de4dot.code/deobfuscators/CodeVeil/StringDecrypter.cs index a5c7dadf..893fb6cb 100644 --- a/de4dot.code/deobfuscators/CodeVeil/StringDecrypter.cs +++ b/de4dot.code/deobfuscators/CodeVeil/StringDecrypter.cs @@ -220,7 +220,7 @@ namespace de4dot.code.deobfuscators.CodeVeil { var encryptedData = new uint[data.Length / 4]; Buffer.BlockCopy(data, 0, encryptedData, 0, data.Length); - DeobUtils.xxteaDecrypt(encryptedData, encryptedData.Length, key); + DeobUtils.xxteaDecrypt(encryptedData, key); var decryptedData = new byte[data.Length]; Buffer.BlockCopy(encryptedData, 0, decryptedData, 0, data.Length); diff --git a/de4dot.code/deobfuscators/DeobUtils.cs b/de4dot.code/deobfuscators/DeobUtils.cs index 89c46ed7..6335934a 100644 --- a/de4dot.code/deobfuscators/DeobUtils.cs +++ b/de4dot.code/deobfuscators/DeobUtils.cs @@ -91,8 +91,9 @@ namespace de4dot.code.deobfuscators { } // Code converted from C implementation @ http://en.wikipedia.org/wiki/XXTEA (btea() func) - public static void xxteaDecrypt(uint[] v, int n, uint[] key) { + public static void xxteaDecrypt(uint[] v, uint[] key) { const uint DELTA = 0x9E3779B9; + int n = v.Length; uint rounds = (uint)(6 + 52 / n); uint sum = rounds * DELTA; uint y = v[0];