Exemplo n.º 1
0
Arquivo: main.py Projeto: zined/amoco
 def get_target(self,blk,withmap):
     # withmap unused in fforward
     m = code.mapper()
     pc = self.prog.PC()
     m[pc] = blk.address
     target = (blk.map[pc]).eval(m)
     return target.simplify()
Exemplo n.º 2
0
 def get_targets(self,node,parent):
     blk = node.data
     m = code.mapper()
     pc = self.prog.cpu.PC()
     m[pc] = blk.address
     pc = (blk.map(pc)).eval(m)
     return _target(pc,node).expand()
Exemplo n.º 3
0
    def get_targets(self,node,parent):
        """Computes expression of target address in the given node, based
        on its address and the architecture's program counter (PC).

        Arguments:
            node: the current node, not yet added to the cfg.
            parent: the parent node in the cfg that has targeted the
                current node. (Unused by :class:`fforward` but required as
                a generic API for parent classes).

        Returns:
            :class:`_target`: the evaluated PC expression.
        """
        blk = node.data
        m = code.mapper()
        pc = self.prog.cpu.PC()
        m[pc] = blk.address
        pc = (blk.map(pc)).eval(m)
        return _target(pc,node).expand()
Exemplo n.º 4
0
 def build(self):
     m = mapper()
     for k,v in self.map:
         m[k.build()] = v.build()
         m.conds = [c.build() for c in self.conds]
     return m
Exemplo n.º 5
0
 def build(self):
     m = mapper()
     for k, v in self.map:
         m[k.build()] = v.build()
         m.conds = [c.build() for c in self.conds]
     return m