Systems administrators often find themselves examining raw computer data that doesn't make much sense. Data from tools such as network-packet analyzers and disk editors should be easy to read, but instead it's a computer novel of hexadecimal codes and offset values. For busy administrators, sorting through this "hex dump" for useful information is a waste of time. So, I created a Perl script named HexDump.pl that converts computer hex dumps into legible text. To understand how this script works, you need to know the anatomy of a network (i.e., TCP/IP) packet and what a hex dump contains.
The Anatomy of a Network Packet
Most network-packet analyzers let you analyze each network packet. Such analyses describe all sorts of interesting information, such as the IP address the packet was traveling to, the IP address it came from, and destination and source TCP ports. It's easy for network-packet analyzers to pick out this information because every packet must have it and it's in a predicable location. . . .