Hacking Looking for advices or help to decode files for Yakuza PSP

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
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.
s4LK5dN.png


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 :
GRjaHtS.png


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.
 
  • Like
Reactions: Hargrun and GHANMI

JamRules

.....
Member
Joined
Jan 9, 2014
Messages
527
Trophies
1
XP
2,203
Country
United States
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
 
  • Like
Reactions: Hargrun

thexyz

Active Member
Newcomer
Joined
Jan 8, 2014
Messages
40
Trophies
0
Age
54
XP
180
Country
Serbia, Republic of
But gimconv gives me files with a different size; slightly bigger, even with the good dimension, endianness, color_format etc.

If that happens with edited .png files, you might want to run them through pngquant.
 
  • Like
Reactions: Hargrun

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
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!
Zm4Kh8q.png


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:
Ax55Jyt.png
qmeP9Kb.png
FIRs1C0.png
LHpyaVc.png
 
  • Like
Reactions: Hargrun

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
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.
 

Attachments

  • 03_363109563_000035C0.zip
    1.5 KB · Views: 250
  • Like
Reactions: Hargrun

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
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!
 
  • Like
Reactions: Hargrun

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
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.
 

jijisama

Well-Known Member
Newcomer
Joined
Aug 19, 2014
Messages
57
Trophies
0
Age
36
XP
605
Country
Morocco
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
 

FShadow

Well-Known Member
Newcomer
Joined
Aug 13, 2014
Messages
93
Trophies
0
Age
27
XP
507
Country
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.".
 
  • Like
Reactions: Hargrun

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
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.
 
  • Like
Reactions: Hargrun

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
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.
rJgBxkO.png
Here look for "Story Mode", which is longer than ストーリーモード
szZuBKk.png
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.
 

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
France
LG4OnxW.png


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.
 

FShadow

Well-Known Member
Newcomer
Joined
Aug 13, 2014
Messages
93
Trophies
0
Age
27
XP
507
Country
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:
62_939171516_00014600_enquant_zps9da52735.png
 
  • Like
Reactions: Hargrun

CradleDown

Member
Newcomer
Joined
Jan 21, 2014
Messages
5
Trophies
0
Age
35
Location
Bum f#@$ Egypt Mississippi
XP
58
Country
United States
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.
 

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
France
FShadow, you were right. I used pnquant and now : tadaa!
tTXaACK.png

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?
 
  • Like
Reactions: Hargrun

CradleDown

Member
Newcomer
Joined
Jan 21, 2014
Messages
5
Trophies
0
Age
35
Location
Bum f#@$ Egypt Mississippi
XP
58
Country
United States
FShadow, you were right. I used pnquant and now : tadaa!
tTXaACK.png

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?

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
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Sorry for accidentally bending over