19.4 Binary patch

The '-r' flag of radiff will make it dump radare commands instead of human readable information. These commands if applied will make the first binary be the same as the second one. For example, have a look on this unit test:

$ cat tests/chk/radiff-test.sh 
#!/bin/sh
printf "Checking radiff -rd... "
cp /bin/true .
radiff -rd true /bin/false | radare -vnw true
RET=`radiff -d true /bin/false`
if [ -n "${RET}" ]; then
        echo "Failed"
else
        echo "Success"
fi
rm -f true

Piping the output of radiff -r into radare opening in read-write mode the original file will modify it to make the contents be the same as the second one.