Topic: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)  (Read 56535 times)

0 Members and 1 Guest are viewing this topic.

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #60 on: December 08, 2015, 07:07:34 pm »
That's weird, I'm pretty sure we fixed that bug a while back. It's caused by editing the names of Spirit commands; the game tries to look up, say, "Focus", but can't find it because everywhere else in the code is just the kanji for that. So it stalls forever. I'm pretty sure the Data_Spirits.txt in the game should have all the spirit names in japanese to avoid that, so I really don't know what to say other than maybe you have an old version of the patch?

then again it's been two months so you probably already fixed it

Anyways! The FMW I translation LP is officially done, so I'm planning on finishing up the patch for this game soon. And by that, I mean I'll finally get around to filling in the untranslated bits of the MoF half of the game and fixing up any minor bugs/typos I can find. All the other stuff (spirit names, battle dialogue, Gensokyo Chronicles, basically anything not directly related to menus or the story) are probably not going to happen. The process of decrypting the .dats is explained in the very first post of this thread though, so if anyone else wants to take a crack at that then I encourage you too!

If someone figures out a way to edit FMW I's .dats I guess we could start a project for that game too, but it doesn't look like anyone is ever going to. Oh well.

dawnbomb

  • Adventurer
  • Nickname: Dawn
  • Gender: Male
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #61 on: December 16, 2015, 11:49:58 pm »
you gonna jump into translating the next game after?
There's no way I could love anyone
but i wish to be loved by someone in return

Clarste

  • Nickname: Ixi
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #62 on: December 17, 2015, 12:25:39 am »
No.

Just so people are clear about this, this whole project has always been first and foremost about the LP. But since we were translating it anyway and discovered how to edit the .dat files, we figured it wouldn't be too much more trouble to toss that translation into a rough patch for other people. However, we're not a game-patching team and have no particular motivation to continue. If someone else figures out the FMWI files, I suppose it's possible we could throw in the LP translation for that, but... probably not. Although honestly anyone else could do the exact same thing just by looking through the LP archive and copy-pasting.

Alcoraiden

  • Do not go gentle into that good night
  • Nickname: Alcor
  • Gender: Female
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #63 on: December 18, 2015, 08:38:14 am »
Just to make sure I read everything right, you translated the entirety of this game but have no intention of translating game 3?

Clarste

  • Nickname: Ixi
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #64 on: December 18, 2015, 12:55:41 pm »
We've translated 3 already. We have an English script for it, made for a Let's Play on Something Awful. There's just no way to patch 3 because no one's cracked the data files yet and we're not really a game patching team. If someone later finds a way to copy-paste our script into the game itself, then knock yourselves out but we're probably not going to.
« Last Edit: December 18, 2015, 12:57:49 pm by Clarste »

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #65 on: January 01, 2016, 10:04:36 pm »
Here's your patch, now with 100% less White Jade Belvedere.

With this, the entire script of FMW P has been translated. There's a bunch of stuff left to do for this to be a "complete" patch, but as Clarste has mentioned we're not a real game patching team so we're not going to do that. If anyone wants to finish what we started, though, then feel free too! All the tools we used are the programs at the beginning of this thread, so there shouldn't be any difficulties continuing.

Also I've been hearing about a bunch of strange bugs. I took a bunch of time to proofread the script so there shouldn't be any more event errors (at least I really hope so), so if anything still goes wrong than it's beyond my knowledge to fix. Keep a backup of the japanese data5.dat and swap it in every time something goes wrong, I guess.

Have a Happy New Year!

PS: If you want to go on to FMW I, just use this.

Roonerspism

  • Nickname: Roonespism
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #66 on: January 12, 2016, 09:36:22 am »

Well gosh, Yukari, we're all ears.

I figured out how to insert text in to Ei! It uses a game maker extension called UltraCrypt to encrypt its data files. If you download UltraCrypt it comes with an example file that you can run in game maker to encrypt and decrypt files on your computer.

