ipa-firmware: Look at the table offset
* The two dummy bytes appear to be an offset, check that they are zero and refuse to work when they are not.
This commit is contained in:
parent
6e79b54d7b
commit
c88181a7df
|
@ -74,6 +74,13 @@ int ipaccess_analyze_file(int fd, const unsigned int st_size, const unsigned int
|
||||||
INIT_LLIST_HEAD(&header->header_list);
|
INIT_LLIST_HEAD(&header->header_list);
|
||||||
llist_add(&header->entry, list);
|
llist_add(&header->entry, list);
|
||||||
|
|
||||||
|
if (ntohs(firmware_header->table_offset) != 0) {
|
||||||
|
fprintf(stderr, "The table offset is not zero. That is not supported: 0x%x at 0x%x\n",
|
||||||
|
ntohs(firmware_header->table_offset), base_offset);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ntohs(firmware_header->part_length) % PART_LENGTH != 0) {
|
if (ntohs(firmware_header->part_length) % PART_LENGTH != 0) {
|
||||||
fprintf(stderr, "The part length seems to be wrong.\n");
|
fprintf(stderr, "The part length seems to be wrong.\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue