I've got two PCAP files, A
and B
.
A
has a 'magic number' in the header of d4 c3 b2 a1
, B
has a 'magic number' in the header of 4d 3c b2 a1
. According to the wireshark documentation (http://wiki.wireshark.org/Development/LibpcapFileFormat), only 0xd4c3b2a1
and 0xa1b2c3d4
are valid magic numbers, which leads me to think that B is not a valid magic number.
Running file
on linux backs this up, with the output of file A
being:
tcpdump capture file (little-endian) - version 2.4 (Ethernet, capture length 65535)
file B
simply gives:
data
It looks like that whatever wrote B
wrote it in a 'swapped' (little-endian) format, but wrote the forst twp bytes with the nibbles the wrong way round. Given that I'd expect a big-endian system to write the whole int32 the other way around and not the individual bytes, giving a magic number of 1a 2b 3c 4d
.
Is B
a valid file? If so, why? Can different systems write both 32-bit ints and the individual nibbles in a byte in an arbitrary order?