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
----------
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:
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?
----------------------------
}
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);
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);