So inserting arbitrary English text is as simple as can be:
Download game maker (actually, I'm not sure precisely what versions work and/or if you need a paid version, I just happened to have one that worked fine) and ultracrypt
Open UltraCrypt's example.gm6 and run it in game maker.
It'll ask for an encryption key. Choose to use a string, then use the two characters 'bV'.
It'll ask for a file. Search for data5.dat or something.
Congrats, the file is now decrypted! Type in whatever you feel like, just make sure you keep the character count exactly the same so the file size checks out.
UltraCrypt encrypts things much in the same way it decrypts things, use the same key and select your modified unencrypted file and it'll work out that you want to encrypt instead of decrypt this time.
Done! Copy it back in to FMW I's data folder and it should work.

Decrypted Ei files seem to be much the same as decrypted You files from what I could tell. So... that's great! I hope! I forget how you guys got around the file size checking thing on data5.dat, but it should work the same and then the copying and pasting from BlitzBlast's translation LP can begin.

I would like to, perhaps selfishly, request that I don't have much to do with that bit, though - I've avoided reading anything past chapter 35 for spoiler purposes. Even after all this time I'm pleased that I got to see all of the cool moments of FMW P as they came, with the music, visuals and text all together, and I'd like to experience FMW I like that too.

And finally this is the thread I've mainly been keeping up with for FMW P stuff so if there's another place that this information should go or somebody that should know about this then feel free to tell them, I guess?
« Last Edit: January 12, 2016, 09:49:17 am by Roonerspism »

Nook

  • Nickname: cs
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #67 on: January 12, 2016, 08:21:34 pm »
This is a pretty big step forward.
Apparently the latest version of Game Maker (8.1) won't run the file but 8.0 will? So keep that in mind, I guess. If whatever the game uses to check file size is the same method FMW2 used it should be simple to work around that and make a translation, otherwise whatever english is put into the game would be incredibly clunky.
« Last Edit: January 12, 2016, 08:34:58 pm by Nook »

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #68 on: January 13, 2016, 02:13:58 am »
Testing it out, unpack.cpp doesn't work with the FMW3 data files on either a Windows or Unix environment. That doesn't actually stop the translation from being possible, but it makes things more annoying.

EDIT: Wait, filesize will probably screw us over. Yeah, until that gets addressed we can't really do much.

« Last Edit: January 13, 2016, 04:33:29 am by BlitzBlast »

Roonerspism

  • Nickname: Roonespism
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #69 on: January 13, 2016, 07:02:58 am »
So I spent an hour or two looking in to how FMWI unpacks its files and figured some stuff out:

I'm pretty sure that FMWI (and FWMP) uses GMBinFile to pack their files. The source code for that and a game maker example file that uses it can be found here:
http://gmc.yoyogames.com/index.php?showtopic=393301
So we might be able to use the game maker extension they use but in reverse to unpack them, just like decrypting. Certainly, anything I do from here on will probably be in pursuit of that, because...

For anyone planning on writing an unpacker, there's some really strange data in data5.dat that I can't make heads or tails of. It starts at 0000efd5, just after where the first file should end (according to what I think is the filesize in its header, efbb)
It goes on for about 1330016 bytes and seems to be completely unreadable, in a file otherwise full of Japanese and English text? Also, there are blocks of inexplicable (to me) data just like it between most of the files in data5.dat. I'm basically a layperson to this kind of stuff so I can only guess that for some reason there's some non-textual data in this big data pack that's supposed to just have all the text in it.
Anyway, because of that I can't figure out where the data ends and the headers begin, so good luck!
« Last Edit: January 13, 2016, 07:06:44 am by Roonerspism »

Roonerspism

  • Nickname: Roonespism
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #70 on: January 14, 2016, 07:38:55 am »
Here's what is quickly becoming my daily report:

As it turns out, figuring out how to unpack their files with GMBIN is basically exactly the same as rewriting Yamsman's unpacker, GMBIN basically just provides the same basic tools that a novice programmer (hey, that's me!) could write in c++.

