Hacking Nayuta no Kiseki - English Translation

flame1234

Well-Known Member
OP
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
954
Country
United States
NPJH50625_00085.jpg


Patch 4.14 (current)
Project image gallery - Gallery title is wrong, some of these images are old

Project Credits:
Flame (that's me!) - Project leader, main programmer, translator
SkyeWelse - images
naachan - translation assistance - helped with boss, character and location names
Kelebek - programming assistance
CUE - programming assistance
zero_g_monkey - programming assistance (images)
M_bot - image programming

Tools
If you would like to make your own version of the patch, you may use the following tools:
Item Dump
Item Insert
Eboot Dump
Eboot Insert

Current Script Tools:
Script Dump
Script Insert
Resources
Script Dumps (Complete- Includes translation)
Of course, you may use the script dump tools to dump it yourself.

Save Games (End of: Prologue, Chapters 1, 2, 3, 4, 5 and 6 and the Epilogue)
25May15:
Draft translation complete (entire game).
The only thing that is not are these animated messages displayed the first time you enter each area and at the start of each boss fight.
NPJH50625_00084.jpg

About the only thing left are script improvements and those animated messages.

21Nov14:
Prologue: Draft translation complete (patch released)
Chapter 1: Draft translation complete
Chapter 2: Draft translation in progress
 
Last edited by flame1234,

flame1234

Well-Known Member
OP
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
954
Country
United States
Was trying to figure out how the decompression works.

Save File

So I was looking at the level (place) names. The first level is 樹陰の獣道・春.
Once you load that save, that text appears in RAM in several places. Set your memory breakpoint on a write at 0x9617512. It breaks inside the subroutine at 0x89B0D86. I think this subroutine is decompressing data. I stepped through it, but couldn't make sense of what is happening.

I made this spreadsheet. Am I on the right track?

It's reading the level name (I think) from \text\fldist0.tbb. That file (the whole thing) appears in RAM at 0x8A7E460. I need to figure out this .tbb format.
 

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
42
XP
300
Country
United States
Heheheh... I didn't know you were working on this flame. I was actually gonna make an announcement about picking it up later this week. Funny timing.


Calling it a night right now, but I will if I can help you out with the previous post problem hopefully tomorrow.
 
  • Like
Reactions: GHANMI and Hargrun
D

Deleted User

Guest
Heheheh... I didn't know you were working on this flame. I was actually gonna make an announcement about picking it up later this week. Funny timing.


Calling it a night right now, but I will if I can help you out with the previous post problem hopefully tomorrow.

I'd say stick to 1 game, i've seen guys pick 20 projects and finish none.
 

GHANMI

Well-Known Member
Member
Joined
Jun 10, 2012
Messages
969
Trophies
0
XP
910
Country
Wow... that's really cool :D
To be honest I'd be fine with even a menu + quest translation, since the main plot isn't one of the strengths of this game.
Thanks a million ! :D
(Don't waste time looking for the debug maps referenced by the script list btw, they were all removed)

No chance that Xseed might pick this up now and announce it near your patch release, since they (and Falcom for now) don't make PC ports themselves, and that Chinese company kind of forgot about this one.
 

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
42
XP
300
Country
United States
Hey flame. How about posting a savefile and a screenshot of the text you are looking into? I have a few leads that I wanna check out and see if I am snooping in the right area.
 

flame1234

Well-Known Member
OP
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
954
Country
United States
The save file is posted.
As for the screenshots, I will need to do it when I get home around 1830 EST (in 8 hours).
 

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
42
XP
300
Country
United States
Just to make sure I am digging the right spot. You are talking about the text on the over world map screen and not the ones for when you are in the actual level right? Because I have located the ones for in the actual level and got those working.
 

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
42
XP
300
Country
United States
I can say this much. It is definitely actual text and not am image. I located it in the memory view with PPSSPP at x9615462. Note this is using the version I have with the files edited for test text. But it really should not matter. The files mp_1000a (b,c and d) are the ones that affect the level text. Those appear in a different part of the memory. Gotta love these goose chances, huh flame? I am beginning to think it just may be in one of those encrypted files... but I am not giving up hope yet. Still got some things I wanna try.




EDITED PART:
After seeing your post on another forum, I believe we are both of the same conclusion. I bet it is located in the fldlist1.tbb file. I noticed some random text from the memory viewer that is in that file. Somewhere I read a while back that Falcom uses a variation of zlib compression. I am searching to see if maybe there was a chinese translation for this game. They usually have tools or info about stuff when they do.
 
  • Like
Reactions: Haseeb_BSAA

flame1234

Well-Known Member
OP
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
954
Country
United States
M6F7tNg.png

The plaintext is: 樹陰の獣道・春
It's at 0x28C.

Read up on LZ77 compression. I'm not aware this topic has been discussed on this forum. It looks like that's what's happening.

That reading made me think that the game is unpacking the entire file and not just a tiny piece of the file.

More goodies:
In memory, the uncompressed version of this file starts at 0x9616700 and ends at 0x961CF70.
To see it, set your memory breakpoint somewhere in there (0x9616700 should work fine) to break on a "write." Then use the "step out" function of the disassembler and it will be there.

At least for the .tbb files, the uncompressed length is at offset 0x23 (a full word, four bytes). So for this file, the compressed length is 0x10F6 (4.3 kB) and the uncompressed length is 0x6978 (27 kB) so they achieved quite a bit of compression with this file.
And one more thing: the full word at 0x2B says how far it is from there to the end of the compressed file.

LZ77 is weird because the specification basically says how the packed file is unpacked. It's up to the programmer to turn the unpacked file into the smallest possible one that both matches the specification and will unpack into the uncompressed file.
 

GHANMI

Well-Known Member
Member
Joined
Jun 10, 2012
Messages
969
Trophies
0
XP
910
Country
That explains why I got nothing changed while trying to change the uncompressed variant for the text.
Why do they even have an uncompressed variant lying around??
 

flame1234

Well-Known Member
OP
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
954
Country
United States
GHANMI: No idea why those are there.

So let's try this again, shall we, from the top this time, now that we actually know something. Still might not get it, but it's bound to be closer to the right answer.
RzsrQKn.png

The "message" data (what the decompressor is acting on) starts at 0x2F in the compressed version and at 0x0 in the uncompressed version.
Okay, so we have the first 8 bytes as literal. Pretty sure all the files start with 8 literal bytes.
Then the following: 83 00 01 1E 00.
What I need is to figure out what that means.

There are 0x2C of zero bytes between the first literal and the second. How on earth is it getting 0x2C from that?
 
  • Like
Reactions: zero_g_monkey

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
42
XP
300
Country
United States
I knew I had seem that scheme somewhere before. That is they kind I was wondering about for Astonishia Story. lz77 or one of it's variants. Good find there flame.
 

StorMyu

"I'm too old for this"
Member
Joined
Jan 2, 2010
Messages
943
Trophies
0
XP
1,031
Country
France
LZ77 is kinda common btw.
I thought I remember some program that would check some compression but I guess I was wrong, I suck at compression scheme but translating an asm uncompression is not impossible (but I'm so rusty right now xD) I looked at this game quite a while ago (like 10min with Omarrrio actually)

If you need some help I'll try to see what I can do ^^
 

flame1234

Well-Known Member
OP
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
954
Country
United States
I think really what we need is what the hacker did over there:
Find out what codes tell the decompressor "this is a literal string" and then make an encoder that just repeats those over and over as needed. The "compressed" file ends up being larger than the uncompressed one, but at least it works. That's all I care about.

I'd appreciate any help you could provide. :)
 

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
42
XP
300
Country
United States
I was trying to see if there was anything related to QuickBMS for this. There was a few files related to other Falcom titles and text but I couldn't get any real bites from them since I am not a programmer. I know that program supports it natively, but this is just stuff that I have read from the net. Only thing I use it for is CPK stuff. Take that 7th Dragon 2020 and Persona 2...
 
General chit-chat
Help Users
    AliceCE @ AliceCE: all colors kick off, and everything is rendered in black and white