是否有用于解析/格式化 TCP 数据包的库或任何有助于完成此操作的库?
我的应用程序使用 tcp 连接到我的服务器,我正在使用wireshark对其进行数据包嗅探,以了解它是如何工作的,我首先想到的是以十六进制形式发送给我的数据包,因此手动查看和解码非常困难。
所以我很难做一个解析器,我会做这样的事情:
<packet id="0x01" name="undefined">
<part name="userID" type="d"/>
</packet>
其中 d 代表十进制,并且会得到 4 个字节。
我的目标是做这样的事情:
在其下方是一个列表视图,其中数据包名称为根,其中的部分名称及其值。
我环顾四周,发现了可以嗅探数据等的库,但我真正寻找的是可以帮助我解析/格式化它的东西,周围有吗?
My application uses tcp to connect to my server and I am packet sniffing it to see how it works using wireshark, the first thing that crossed my mind is the packets that are coming to me in hex so manually looking and decoding is very hard.
So I tough was doing a parser where I do things like:
<packet id="0x01" name="undefined">
<part name="userID" type="d"/>
</packet>
Where d is for decimal and would get 4 bytes to it.
My goal is to make something like this:
And below it a listview with the packet name as root and the part names inside with their value.
I was looking around and found libraries to sniff the data etc but what I was really looking for is something that would help me parse/format it, is there any around ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找的是解码后的数据包,不幸的是,从 TCP 的角度来看,您正在寻找的已经是解码后的数据包。
要获取更多信息,您需要一个在更高级别协议上运行的协议解析器。对于现成的协议,这样的解析器可能已经存在,但如果您推出自己的协议,您还需要推出自己的解析器。有一个codeproject教程,用于为wireshark构建自定义解析器,它应该对您有帮助如果你想走这条路,就开始吧。
What you are looking for is the decoded packets, unfortunately from the perspective of TCP what you are looking at is already the decoded packet.
To get additional information you need a protocol dissector that operates on a higher level protocol. For off the shelf protocols such a dissector probably already exists, but if you rolled your own protocol you will also need to roll your own dissector. There is a tutorial on codeproject for building a custom dissector for wireshark which should help you get started if you want to go this route.