1
我想单独解析TCP包,而不使用PCAPLib自己的数据结构。出于这个原因,我需要获取TCP头的字节阵列。从pipcapfile中的TCP头部获取ByteArray
from pcapfile import savefile
capfile = open('delta_capture.pcap')
sf = savefile.load_savefile(capfile)
for packet in sf.packets:
print packet.timestamp
print packet.packet
print packet.header # Returns a library object, I need the bytearray instead, as I want to use my own data structure and parse.
capfile.close()
我试图调试和inspectiong对象结构,但不能看到其中实际字节存储在TCP报头的任何对象。
为变量“包”调试结果截图:
它甚至有可能在这个图书馆这样做呢?