def _classify_load_constant(self, regs_init, regs_fini, mem_fini, written_regs, read_regs):
        """Classify load-constant gadgets.
        """
        matches = []

        # Check for "dst_reg <- constant" pattern.
        for dst_reg, dst_val in regs_fini.items():
            # Make sure the *dst* register was written.
            if dst_reg not in written_regs:
                continue

            # Check restrictions...
            if dst_val == regs_init[dst_reg]:
                continue

            dst_val_ir = ReilImmediateOperand(dst_val, self._arch_regs_size[dst_reg])
            dst_reg_ir = ReilRegisterOperand(dst_reg, self._arch_regs_size[dst_reg])

            matches.append({
                "src": [dst_val_ir],
                "dst": [dst_reg_ir]
            })

        return matches
def _classify_load_constant ( self , regs_init , regs_fini , mem_fini , written_regs , read_regs ) : matches = [ ] for dst_reg , dst_val in regs_fini . items ( ) : if dst_reg not in written_regs : continue if dst_val == regs_init [ dst_reg ] : continue dst_val_ir = ReilImmediateOperand ( dst_val , self . _arch_regs_size [ dst_reg ] ) dst_reg_ir = ReilRegisterOperand ( dst_reg , self . _arch_regs_size [ dst_reg ] ) matches . append ( { "src" : [ dst_val_ir ] , "dst" : [ dst_reg_ir ] } ) return matches
Classify load-constant gadgets.