But I've made two discoveries that I think completely cover the differences between FMWP data files and FMWI data files from the view of someone attempting to unpack them.
1. The header is different because they aren't using GMBIN's built-in encryption any more. It used to have 45 bytes at the start that stored the hashed password, now it just immediately begins with the file list pointer.
2. The file list at the end is partially encrypted manually instead of with UltraCrypt! Here's the cypher they used to encrypt the file names:
Code: [Select]
"abcdefghijklmnopq rstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_();:.=-"
"(1cUMvBu;C 5o0NmY=bRJ_xq2ThtEIlgO4r.Xj:yH7aWfPDdAke)nG3pF6QzKVw98SiLsZ-"

I actually noticed this in my initial decryption attempts. "Huh, NooN0sJ2J shows up a fair bit. Maybe that's part of their key?"
Nope! But when you run that through their cypher, backwards, it becomes "ommon.txt", as in "ChatList_35Common.txt"!

I think I'm getting close, now. Just need to figure out exactly how their new password-less header works (I think they store the file list's position differently, so everything else might be different too) and quickly write up something that puts the filenames in the file list (but not the other bits of the file list, those are actually totally unencrypted) backwards through their cypher.

Roonerspism

  • Nickname: Roonespism
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #71 on: January 14, 2016, 04:20:00 pm »
Alright, sorry for the triple post but I've done it. Here's the link to all the tools you'll need:
http://pastebin.com/Au7Bh3tF

So, to make things super clear because it's a little complicated, here's how you insert arbitrary text of any size in to FMWI:
1. Take the data file you want to edit out of FMWI's data folder. Probably leave a backup.
2. Decypher it with my first program. Run it with the command line arguments 'data5.dat d'.
3. Take the output of that, and unpack it with my program. Run it with the command line argument 'decyphered.dat'.
4. Go in to wherever you put your copy of UltraCrypt and run the example game in game maker. Choose one of the unpacked files, choose to decrypt it with the string bV.
5. Finally, you have a single file that you can edit. Put in whatever text you feel like.
6. Reverse the decryption by doing step 4 again on your now edited file.
7. Reverse the unpacking by running my packing program with the command line argument 'decyphered.dat.gsty'.*
8. Reverse the decyphering by running my cypher program with the command line arguments 'repacked.dat c'.
9. Oh my goodness, you're done.

*Whoops, couldn't be bothered changing the file extension to .gste, doesn't matter though

And a few closing thoughts:
I've done only the smallest amount of testing on my programs (editing Yukari's first line to say "I am terse.", which worked fine) so maybe they still aren't perfect. I have absolutely no idea if they work on any data files other than data5! eh it seems fine for other data files too, phew
Actually, on that note, I didn't even include usage information for unpacking and repacking data2-1 through data2-3, and data6-1 through data6-3. I haven't tested that, but it should theoretically work the same way it did for Yamsman's code.

I'd like to reiterate that I would prefer not to lead the FMWI patching project (as it were) from here on, because I want to avoid spoiling myself by reading the translation LP. Someone recently PMed me asking how they could help with the patching. Well, I'm happy that you're enthusiastic, and I think you could help everybody copy and paste the translation from the LP in to the game files. But I don't want to be the person that you report to!

ugghh of course it was unpack then decrypt, not decrypt then unpack
« Last Edit: January 14, 2016, 04:26:44 pm by Roonerspism »

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #72 on: January 15, 2016, 04:06:59 am »
I tried the process out, and everything worked up till the repack. Even on a basic unpack > immediately repack, it always reports there's a missing file and outputs a repacked.dat with a filesize of 0 KB.

I'm glad you're putting so much work into this, though!

Roonerspism

  • Nickname: Roonespism
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #73 on: January 15, 2016, 04:25:39 am »
I tried the process out, and everything worked up till the repack. Even on a basic unpack > immediately repack, it always reports there's a missing file and outputs a repacked.dat with a filesize of 0 KB.

I'm glad you're putting so much work into this, though!

Hm - it's still fine on my end. Two things that would help me fix this:
1. What exactly does the error say? The error that FMWIRepack throws should give the name of the file.
2. Upload or attach the decyphered.dat.gsty file that FMWIUnpack creates somewhere and I'll see if it's somehow any different from the one it makes on my machine.

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #74 on: January 15, 2016, 04:38:42 am »
That was the weird part, there's a gap for the missing file name but



nothing actually displays because nothing is missing.

