To test this program, I used the following commands:
>copy c:\winnt\system32\ping.exe ping.exe
1 file(s) copied.
>Bin2Hex.pl ping.exe ping.hex
Number of bytes converted = 16144
>Hex2Bin.pl ping.hex ping_copy.exe
Number of bytes converted = 16144
>ping_copy localhost
Pinging localhost.herong.com [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms