Пример #1
0
        public ExpressionSimplifier(SegmentMap segmentMap, EvaluationContext ctx, DecompilerEventListener listener)
        {
            this.segmentMap = segmentMap ?? throw new ArgumentNullException(nameof(SegmentMap));
            this.ctx        = ctx;
            this.cmp        = new ExpressionValueComparer();

            this.add2ids             = new AddTwoIdsRule(ctx);
            this.addEcc              = new Add_e_c_cRule(ctx);
            this.addMici             = new Add_mul_id_c_id_Rule(ctx);
            this.dpbConstantRule     = new DpbConstantRule();
            this.dpbdpbRule          = new DpbDpbRule(ctx);
            this.idConst             = new IdConstant(ctx, new Unifier(), listener);
            this.idCopyPropagation   = new IdCopyPropagationRule(ctx);
            this.idBinIdc            = new IdBinIdc_Rule(ctx);
            this.sliceConst          = new SliceConstant_Rule();
            this.sliceMem            = new SliceMem_Rule();
            this.sliceSegPtr         = new SliceSegmentedPointer_Rule(ctx);
            this.negSub              = new NegSub_Rule();
            this.constConstBin       = new ConstConstBin_Rule();
            this.shAdd               = new Shl_add_Rule(ctx);
            this.shMul               = new Shl_mul_e_Rule(ctx);
            this.shiftShift          = new ShiftShift_c_c_Rule(ctx);
            this.mpsRule             = new Mps_Constant_Rule(ctx);
            this.sliceShift          = new SliceShift(ctx);
            this.binopWithSelf       = new BinOpWithSelf_Rule();
            this.constDiv            = new ConstDivisionImplementedByMultiplication(ctx);
            this.selfdpbRule         = new SelfDpbRule(ctx);
            this.idProcConstRule     = new IdProcConstRule(ctx);
            this.castCastRule        = new CastCastRule(ctx);
            this.distributedCast     = new DistributedCastRule();
            this.distributedSlice    = new DistributedSliceRule();
            this.mkSeqFromSlicesRule = new MkSeqFromSlices_Rule(ctx);
            this.constOnLeft         = new ComparisonConstOnLeft();
            this.sliceSeq            = new SliceSequence(ctx);
        }
Пример #2
0
        public ExpressionSimplifier(EvaluationContext ctx, DecompilerEventListener listener)
        {
            this.ctx = ctx;

            this.add2ids           = new AddTwoIdsRule(ctx);
            this.addEcc            = new Add_e_c_cRule(ctx);
            this.addMici           = new Add_mul_id_c_id_Rule(ctx);
            this.dpbConstantRule   = new DpbConstantRule();
            this.dpbdpbRule        = new DpbDpbRule(ctx);
            this.idConst           = new IdConstant(ctx, new Unifier(), listener);
            this.idCopyPropagation = new IdCopyPropagationRule(ctx);
            this.idBinIdc          = new IdBinIdc_Rule(ctx);
            this.sliceConst        = new SliceConstant_Rule();
            this.sliceMem          = new SliceMem_Rule();
            this.sliceSegPtr       = new SliceSegmentedPointer_Rule(ctx);
            this.negSub            = new NegSub_Rule();
            this.constConstBin     = new ConstConstBin_Rule();
            this.shAdd             = new Shl_add_Rule(ctx);
            this.shMul             = new Shl_mul_e_Rule(ctx);
            this.shiftShift        = new ShiftShift_c_c_Rule(ctx);
            this.mpsRule           = new Mps_Constant_Rule(ctx);
            this.sliceShift        = new SliceShift(ctx);
            this.binopWithSelf     = new BinOpWithSelf_Rule();
            this.constDiv          = new ConstDivisionImplementedByMultiplication(ctx);
            this.selfdpbRule       = new SelfDpbRule(ctx);
            this.idProcConstRule   = new IdProcConstRule(ctx);
            this.castCastRule      = new CastCastRule(ctx);
        }
