Looking for advices or help to decode files for Yakuza PSP

Discussion in 'PSP - Hacking & Homebrew' started by Aegehn, Aug 30, 2014.

  1. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    Hello all,

    I'm really pondering wether I can launch a project for translating Yakuza PSP . The fact is I start with several disadvantages :
    • I don't know japanese
    • I don't have prior experience on the PSP scene or Romhacking in general.
    But I'm a CS Engineer, know several programming languages, specialized in HPC which gives me a bit of low-level knowledge and sense, and I really want to play the game in English.

    Anyway, I was poking around the rom files, trying to evaluate how hard it is to hack some english into the game. It's been less than a day since I started this, but I've made some progress :
    • Cutscenes subtitles are really easy to get and translate. They are in CVS, encoded UTF-8. There are 78 files, which amount for all the cutscenes spanning the 10 chapters of the game. Problem is, not all roman characters are available, espacially in lower case. I guess one way to solve this would be to edit the characters tiles, replace the katakanas for roman letters, and calling the good for displaying the wanted letter.
    • I've extracted a lot of GIM pictures, and to test things, edited the one displaying the first chapter title, then repacked it. It works, but the way GIM are packed in files seems unusual, as I did not find any information.
    Here's a few seconds of the intro, just to show that it's doable : http://webmup.com/E71wS

    So, what advices or help am I looking for ? Well, two things :

    • Fonts used for subtitles seems to be in a file called font_subtitles.pspf. Here the header of the file.
    [​IMG]

    I've set the encoding in SHIFT-JIS, and google translate 映画字幕書体 into Movie subtitles typeface. But I have no idea how to decode it, nor edit it. If you've already deal with something similar, I'll be really glad if could teach me how to do it.

    • Second thing, a lot of GIM files are packed in files started with the header ELPK. After what I think is a TOC, files are just concatenated, without compression nor encryption. Tools like TextER or GitMO easily extracts the GIM files, but without understanding how the header is formed, I have to repack GIM files that are the exact same size. But gimconv gives me files with a different size; slightly bigger, even with the good dimension, endianness, color_format etc. Hacking the GIM file and truncating the end (and modifying the header) works fine (that's how I did for inserting the modified chapter title), but it's extremely messy, long and boring to do it that way, so I'd like help to figure out how the header in encoded. Here's an example of a file containing 12 GIM files :
    [​IMG]

    If you can help me or tell me where to look at for information, I would be very grateful. If I can tackle those issue, maybe I'll try to launch a project for translating this great game.
     
    Hargrun and GHANMI like this.
  2. JamRules

    JamRules ...

    Member
    428
    422
    Jan 9, 2014
    Difficult to tell without looking at the full file but the ELPK seems to be

    4 bytes - magic
    4 bytes - file size
    4 bytes - ?
    4 bytes - \0

    4 bytes - file count

    [per file]
    4 bytes - id?
    4 bytes - start offset
    4 bytes - size
     
    Hargrun likes this.
  3. thexyz

    thexyz Member

    Newcomer
    40
    24
    Jan 8, 2014
    Serbia, Republic of
    If that happens with edited .png files, you might want to run them through pngquant.
     
    Hargrun likes this.
  4. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    JamRules : You may be onto something, but there is 4 more bytes to consider, because MIG starts at those offsets:
    0x000000C0, 0x00004200, 0x00008340, 0x0000C480, 0x000105C0, 0x00012700, 0x000128C0, 0x00016A00, 0x0001AB40, 0x0001EC80, 0x00022DC0 and 0x00026F00.

    thexyz : thanks for the advice, I'll try that!

    EDIT : Forget about what I said about the 4 additional bytes, that fits exactly right. Thanks a lot!
    [​IMG]

    EDIT 2 : And pngquant did the job! Thanks.

    Now I need to script things a bit, and to solve the font issue, and I'll have everything to decide wether to do something.

    EDIT 3 : Here's the four font files headers:
    [​IMG][​IMG][​IMG][​IMG]
     
    Hargrun likes this.
  5. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    Hello all,

    So, I've continued my tests, coded an unpacker/repacker for the EPLK files, automated conversion between gim and png, etc. But I still haven't found how to display the font files to see what's within.

    Anyway, there's this file, attached to this post, in which I think there are the menu strings. But no encoding displays anything intelligible, so I'm guessing it's compressed. 7z says it's compressed in LZMA:28, but that the file is corrupted, but it may be a false positive. If someone who knows how to deal with it can look at it, thank you. It should contains "ストーリーモード" (story mode) and "PREMIUM ADVENTURE", for example.

    Also, some files starts with the magic word "C.B.I.N.", if you know what they are please tell me.

    Thanks.
     

    Attached Files:

    Hargrun likes this.
  6. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    Guess who's an idiot for forgetting about the eboot.bin : me. Anyway, I've found the strings I was looking for. For now. But I doub't every string are located in the eboot file. Anyway, still progressing, but still looking for some help on the font front. Thanks!
     
    Hargrun likes this.
  7. jijisama

    jijisama Member

    Newcomer
    20
    3
    Aug 19, 2014
    Macau
    so this is officially begin? you will translate it? OMG if yes i'm your first fan count me in!
     
  8. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    No, not at all. Sorry. I'm still facing issue that I need solved before beginning anything ;
    - Modifying the fonts : I'm pretty sure that's necessary for the cutscenes. I can see the tiles using ppsspp debugger, but I can't find a way to relate it to the four font files, and how to modifie them.
    - Modifiyng the strings : Some are in Shift-JYS, some in UTF-8 and some in UTF-16LE. I need to test what happens when I change their sizes, finding the way they are indexed, etc.
    - Translating : I don't know Japanese, so unless some translators wants to join and help, this project won't go far.

    On the plus side, I can dump most of the scripts, in-game and cutscenes, and pictures, and repack them.

    If I was to begin a project, I think I would want to do it by stages : First the cutscenes and basic menus (which should be enough to play and understand the game for many, this is a Yakuza game, not a jrpg), then in-game dialogs, missions, etc., then items, mini-games, and miscellanous. That way, if the project was to lose it's momentuum, people would have something to play with, even if not complete.

    All of that is hypothetical talk, of course. But if you're interested and have skill in either translation or hacking/coding, please tell me.
     
  9. jijisama

    jijisama Member

    Newcomer
    20
    3
    Aug 19, 2014
    Macau
    firstly i can go talk to some translators/fonts modifying guys if you want (i will tray talk to them because i'm still new in gbatemp)
    scondly i will be lying if i till you i know something about hacking/coding and traslating :sad: so i'm sorry good luck man
     
  10. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    Don't get your hopes up, but things are starting to get interesting :
    [​IMG]

    I need to find are strings are mapped in order to be able to input longer strings. But that's a good start.
     
    Hargrun, Mort alttwo and JamRules like this.
  11. FShadow

    FShadow Advanced Member

    Newcomer
    90
    154
    Aug 13, 2014
    United States
    Couldn't you just change VsMulti to Versus, and CoopMulti to Co-Op? They'd get the same point across, anyway. If can't resolve the string length issue, you could have "Character" if Character Edit doesn't fit. Options could be changed and abbreviated to Sett., while Password could be shorted to "Pass.".
     
    Hargrun likes this.
  12. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    I think we won't have to resort to this kind of tricks. I've figured how the string are indexed, and I'm writing a tool to unpack them in a csv file. Once modified, the tool will repack them, with the good mapping.
     
    Hargrun likes this.
  13. FShadow

    FShadow Advanced Member

    Newcomer
    90
    154
    Aug 13, 2014
    United States
    Glad you could resolve the issue. Hopefully you can show us some pictures when you finish.
     
    Hargrun likes this.
  14. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    Ok so now I have a way to unpack things, extract string in csv for easy editing, build a new string file from the cvs, and repack it, even if it's size is different.
    [​IMG]Here look for "Story Mode", which is longer than ストーリーモード
    [​IMG]Here look for the string at the top of the screen.

    So now my only (big) issue is that I don't know how to edit the cut scenes font. Once I'll solved that, I guess I'll have every tools needed to start a translation.
     
    Hargrun and JamRules like this.
  15. Gaming4Ever

    Gaming4Ever Banned

    Banned
    486
    94
    May 28, 2014
    United States
    Wow ur the man this would be amazing to play :grog:

    Keep up the hard work
     
  16. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    [​IMG]

    Fully Translated menu.
    As you can see, the bottom sprite meaning "Confirm" is all scrambled. FShadow gave me a translated sprite of the button, but it seems I need to figure something out about the way to convert png back to gim.
     
    cearp, Hargrun and JamRules like this.
  17. FShadow

    FShadow Advanced Member

    Newcomer
    90
    154
    Aug 13, 2014
    United States
    Something similar happened in one of the games I translated. Did you use PNGquant on the image before converting it to gim? If not, that might be the source of your problem.

    Try using this, I ran it through PNGquant:
    [​IMG]
     
    Hargrun likes this.
  18. CradleDown

    CradleDown Newbie

    Newcomer
    5
    0
    Jan 21, 2014
    United States
    Bum f#@$ Egypt Mississippi
    OK I've been looking around about starting translation. I have a laptop and a android phone. I seen somewhere where there is a app for android that will let you translate games. I have no experience but I'm really eager to learn and start somewhere. I know it wouldn't be hard to find out what was being said in game through voice or Japanese subtitles. I really want to do this. Any advice or tutorial or teaching that anyone can give I would be greatly appreciative.
     
  19. Aegehn
    OP

    Aegehn Advanced Member

    Newcomer
    67
    153
    Mar 14, 2009
    France
    FShadow, you were right. I used pnquant and now : tadaa!
    [​IMG]
    Now I think "Confirm" would be better, but that's just to show it's doable. Until now I used windows batch script but I think I'll go python because batch is really a mess.

    CradleDown do you know any Japanese ? What's the Android app you're talking about?
     
    Hargrun likes this.
  20. CradleDown

    CradleDown Newbie

    Newcomer
    5
    0
    Jan 21, 2014
    United States
    Bum f#@$ Egypt Mississippi
    Unipatcher, and ROM patcher. And no I don't know any Japanese but there is a lot of ways these days to figure out what's being said