Anyways here's the .gsty, and just in case here's the file we were using for testing. It hasn't been reencrypted with UltraCrypt yet, so you'll have to do that first before you can test it.

Roonerspism

  • Nickname: Roonespism
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #75 on: January 15, 2016, 04:52:36 am »
That was the weird part, there's a gap for the missing file name but

(Image removed from quote.)

nothing actually displays because nothing is missing.

Anyways here's the .gsty, and just in case here's the file we were using for testing. It hasn't been reencrypted with UltraCrypt yet, so you'll have to do that first before you can test it.

Alright, figured it out. Your .gsty file has, in its header, "When repacking, be sure to look for all 1.7 billion files that were unpacked". Heh.

That bit of the file is written by my new size_to_bytes code that's a little different from Yam's, so I guess I've done something environment-specific that he didn't. So I'll quickly put up some new pastebins, but I bet it'll all work if you replace this:

Code: [Select]
unsigned char *size_to_bytes(unsigned int num) {
    unsigned char *returnBytes = new unsigned char[4];
    returnBytes[3] = num >> 24;
    returnBytes[2] = (num >> 16) % 256;
    returnBytes[1] = (num >> 8) % 256;
    returnBytes[0] = num % 256;
}
(wait, holy moly, this doesn't even RETURN ANYTHING! does c++ just let you do this? EDIT: honestly, maybe that was the problem? Maybe I could've just told you to add "return returnBytes;".)

with this:

Code: [Select]
unsigned char *size_to_bytes(unsigned int num) {
    unsigned char *szbytes = new unsigned char[4];
    for (int i=0; i<4; i++) {
        szbytes[i] = num >> i*8;
    }
   
    return szbytes;
}

Replace it in both FMWIUnpack and FMWIRepack. I'll write up some new pastebins (and maybe make an account this time so I can edit them I guess) and wait for a reply on whether it works now or not.
« Last Edit: January 15, 2016, 04:54:42 am by Roonerspism »

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #76 on: January 15, 2016, 05:11:56 am »


It works!

Roonerspism

  • Nickname: Roonespism
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #77 on: January 15, 2016, 05:32:17 am »
Yaaay

Here's the new pastebin with the new tools:
http://pastebin.com/dYK9w7w9

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #78 on: January 16, 2016, 10:34:26 pm »
The menu patch is going fairly smoothly, so it's safe to assume this works. We're starting up copy/pasting the main script, and as always we'd appreciate more hands to make this go faster.

We're still on #touhou on synIRC. If you don't know how to use an IRC, just use a web client like mibbit.

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #79 on: January 18, 2016, 05:20:12 am »
Here's the first release. It's a "menu patch" that doesn't actually translate any of the main menus. Unlike FMW2, which stored all of that text in a .dat, FMW3 seems to keep that stuff in its .exe. Until somebody finds a way to crack that, we're just going to leave the menus untranslated since... well, if you got to FMW3 then you presumably know how the menus work by now!

You can decompile the .exe with a specified Game Maker decompiler program, but you can't re-compile it without the extensions Sanbondo used. I imagine it's possible to find them, but we're busy enough copy/pasting the main script in so screw doing that.

Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #80 on: January 23, 2016, 04:13:57 am »
I feel like you guys aren't getting enough love for doing this. Just here to express my appreciation. <3

I never actually expected anyone to make it past the second game, and yet here you guys are making steady progress. I'm actually really excited that my favorites series of fan-games are getting patched. This is all really amazing stuff that's going on.

Nonetheless, thanks for putting the time into translating these!

BlitzBlast

  • Nickname: Burizu
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #81 on: February 07, 2016, 11:21:24 pm »
It's been about a month, so I may as well post a progress update.

