如何用dd覆盖二进制文件的一些字节? [英] How to overwrite some bytes of a binary file with dd?

查看:30
本文介绍了如何用dd覆盖二进制文件的一些字节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个二进制文件,我想将地址 DEADBEEF 处的值 A2 替换为其他值,例如 A1.p>

我怎样才能用 dd 做到这一点?如果有其他工具可以做到这一点,请提出建议.但我计划在 iPhone 上执行此操作,因此我只能使用最基本的 Unix 工具.

解决方案

printf 'xa1' |dd conv=notrunc of=somefile bs=1 seek=$((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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