From 9f39f1992607a95ec9b72c02b34e2f8c15a02bef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Sun, 8 Jan 2023 13:56:42 +0100 Subject: [PATCH] tools: kwbimage: Fix endianity when printing kwbimage header MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit All fields in kwbimage header are in little endian format. Signed-off-by: Pali Rohár --- tools/kwbimage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 1128c934dd..97be3bed79 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -1928,9 +1928,9 @@ static void kwbimage_print_header(const void *ptr) } printf("Data Size: "); - genimg_print_size(mhdr->blocksize - sizeof(uint32_t)); - printf("Load Address: %08x\n", mhdr->destaddr); - printf("Entry Point: %08x\n", mhdr->execaddr); + genimg_print_size(le32_to_cpu(mhdr->blocksize) - sizeof(uint32_t)); + printf("Load Address: %08x\n", le32_to_cpu(mhdr->destaddr)); + printf("Entry Point: %08x\n", le32_to_cpu(mhdr->execaddr)); } static int kwbimage_check_image_types(uint8_t type) -- 2.39.5