通过 dclfdd 或 split 拆分 hex 文件? [英] To split hex file by dclfdd or split?

查看:48
本文介绍了通过 dclfdd 或 split 拆分 hex 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在此处解决关于通过同步进度监控进行拆分的挑战.假设头部的可检测字段是FA FA FA FA,十六进制.

I am solving the challenge about splitting with simultaneous progress monitoring here. Assume the detectable field of the header is FA FA FA FA in Hex.

按字段拆分的步骤

  • 数据的二进制到二进制 ascii,如此处
  • 所述
  • bin2hex
  • 通过 gsed 's/FA FA FA/\0/100g' 标记分割点
  • 用伪代码 split -p'\0' input.txt 分割标记 \0 的位置,这在 这里
  • binary to binary ascii of the data as described here
  • bin2hex
  • mark split points by gsed 's/FA FA FA FA/\0/100g'
  • split where marks \0 by pseudocode split -p'\0' input.txt which is discussed here

如何进行bin2hex的转换?

How can you do the conversion bin2hex?

推荐答案

无法访问您共享的链接...

Couldn't access the link you shared...

但是,您可以使用 bc(bash 计算器)实用程序进行转换...也许会有更好的方法(我不知道 :-))

But, you can use bc (bash calculator) utility for the conversions... Maybe there will be a better approach (which i am unaware of :-))

对于十六进制到二进制:

v=F; echo "ibase=16;obase=2;$(echo $v)" | bc

这会将 0xF 转换为 1111b.

ibase 是输入基础系统(16 => hex).obase 是输出基础系统(2 => binary).

ibase is the input base system (16 => hex). obase is the output base system (2 => binary).

对于二进制到十六进制:

v=1111; echo "ibase=2;obase=10000;$(echo $v)" | bc

这会将 1111b 转换为 0xF.

ibase 是输入基础系统(2 => binary).obase 是输出基础系统(10000 => hex(obase 应该提到使用 ibase 作为基础系统,我们的 obase, 10000b = 16 十进制 => 十六进制)).

ibase is the input base system (2 => binary). obase is the output base system (10000 => hex (obase should be mentioned using ibase as the base system, our obase, 10000b = 16 decimal => hex)).

这篇关于通过 dclfdd 或 split 拆分 hex 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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