def corefile(process):
 if context.noptrace:
  log.warn_once('Skipping corefile since context.noptrace==True')
  return
 temp = tempfile.NamedTemporaryFile(prefix='pwn-corefile-')
 if (version() < (7, 11)):
  log.warn_once(('The installed GDB (%s) does not emit core-dumps which contain all of the data in the process.\nUpgrade to GDB >= 7.11 for better core-dumps.' % binary()))
 gdb_args = ['-batch', '-q', '--nx', '-ex', '"set pagination off"', '-ex', '"set height 0"', '-ex', '"set width 0"', '-ex', '"set use-coredump-filter on"', '-ex', ('"generate-core-file %s"' % temp.name), '-ex', 'detach']
 with context.local(terminal=['sh', '-c']):
  with context.quiet:
   pid = attach(process, gdb_args=gdb_args)
   os.waitpid(pid, 0)
 return elf.corefile.Core(temp.name)

def corefile ( process ) : if context . noptrace : log . warn_once ( 'Skipping corefile since context.noptrace==True' ) return temp = tempfile . NamedTemporaryFile ( prefix = 'pwn-corefile-' ) if ( version ( ) < ( 7 , 11 ) ) : log . warn_once ( ( 'The installed GDB (%s) does not emit core-dumps which contain all of the data in the process.\nUpgrade to GDB >= 7.11 for better core-dumps.' % binary ( ) ) ) gdb_args = [ '-batch' , '-q' , '--nx' , '-ex' , '"set pagination off"' , '-ex' , '"set height 0"' , '-ex' , '"set width 0"' , '-ex' , '"set use-coredump-filter on"' , '-ex' , ( '"generate-core-file %s"' % temp . name ) , '-ex' , 'detach' ] with context . local ( terminal = [ 'sh' , '-c' ] ) : with context . quiet : pid = attach ( process , gdb_args = gdb_args ) os . waitpid ( pid , 0 ) return elf . corefile . Core ( temp . name )
drops a core file for the process .