Changes

a footer
Line 10: Line 10:  
  unsigned char SHA[2][20]; // the two SHA-1 sums
 
  unsigned char SHA[2][20]; // the two SHA-1 sums
 
  } sHNHA_Title;
 
  } sHNHA_Title;
--[[User:Ludo6431|Ludo6431]] 19:24, 5 August 2009 (UTC)
+
 
 +
typedef struct {
 +
unsigned char pad[0x18];
 +
} sHNHA_Footer;
 +
--[[User:Ludo6431|Ludo6431]] 19:56, 5 August 2009 (UTC)
    
== C dumper ==
 
== C dumper ==
Line 26: Line 30:  
  sHNHA_Header header;
 
  sHNHA_Header header;
 
  sHNHA_Title title;
 
  sHNHA_Title title;
 +
sHNHA_Footer footer;
 
   
 
   
 
  fread(&header, 1, 0x88, fd); // read the header
 
  fread(&header, 1, 0x88, fd); // read the header
 +
printf("\nnumber of titles : %d", header.number);
 +
 +
size_t count=header.number;
 +
while(count--) { // read each title
 +
fread(&title, 1, sizeof(sHNHA_Title), fd);
 
   
 
   
while(fread(&title, 1, 48, fd)==48) { // read each title
   
  printf("\nTID=");
 
  printf("\nTID=");
 
  myprint("%c", title.TID, 4);
 
  myprint("%c", title.TID, 4);
Line 38: Line 47:  
  myprint("%02X", title.SHA[1], 20);
 
  myprint("%02X", title.SHA[1], 20);
 
  }
 
  }
 +
 +
fread(&footer, 1, sizeof(sHNHA_Footer), fd); // read the footer
 +
 +
if(fgetc(fd)!=EOF) printf("error");
 
   
 
   
 
  fclose(fd);
 
  fclose(fd);
 
  }
 
  }
 
--[[User:Ludo6431|Ludo6431]] 19:24, 5 August 2009 (UTC)
 
--[[User:Ludo6431|Ludo6431]] 19:24, 5 August 2009 (UTC)
71

edits