Here is the current version of the patch. It translates the entire main script except chapters 45 and 46 (we're still waiting on the copy/pasters for those chapters), though the proofreading pass has only gone up to chapter 41 so it might be a little funky past there.

Much more importantly, though, is the fact that we finally branched out to data4! This patch translates spirit names, personalities, and various aspects of the Status menu. Alice and Sanae's weapon menus are also fully translated, mostly as a proof of concept thing that we'll take further later.

There have been a few changes:

1. The personalities have been renamed for the most part. Sorry Deranged, but Strong-willed and Resolute are kinda eh.
2. The Guard spirit became Wall to differentiate from the Guard skill more (and it's literally Iron Wall anyways).
3. The Spirit spirit became Yell because come on Atlus. That was dumb.
« Last Edit: February 08, 2016, 01:31:12 am by BlitzBlast »

Starxsword

  • Nickname: Starx
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #82 on: February 07, 2016, 11:30:18 pm »
Looks like a good update.

Roonerspism

  • Nickname: Roonespism
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #83 on: February 08, 2016, 09:50:26 am »
It's been about a month, so I may as well post a progress update.

Here is the current version of the patch. It translates the entire main script except chapters 45 and 46 (we're still waiting on the copy/pasters for those chapters), though the proofreading pass has only gone up to chapter 41 so it might be a little funky past there.

Much more importantly, though, is the fact that we finally branched out to data4! This patch translates spirit names, personalities, and various aspects of the Status menu. Alice and Sanae's weapon menus are also fully translated, mostly as a proof of concept thing that we'll take further later.

There have been a few changes:

1. The personalities have been renamed for the most part. Sorry Deranged, but Strong-willed and Resolute are kinda eh.
2. The Guard spirit became Wall to differentiate from the Guard skill more (and it's literally Iron Wall anyways).
3. The Spirit spirit became Yell because come on Atlus. That was dumb.

Fantastic, especially that much more important bit. Send my regards to the chefs.

nyttyn

  • Drill baby drill!
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #84 on: February 14, 2016, 04:34:43 am »
An fininite thanks to you fine fellows! It is thanks to your hard work I'm able to enjoy these games in a more natural fashion, and to that I give you a thousand salutes. Even this beta version is a huge boon, as was the one for eternity. A thousandfold thanks!

Clarste

  • Nickname: Ixi
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #85 on: February 18, 2016, 07:01:24 am »
In an amusing bug, the game apparently changes all instances of "Keine" in the script into "KeineH" when she transforms. Like, the script itself is being treated as a reference to her object or whatever. We're doomed.

Starxsword

  • Nickname: Starx
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #86 on: February 19, 2016, 04:02:03 am »
Wow, that sounds so bad.

Eilaris

  • Nickname: Snowduck
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #87 on: February 20, 2016, 01:43:10 am »
Where does the "KeineH" text come from anyway?  If it's coming from the unit identifier, is it possible to not have her name change with the form change and just expect the player to know the graphical difference between the two?

Clarste

  • Nickname: Ixi
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #88 on: February 20, 2016, 12:54:10 pm »
Where does the "KeineH" text come from anyway?  If it's coming from the unit identifier, is it possible to not have her name change with the form change and just expect the player to know the graphical difference between the two?

KeineH comes from the name of the programming object that is Keine in Hakutaku mode. Her name isn't supposed to change at all in-game (that would be weird if it did). From a programming perspective, KeineH is a totally different character, which makes sense since she has different sprites and portraits and whatnot. Since the code itself can't use Japanese characters, the objects are labeled with the English names, and there's actually a whole section of the data file devoted to giving each object its display name in Japanese. Both "Keine" and "KeineH" became "慧音", which we changed to "Keine". I'd imagine that there's some kind of switch that tells it to put "KeineH" everywhere "Keine" used to be whenever she transforms, and that ends up targeting the script in addition to the behind-the-curtain programming stuff.
« Last Edit: February 20, 2016, 12:58:24 pm by Clarste »

Prime32

  • Munch-Munch Demon
Re: Gensou Shoujo Taisen You - Translation (Decrypted .dat files)
« Reply #89 on: February 20, 2016, 10:04:14 pm »
I don't suppose you could cheat and replace one of the letters in "Keine" with an identical one from another alphabet? Like replacing e with е.
« Last Edit: February 20, 2016, 10:06:12 pm by Prime32 »
 

SMF 2.0.15 | SMF © 2017, Simple Machines
Theme based on ModernDark64 design by BlocWeb
Page created in 0.046 seconds with 40 queries.