void Initialize(ConstantsDecrypterBase constDecrypter, ref bool hasInitialized) { if (hasInitialized || constDecrypter == null || !constDecrypter.Detected) { return; } hasInitializedConstantsDecrypter15 = true; DecryptResources(); constDecrypter.Initialize(); int32ValueInliner = new Int32ValueInliner(); int64ValueInliner = new Int64ValueInliner(); singleValueInliner = new SingleValueInliner(); doubleValueInliner = new DoubleValueInliner(); foreach (var info in constDecrypter.DecrypterInfos) { staticStringInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptString(staticStringInliner.Method, method, args)); int32ValueInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptInt32(int32ValueInliner.Method, method, args)); int64ValueInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptInt64(int64ValueInliner.Method, method, args)); singleValueInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptSingle(singleValueInliner.Method, method, args)); doubleValueInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptDouble(doubleValueInliner.Method, method, args)); } int32ValueInliner.RemoveUnbox = true; int64ValueInliner.RemoveUnbox = true; singleValueInliner.RemoveUnbox = true; doubleValueInliner.RemoveUnbox = true; DeobfuscatedFile.StringDecryptersAdded(); AddFieldsToBeRemoved(constDecrypter.Fields, "Constants decrypter field"); var moduleType = DotNetUtils.GetModuleType(Module); foreach (var info in constDecrypter.DecrypterInfos) { if (info.decryptMethod.DeclaringType == moduleType) { AddMethodToBeRemoved(info.decryptMethod, "Constants decrypter method"); } else { AddTypeToBeRemoved(info.decryptMethod.DeclaringType, "Constants decrypter type"); } } AddMethodToBeRemoved(constDecrypter.NativeMethod, "Constants decrypter native method"); AddResourceToBeRemoved(constDecrypter.Resource, "Encrypted constants"); }
void Initialize(ConstantsDecrypterBase constDecrypter, ref bool hasInitialized) { if (hasInitialized || (constDecrypter == null || !constDecrypter.Detected)) return; hasInitializedConstantsDecrypter15 = true; DecryptResources(); constDecrypter.Initialize(); int32ValueInliner = new Int32ValueInliner(); int64ValueInliner = new Int64ValueInliner(); singleValueInliner = new SingleValueInliner(); doubleValueInliner = new DoubleValueInliner(); foreach (var info in constDecrypter.DecrypterInfos) { staticStringInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptString(staticStringInliner.Method, method, args)); int32ValueInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptInt32(int32ValueInliner.Method, method, args)); int64ValueInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptInt64(int64ValueInliner.Method, method, args)); singleValueInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptSingle(singleValueInliner.Method, method, args)); doubleValueInliner.Add(info.decryptMethod, (method, gim, args) => constDecrypter.DecryptDouble(doubleValueInliner.Method, method, args)); } int32ValueInliner.RemoveUnbox = true; int64ValueInliner.RemoveUnbox = true; singleValueInliner.RemoveUnbox = true; doubleValueInliner.RemoveUnbox = true; DeobfuscatedFile.StringDecryptersAdded(); AddFieldsToBeRemoved(constDecrypter.Fields, "Constants decrypter field"); var moduleType = DotNetUtils.GetModuleType(module); foreach (var info in constDecrypter.DecrypterInfos) { if (info.decryptMethod.DeclaringType == moduleType) AddMethodToBeRemoved(info.decryptMethod, "Constants decrypter method"); else AddTypeToBeRemoved(info.decryptMethod.DeclaringType, "Constants decrypter type"); } AddMethodToBeRemoved(constDecrypter.NativeMethod, "Constants decrypter native method"); AddResourceToBeRemoved(constDecrypter.Resource, "Encrypted constants"); }