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
You may translate simple things like menu and such, but I do think you need to know a little of japanese to translate adequately dialogues, missions briefings, etc.

EDIT : Those apps seems to help you apply a patch on a rom. That's cool but that does not make the patch...
 
  • Like
Reactions: cearp

Mort alttwo

Active Member
Newcomer
Joined
Jul 14, 2014
Messages
25
Trophies
0
Age
29
XP
106
Country
United States
Yes I had just realized that. I need to really know how to get into a game and how to change the text and such. I can't seem to find any info on how to
There is no unified guide on how to translate games. Every game is different and you need to figure things out. Sometimes you may even need to code your own programs to edit the game files. Is there a specific game you're trying to work on? Or did you just want to know how in general?
 

Abu_Senpai

Well-Known Member
Member
Joined
Jul 13, 2014
Messages
1,515
Trophies
0
XP
1,186
Country
Syria
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?



Well done keep it up XD
 

Aegehn

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

In-game dialogues are in special file (magic word KSEQ), which is a mixed file with unknown data (maybe binary) and strings. I need to figure out how strings are indexed.
 

Popz

Member
Newcomer
Joined
Aug 29, 2013
Messages
6
Trophies
0
XP
80
Country
France
Hey, are you the guy from /v/ who was asking for some help about this issue a week ago? If so, glad to see you finally came here!
I'm a complete dork when it comes to hacking and my japanese knowledge is more than limited, but I hope you'll figure things out. Bon courage!
 

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
France
So my biggest issue is that I don't know how to decipher/display/edit a font file (attached). It contains the fonts used during cutscenes, and seems to have only the symbols used in the game. Regarding roman characters, there's only most of the uppercase, and a few of lowercase. So i'd like to edit it and change some symbols to roman characters. Then, with the proper encoding, cutscenes will be subtitled in English.

On a lower scale, I need to figure out how files containing in-game dialogues are mapped, but I haven't give up on finding this by myself yet. That's almost all there is to figure.
 

Attachments

  • font_subtitles.zip
    153.4 KB · Views: 130
  • Like
Reactions: Hargrun

Riku

Well-Known Member
Member
Joined
May 3, 2009
Messages
288
Trophies
0
XP
1,491
Country
United States
Your fonts are in simpliest format possible, you should really learn rom editing basics.

0VAzWym.png


In pic there's no proper pallete/clut applied, it's easier to dump it from ram (I don't have game).
 
  • Like
Reactions: cearp

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
France
Well, learning is exactly what I'm doing. Two weeks ago I didn't know anything about rom editing on PSP or in general. Now I have ways of editing texts and graphics. Would you mind explaining how you got that dump, and the way to reverse it back into the original file ? Thank you !
 
  • Like
Reactions: cearp

Riku

Well-Known Member
Member
Joined
May 3, 2009
Messages
288
Trophies
0
XP
1,491
Country
United States
Uncompressed graphics starting at 0xB480. It's either 8bpp 64x64 tiles, or 4bpp 128x128 (can't say for sure without looking how it displays in game or proper palette). And getting palette is just matter of looking in ppsspp GS debugger for CLUT offset in ram.
 
  • Like
Reactions: Aegehn

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
France
Fonts aren't strictly bound into a grid, so how does it manage to display each font ? Is there a map associated with each character showing the area to display ?
 

Riku

Well-Known Member
Member
Joined
May 3, 2009
Messages
288
Trophies
0
XP
1,491
Country
United States
Width table, yes. Some games store it in main executable elf (pain to find and edit, since it scattered in pieces by compiler) and some store it in external files. Sometimes in same file where graphics/font glyphs is. Good luck finding it.
 

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
France
So, I've figured out that, from offset 0x0280up to the uncompressed graphics, we have an array indexing which symbols to draw for which characters. Consider each symbol in the map is numbered : 0 for space, 1 for "!" up to 1559 for "~" and 1560 for "." The index of the array is the index of the character in the Shift-JIS table (I think). So if you want to draw "*", which is the 42th in the table, you look at the 42th position in the array (from 0, 2 bytes by 2), and you get 0x0002. So it'll be the 3rd symbol in the graphics.

Now almost all the file makes sense, except for most of the first 0x280 bytes.

EDIT : Also, 4 bytes at 0x2C are offset where the uncompressed graphic ends. At this offset is written where the graphics starts... I suspect what is after that is the variable-width info.
 

Aegehn

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

See those faint "AAAA" ? Those are hand-drawn, with wrong palette, Latin A. Still, they mean soon there will be beautiful, vibrant, latin characters.
What is the best tool to edit a font, considering this is not a "standard" format? I used TileMolester to drawn the A, but there's no way to just copy letter (as with paint, for example), and I have trouble finding a good tool.
 
  • Like
Reactions: Hargrun

Aegehn

Well-Known Member
OP
Newcomer
Joined
Mar 14, 2009
Messages
71
Trophies
0
XP
755
Country
France
Hi all,

