-struct fw_header {
- unsigned int unknown[8];
- unsigned int len;
- char ident[4];
- unsigned int offset;
- char desc[128];
-};
-
-void parse_fw(unsigned char *fw, unsigned int off) {
- struct fw_header *header = (struct fw_header*)(fw + off);
- static unsigned int last_off;
- int i;
-
- printf("Address in file: 0x%08x, Difference to last: %u\n", off, off-last_off);
- printf("Unknown: ");
- for (i = 0; i < 8; i++)
- printf("0x%08x ", header->unknown[i]);
-
- printf("\n");
-
- printf("Length: %u, possible next entry at: 0x%08x\n", header->len, off + header->len + 22);
-
- printf("Identifier: %.4s\n", header->ident);
-
- printf("Offset: 0x%08x\n", header->offset);
-
- printf("Descriptiom: %s\n", header->desc);
-
- printf("\n");
- last_off = off;
-}
-