Пример #1
0
 def mmap(self):
     """
      mmap-ed access gives a 20% perf increase on by tests
     :return:
     """
     # DO NOT USE ptrace.process.readArray on 64 bits.
     # It breaks stuff.
     # probably a bad cast statement on c_char_p
     # FIXME: the big perf increase is now gone. Howto cast pointer to bytes
     # into my_ctypes array ?
     if not self.is_mmaped():
         self._local_mmap_content = self._utils.bytes2array(self._process().read_bytes(self.start, len(self)), self._ctypes.c_ubyte)
         log.debug('type array %s' % (type(self._local_mmap_content)))
         self._local_mmap = LocalMemoryMapping.fromAddress(self, self._ctypes.addressof(self._local_mmap_content))
         self._base = self._local_mmap
     return self._local_mmap
Пример #2
0
 def mmap(self):
     """
      mmap-ed access gives a 20% perf increase on by tests
     :return:
     """
     # DO NOT USE ptrace.process.readArray on 64 bits.
     # It breaks stuff.
     # probably a bad cast statement on c_char_p
     # FIXME: the big perf increase is now gone. Howto cast pointer to bytes
     # into my_ctypes array ?
     if not self.isMmaped():
         self._local_mmap_content = self._utils.bytes2array(self._process().read_bytes(self.start, len(self)), self._ctypes.c_ubyte)
         log.debug('type array %s' % (type(self._local_mmap_content)))
         self._local_mmap = LocalMemoryMapping.fromAddress(self, self._ctypes.addressof(self._local_mmap_content))
         self._base = self._local_mmap
     return self._local_mmap
Пример #3
0
 def mmap(self):
     """ mmap-ed access gives a 20% perf increase on by tests """
     # DO NOT USE ptrace.process.readArray on 64 bits.
     # It breaks stuff.
     # probably a bad cast statement on c_char_p
     # FIXME: the big perf increase is now gone. Howto cast pointer to bytes
     # into my_ctypes array ?
     my_ctypes = self._target_platform.get_target_ctypes()
     my_utils = self._target_platform.get_target_ctypes_utils()
     if not self.isMmaped():
         # self._process().readArray(self.start, my_ctypes.c_ubyte, len(self) ) # keep ref
         # self._local_mmap_content = self._process().readArray(self.start,
         # my_ctypes.c_ubyte, len(self) ) # keep ref
         self._local_mmap_content = my_utils.bytes2array(
             self._process().readBytes(self.start, len(self)), my_ctypes.c_ubyte
         )
         log.debug("type array %s" % (type(self._local_mmap_content)))
         self._local_mmap = LocalMemoryMapping.fromAddress(self, my_ctypes.addressof(self._local_mmap_content))
         self._base = self._local_mmap
     return self._local_mmap
Пример #4
0
 def mmap(self):
     ''' mmap-ed access gives a 20% perf increase on by tests '''
     # DO NOT USE ptrace.process.readArray on 64 bits.
     # It breaks stuff.
     # probably a bad cast statement on c_char_p
     # FIXME: the big perf increase is now gone. Howto cast pointer to bytes
     # into my_ctypes array ?
     my_ctypes = self._target_platform.get_target_ctypes()
     my_utils = self._target_platform.get_target_ctypes_utils()
     if not self.isMmaped():
         # self._process().readArray(self.start, my_ctypes.c_ubyte, len(self) ) # keep ref
         # self._local_mmap_content = self._process().readArray(self.start,
         # my_ctypes.c_ubyte, len(self) ) # keep ref
         self._local_mmap_content = my_utils.bytes2array(
             self._process().readBytes(self.start, len(self)),
             my_ctypes.c_ubyte)
         log.debug('type array %s' % (type(self._local_mmap_content)))
         self._local_mmap = LocalMemoryMapping.fromAddress(
             self, my_ctypes.addressof(self._local_mmap_content))
         self._base = self._local_mmap
     return self._local_mmap