Exemplo n.º 1
0
 def initPid(self, args):
   dbg = PtraceDebugger()
   process = dbg.addProcess(args.pid, is_attached=False)
   if process is None:
     log.error("Error initializing Process debugging for %d"% args.pid)
     raise IOError
     # ptrace exception is raised before that
   mappings = memory_mapping.readProcessMappings(process)
   t0 = time.time()
   for m in mappings :
     if args.mmap:
       ### mmap memory in local space
       m.mmap()
       log.debug('mmap() : %d'%(len(m.mmap())))
   if args.mmap:
     ### mmap done, we can release process...
     process.cont()
     log.info('Memory mmaped, process released after %02.02f secs'%(time.time()-t0))
   return mappings
Exemplo n.º 2
0
 def initPid(self, pid, mmap):
   dbg = PtraceDebugger()
   process = dbg.addProcess(pid, is_attached=False)
   if process is None:
     log.error("Error initializing Process debugging for %d"% pid)
     raise IOError
     # ptrace exception is raised before that
   mappings = memory_mapping.readProcessMappings(process)
   t0 = time.time()
   for m in mappings :
     if mmap:
       ### mmap memory in local space
       m.mmap()
       log.debug('mmap() : %d'%(len(m.mmap())))
   if mmap:
     ### mmap done, we can release process...
     process.cont()
     log.info('Memory mmaped, process released after %02.02f secs'%(time.time()-t0))
   return mappings
Exemplo n.º 3
0
 def initPid(self, pid, mmap):
     if not isinstance(pid, (int, long)):
         raise TypeError('PID should be a number')
     dbg = PtraceDebugger()
     process = dbg.addProcess(pid, is_attached=False)
     if process is None:
         log.error("Error initializing Process debugging for %d" % pid)
         raise IOError
         # ptrace exception is raised before that
     mappings = memory_mapping.readProcessMappings(process)
     t0 = time.time()
     for m in mappings:
         if mmap:
             ### mmap memory in local space
             m.mmap()
             log.debug('mmap() : %d' % (len(m.mmap())))
     if mmap:
         ### mmap done, we can release process...
         process.cont()
         log.info('Memory mmaped, process released after %02.02f secs' %
                  (time.time() - t0))
     return mappings
Exemplo n.º 4
0
 def _init_pid(pid, mmap):
     if not isinstance(pid, (int, long)):
         raise TypeError('PID should be a number')
     dbg = PtraceDebugger()
     process = dbg.addProcess(pid, is_attached=False)
     if process is None:
         log.error("Error initializing Process debugging for %d" % pid)
         raise IOError
         # ptrace exception is raised before that
     _memory_handler = readProcessMappings(process)
     t0 = time.time()
     for m in _memory_handler:
         if mmap:
             # mmap memory in local space
             m.mmap()
             log.debug('mmap() : %d' % (len(m.mmap())))
     if mmap:
         # mmap done, we can release process...
         process.cont()
         log.info(
             'MemoryHandler mmaped, process released after %02.02f secs' %
             (time.time() - t0))
     return _memory_handler