From 432279ee98cd1bd30fabf44ce7053fc478394e51 Mon Sep 17 00:00:00 2001 From: Jon Feldman Date: Wed, 18 Oct 2017 00:01:32 -0400 Subject: [PATCH] Now with basic changes to support generating an EOV undub (yay) --- README.md | 7 ++++++- extract.c | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 71fc5c7..2ee03a0 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ These tools are capable of modifying "Etrian Odyssey Untold: The Millenium Girl" The only reason this is possible is due to this guy: https://github.com/xdanieldzd and his tool UntoldUnpack, which served as documentation for implementing my own tool. +Now with support for EOV, due to using the exact same data format! Whee. + How to use ---------- @@ -21,7 +23,7 @@ More specifically: You need the data files MORI1R.HPI and MORI1R.HPB from both. First, run the following: ``` -./extract JPN_MORI1R.HPI JPN_MORI1R.HPB +./extract JPN_MORI1R.HPI JPN_MORI1R.HPB 1 ``` This will generate an output folder named `VOICE` with the japanese voice data. Next, in the same directory, run the following: @@ -34,6 +36,9 @@ This will generate two output files: out.hpi and out.hpb. These are your undub. For a full undub, you'll also want to overwrite the video files that are not in the archive and in the folder named `Mobiclip` within the romfs. +If you want to do this with EOV, replace MORI1R with MORI5 and use '5' as the argument to extract instead of '1'. And use a +Japanese and English copy of that game, not Untold. + How the hell does this work? ---------------------------- diff --git a/extract.c b/extract.c index c4a2ddc..ff6c00c 100644 --- a/extract.c +++ b/extract.c @@ -69,13 +69,24 @@ char* data_map(hpi_file_entry_t *entries, int index, char* data) { } int main(int c, char** v) { + if (c < 3 || c > 4) { + die("usage: extract hpi hpb [flavor]\n flavor is either 1 (Untold), 5 (EOV), or 0 (Ignore)"); + } + FILE* hpi = fopen(v[1], "rb"); FILE* hpb = fopen(v[2], "rb"); + int flavor = 1; + if (!hpi) die("Failed to open HPI.\n"); if (!hpb) die("Failed to open HPB.\n"); + if (c == 4) + flavor = v[3][0] - '0'; + if (!(flavor == 1 || flavor == 5 || flavor == 0)) + die("invalid flavor\n"); + fseek(hpi, 0, SEEK_END); size_t hpi_file_size = ftell(hpi); rewind(hpi); @@ -111,7 +122,10 @@ int main(int c, char** v) { char *name = name_map(file_entries, i, filename_blob); // If you're poking around, comment this. Keep in mind no decompression is performed. - if (strncmp(name, "VOICE/", 6)) + if (flavor == 1 && strncmp(name, "VOICE/", 6)) + continue; // Not voice files, keep going + + if (flavor == 5 && strncmp(name, "SND/", 4)) continue; // Not voice files, keep going char* dir = dir_name(name); -- 2.39.5