I'm writing back because I can't figure this out, and that's the last thing I need to complete the work on the fonts.

Let's look at the first block of fonts :
kHvfiXo.png


At the end of the font file, you've got a table for each font block. Here's the one for this block :
Code:
80b4 0000    0000    0a00    0000    0214    space
80b4 0000    0100    0900    0300    0c14    !
80b4 0000    0100    0900    0d00    1614    *
80b4 0000    0000    0a00    1700    1c14    comma
80b4 0000    0100    0900    1d00    2614    -
80b4 0000    0300    0700    2700    2b14    .
80b4 0000    0100    0900    2c00    3514    0
80b4 0000    0100    0900    3600    3f14    1
80b4 0000    0100    0900    4000    4914    2
80b4 0000    0100    0900    4a00    5314    3
80b4 0000    0100    0900    5400    5d14    4
80b4 0000    0100    0900    5e00    6714    5
80b4 0000    0100    0900    6800    7114    6
80b4 0000    0100    0900    7200    7b14    7    newline
80b4 0000    0100    0900    0014    0928    8
80b4 0000    0100    0900    0a14    1328    9
80b4 0000    0100    0900    1414    1d28    ?
80b4 0000    0a00    0a00    1e14    2628    double quote begin
80b4 0000    0200    1200    2714    2e28    double quote end
80b4 0000    0200    1200    2f14    3f28    ...
80b4 0000    0200    1200    4014    4f28    note
80b4 0000    0100    1300    5014    5628    '
80b4 0000    0100    1300    5714    5d28    .
80b4 0000    0300    1100    5e14    6d28    n            newline
80b4 0000    0b00    0900    0028    083c    [
80b4 0000    0100    1300    0928    123c    ]
80b4 0000    0300    1100    1328    203c    lil a
80b4 0000    0200    1200    2128    323c    a
80b4 0000    0400    1000    3328    3f3c    lil i
80b4 0000    0200    1200    4028    503c    i
80b4 0000    0300    1100    5128    5f3c    lil u
80b4 0000    0300    1100    6028    6f3c    u            newline
80b4 0000    0300    1100    003c    0e50    lil e
80b4 0000    0200    1200    0f3c    1f50    e
80b4 0000    0400    1000    203c    2d50    lil o
80b4 0000    0100    1300    2e3c    4050    o
80b4 0000    0200    1200    413c    5350    ka
80b4 0000    0100    1300    543c    6750    ga
80b4 0000    0200    1200    683c    7850    ki          newline
80b4 0000    0100    1300    0050    1364    gi
80b4 0000    0300    1100    1450    2364    ku
80b4 0000    0200    1200    2450    3564    gu
80b4 0000    0200    1200    3650    4664    ke
80b4 0000    0100    1300    4750    5a64    ge
80b4 0000    0200    1200    5b50    6a64    ko          newline
80b4 0000    0100    1300    0064    1378    go
80b4 0000    0100    1300    1464    2678    sa
80b4 0000    0100    1300    2764    3a78    za
80b4 0000    0300    1100    3b64    4a78    shi
80b4 0000    0300    1100    4b64    5a78    ji
80b4 0000    0100    1300    5b64    6d78    su

I'm pretty sure understand this table will led me to understand how to deal with variable width.
Here's what I've figured out :
- the first column is the offset of the block.
- the next four bytes seems linked to the size of the characters. Size taking the same amount of space of those four bytes identical.
- The last next bytes seems related to the position of the character on the "line", notice it resets every time the characters goes to a new line.
- Notice the difference between the first four bytes for double quote begin and end, but they share similar "format".

I tried modifying the value but it didn't prove insightful. Maybe you'll have a sharper mind than mine and figure it out.

Thanks!
 

jjjewel

Well-Known Member
Member
Joined
Dec 17, 2009
Messages
1,010
Trophies
0
XP
522
Country
United States
(I only looked at your table and make a guess, so it might not be correct.)

I'll ignore the first 8 bytes.
0000 0a00 0000 0214 space
0100 0900 0300 0c14 !

The first 2 columns seem to add up to a certain value. (For ASCII codes, they always add up to 0A and for the Japanese characters, they always add up to 0x14) So these 2 values could be like a character's indentation and then the next offset of your next character, etc.
Ex. for !, think of a block of 0Ax0A. The ! will be drawn starting at 0001 pixel from the left and the next character will be drawn 0009 pixel after the indentation (so the next character is at 0A.)

The next 2 columns seem like x, y coordinate of your font. (0000 0214 = start from x= 0, y = 0 to x = 2, y = 0x14)
But it's a little odd that there is a difference of 1 for the x values of the adjacent characters but I don't see that gap in the pic. (Ex. between the . and 0)
You might want to try changing some values and see. (Ex. for the space, when you change 0214 to 0614, it should output a part of ! too.)

Anyway all of this is just my guess from your table. :P
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Nut on the hill