Hacking Queen's Blade: Spiral Chaos Translation Project ( Hackers needed )

Seryuu

Member
OP
Newcomer
Joined
Mar 11, 2015
Messages
13
Trophies
0
XP
117
Country
UODFxCJ.jpg


About the game: With the Queen's Blade Tournament ongoing, rumors arise about a dark, mysterious power threatening to destroy all of Gainos. The new heroes Cute, Jean, and the rest of the Queen's Blade competitors seek to find the root of this power and destroy it to restore balance to the land.

The game features tactical, turn based combat, with moves being decided prior to engaging an enemy. During battle, there is an armor based system that enables parts of armor to be broken off of most of the characters, excluding the males and creatures. There is also an relationship building part of the game, as such when certain characters have a higher affinity for each other they may be able to perform team based moves. If the affinity is high enough, the other character may jump in front of some attacks and take damage for the other character.

Translation team:
Project leader: Seryuu
Translator: leecherboy
Programmer/Hacker: Flame
Editors: Final_Agent , Shira

Special thanks to JamRules and zero_g_monkey.

About the project: As you may know the previous translation project for this game ended with a patch that only translates some items and options because the translator was unable to extract the rest of the text from the game. We are attempting to restart and finish the project.
 
Last edited by Seryuu,

Seryuu

Member
OP
Newcomer
Joined
Mar 11, 2015
Messages
13
Trophies
0
XP
117
Country
You're investigating how to dump the text. It's a report about the investigation you did. Like see these links:
http://gbatemp.net/threads/romhacking-in-tales-of-destiny-2.373960/
http://gbatemp.net/threads/legend-of-heroes-translation.366149/page-23#post-5515566

I dont really have a full report but but a few users on a different forum checked it out.
You can she what they found here: http://forums.fuwanovel.net/topic/9...chaos-psp-translation-project-hackers-needed/

After that qwikrazor87 managed to extract some stuff from the EBOOT.BIN . After checking out the files the translators said that its stuff like items and messages in between battles, basically everything but story. If you want to see the files he extracted you can get them here https://mega.nz/#!nsAyRI7D!ynuaFoXL27BGSXs_4WVEMqzAksKVQRVTxyJwz5njc_A .
 

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Here is a breakdown of where you need to start looking.

shared.bin file - first you will need to locate all the LICE headers. Don't know what they do but this will take you closer to the TOC of the individual files that are compressed. Somewhere remotely close to this header, you will find another one Wpbb. This is followed by what I am guessing is the number count for the files in the archive. Remember to convert the hex to dec. The TOC is 32 bit pointers that start from the position of the closest Wpbb. If you open the shared.bin and look at x72040. I made a screencap to maybe help out. See below.

QB_Breakdown.png
 
Last edited by zero_g_monkey,

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Here is how you are gonna accomplish this. Keep in mind, I am not a skilled programmer but I am deadly with a hex editor.

1) The shared.bin is an archive file made up of compressed archive files. I haven't found a TOC/Pointer Table to break apart the first half of this file. I also have not looked at in a few days... You are going to have to find a way to break apart the shared.bin file. There is programs that can do this or you could just rip it apart with a hex editor so you can create another file. Very tedious to do, but it does work.

2) The part of the files you want to focus on is the Wpbb. This is the spot the TOC/Pointer Table is based on. See example above. You see the number x72040 is the position where it starts. Now go over to the first pointer. It is x40. If you add x72040 and x40 you will get x72080. This is where the first compressed file in this archive begins. Again... you are gonna have to tear these files apart. Thankfully though, the archive in the archive has the TOC/Pointer Table.

3) I think I saw somewhere in one of the linked posts that it uses a zlib compression scheme. Searching the internet may help produce some results for getting the stuff decompressed. I think 7 zip might be able to help. I may have seen something about that one time... Can't remember exactly.

4) Will make suggestions for handling text when I can actually see a decompressed file.

5) The hardest part is going to be getting it all put back together in the proper format. For that, you are gonna need special tools which you all already know. I can't help with that currently at this moment. Maybe somebody else can though.


