gpt4 book ai didi

linux - 十六进制字符串到 wireshark pcap

转载 作者:太空狗 更新时间:2023-10-29 12:04:02 27 4
gpt4 key购买 nike

我有一个十六进制字符串,我想将其转换为 Wireshark pcap。 Wireshark 接受以下格式的十六进制转储:

0000 00 00 00 00 00 aa 00 00 00 00 00 01 88 47 00 3e
0010 80 0a 00 00 d1 0a 10 00 89 02 20 01 05 46 00 00
0020 00 01 00 02 04 03 6d 64 31 02 03 6d 61 57 00 00
0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0060 00 00 00 00 00

我有以下流:

0000000000AA0000000000018847003E800A0000D10A100089022001054600000001000204036D643102036D615700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

我一直在 linux 中尝试使用 od -Ax -tc1 -v 命令,但似乎无法获得正确的输出。有谁知道如何做到这一点?

最佳答案

先把十六进制流放到一个文本文件“a.txt”中,

0000000000AA0000000000018847003E800A0000D10A100089022001054600000001000204036D643102036D615700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

然后将文本文件转换为二进制文件:

xxd -r -p a.txt a.bin

使用 od 和 text2pcap 将二进制文件转换为 pcap 文件。

od -Ax -tx1 -v a.bin | text2pcap - a.pcap

关于linux - 十六进制字符串到 wireshark pcap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21427322/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com