This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Options for HEX2BIN utility ?

The help screen on the HEX2BIN utility does not give any hint to the usage of 'n'.

I want to convert a HEX file (less than 32k) to a binary file with size=32k (8000 Hex).
Unused bytes should be padded with FF.

I expected the following command to work:

HEX2BIN /P0xFF myfile.hex

but this cmd pads with 00.

To my surprise it works with this command:

HEX2BIN /L0x8000 myfile.hex

Can anyone explain?

Parents
  • Yes, but if you have a file with gaps, and you just want to fill the gaps, you can't do this without specifying the length.
    For example:

    HEX2BIN /l0x1000 /f0xff myfile.hex

    will work, while

    HEX2BIN /f0xff myfile.hex

    fills the gaps with 0x00.
    This is not what you expect, but of course Hex2Bin would have to go through the hex file twice to fetch the size in the 1st run (or it could just fill up a 64kb array).

Reply
  • Yes, but if you have a file with gaps, and you just want to fill the gaps, you can't do this without specifying the length.
    For example:

    HEX2BIN /l0x1000 /f0xff myfile.hex

    will work, while

    HEX2BIN /f0xff myfile.hex

    fills the gaps with 0x00.
    This is not what you expect, but of course Hex2Bin would have to go through the hex file twice to fetch the size in the 1st run (or it could just fill up a 64kb array).

Children