It really is a simple file format compared to some I have seen. It reminds me a lot of Legend of Heroes PSP (White Witch one). It has a set up of multiple files stored within one archive and they start with TYO. But they follow the same formula minus the compression. I hope this helps some.
 

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Ok. Triple Post. Sorry everybody.

I found a way to dump "some" text.

OffZip

First, you need to setup a folder. Extract this program to the folder OffZip.
Second, inside that folder, create a folder named "dumped".
Third sure the file shared.bin is in the Offzip folder.
Fourth. Open a CMD prompt in the Offzip directory. If you type CMD in the address bar for the folder, it should load up ready for the folder.
Fifth. This is the import step. Type or Copy/Paste this exact command into the command prompt - offzip -a shared.bin dumped 0

That last thing is a zero. Breakdown of the command.
offzip - start the program
-a - the command on how to handle the file you are handling
shared.bin - THE FILE
dumped - This tells the program where to dump the 500+ files. Much cleaner than dumping in the same folder. This command won't work if the folder isn't in the offzip folder.
0 - no clue but the original command from the creator is there and I'm not messing with it.

You should get 557 files from this. They will be in shift-jis format and the text is near the end of the file. You are on your own for getting them formatted. Hope this helps.
 

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Your welcome. Let me know if you are having any trouble extracting the files. I have them sitting on my desktop but I think it would be best if you were able to do it yourself in case the time arises again you need to use this process.
 
  • Like
Reactions: Seryuu

zero_g_monkey

Well-Known Member
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Oh. Good to know Kelebek.

So apparently, you can use the same method for the battle, graphic, map and shared files. They all have some compressed files in them.
 

Seryuu

Member
OP
Newcomer
Joined
Mar 11, 2015
Messages
13
Trophies
0
XP
117
Country
Ok. Triple Post. Sorry everybody.

I found a way to dump "some" text.

OffZip

First, you need to setup a folder. Extract this program to the folder OffZip.
Second, inside that folder, create a folder named "dumped".
Third sure the file shared.bin is in the Offzip folder.
Fourth. Open a CMD prompt in the Offzip directory. If you type CMD in the address bar for the folder, it should load up ready for the folder.
Fifth. This is the import step. Type or Copy/Paste this exact command into the command prompt - offzip -a shared.bin dumped 0

That last thing is a zero. Breakdown of the command.
offzip - start the program
-a - the command on how to handle the file you are handling
shared.bin - THE FILE
dumped - This tells the program where to dump the 500+ files. Much cleaner than dumping in the same folder. This command won't work if the folder isn't in the offzip folder.
0 - no clue but the original command from the creator is there and I'm not messing with it.

You should get 557 files from this. They will be in shift-jis format and the text is near the end of the file. You are on your own for getting them formatted. Hope this helps.

Ok I have done this and got the files :)

I will wait for the other team members to see this and then we will see about formatting the files, thanks again.
 
Last edited by Seryuu,
  • Like
Reactions: reinzhart

Final_Agent

Member
Newcomer
Joined
Oct 15, 2015
Messages
12
Trophies
0
Age
36
XP
49
Country
Canada
So, me being a total newbie, I looked around and tried using http://www.motobit.com/util/charset-codepage-conversion.asp this website to get a format change from shift-jis to utf-8 and see what was inside the files that Seryuu managed to pull out.

After a few converted files and using google translate to give them a look see, I found a file containing text I recognize within the dump (something we translated a while back as part of a video series). So at the very least, we found ourselves at least one reference point already. I was hoping to have some opinions though, do you think the converter I'm using is sufficiently precise enough to serve our purposes even farther down the line or should I be upping my game to something a bit different?

For now, I'll try and create a doc for myself, Seryuu and the translator to keep track of the .log files and what each one contains. A little early organization never hurts. Here's an attachment of the utf-8 file that resulted from tossing a .log file in shift-jis through the converter site above.
 

Attachments

  • 001f0150.txt
    10 KB · Views: 616
  • Like
Reactions: reinzhart

