How to overwrite some bytes of a binary file with dd?

和自甴很熟 提交于 2019-11-26 20:09:22

问题


I have a binary file and i want to replace the value A2 at address DEADBEEF with some other value, say A1.

How can I do this with dd? If there are other tools that can do this, please suggest. But I plan to do this on iPhone so I can only work with most basic Unix tools.


回答1:


printf '\xa1' | dd conv=notrunc of=somefile bs=1 seek=$((0xdeadbeef))


来源:https://stackoverflow.com/questions/7290816/how-to-overwrite-some-bytes-of-a-binary-file-with-dd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!