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!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…