Пример #3
0
 public ExpressionSimplifier(SegmentMap segmentMap, EvaluationContext ctx, DecompilerEventListener listener)
 {
     this.segmentMap              = segmentMap ?? throw new ArgumentNullException(nameof(SegmentMap));
     this.ctx                     = ctx;
     this.cmp                     = new ExpressionValueComparer();
     this.m                       = new ExpressionEmitter();
     this.unifier                 = new Unifier();
     this.add2ids                 = new AddTwoIdsRule(ctx);
     this.addEcc                  = new Add_e_c_cRule(ctx);
     this.addMici                 = new Add_mul_id_c_id_Rule(ctx);
     this.idConst                 = new IdConstant(ctx, unifier, listener);
     this.idCopyPropagation       = new IdCopyPropagationRule(ctx);
     this.idBinIdc                = new IdBinIdc_Rule(ctx);
     this.sliceConst              = new SliceConstant_Rule();
     this.sliceMem                = new SliceMem_Rule();
     this.sliceSegPtr             = new SliceSegmentedPointer_Rule(ctx);
     this.negSub                  = new NegSub_Rule();
     this.constConstBin           = new ConstConstBin_Rule();
     this.shAdd                   = new Shl_add_Rule(ctx);
     this.shMul                   = new Shl_mul_e_Rule(ctx);
     this.shiftShift              = new ShiftShift_c_c_Rule(ctx);
     this.mpsRule                 = new Mps_Constant_Rule(ctx);
     this.sliceShift              = new SliceShift(ctx);
     this.binopWithSelf           = new BinOpWithSelf_Rule();
     this.constDiv                = new ConstDivisionImplementedByMultiplication(ctx);
     this.idProcConstRule         = new IdProcConstRule(ctx);
     this.convertConvertRule      = new ConvertConvertRule(ctx);
     this.distributedConvert      = new DistributedConversionRule();
     this.distributedCast         = new DistributedCastRule();
     this.distributedSlice        = new DistributedSliceRule();
     this.mkSeqFromSlicesRule     = new MkSeqFromSlices_Rule(ctx);
     this.constOnLeft             = new ComparisonConstOnLeft();
     this.sliceSeq                = new SliceSequence(ctx);
     this.sliceConvert            = new SliceConvert();
     this.logicalNotFollowedByNeg = new LogicalNotFollowedByNegRule();
     this.logicalNotFromBorrow    = new LogicalNotFromArithmeticSequenceRule();
     this.unaryNegEqZero          = new UnaryNegEqZeroRule();
     this.scaledIndexRule         = new ScaledIndexRule(ctx);
 }
Пример #4
0
        public ExpressionSimplifier(EvaluationContext ctx)
        {
            this.ctx = ctx;

            this.add2ids           = new AddTwoIdsRule(ctx);
            this.addEcc            = new Add_e_c_cRule(ctx);
            this.addMici           = new Add_mul_id_c_id_Rule(ctx);
            this.dpbConstantRule   = new DpbConstantRule();
            this.dpbdpbRule        = new DpbDpbRule(ctx);
            this.idConst           = new IdConstant(ctx, new Unifier());
            this.idCopyPropagation = new IdCopyPropagationRule(ctx);
            this.idBinIdc          = new IdBinIdc_Rule(ctx);
            this.sliceConst        = new SliceConstant_Rule();
            this.sliceMem          = new SliceMem_Rule();
            this.negSub            = new NegSub_Rule();
            this.constConstBin     = new ConstConstBin_Rule();
            this.shMul             = new Shl_mul_e_Rule(ctx);
            this.shiftShift        = new ShiftShift_c_c_Rule(ctx);
            this.mpsRule           = new Mps_Constant_Rule(ctx);
            this.sliceShift        = new SliceShift(ctx);
            this.binopWithSelf     = new BinOpWithSelf_Rule();
        }