in reply to converting tcpdump files

Have you tried using pack or unpack?
perldoc -f pack