mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-15 08:20:59 +02:00
util/nvmutil: nicer hexdump display
make it look like hexdump -C, where individual bytes are spaced, and there is an additional space after 8 bytes, per row. i won't bother with a character display, since that is meaningless on gbe nvm words. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -219,10 +219,12 @@ void
|
|||||||
hexdump(int partnum)
|
hexdump(int partnum)
|
||||||
{
|
{
|
||||||
for (int row = 0; row < 8; row++) {
|
for (int row = 0; row < 8; row++) {
|
||||||
printf("%07x", row << 4);
|
printf("%08x ", row << 4);
|
||||||
for (int c = 0; c < 8; c++) {
|
for (int c = 0; c < 8; c++) {
|
||||||
uint16_t val16 = word((row << 3) + c, partnum);
|
uint16_t val16 = word((row << 3) + c, partnum);
|
||||||
printf(" %02x%02x", val16 & 0xff, val16 >> 8);
|
if (c == 4)
|
||||||
|
printf(" ");
|
||||||
|
printf(" %02x %02x", val16 & 0xff, val16 >> 8);
|
||||||
} printf("\n");
|
} printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user