Version 1.05
[firmware_header_dump.git] / firmware_header_dump.c
index 5e1f99e..fda9fe1 100644 (file)
@@ -1,7 +1,7 @@
 static const char *title =\
 "Broadcom Consumer Router Firmware Header Dump"
 ;
-static const float VERSION = 1.01f;
+static const float VERSION = 1.05f;
 
 static const char *copyright = \
 "Copyright 2015-2016 TJ <hacker@iam.tj>\n"
@@ -142,7 +142,7 @@ main(int argc, char **argv)
          header_len = sizeof(IMAGE_TAG);
 
        lseek(fd, offset, SEEK_SET);
-       printf("Header Offset: 0x%08x\n", offset);
+       printf("Header Offset: 0x%08x (%u)\n", offset, offset);
 
        if ( (buffer = heap_and_reap(NULL, header_len, 1)) != NULL) {
          ssize_t qty;
@@ -183,9 +183,9 @@ main(int argc, char **argv)
          }
 
          if (!count) {
-           printf("Image Offset:  0x%08x\n", offset);
+           printf("Image Offset:  0x%08x (%u)\n", offset, offset);
            printf("%04lx Tag Version: %s\n"
-                  "%04lx Signature 1: %s\n"
+                  "%04lx Signature 1: %s (Model: %s)\n"
                   "%04lx Signature 2: %s\n"
                   "%04lx Chip ID: %s\n"
                   "%04lx Board ID: %s\n"
@@ -207,7 +207,7 @@ main(int argc, char **argv)
                   "     Calculated Tag   CRC32: 0x%08x\n"
                   "\n",
                   offsetof(struct _FILE_TAG, tagVersion), pfile->tagVersion,
-                  offsetof(struct _FILE_TAG, signiture_1), pfile->signiture_1,
+                  offsetof(struct _FILE_TAG, signiture_1), pfile->signiture_1, pfile->signiture_1 + strlen(pfile->signiture_1) + 1,
                   offsetof(struct _FILE_TAG, signiture_2), pfile->signiture_2,
                   offsetof(struct _FILE_TAG, chipId), pfile->chipId,
                   offsetof(struct _FILE_TAG, boardId), pfile->boardId,
@@ -230,7 +230,7 @@ main(int argc, char **argv)
            );
 
          } else {
-           printf("Image Offset:  0x%08x\n", offset);
+           printf("Image Offset:  0x%08x (%u)\n", offset, offset);
            printf("%04lx Image Next: %u\n"
                   "%04lx Image Type: %s (%lu)\n"
                   "%04lx Image Signature: %u\n"