-
-
Save spbdimka/803ec5577c95fc4eb3fcbe276525e372 to your computer and use it in GitHub Desktop.
Reverse endianess on a binary file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Following command will reorder 32 bit words from little endian to big endian | |
# | |
# This is needed on TI81xx platforms to convert a standard LE bootloader/SPL/MLO | |
# to a byte ordering the works via SPI flash | |
arm-none-linux-gnueabi-objcopy -Ibinary --reverse-bytes=4 MLO MLO.spi | |
# Output: | |
# $ hexdump -C MLO | head -n2 | |
# 00000000 40 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 |@...............| | |
# 00000010 00 00 00 00 43 48 53 45 54 54 49 4e 47 53 00 00 |....CHSETTINGS..| | |
# $ hexdump -C MLO.spi | head -n2 | |
# 00000000 00 00 00 40 00 00 00 0c 00 00 00 00 00 00 00 00 |...@............| | |
# 00000010 00 00 00 00 45 53 48 43 4e 49 54 54 00 00 53 47 |....ESHCNITT..SG| | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment