News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Find dialogue text in PS2 game (Racjin)  (Read 4307 times)

Iredc

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Find dialogue text in PS2 game (Racjin)
« on: August 22, 2017, 11:50:14 am »
I'm trying to locate the text script of a PS2 game (Fullmetal Alchemist 3: Kami o Tsugu Shoujo) to translate it from Japanese. The game was developed by Racjin, and it seems to have a very similar structure to other Racjin games like Naruto Uzumaki Chronicles, so any info on any of those games will be quite useful as well.
Upon extracting the ISO, this is what I found:

-A folder called "DSI": it contains the cinematic cutscenes in .dsi format (VGMtoolbox presumably opens them)
-A folder called "XA": it contains a file, "XA.pak". I'm not sure what is this, but was told in another forum that it was just music (it has no header).
-A "CFC.DIG" file: there's a quickbms script which extracts it and produces a lot of .raw files. Some are audio, and the others may be models (if it's the same case as this, as it seems: https://www.romhacking.net/forum/index.php?topic=24139.0)
-A "DATA0" file which is almost empty (200kb): apparently, only has some audio
-The .IRX modules
-SYSTEM.CNF
-IOPRP255.IMG (258 kb)
-The .ELF file (SLPM_660.73): the executable, I suppose.

Apart from this, there's nothing more inside the ISO, so I don't know how to proceed from here. I haven't found anything that looks remotely as a dialogue script, yet it should be "somewhere". This game has a lot of dialogue, similar to a visual novel, so it's very unlikely that the text is simply stored in texture files. Also, when I checked the previous FMA games (which were released in English by the same company), I couldn't find anything either.

Does this file structure ring any bells for someone? Perhaps the text is inside the .ELF? I can't really interpret the hex data inside it, but seems to be the only place left for it. Does that make any sense? I also checked the memory dump of a PCSX2 save, but there wasn't dialogue text there (neither in the Japanese nor in the English games).
I hope someone can shed some light on this mistery, because being a newbie in this, I'm totally confused.

mz

  • Sr. Member
  • ****
  • Posts: 441
  • Whore
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #1 on: August 22, 2017, 01:16:46 pm »
You'll never find text by opening each file in an ISO file and looking for simple text in ASCII or something.

This is what I'd do to find it very quickly if the text is not compressed or encrypted:
1. Find the text inside the complete ISO file with a relative-search tool like Monkey-Moore.
2. Now you can find that piece of bytes within the extracted files, either by searching with a hex editor or by looking at the ISO LBA with a tool like CDmage.
There has to be a better life.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6927
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #2 on: August 22, 2017, 01:27:43 pm »
I thought Square-Enix was a fan of hiding files behind custom filesystems (in which case standard ISO programs wouldn't help), having seen a number of people wanting to hack SE games and finding the files are "invisible".
"My watch says 30 chickens" Google, 2018

Iredc

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #3 on: August 22, 2017, 06:19:36 pm »
I already tried the Monkey Moore and Arbitrary Search tools, both in the individual files and ISO, but got no result.
I had also heard that Square games were particularly difficult to hack, but wasn't some Kingdom Hearts game translated by fans?

There's this list of game characters inside the .ELF file:


Is this relevant?
There's also this, which looks like... a list of fonts? (it's from the English game):

MarkAss

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #4 on: September 04, 2017, 06:57:47 pm »
Text can be stored in .db files inside SYSTEM.DAT.

http://www.romhacking.net/forum/index.php?topic=18254.0

Iredc

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #5 on: September 06, 2017, 12:35:08 pm »
Yeah, but in this case there's no SYSTEM.DAT. It's a SYSTEM.CNF which only has this data:
Code: [Select]
BOOT2 = cdrom0:\SLPM_660.73;1.VER   = 1.01.VMODE = NTSC..
I think the files are compressed or encrypted, so probably can't be retrieved without some serious reverse engineering.

MarkAss

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #6 on: September 17, 2017, 01:16:27 pm »
Did you try sector viewer/ editor?

https://photos.app.goo.gl/SyxxRZvQwj2N2hD02

I will keep trying, since I love puzzles, and let you know if anything comes up.
« Last Edit: September 18, 2017, 06:46:19 pm by MarkAss »

Iredc

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #7 on: September 18, 2017, 05:19:53 pm »
Well, that's some progress  :)
I assumed the XA.PAK was audio based on others' comments, and since the first game of the series lacks that file (and coincidentally doesn't have voiceovers either), I supposed it contained just the voice acting. Though it's possible that they used a different file system in the first game. Perhaps comparing the spoken lines vs. the text-only lines (as in conversations with the random characters) could shed some light.
Anyway, thanks a lot for looking into this.

