I've modified configuration files on a FreeBSD filesystem image with a hex editor to cause it to obtain a dhcp lease and allow password ssh login for the default account. (Linux cannot read/write to the default FreeBSD filesystem.)
This allowed me to set up the RPi headless and keyboardless.
Of course the filesystem was dirty, but it's nothing an fsck couldn't solve.
Changing a string like 'foo=yes' to 'foo=no ' would be easy enough - as long as the filesystem does not checksum data.
Adding multiple lines to multiple files is not going to work very well.