Is there any straightforward way to modify a binary from the commandline? Let's say I know that my binary contains 1234abcd and i want to change it to 12FFabcd or FFFFabcd or maybe even FF34FFabc0 (you get the idea) :-)
How might I achieve that without using any special purpose tools like http://stahlworks.com/dev/swiss-file-knife.html or similar.
It would be great to do it just from the commandline with only standard linux tools.
Or maybe even better instead for searching for the hex string i want to replace directly writing FF at Offset 0x10000, 12 at Offset 0x100001 and so on.
It should be scriptable and run directly from the commandline. I am looking for something like "binary-which-is-included-in-the-distro --write AB --at-offset 100000 --file thebinary.bin". I am quite sure that it is possible with "dd", but I wasn't able to wrap my head around the man page.
Any idea?
Thanks in advance!
printf '\x31\xc0\xc3' | dd of=test_blob bs=1 seek=100 count=3 conv=notrunc
dd arguments:
One Josh looking out for another ;)