bgrep如何工作? [英] How does bgrep work?

查看:35
本文介绍了bgrep如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究在此处找到的命令 bgrep .我运行 bgrep"fafafa" test_27.6.2015.bin |较少-M 的二进制数据称为 test_27.6.2015.bin 但我明白了

I am studying the command bgrep found here. I run bgrep "fafafa" test_27.6.2015.bin | less -M on the the binary data called test_27.6.2015.bin but I get

test_27.6.2015.bin: 00005ee4
test_27.6.2015.bin: 0000bd3c

我怀疑会得到包含术语 fafafafa 的匹配项.两个匹配项是正确的匹配项数.这些十六进制数字可能属于包含 fafafafa 的某些段.

I would suspect to get matches containing the term fafafafa. Two matches is the correct amount of matches. These hex numbers are probably of some segment containing fafafafa.

bgrep如何形成其搜索结果?

How does bgrep form its search result?

推荐答案

bgrep 的搜索结果是格式化如下:

bgrep's search result are formatted this way:

printf("%s: %08llx\n", filename, (unsigned long long)(offset + o - len));

因此,它将显示文件名,然后显示搜索字符串开始处的十六进制偏移,如下所示:

Hence, it displays the filename, and then the hex offset where the search string started, as illustrated here:

$ xxd test_27.6.2015.bin | grep 5ee0
0005ee0: 0c89 0c88 fafa fafa 585e 0000 fe5a 1eda  ........X^...Z..

这篇关于bgrep如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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