Skip to content
This repository
Browse code

Update img3unpack/img3.c

"img3.h" casts its variables as unsigned int, yet in "img3.c", it asks for long signed int. The solution was to either change "img3.h" to cast the variables as long signed int, or change "img3.c" to ask for an unsigned int. I chose the later.
  • Loading branch information...
commit c032011c68058db9a2f320f173893aec2166de60 1 parent 2bcd24c
renegadezombies authored September 24, 2012

Showing 1 changed file with 10 additions and 10 deletions. Show diff stats Hide diff stats

  1. 20  img3unpack/img3.c
20  img3unpack/img3.c
@@ -25,24 +25,24 @@ void dumpImg3Header(const Img3* header)
25 25
 	printf("Header size: %d\n", sizeof(*header));
26 26
 
27 27
 	printf("Magic:       0x%x (%s)\n", header->magic, str_magic(header->magic));
28  
-	printf("Length:      %ld\n", header->dataLenPad);
29  
-	printf("Unknown:     %ld\n", header->u1);
30  
-	printf("Cert Offset: %ld\n", header->certOffset);
  28
+	printf("Length:      %u\n", header->dataLenPad);
  29
+	printf("Unknown:     %u\n", header->u1);
  30
+	printf("Cert Offset: %u\n", header->certOffset);
31 31
 	printf("Name:        0x%x (%s)\n", header->name, str_magic(header->name));
32 32
 	printf("Type:        0x%x (%s)\n", header->type, str_magic(header->type));
33  
-	printf("nameOffset:  %ld\n", header->nameOffset);
34  
-	printf("dataLen:     %ld\n", header->dataLen);
  33
+	printf("nameOffset:  %u\n", header->nameOffset);
  34
+	printf("dataLen:     %u\n", header->dataLen);
35 35
 }
36 36
 void dumpImg3Footer(const Img3_footer2* footer)
37 37
 {
38 38
 	printf("=======================================\n");
39 39
 	printf("Footer size: %d\n", sizeof(*footer));
40 40
 
41  
-	printf("Block Size: %ld bytes\n", footer->blockSize);
42  
-	printf("Signature:  %ld bytes\n", footer->sigLen);
  41
+	printf("Block Size: %u bytes\n", footer->blockSize);
  42
+	printf("Signature:  %u bytes\n", footer->sigLen);
43 43
 	printf("Cert Head:  0x%x (%s)\n", footer->cert_magic, str_magic(footer->cert_magic));
44  
-	printf("Cert Size:  %ld\n", footer->cert_size);
45  
-	printf("Certficate: %ld bytes\n", sizeof(footer->cert));
  44
+	printf("Cert Size:  %u\n", footer->cert_size);
  45
+	printf("Certficate: %u bytes\n", sizeof(footer->cert));
46 46
 
47 47
 }
48 48
 int main(int argc, char *argv[]) {
@@ -117,7 +117,7 @@ int main(int argc, char *argv[]) {
117 117
 		offSet = sizeof(*dF);
118 118
     while(offSet < pHeaderImg3->dataLenPad) {
119 119
     	printf("Flag:        0x%x (%s)\n", dF->name, str_magic(dF->name));
120  
-			printf("Offset:      %ld\n", offSet);
  120
+			printf("Offset:      %d\n", offSet);
121 121
       if(dF->name == END_FLAG_HSHS) {
122 122
 				offSet += - 16;
123 123
 				memcpy(pFooterImg3_2, (fBuf + sizeof(Img3) + pHeaderImg3->nameOffset) - 12 + offSet, sizeof(*pFooterImg3_2));

0 notes on commit c032011

Please sign in to comment.
Something went wrong with that request. Please try again.