Skip to content

Allows you to convert a file of any type to hexadecimal format (and vice versa).

License

Notifications You must be signed in to change notification settings

LucaBarile/HexFileConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HexFileConverter

Why HexFileConverter?

I needed to convert a hex file (saved in a particular format) in order to develop my ARB_RW exploit for ZDI-CAN-16318.
(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.

What is it for?

Allows you to convert a file of any type to hexadecimal format (and vice versa).

Usage

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).

Hex file format

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:
  1. 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.
  2. 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 😥)).

Oh?! Is that a flying unicorn?! 😲

If you liked HexFileConverter, what do you think about buying me a unicorn? 🦄
Here you can buy me a unicorn.