Пример #1
0
 def refresh_regs(self):
     """ loads and caches values of the registers on the device """
     self.send('g')
     if self.arch['endian']:
         self.regs=dict(zip(self.registers,(switch_endian(reg) for reg in split_by_n(self.readpkt(),self.arch['bitsize']>>2))))
     else:
         self.regs=dict(zip(self.registers,split_by_n(self.readpkt(),self.arch['bitsize']>>2)))
Пример #2
0
 def store(self, data, addr=None):
     """ stores data at addr if given otherwise at beginning of
         .text segment aka self.elf.workarea"""
     if addr==None:
         addr=self.elf.workarea
     for pkt in split_by_n(data, 400): # TODO should pktmaxsize, see todo in __init__
         pktlen = len(pkt)
         self.fetchOK('X%x,%x:%s' % (addr, pktlen, pkt))
         addr+=pktlen
Пример #3
0
 def refresh_regs(self):
     """ loads and caches values of the registers on the device """
     self.send(b'g')
     enc_reg_blob = self.readpkt()
     reg_blob = rsp_decode(enc_reg_blob)
     raw_regs = split_by_n(reg_blob, self.arch['bitsize'] >> 2)
     if self.arch['endian']:
         raw_regs = iter(switch_endian(reg) for reg in raw_regs)
     self.regs = dict(zip(self.registers, raw_regs))
Пример #4
0
Файл: rsp.py Проект: stef/pyrsp
 def refresh_regs(self):
     """ loads and caches values of the registers on the device """
     self.send(b'g')
     enc_reg_blob = self.readpkt()
     reg_blob = rsp_decode(enc_reg_blob)
     raw_regs = split_by_n(reg_blob, self.arch['bitsize']>>2)
     if self.arch['endian']:
         raw_regs = iter(switch_endian(reg) for reg in raw_regs)
     self.regs = dict(zip(self.registers, raw_regs))
Пример #5
0
Файл: rsp.py Проект: stef/pyrsp
 def store(self, data, addr=None):
     """ stores data at addr if given otherwise at beginning of
         .text segment aka self.elf.workarea"""
     if addr==None:
         addr=self.elf.workarea
     for pkt in split_by_n(hexlify(data), int(self.feats[b'PacketSize'],16) - 20):
         pktlen = len(pkt)//2
         self.fetchOK(b'M%x,%x:%s' % (addr, pktlen, pkt))
         addr+=pktlen
Пример #6
0
 def store(self, data, addr=None):
     """ stores data at addr if given otherwise at beginning of
         .text segment aka self.elf.workarea"""
     if addr == None:
         addr = self.elf.workarea
     for pkt in split_by_n(hexlify(data),
                           int(self.feats['PacketSize'], 16) - 20):
         pktlen = len(pkt) / 2
         self.fetchOK('M%x,%x:%s' % (addr, pktlen, pkt))
         addr += pktlen
Пример #7
0
 def store(self, data, addr=None):
     """ stores data at addr if given otherwise at beginning of
         .text segment aka self.elf.workarea"""
     if addr == None:
         addr = self.elf.workarea
     for pkt in split_by_n(
             data, 400):  # TODO should pktmaxsize, see todo in __init__
         pktlen = len(pkt)
         self.fetchOK('X%x,%x:%s' % (addr, pktlen, pkt))
         addr += pktlen
Пример #8
0
Файл: rsp.py Проект: stef/pyrsp
    def refresh_regs(self):
        """ loads and caches values of the registers on the device """
        self.send(b'g')
        enc_reg_blob = self.readpkt()
        reg_blob = rsp_decode(enc_reg_blob)
        raw_regs = split_by_n(reg_blob, self.arch['bitsize'] >> 2)
        if self.arch['endian']:
            raw_regs = iter(switch_endian(reg) for reg in raw_regs)
        self.regs = dict(zip(self.registers, raw_regs))

        pktsz = len(enc_reg_blob) + 4  # 4 adds back the header and checksum
        if pktsz > self.maxsize_g_packet:
            self.maxsize_g_packet = pktsz