mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2026-09-19 21:34:19 +00:00
Add Wii U conversion support: implement command and usage for converting WUD/WUX to AaruFormat
This commit is contained in:
@@ -35,9 +35,13 @@ add_executable(aaruformattool
|
||||
iso9660_mini.c
|
||||
iso9660_mini.h
|
||||
convert_ps3.c
|
||||
convert_wiiu.c
|
||||
wiiu_reader.c
|
||||
wiiu_reader.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../src/lib/aes128.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../src/ps3/ps3_crypto.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../src/ps3/ps3_encryption_map.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../src/wiiu/wiiu_crypto.c
|
||||
termbox2.h
|
||||
)
|
||||
|
||||
|
||||
@@ -45,5 +45,6 @@ int upgrade_ddt_to_alpha21(const char *path);
|
||||
int inject_media_tag(const char *tag_type, const char *media_tag_file, const char *image_file);
|
||||
int convert_ps3(const char *input_path, const char *output_path, const char *disc_key_hex, const char *data1_key_hex,
|
||||
const char *ird_path);
|
||||
int convert_wiiu(const char *input_path, const char *output_path, const char *disc_key_hex);
|
||||
|
||||
#endif // LIBAARUFORMAT_TOOL_AARUFORMATTOOL_H_
|
||||
|
||||
@@ -243,6 +243,29 @@ int cmd_convert_ps3(int argc, char *argv[])
|
||||
return result;
|
||||
}
|
||||
|
||||
int cmd_convert_wiiu(int argc, char *argv[])
|
||||
{
|
||||
struct arg_str *input_filename = arg_str1(NULL, NULL, "<input>", "Input WUD, WUX, or AaruFormat image");
|
||||
struct arg_str *output_filename = arg_str1(NULL, NULL, "<output>", "Output AaruFormat image");
|
||||
struct arg_str *disc_key_arg = arg_str0(NULL, "disc-key", "<hex>", "32-char hex disc key");
|
||||
struct arg_end *end = arg_end(10);
|
||||
void *argtable[] = {input_filename, output_filename, disc_key_arg, end};
|
||||
|
||||
if(arg_parse(argc, argv, argtable) > 0)
|
||||
{
|
||||
arg_print_errors(stderr, end, "convert-wiiu");
|
||||
usage_convert_wiiu();
|
||||
arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *disc_key_hex = disc_key_arg->count > 0 ? disc_key_arg->sval[0] : NULL;
|
||||
|
||||
const int result = convert_wiiu(input_filename->sval[0], output_filename->sval[0], disc_key_hex);
|
||||
arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
|
||||
return result;
|
||||
}
|
||||
|
||||
Command commands[] = {
|
||||
{ "identify", cmd_identify},
|
||||
{ "info", cmd_info},
|
||||
@@ -256,6 +279,7 @@ Command commands[] = {
|
||||
{"upgrade-ddt-to-alpha21", cmd_upgrade_ddt_to_alpha21},
|
||||
{ "inject-media-tag", cmd_inject_media_tag},
|
||||
{ "convert-ps3", cmd_convert_ps3},
|
||||
{ "convert-wiiu", cmd_convert_wiiu},
|
||||
};
|
||||
|
||||
const size_t num_commands = sizeof(commands) / sizeof(commands[0]);
|
||||
|
||||
19
tool/usage.c
19
tool/usage.c
@@ -38,6 +38,8 @@ void usage()
|
||||
printf(" cli-compare Compares two AaruFormat images sector by sector (CLI mode).\n");
|
||||
printf(" compare Compares two AaruFormat images.\n");
|
||||
printf(" convert Converts an AaruFormat image to another AaruFormat image.\n");
|
||||
printf(" convert-ps3 Converts a PS3 disc image to AaruFormat with decrypted storage.\n");
|
||||
printf(" convert-wiiu Converts a Wii U disc image to AaruFormat with decrypted storage.\n");
|
||||
printf(" identify Identifies if the indicated file is a supported AaruFormat image.\n");
|
||||
printf(" info Prints information about a given AaruFormat image.\n");
|
||||
printf(" inject-media-tag Injects a media tag into an AaruFormat image.\n");
|
||||
@@ -180,3 +182,20 @@ void usage_convert_ps3()
|
||||
printf(" 4. Sidecar files: <input>.disc_key, <input>.data1, <input>.ird\n");
|
||||
printf(" 5. Source AaruFormat image media tags\n");
|
||||
}
|
||||
|
||||
void usage_convert_wiiu()
|
||||
{
|
||||
printf("\nUsage:\n");
|
||||
printf(" aaruformattool convert-wiiu <input> <output> [options]\n\n");
|
||||
printf("Converts a Wii U disc WUD, WUX, or AaruFormat image to an AaruFormat image\n");
|
||||
printf("with decrypted sector storage and Wii U encryption metadata.\n\n");
|
||||
printf("Arguments:\n");
|
||||
printf(" <input> Path to input WUD, WUX, or AaruFormat image.\n");
|
||||
printf(" <output> Path to output AaruFormat image.\n\n");
|
||||
printf("Options:\n");
|
||||
printf(" --disc-key=<hex> 32-char hex disc key (16 bytes).\n\n");
|
||||
printf("Key resolution order:\n");
|
||||
printf(" 1. --disc-key argument\n");
|
||||
printf(" 2. Sidecar files: <input>.disckey, <input>.key\n");
|
||||
printf(" 3. Source AaruFormat image media tags\n");
|
||||
}
|
||||
|
||||
@@ -34,5 +34,6 @@ void usage_convert();
|
||||
void usage_upgrade_ddt_to_alpha21();
|
||||
void usage_inject_media_tag();
|
||||
void usage_convert_ps3();
|
||||
void usage_convert_wiiu();
|
||||
|
||||
#endif // LIBAARUFORMAT_USAGE_H
|
||||
|
||||
Reference in New Issue
Block a user