3 ms·
TL;DR The code is mostly this with a nice wrapper. gdb_cmds = [ 'PyGILState_Ensure()', # Allow payloads to import modules alongs
by onedognight 15y ago
TL;DR The code is mostly this with a nice wrapper.
gdb_cmds = [
'PyGILState_Ensure()',
# Allow payloads to import modules alongside them
'PyRun_SimpleString("import sys; sys.path.insert(0, \\"%s\\");")' %
os.path.dirname(self.filename),
'PyRun_SimpleString("execfile(\\"%s\\")")' % self.filename,
'PyGILState_Release($1)',
]
self._run('gdb -p %d -batch %s' % (self.pid,
' '.join(["-eval-command='call %s'" % cmd for cmd in gdb_cmds])))