コード例 #1
0
ファイル: Deobfuscator.cs プロジェクト: cortex666/de4dot
        public override void deobfuscateBegin()
        {
            base.deobfuscateBegin();

            proxyDelegateFinder = new ProxyDelegateFinder(module);
            proxyDelegateFinder.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, args) => {
                        return(integerDecrypter.decrypt(method2));
                    });
                }
            }

            if (options.DecryptArrays)
            {
                arrayValueInliner = new ArrayValueInliner(module, initializedDataCreator);
                foreach (var method in arrayDecrypter.getMethods())
                {
                    arrayValueInliner.add(method, (method2, args) => {
                        return(arrayDecrypter.decrypt(method2));
                    });
                }
            }

            foreach (var method in stringDecrypter.getMethods())
            {
                staticStringInliner.add(method, (method2, args) => {
                    return(stringDecrypter.decrypt(method2));
                });
                DeobfuscatedFile.stringDecryptersAdded();
            }

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

            startedDeobfuscating = true;
        }