コード例 #1
0
        public void CheckBlocks()
        {
            List <Block> allBlocks = new List <Block>();

            this.CleanBlocks();

            this.blocks.MethodBlocks.GetAllBlocks(allBlocks);

            var solver = new CflowSolver();

            solver.Initialize(this.blocks, this.token);

            UnsolvedBlocks = new List <UnsolvedBlock>();

            foreach (var block in allBlocks)
            {
                if (block.LastInstr.IsConditionalBranch())
                {
                    if (!solver.SolveBlock(allBlocks[0], block))
                    {
                        UnsolvedBlocks.Add(new UnsolvedBlock(block, solver.FinalExpr, solver.ctx));
                    }
                }
            }
        }
コード例 #2
0
        public bool Deobfuscate()
        {
            bool result = true;

            List <Block> allBlocks = new List <Block>();

            this.CleanBlocks();

            this.blocks.MethodBlocks.GetAllBlocks(allBlocks);

            try
            {
                var solver = new CflowSolver();
                solver.Initialize(this.blocks, this.token);
                solver.Deobfuscate(allBlocks);
            }
            catch (OperationCanceledException)
            {
                result = false;
            }

            this.CleanBlocks();

            if (DeFlowSettings.Settings.Repartition)
            {
                this.blocks.RepartitionBlocks();
            }

            return(result);
        }
コード例 #3
0
        public void SolveBlockAssisted(Context ctx, BoolExpr expr, Block block)
        {
            this.CleanBlocks();

            var solver = new CflowSolver();

            solver.Initialize(this.blocks, this.token);
            solver.SolveBlockAssisted(ctx, expr, block);

            this.CleanBlocks();

            if (DeFlowSettings.Settings.Repartition)
            {
                this.blocks.RepartitionBlocks();
            }
        }