二进制补丁(不是真正的补丁制作流程)

补丁应用工具

rdiff
bsdiff/bspatch
git diff/apply
首先git diff/apply --binary仅限git仓库使用

制作两个不同的二进制文件

$ as --32 -o hello.o hello.s
$ ld -melf_i386 -o hello hello.o
$ cp hello hello.nihao
$ echo “nihao world” > nihao.txt
$ objcopy --update-section .rodata=nihao.txt hello.nihao

$ ./hello ==> Hello world
$ ./hello.nihao ==>nihao world

rdiff的使用

制作差分patch
$ rdiff signature hello hello.sig
$ rdiff delta hello.sig hello.nihao hello.patch
打上差分patch
$ rdiff patch hello hello.patch hello.new
验证
$ chmod a+x hello.new
$ ./hello.new ==> nihao world

bsdiff/bspatch的使用

制作差分patch
$ bsdiff hello hello.nihao hello.patch
打上差分patch
$ bspatch hello hello.new hello.patch
验证
$ chmod a+x hello.new
$ ./hello.new ==> nihao world

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值