From f447d93ddd7ddee758898b167da498a757331f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Jo=C5=84czyk?= Date: Mon, 23 Mar 2026 22:30:24 +0100 Subject: [PATCH] asusuimage: fix fs_offset extraction in show_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This code was apparently intended to look for FS_OFFSET_PREFIX and then read the big-endian 24-bit value just after it. Instead, it did always read the value from a fixed offset. This fixes using bogus (or zero) values of `fs_offset` when analysing TRXv2 images for Asus RT-AX53U. Now the values agree with what the `binwalk` tool prints. This patch modifies the show_info() function, which is used only for firmware analysis and not in an OpenWRT build. Signed-off-by: Mateusz Jończyk --- src/asusuimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asusuimage.c b/src/asusuimage.c index df8870b..b41f19a 100644 --- a/src/asusuimage.c +++ b/src/asusuimage.c @@ -455,7 +455,7 @@ static int show_info(char *img, size_t img_size) buf_size = sizeof(trx2_t) - offsetof(trx2_t, unk); for (size_t i = 0; i < buf_size; i += 2) { if (buf[i] == FS_OFFSET_PREFIX) { - xx = GET_BE24(buf + 1); + xx = GET_BE24(buf + i + 1); if ((xx & 3) == 0) { fs_offset = xx; break;