2

I am trying to remote debug a certain binary which gets user-specified command line arguments, which can be non-printable of course.
My goal is the ability to debug with IDA the process with the command line argument "\x11\x22\x33\x44" which can be done with gdb easily.
The problem is that the "Parameters" field in IDA allows only ASCII characters to be inserted into the process' command line arguments

IDA

I looked thoroughly and found these questions but running:

$ ./linux_server unlink < file

or any other combination does not seem to feed the binary file with my input.
Also, running StartDebugger in the IDA command line did not help (How does this function know which remote debugger to run?)

1
  • A quick workaround for this issue would be for you to start the binary on the terminal with those command line arguments (or feed the input through a file.). After that attach the remote debugger to the process. You would need to patch the entry point so that the execution can be resumed after attaching the debugger. You could use: \xeb\xfe and patch the bytes at entry point after attaching the debugger.
    – Neon Flash
    Apr 27, 2019 at 14:53

1 Answer 1

0

You can work around this by using the IDA API. There is a function set_process_options that takes the process arguments as one of the parameters.

Because it sets all process options you have to pass various null arguments (which don't modify the existing value).

import ida_dbg
ida_dbg.set_process_options(None, "\x11\x22\x33\x44", None, None, None, 0)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.