Seryuu

Member
OP
Newcomer
Joined
Mar 11, 2015
Messages
13
Trophies
0
XP
117
Country
Thanks for all your help guys, now for the next step can someone explain how to re inserting the files ? I'm still new to this so I'm confused as how to do it.
We need to know this as soon as possible for testing purposes so any help will be appreciated.
 
Last edited by Seryuu,

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
Let's start working on a solution.
Okay, start with the file dumping method posted by zero.

Fire up the game and generate the first line of dialog.
ULJS00190_00000.jpg

Type it out in Japanese. There are character names in there. I really want a non-variable part of it for searching.
もっと急いでったら

Search for this in the dumped files using MadEdit. Use the "find in files" option (CTRL+F).
It shows up in 0017e1b0.log. That is named after the location the compressed data was found in the big file, so let's look there. You never know what you might find.

Okay, that file (that is currently loaded) is in the LICE (archive) file at 0x17d800. The file entries table starts at 0x17da00.
Also, the file that is currently loaded is the first sub-file in that archive. The table entry for it is at 0x17da08. That's important.
I wasn't sure about that second value in the table, but it looks like it is decompressed size.

What we need now is to find the end of the compressed data for that file.
If we go back to the entries table at 0x17da00, the next entry is offset 0x2cb0. 0x17da00 + 0x2cb0 = 0x1806b0, so let's look there.

Well, that looks like a miss. Let's explore why:
The position of our first sub-file is 0x17da00 + 0x7b0 = 0x17e1b0. Looking there, we see the first two bytes are 78 9C. Then, looking here at stackoverflow, we see that a common header for zlib is 78 9C. So we expect that's what headers should look like.

Just searching in hex for the next header, we see it's at 0x180327. Then, doing math, 0x180327 - 0x17da00 = 0x2927. That value doesn't make a lot of sense either. Just randomly guessing, let's do another math problem: 0x7b0 + 0x2cb0. = 0x3460. That doesn't make much sense either.

Looks like the next file is at 0x180e60. 0x180e60 - 0x17da00 = 0x3460. Things are starting to make more sense.

Okay, so there are three entries for each file in the header:
1) Offset 2) Decompressed Size 3) Compressed Size

Progress!

Okay, now I need to get myself that file, the compressed version, so I can work with a little more closely. I know Python and zlib is a Python standard library. That means someone wrote a functions that do zlib compression and decompress so I don't have to write them.

First I need to get the file though. So the compressed data for that file is at offset 0x17e1b0 and its size is 0x2cb0. Let's write a short program that dumps that file. That will help us learn how to do file I/O in Python. Take a look at this program: http://pastebin.com/J9yTDmN6

Okay, I have the file. Now I need to see if I can decompress it. Time for a Python decompress test: http://pastebin.com/WgRHdkNG
That test is a pass.

Okay, now we need to see if we can re-compress it. If we can get exactly the same result that HobbyJapan did, then we can make things work, I think. I did a quick check with the commands:
x = zlib.compress(decompressedfiledata)
x == filedata
This returns true, so it means we have the exact same data.

We're not even to the point where a test can be generated. Let's just do a mental exercise where we figure out what's needed.
1) This game uses SHIFT-JIS. Both SHIFT-JIS and UTF-8 will accept ASCII text. So we need to replace some SHIFT-JIS text with ASCII text to see if it will display. It looks like it might because the name entry will let you pick English letters both upper and lower case. We know where the first line is, so it will be easy to test.
2) Recompress. The key here will be to recompress it to smaller than the original size. From my quick test, it doesn't look like that will be possible. I compressed English text with a ratio of .41 and Japanese with a ratio of .48 (English compresses better) but you need 50% more characters for the same thing in English... The English ended up being a little bigger. We can try using a higher compression setting than default but it is unlikely to work in-game.
3) Re-insert and test. Not too hard. We just replace the original file contents with our new compressed file. Just pad with 00 for however much smaller our file is than the original.

Will need to read up those other places about where the LICE file offsets are.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Look at you holding tiny things