Skip to content

Commit

Permalink
unpackbootimg: always dump second offset even if size = 0
Browse files Browse the repository at this point in the history
- offset is used by some OEM images with hidden second sections (signatures), this should help with adding support in the future
  • Loading branch information
osm0sis committed Feb 4, 2017
1 parent 2a0c693 commit 13ca4c6
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions unpackbootimg.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ int main(int argc, char** argv)
printf("BOARD_PAGE_SIZE %d\n", header.page_size);
printf("BOARD_KERNEL_OFFSET %08x\n", header.kernel_addr - base);
printf("BOARD_RAMDISK_OFFSET %08x\n", header.ramdisk_addr - base);
if (header.second_size != 0) {
printf("BOARD_SECOND_OFFSET %08x\n", header.second_addr - base);
}
printf("BOARD_SECOND_OFFSET %08x\n", header.second_addr - base);
printf("BOARD_TAGS_OFFSET %08x\n", header.tags_addr - base);
int a,b,c,y,m = 0;
if (header.os_version != 0) {
Expand Down Expand Up @@ -172,14 +170,12 @@ int main(int argc, char** argv)
sprintf(ramdiskofftmp, "%08x", header.ramdisk_addr - base);
write_string_to_file(tmp, ramdiskofftmp);

if (header.second_size != 0) {
//printf("secondoff...\n");
sprintf(tmp, "%s/%s", directory, basename(filename));
strcat(tmp, "-secondoff");
char secondofftmp[200];
sprintf(secondofftmp, "%08x", header.second_addr - base);
write_string_to_file(tmp, secondofftmp);
}
//printf("secondoff...\n");
sprintf(tmp, "%s/%s", directory, basename(filename));
strcat(tmp, "-secondoff");
char secondofftmp[200];
sprintf(secondofftmp, "%08x", header.second_addr - base);
write_string_to_file(tmp, secondofftmp);

//printf("tagsoff...\n");
sprintf(tmp, "%s/%s", directory, basename(filename));
Expand Down

0 comments on commit 13ca4c6

Please sign in to comment.