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

Discussion in 'PSP - Hacking & Homebrew' started by Seryuu, Mar 11, 2015.

  1. Seryuu
    OP

    Seryuu Member

    Newcomer
    13
    22
    Mar 11, 2015
    [​IMG]

    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, Sep 11, 2016


  2. Seryuu
    OP

    Seryuu Member

    Newcomer
    13
    22
    Mar 11, 2015
    Some time has past so I will update this.

    We are still looking for someone to extract the script, a few people tried but no one was able to do it. One of them only managed to extract the interface text.
     
    Last edited by Seryuu, May 31, 2016
    InquisitionImplied and Margen67 like this.
  3. kaikaiser

    kaikaiser GBAtemp Regular

    Member
    145
    52
    Aug 12, 2015
    United States
    Nice. I'll be rooting for you.
     
  4. flame1234

    flame1234 GBAtemp Advanced Fan

    Member
    719
    407
    May 17, 2009
    United States
    Link to the previous effort please.
    Is there an investigation report from last time?
     
  5. Seryuu
    OP

    Seryuu Member

    Newcomer
    13
    22
    Mar 11, 2015
  6. flame1234

    flame1234 GBAtemp Advanced Fan

    Member
    719
    407
    May 17, 2009
    United States
  7. Seryuu
    OP

    Seryuu Member

    Newcomer
    13
    22
    Mar 11, 2015
    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 .
     
  8. GamerzHell9137

    GamerzHell9137 GBAtemp Psycho!

    Member
    3,828
    1,655
    Nov 1, 2011
    Bosnia and Herzegovina
    Never heard of it but its for PSP, can't wait to play it! :yaypsp:
     
  9. zero_g_monkey

    zero_g_monkey GBAtemp Fan

    Member
    332
    203
    Aug 9, 2013
    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, Oct 14, 2015
    JamRules, Seryuu, Fluffx and 2 others like this.
  10. zero_g_monkey

    zero_g_monkey GBAtemp Fan

    Member
    332
    203
    Aug 9, 2013
    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.
     
  11. zero_g_monkey

    zero_g_monkey GBAtemp Fan

    Member
    332
    203
    Aug 9, 2013
    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.
     
  12. Seryuu
    OP

    Seryuu Member

    Newcomer
    13
    22
    Mar 11, 2015
    Thank you for all the info, your help is appreciated.
     
    InquisitionImplied likes this.
  13. zero_g_monkey

    zero_g_monkey GBAtemp Fan

    Member
    332
    203
    Aug 9, 2013
    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.
     
    Seryuu likes this.
  14. Kelebek

    Kelebek GBAtemp Regular

    Member
    165
    62
    May 25, 2012
    It's the offset to start searching from.
     
  15. zero_g_monkey

    zero_g_monkey GBAtemp Fan

    Member
    332
    203
    Aug 9, 2013
    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.
     
  16. Seryuu
    OP

    Seryuu Member

    Newcomer
    13
    22
    Mar 11, 2015
    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, Oct 14, 2015
    reinzhart likes this.
  17. Final_Agent

    Final_Agent Member

    Newcomer
    12
    6
    Oct 15, 2015
    Canada
    We'll give it a shot! Here's hoping we can figure it out from here.
     
  18. Final_Agent

    Final_Agent Member

    Newcomer
    12
    6
    Oct 15, 2015
    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.
     

    Attached Files:

    reinzhart likes this.
  19. Seryuu
    OP

    Seryuu Member

    Newcomer
    13
    22
    Mar 11, 2015
    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, Oct 20, 2015
  20. flame1234

    flame1234 GBAtemp Advanced Fan

    Member
    719
    407
    May 17, 2009
    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.