Esempio n. 1
0
 def getregs(self):
     error("Read registers using ptrace_peekuser()")
     words = []
     nb_words = sizeof(ptrace_registers_t) // CPU_WORD_SIZE
     for offset in xrange(nb_words):
         word = ptrace_peekuser(self.pid, offset * CPU_WORD_SIZE)
         bytes = word2bytes(word)
         words.append(bytes)
     bytes = ''.join(words)
     return cast(bytes, POINTER(ptrace_registers_t))[0]
Esempio n. 2
0
 def getregs(self):
     error("Read registers using ptrace_peekuser()")
     words = []
     nb_words = sizeof(ptrace_registers_t) // CPU_WORD_SIZE
     for offset in xrange(nb_words):
         word = ptrace_peekuser(self.pid, offset*CPU_WORD_SIZE)
         bytes = word2bytes(word)
         words.append(bytes)
     bytes = ''.join(words)
     return cast(bytes, POINTER(ptrace_registers_t))[0]
Esempio n. 3
0
 def getregs(self):
     if HAS_PTRACE_GETREGS or HAS_PTRACE_GETREGSET:
         return ptrace_getregs(self.pid)
     # FIXME: Optimize getreg() when used with this function
     words = []
     nb_words = sizeof(ptrace_registers_t) // CPU_WORD_SIZE
     for offset in range(nb_words):
         word = ptrace_peekuser(self.pid, offset * CPU_WORD_SIZE)
         bytes = word2bytes(word)
         words.append(bytes)
     bytes = ''.join(words)
     return bytes2type(bytes, ptrace_registers_t)
Esempio n. 4
0
 def getregs(self):
     if HAS_PTRACE_GETREGS:
         return ptrace_getregs(self.pid)
     else:
         # FIXME: Optimize getreg() when used with this function
         words = []
         nb_words = sizeof(ptrace_registers_t) // CPU_WORD_SIZE
         for offset in range(nb_words):
             word = ptrace_peekuser(self.pid, offset * CPU_WORD_SIZE)
             bytes = word2bytes(word)
             words.append(bytes)
         bytes = ''.join(words)
         return bytes2type(bytes, ptrace_registers_t)