(The exploit is quite interesting; read my report if you have nothing better to do 🙄).
After developing the code to convert a hex file to its original format I thought I’d also implement the code to perform the reverse conversion as well.
HexFileConverter was born putting everything together in one program.
Allows you to convert a file of any type to hexadecimal format (and vice versa).
First of all download here HexFileConverter.
To convert a file of any type (e.g.
foo.txt
) to hex format:HexFileConverter.exe foo.txt
The
foo.txt.hex
file will be generated.To convert a file from hex format (e.g.
foo.txt.hex
) to its original format (txt):HexFileConverter.exe foo.txt.hex
The
foo.txt
file will be generated.Note:
In this case the file you want to convert must be located in the same folder as
HexFileConverter.exe
If not, you must specify the entire path of the file to convert (e.g.
C:\...\Desktop\foo.txt
).To convert a hex file successfully, it must be formatted as follows:
- Each hexadecimal number must be separated by a space.
- There must be at most 16 hexadecimal numbers in a row.
- The letters of a hexadecimal number can be either uppercase or lowercase.
- After the last hexadecimal number there must be a newline.
- The newline characters must be \r\n
- The hexadecimal file name must be
fileName.OriginalFileExtension.hex
(e.g. foo.txt.hex
).If your hex file is not formatted as shown in the previous image, you have two choices:
-
You have also the original file, so you can throw away your unformatted hex file and use
HexFileConverter.exe
to convert it to the correct hex format. - You don't have the original file, so you must convert it manually (small file) to the correct hex format or by creating a tool that does it for you (large file (sad story 😥)).
Here you can buy me a unicorn.