Beispiel #1
0
        public override void deobfuscateBegin()
        {
            base.deobfuscateBegin();

            cliSecureRtType.findStringDecrypterMethod();
            stringDecrypter.Method = cliSecureRtType.StringDecrypterMethod;

            addAttributesToBeRemoved(cliSecureAttributes, "Obfuscator attribute");

            if (options.DecryptResources) {
                decryptResources(resourceDecrypter);
                addCctorInitCallToBeRemoved(resourceDecrypter.RsrcRrrMethod);
            }

            stackFrameHelper = new StackFrameHelper(module);
            stackFrameHelper.find();

            foreach (var type in module.Types) {
                if (type.FullName == "InitializeDelegate" && DotNetUtils.derivesFromDelegate(type))
                    this.addTypeToBeRemoved(type, "Obfuscator type");
            }

            proxyCallFixer.find();

            staticStringInliner.add(stringDecrypter.Method, (method, args) => stringDecrypter.decrypt((string)args[0]));
            DeobfuscatedFile.stringDecryptersAdded();

            if (options.DecryptMethods) {
                addCctorInitCallToBeRemoved(cliSecureRtType.InitializeMethod);
                addCctorInitCallToBeRemoved(cliSecureRtType.PostInitializeMethod);
                findPossibleNamesToRemove(cliSecureRtType.LoadMethod);
            }

            if (options.RestoreVmCode) {
                csvm.restore();
                addAssemblyReferenceToBeRemoved(csvm.VmAssemblyReference, "CSVM assembly reference");
                addResourceToBeRemoved(csvm.Resource, "CSVM data resource");
            }
        }
Beispiel #2
0
 public MonoDebugCheck(Logger logger, StackFrameHelper stackFrameHelper, ILocalizationService localizationService)
     : base(localizationService)
 {
     _logger           = logger;
     _stackFrameHelper = stackFrameHelper;
 }
Beispiel #3
0
 public MonoDebugCheck(Logger logger, StackFrameHelper stackFrameHelper)
 {
     _logger           = logger;
     _stackFrameHelper = stackFrameHelper;
 }
Beispiel #4
0
        public override void deobfuscateBegin()
        {
            base.deobfuscateBegin();

            addAttributeToBeRemoved(cliSecureAttribute, "Obfuscator attribute");

            resourceDecrypter = new ResourceDecrypter(module);
            resourceDecrypter.find();
            stackFrameHelper = new StackFrameHelper(module);
            stackFrameHelper.find();

            foreach (var type in module.Types) {
                if (type.FullName == "InitializeDelegate" && DotNetUtils.derivesFromDelegate(type))
                    this.addTypeToBeRemoved(type, "Obfuscator type");
            }

            proxyDelegateFinder.find();

            staticStringDecrypter.add(stringDecrypter.Method, (method, args) => stringDecrypter.decrypt((string)args[0]));

            if (options.DecryptMethods) {
                addCctorInitCallToBeRemoved(cliSecureRtType.InitializeMethod);
                addCctorInitCallToBeRemoved(cliSecureRtType.PostInitializeMethod);
                findPossibleNamesToRemove(cliSecureRtType.LoadMethod);
            }
            if (options.DecryptResources)
                addCctorInitCallToBeRemoved(resourceDecrypter.RsrcRrrMethod);
        }