Ejemplo n.º 1
0
    def bregN(self, regnum):
        '''The single operand of the DW_OP_bregn operations provides a signed LEB128 offset from the specified 
        register.'''
        offset = SLEB.decode(self.expression)

        if offset > 0:
            self.push('(char *) get_reg(%i) + %#x' % (regnum, offset))
        elif offset < 0:
            self.push('(char *) get_reg(%i) - %#x' % (regnum, abs(offset)))
        else:
            self.push('(char *) get_reg(%i)' % (regnum))
Ejemplo n.º 2
0
 def bregN(self, regnum):
     '''The single operand of the DW_OP_bregn operations provides a signed LEB128 offset from the specified 
     register.'''
     offset = SLEB.decode(self.expression)
     
     if offset > 0:
         self.push('(char *) get_reg(%i) + %#x' % (regnum, offset))            
     elif offset < 0:
         self.push('(char *) get_reg(%i) - %#x' % (regnum, abs(offset)))
     else:
         self.push('(char *) get_reg(%i)' % (regnum))
Ejemplo n.º 3
0
 def fbreg(self):
     '''The DW_OP_fbreg operation provides a signed LEB128 offset from the address specified by the location
     description in the DW_AT_frame_base attribute of the current function. (This is typically a "stack pointer" 
     register plus or minus some offset. On more sophisticated systems it might be a location list that adjusts
     the offset according to changes in the stack pointer as the PC changes.)'''
     offset = SLEB.decode(self.expression)
     if offset > 0:
         self.push('__adbi_frame__ + %#x' % offset)
     elif offset < 0:
         self.push('__adbi_frame__ - %#x' % abs(offset))
     else:
         self.push('__adbi_frame__')
     self.uses_frame = True
Ejemplo n.º 4
0
 def fbreg(self):
     '''The DW_OP_fbreg operation provides a signed LEB128 offset from the address specified by the location
     description in the DW_AT_frame_base attribute of the current function. (This is typically a "stack pointer" 
     register plus or minus some offset. On more sophisticated systems it might be a location list that adjusts
     the offset according to changes in the stack pointer as the PC changes.)'''
     offset = SLEB.decode(self.expression)
     if offset > 0:
         self.push('__adbi_frame__ + %#x' % offset)
     elif offset < 0:
         self.push('__adbi_frame__ - %#x' % abs(offset))
     else:
         self.push('__adbi_frame__')
     self.uses_frame = True
Ejemplo n.º 5
0
 def consts(self):
     '''The single operand of the DW_OP_consts operation provides a signed LEB128 integer constant.'''
     val = SLEB.decode(self.expression)
     self.push('%#x' % val)
Ejemplo n.º 6
0
 def consts(self):
     '''The single operand of the DW_OP_consts operation provides a signed LEB128 integer constant.'''
     val = SLEB.decode(self.expression)
     self.push('%#x' % val)