20.5 Program arguments

The program arguments of a debugger session can be defined from a file with a format similar to the one explained in the 'debugger environment' chapter.

The format is:

[#comment][arg[N]]=[@file|string]

Quotes ('"') are not supported here, the N is the number of argument to be redefined. Arguments can also be filled with the contents of files, that's important for exploiting while testing the limits of buffers when reading from arguments.

Here's an example file and session:

$ cat arg.txt
arg0=/bin/ls
arg1=@/bin/true

As you see, the above example is overriding the first argument of the program (which stands for the program path). This way you can reset the path to it, so radare will load that file instead of the one you specify in the prompt. The program will run with a single argument containing all the bytes of the /bin/true file.

$ radare -e file.dbg_arg=arg.txt ls