Edit: is the sector viewer you're using some function of PCSX2 log window? I can't seem to find the same functions; maybe I'm running an older version of the emulator.
« Last Edit: September 20, 2017, 01:15:57 am by Iredc »

MarkAss

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #8 on: September 21, 2017, 06:31:16 am »
http://www.vso-software.fr/products/inspector/inspector.php

It doesn't mean that it is not pulling sound from XA.pak in this sector in my screenshot.

VLC player shows 25 minutes of audio if you try to open it. (No audio)
VLC will play DSI videos.

All irx and main SL.... File can be extracted with 7zip.

Still trying though. ;)

PS: https://forum.xentax.com/viewtopic.php?f=10&t=10231
I dont have a ps3 to test with.
« Last Edit: September 21, 2017, 07:29:46 pm by MarkAss »

Iredc

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #9 on: September 21, 2017, 02:16:49 pm »
Ok, I made a try with a piece of dialogue with just text and no voice (this happens when you try to leave the starting area in the wrong direction):
https://photos.app.goo.gl/ViqTO20FZeQIG5Hh2


The VSO scan viewer shows that sector 395540 belongs to the CFC.DIG file (offset 1409D000). All the other sectors in the screenshot belong to that file as well.
The quickbms script I first used to extract CFC.DIG is here: http://aluigi.altervista.org/quickbms.htm (it's called simply "Cfc Dig").
The script creates a folder "0" that contains audio with the IECS header and a folder "1" with many files (among them the ones which contain the sectors from above). So I suppose the dialogue is in some of those files. The problem is that they look compressed or encrypted, without any readable text. All of them begin with 00 05.
« Last Edit: September 22, 2017, 12:12:54 pm by Iredc »

MarkAss

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #10 on: September 23, 2017, 05:51:43 pm »
I am going to scan ISO with "Cube Media Player 2", apparently this program can find videos and sound on PS2, even if the partition is hidden.
It takes a long time to run a scan, but hopefully show some insite to the file structure.
I will post update tomorrow when search is complete. (I guess it can takes HOURS.)

http://forum.xentax.com/viewtopic.php?f=21&t=12957

*After 24 hours, it's at 40%. Don't use this program if you're in a hurry.  :laugh:

I do this test because I believe there is hidden info on the ISO and not the .dig file like King Mike said.
https://photos.app.goo.gl/vmTUa71c6IfoPHkH2
« Last Edit: September 24, 2017, 08:16:22 pm by MarkAss »

Iredc

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #11 on: September 25, 2017, 11:13:57 am »
I tried IsoBuster with this, and it retrieves some additional files. But they can't be extracted with the free edition of the program so I don't know what they are. Some of them look like the cutscenes in .mpeg format. However, when viewing the ISO in a hex editor I didn't find anything that wasn't already in the extracted files.

MarkAss

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #12 on: September 26, 2017, 12:29:21 pm »
The ISO size VS extracted size still confuses me, but you're right.
I tried Xpert PS2 Rebuilder and it extracted the same files as 7zip and when I recompiled the ISO the game worked perfectly.
http://www.theisozone.com/downloads/playstation/tools/xpert-v20/

But if xa.pak is audio, and one folder of cnf.dig is audio, images need to be stored somewhere too, is text really in cnf.dig?

Hopefully Cube Media player will allow us to compare known media formats to these archives to make sure. (84%)

* Unfortunately it does appear that cfc.dig is a custom archive with custom encryption.
To locate the algorithm, some ASM hacking will probably need to be done, along with examining memory dumps, or comparing save states. Most likely it is game specific, so don't expect to find a working script online.

https://gamehacking.org/vb/forum/video-game-hacking-and-development/school-of-hacking/1644-ps2-mips-assembly-language
« Last Edit: September 27, 2017, 04:30:14 pm by MarkAss »

Iredc

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #13 on: September 28, 2017, 07:39:41 am »
Yeah, I was afraid it would be so in the end. Unfortunately, comparing data to find that kind of algorithm is way, way above my skills. Guess I'll have to try luck with a different game, perhaps some of the GBA Fullmetal games instead, if such project hasn't been taken already.
Thank you for all your help and effort. At least the problem is identified now.  :)

MarkAss

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #14 on: September 28, 2017, 04:56:31 pm »
If you know Russian you could track down the team that made Russian translations for the first two games.
https://m.vk.com/topic-134418_28510306

Same files, but I can only find game download, no tools.

Iredc

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Find dialogue text in PS2 game (Racjin)
« Reply #15 on: October 02, 2017, 04:44:56 am »
I had no idea those translations existed. It seems the team is called NoRG or NoRG/Vector, and they've done many Russian translations for different games, but I couldn't find any contact information. All references are to torrent sites and the like.