Example #1
0
        public override void DeobfuscateBegin()
        {
            base.DeobfuscateBegin();

            proxyCallFixer = new ProxyCallFixer(Module);
            proxyCallFixer.Find();
            localsRestorer = new LocalsRestorer(Module);
            if (options.RestoreLocals)
            {
                localsRestorer.Find();
            }

            logicalExpressionFixer = new LogicalExpressionFixer();
            stringDecrypter.Initialize();
            integerDecrypter.Initialize();
            arrayDecrypter.Initialize();

            if (options.DecryptIntegers)
            {
                int32ValueInliner = new Int32ValueInliner();
                foreach (var method in integerDecrypter.GetMethods())
                {
                    int32ValueInliner.Add(method, (method2, gim, args) => {
                        return(integerDecrypter.Decrypt(method2));
                    });
                }
            }

            if (options.DecryptArrays)
            {
                arrayValueInliner = new ArrayValueInliner(Module, initializedDataCreator);
                foreach (var method in arrayDecrypter.GetMethods())
                {
                    arrayValueInliner.Add(method, (method2, gim, args) => {
                        return(arrayDecrypter.Decrypt(method2));
                    });
                }
            }

            foreach (var method in stringDecrypter.GetMethods())
            {
                staticStringInliner.Add(method, (method2, gim, args) => {
                    return(stringDecrypter.Decrypt(method2));
                });
                DeobfuscatedFile.StringDecryptersAdded();
            }

            if (options.RemoveAntiStrongName)
            {
                AddTypeToBeRemoved(strongNameChecker.Type, "Strong name checker type");
            }

            startedDeobfuscating = true;
        }
Example #2
0
		public override void DeobfuscateBegin() {
			base.DeobfuscateBegin();

			proxyCallFixer = new ProxyCallFixer(module);
			proxyCallFixer.Find();
			localsRestorer = new LocalsRestorer(module);
			if (options.RestoreLocals)
				localsRestorer.Find();

			logicalExpressionFixer = new LogicalExpressionFixer();
			stringDecrypter.Initialize();
			integerDecrypter.Initialize();
			arrayDecrypter.Initialize();

			if (options.DecryptIntegers) {
				int32ValueInliner = new Int32ValueInliner();
				foreach (var method in integerDecrypter.GetMethods()) {
					int32ValueInliner.Add(method, (method2, gim, args) => {
						return integerDecrypter.Decrypt(method2);
					});
				}
			}

			if (options.DecryptArrays) {
				arrayValueInliner = new ArrayValueInliner(module, initializedDataCreator);
				foreach (var method in arrayDecrypter.GetMethods()) {
					arrayValueInliner.Add(method, (method2, gim, args) => {
						return arrayDecrypter.Decrypt(method2);
					});
				}
			}

			foreach (var method in stringDecrypter.GetMethods()) {
				staticStringInliner.Add(method, (method2, gim, args) => {
					return stringDecrypter.Decrypt(method2);
				});
				DeobfuscatedFile.StringDecryptersAdded();
			}

			if (options.RemoveAntiStrongName)
				AddTypeToBeRemoved(strongNameChecker.Type, "Strong name checker type");

			startedDeobfuscating = true;
		}