9/19 What's the easiest way to replace text strings in a binary file?
I have a feeling that sed can't be used with binary files...
\- uh you can try emacs. anymore is probably beyond the scope of wall.
\_ perl -pi -e 's/foo/bar/g' is probably pretty safe;
add in a -0777 first if you want to be paranoid
\_ If you're replacing same-size strings, any hex editor will do. If
you're shrinking them, then fill with spaces. If you're growing,
you might break something if it's an executable or some self
referenced data file like a zip.
\_ spaces? Why not null chars?
\_ because code accessing those strings may run into trouble
with nulls/
\_ Arrr - nold for California Governor!
\_ Avast Right-Wing Conspiracy! |