如何用覆盖DD二进制文件的一些字节? [英] How to overwrite some bytes of a binary file with dd?
本文介绍了如何用覆盖DD二进制文件的一些字节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个二进制文件,我想与其他一些值替换地址 DEADBEEF
值 A2
,说 A1
。
我怎样才能做到这一点与 DD
?如果有其他的工具,可以做到这一点,请建议。但是,我打算这样做在iPhone上,所以我只能用最基本的Unix工具的工作。
解决方案
的printf'\\ XA1| DD兑换= = somefile BS = 1寻求= $ notrunc之外的((0xdeadbeef))
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.
解决方案
printf '\xa1' | dd conv=notrunc of=somefile bs=1 seek=$((0xdeadbeef))
这篇关于如何用覆盖DD二进制文件的一些字节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文