Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyrolledyou #20

Open
wants to merge 2 commits into
base: marcan
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions img3unpack/img3.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ void dumpImg3Header(const Img3* header)
printf("Header size: %d\n", sizeof(*header));

printf("Magic: 0x%x (%s)\n", header->magic, str_magic(header->magic));
printf("Length: %ld\n", header->dataLenPad);
printf("Unknown: %ld\n", header->u1);
printf("Cert Offset: %ld\n", header->certOffset);
printf("Length: %u\n", header->dataLenPad);
printf("Unknown: %u\n", header->u1);
printf("Cert Offset: %u\n", header->certOffset);
printf("Name: 0x%x (%s)\n", header->name, str_magic(header->name));
printf("Type: 0x%x (%s)\n", header->type, str_magic(header->type));
printf("nameOffset: %ld\n", header->nameOffset);
printf("dataLen: %ld\n", header->dataLen);
printf("nameOffset: %u\n", header->nameOffset);
printf("dataLen: %u\n", header->dataLen);
}
void dumpImg3Footer(const Img3_footer2* footer)
{
printf("=======================================\n");
printf("Footer size: %d\n", sizeof(*footer));

printf("Block Size: %ld bytes\n", footer->blockSize);
printf("Signature: %ld bytes\n", footer->sigLen);
printf("Block Size: %u bytes\n", footer->blockSize);
printf("Signature: %u bytes\n", footer->sigLen);
printf("Cert Head: 0x%x (%s)\n", footer->cert_magic, str_magic(footer->cert_magic));
printf("Cert Size: %ld\n", footer->cert_size);
printf("Certficate: %ld bytes\n", sizeof(footer->cert));
printf("Cert Size: %u\n", footer->cert_size);
printf("Certficate: %u bytes\n", sizeof(footer->cert));

}
int main(int argc, char *argv[]) {
Expand Down Expand Up @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) {
offSet = sizeof(*dF);
while(offSet < pHeaderImg3->dataLenPad) {
printf("Flag: 0x%x (%s)\n", dF->name, str_magic(dF->name));
printf("Offset: %ld\n", offSet);
printf("Offset: %d\n", offSet);
if(dF->name == END_FLAG_HSHS) {
offSet += - 16;
memcpy(pFooterImg3_2, (fBuf + sizeof(Img3) + pHeaderImg3->nameOffset) - 12 + offSet, sizeof(*pFooterImg3_2));
Expand Down