you want to take a look at the libpcap library: https://pypi.org/project/libpcap/
github: https://github.com/karpierz/libpcap
docs: https://www.tcpdump.org/papers/bpf-usenix93.pdf
The pcap file is not just one record, but is a protocol of various records explained here: https://github.com/hokiespurs/velodyne-c...CAP-format
Thus to be able to read, you need to extract the various records
All binary can be displayed as hex, octal or decimal (and many formats, but not all binary can be displayed as ASCII, as ASCII is for printable characters only).
I think you will probably get what you are looking for with pyshark:
to install:
github: https://github.com/KimiNewt/pyshark
documentation: Python wrapper for tshark, allowing python packet parsing using wireshark dissectors.
github: https://github.com/karpierz/libpcap
docs: https://www.tcpdump.org/papers/bpf-usenix93.pdf
The pcap file is not just one record, but is a protocol of various records explained here: https://github.com/hokiespurs/velodyne-c...CAP-format
Thus to be able to read, you need to extract the various records
Quote:I want to read the hex part and convert it into binary sequences.I know what you are asking here, but your terminology is incorrect as hex is just one representation of binary data, ASCII is another for printable character format, and does not have values for every binary value.
All binary can be displayed as hex, octal or decimal (and many formats, but not all binary can be displayed as ASCII, as ASCII is for printable characters only).
I think you will probably get what you are looking for with pyshark:
to install:
pip install pyshark
github: https://github.com/KimiNewt/pyshark
documentation: Python wrapper for tshark, allowing python packet parsing using wireshark dissectors.