Skip to content

Commit

Permalink
fix the wrong offset of CRC data, close #2
Browse files Browse the repository at this point in the history
  • Loading branch information
0CBH0 committed Jun 25, 2017
1 parent 6747b37 commit 294f608
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions wiiurpxtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ int decompress(FILE *in, FILE *out)
fwrite32_BE(shdr_table[i].sh_addralign, out);
fwrite32_BE(shdr_table[i].sh_entsize, out);
}

fseek(out, crc_data_offset, 0);
for (u32 i=0; i<ehdr.e_shnum; i++)
fwrite32_BE(crcs[i], out);
Expand Down Expand Up @@ -365,6 +366,7 @@ int compress(FILE *in, FILE *out)
fwrite32_BE(shdr_table[i].sh_addralign, out);
fwrite32_BE(shdr_table[i].sh_entsize, out);
}

fseek(out, crc_data_offset, 0);
for (u32 i=0; i<ehdr.e_shnum; i++)
fwrite32_BE(crcs[i], out);
Expand All @@ -378,7 +380,7 @@ int main(int argc, char *argv[])
{
if(argc != 3)
{
printf("wiiurpxtool - version:1.1\n");
printf("wiiurpxtool - version:1.2\n");
printf("Compress or decompress RPL/RPX files for Wii U\n\n");
printf("Usage:\n");
printf("decompress:\n");
Expand All @@ -403,9 +405,9 @@ int main(int argc, char *argv[])
}
fclose(in);
fclose(out);
//if(result == 0)
// fcopy("temp.bin", argv[2]);
//remove("temp.bin");
if(result == 0)
fcopy("temp.bin", argv[2]);
remove("temp.bin");
return 0;
}

Expand Down

0 comments on commit 294f608

Please sign in to comment.