Skip to content

Commit

Permalink
fix the offset of crc data and regulate the usage
Browse files Browse the repository at this point in the history
  • Loading branch information
0CBH0 committed Jan 7, 2018
1 parent 492a56c commit ff09009
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions wiiurpxtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,20 +368,27 @@ int compress(FILE *in, FILE *out)

int main(int argc, char *argv[])
{
if(argc != 3)
if(argc < 3)
{
printf("wiiurpxtool - version:1.2\n");
printf("wiiurpxtool - version:1.3\n");
printf("Compress or decompress RPL/RPX files for Wii U\n\n");
printf("Usage:\n");
printf("decompress:\n");
printf("wiiurpxtool -d [rpx_name]\n");
printf("wiiurpxtool -d <rpx_name> [out_name]\n");
printf("compress:\n");
printf("wiiurpxtool -c [rpx_name]\n");
printf("wiiurpxtool -c <rpx_name> [out_name]\n");
return 0;
}
FILE *in = fopen(argv[2], "rb");
if(in == NULL) return -1;
FILE *out = fopen("temp.bin", "wb");
FILE *out;
if(argc == 3)
out = fopen("temp.bin", "wb");
else
{
out = fopen(argv[3], "wb");
if (out == NULL) return -1;
}
s32 result = -1;
if(strcmp("-d", argv[1]) == 0)
{
Expand All @@ -395,7 +402,7 @@ int main(int argc, char *argv[])
}
fclose(in);
fclose(out);
if(result == 0)
if(argc == 3 && result == 0)
fcopy("temp.bin", argv[2]);
remove("temp.bin");
return 0;
Expand Down

0 comments on commit ff09009

Please sign in to comment.