๐ Are there any little-endian-native hex editors?
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
Little-endian grows significance to the left, ...543210; whereas big-endian grows to the right 012345... which means all hex editors I'm able to find lay out files in big-endian notation.
(math in arabic-numeral notation is little-endian. Bit-shifts <<
and >>
are also little-endian)
A little-endian-native hex editor would look something like this:
// little-endian CPU uint32_t array[] = {1,2,3,4,5,6,7,8}; uint8_t* one = array; assert(1 == *one); // should fail on big-endian // big-endian has little-endian bits-for-words FF EE DD CC BB AA 99 88 77 66 55 44 33 22 11 00 00 00 00 04 00 00 00 03 00 00 00 02 00 00 00 01 :0000 00 00 00 08 00 00 00 07 00 00 00 06 00 00 00 05 :0010
[link] [comments] ...