hexf 0.3 - ASCII to binary filter for interactive programs hexf opens a two-way pipe to another program and translates hex characters into binary and binary into hex characters. This allows the user or another program to interact with binary protocol or files using ordinary text tools. Hex digits are separated into bytes or words by spaces or other non-hex characters. Word sizes of 8, 16, and 32 bits are supported. Hex values may optionally have a leading "0x". Odd numbers of digits are ok, and a leading zero is assumed in this case (624 = 0624). Examples of valid input hex and their output on a little-endian machine: 11223344 55 66bbd 0824 # 44 33 22 11 55 bd 6b 06 00 24 08 aa:bb.cc:dd/eeff # aa bb cc dd ff ee Endian conversion occurs if the target format's endianness does not match the host's. The optional "-e" flag specifies the target is big-endian ("-be") or little-endian ("-le"). If no flag is specified, the target is assumed to have the same endianness as the host. Bytes output by the target are printed with a preceding "#" to distinguish them from input bytes. Example output of the string "nate": # 6e 61 74 65 Example usage: > hexf nc example.com 139 81 00 00 44 20 44 42 44 41 43 4f 44 42 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 41 44 00 20 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 41 41 00 # 82 00 00 00 And here's what that looked like to tcpdump: IP src.62872 > dst.139: P 1:73(72) ack 1 NBT Session Packet: Session Request IP dst.139 > src.62872: P 1:5(4) ack 73 NBT Session Packet: Session Granted Example of big-endian conversion: > hexf -eb cat 1234 6a b2 # 12 34 6a b2 LICENSING hexf is covered by a BSD license. See the file(s) for details. Copyright (c) 2006 Nate Lawson