def set_arguments(arguments, _view):
version = get_version(_view).host_version
if 'gdb' in version:
# Voltron doesn't like commands that aren't UTF-8, but for exploit work we're going to need
# arbitary byte support. A named temporary file that we can source commands from is the best
# solution I've come up with so far, despite the fact that it's inelegant.
with tempfile.NamedTemporaryFile() as tempf:
tempf.write('set args ')
tempf.write(arguments)
tempf.write('\n')
tempf.flush()
binjatron.custom_request("command", _build_command_dict("source " + tempf.name))
elif 'lldb' in version:
with tempfile.NamedTemporaryFile() as tempf:
tempf.write('settings set target.run-args ')
tempf.write(arguments)
tempf.write('\n')
tempf.flush()
binjatron.custom_request("command", _build_command_dict("command source " + tempf.name))
评论列表
文章目录