Wireshark 中是否有一个函数可以用来解码内存缓冲区中的数据包而不是捕获文件?

发布于 2024-11-16 01:26:07 字数 417 浏览 3 评论 0原文

我一直在阅读 Wireshark 附带的文档,并分析源代码,以确定 Wireshark 中是否存在函数或函数集合,这将允许我传递包含捕获数据的缓冲区(而不是使用外部文件)。

我也在 Wireshark-dev 列表上问了这个问题,但没有得到回应。

据我了解,你告诉 Wireshark 在哪里寻找数据包(就文件、管道或套接字而言),它会告诉你每当它从该流中获取数据包时,所以我的直觉是没有办法将指针传递给包含捕获数据的缓冲区,并让 Wireshark 解析它在那里找到的任何内容。

然而,我绝不是 Wireshark 内部的专家,所以我希望 SO 能帮助我找到一个明确的答案。谢谢。

I have been reading the docs that come with Wireshark along with analyzing the source to figure out if there is a function or collection of functions in Wireshark which would allow me to pass a buffer containing capture data (rather than using an external file).

I asked this question on the Wireshark-dev list as well, but had no responses.

As far as I understand, you tell Wireshark where to look for packets (in terms of a file, pipe or socket) and it tells you whenever it's got a packet from that stream, so my gut feeling is that there isn't a way to pass a pointer to a buffer containing capture data and have Wireshark parse whatever it can find there.

However, I am by no means an expert on the internals of Wireshark, so I am looking to SO to help me figure out a definitive answer. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

镜花水月 2024-11-23 01:26:07

您是否尝试过创建一个新的 tvbuff_t 作为 TVBUFF_REAL_DATA 并提供您的内存区域作为 data 参数?

tvbuff_t *tvb = tvb_new_real_data(mem_buffer_ptr, mem_buf_length, mem_buf_length);
//mem_buffer_ptr is your memory buffer
//mem_buf_length is the number of bytes in your buffer

Wireshark 历史上与其他应用程序配合得不好,因此这是否有效是值得怀疑的,特别是如果您认为数据在分析时可能会发生变化。难道不能写出临时文件吗?

Have you tried creating a new tvbuff_t as TVBUFF_REAL_DATA and providing your memory region as the data parameter?

tvbuff_t *tvb = tvb_new_real_data(mem_buffer_ptr, mem_buf_length, mem_buf_length);
//mem_buffer_ptr is your memory buffer
//mem_buf_length is the number of bytes in your buffer

Wireshark historically does not play well with other applications, so whether this will work or not is questionable, especially if you think your data may change while it is being dissected. Is it not possible to write out a temporary file?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文