~Hakurei Shrine~ > Touhou Projects

Gensou Shoujo Taisen You - Translation (Decrypted .dat files)

<< < (2/30) > >>

Roonerspism:
I just played around encrypting and decrypting data5.dat and running an encryption/decryption loop turns most of it in to garbage data, with strings of correctly preserved characters mixed in. It also makes the file larger on both encryption and decryption.

I tried removing the actual encryption part of the program so it just reads data5.dat and writes its characters without doing anything in to output.dat. Even then the output file has 1500 random linebreaks added to it, although the data is otherwise exactly the same. GSW2 still rejects the new file and crashes though so I guess the whitespace is important.

So yeah, something's happening either at the character storing or writing step that's making files that aren't exactly the same.

Deranged:
Eh-heh...

Yeaaah, to be honest, I actually found a way to extract the files awhile ago and actually translated a teensy bit(http://i.imgur.com/7l8PSX6.png - see modified date). The problems I had was putting it back in, although the method I used seems different from yours (I made a hacked exe that read the files from the dats and dumped it into my pc instead of loading it into the game) but doing the reverse stymied me a bit. Then LoT2 happened, and then real life happened.

If you manage to find a way to convert the scripts into a format that's readable by the game, AND find a way to get the strings in the exe translated while still having the exe entirely workable, that'll be great. I'll also be glad to help on the translation effort now too since real life has let off a bit, whether it be translation checking or translating the whole thing or whatever - I still feel a bit unfulfilled from not following up from the first game. If not, I might try poking around with the methods I used a year ago, though I'm kinda rusty in that now...

brliron:
I think Yamsman made his program on an unix computer. Windows handles end of lines differently and, by default, tries to support unix text files as well as windows text files. This leads to some end of lines conversion, which isn't wanted in our case.
To fix it, replace the line 30 by :

--- Code: ---FILE * ofile = fopen("output.dat", "wb");
--- End code ---

BlitzBlast:
Changing that gets the game to accept the .dat files after a straight decryption/encryption loop, but the fact that spaces matter so much predictably also means that actually changing the original Japanese strings leads to the exact same memory issues. I guess it might work if the english text had exactly the same length as the japanese (in bytes, not word count), but that would lead to a clunky at best translation. I'd assume the problem at hand is in the .exe itself, which brings us all back to the original problem that stymied everyone for so long: it's fairly easy to decompile the .exe (it's just Game Maker), but recompiling is a whole nother story.

Just having access to a text dump is a huge boon though, even if this doesn't ultimately pan out. Once again, thanks!

Yamsman:

--- Quote from: brliron on March 25, 2015, 03:52:23 PM ---I think Yamsman made his program on an unix computer. Windows handles end of lines differently and, by default, tries to support unix text files as well as windows text files. This leads to some end of lines conversion, which isn't wanted in our case.

--- End quote ---
I did write the program on Linux, and I was unaware that it would be different for Windows. Thank you for letting me know, I updated the code in the pastebin.


--- Quote from: BlitzBlast on March 25, 2015, 07:48:38 PM ---changing the original Japanese strings leads to the exact same memory issues. I guess it might work if the english text had exactly the same length as the japanese (in bytes, not word count), but that would lead to a clunky at best translation.

--- End quote ---
I should have included this information earlier, but the reason why it won't work is because there are 4 bytes before the start of each file's data that tells the length in bytes. When you change the size, those bytes must be modified as well to accomodate the change.


As of now, I'm working on a set of tools to unpack the files for modification and then repack them into a data file. Ideally it will make it possible to freely edit the files without having to worry about changing the size bytes. EDIT: The unpacking tool is complete, I've added the link to the OP.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version