Tuesday, March 31, 2020

Tile Molesting, the easy way

I spend some time again trying to get the .FNT files to display in a Tile Viewer tool.
Having no luck with various programs i decided to try "Tile Molester Mod" again:

https://www.romhacking.net/utilities/991/

And after some initial trial and error i finally managed to get our beautiful and ugly GL6 font to display!:




And here with another codec, 4bpp linear, reverse order:





Maybe we are now able to fix some of the GL6 font issues that currently exist, for example the big and small characters not aligning properly:



I sadly didn't find any clue on getting a variable width font to work on GL6 yet.
I am pretty certain that the guys who did the official GL5 translation did the following:

1. created a better font
2. created a vwf code to let it display properly

Now, i believe that the developers of GL6 didn't care about the font code and didn't include it in GL6...
So, i imagine that i gotta somehow create a new function that has the GL5 VWF code in GL6 and after that let the "text display" function point to that code.
No idea how to do any of that, but i will keep on trying.
If someone has knowledge of programming, VWFs and stuff like that, please write me a mail!

For anybody interested, heres how the GL5 font looks like in the tile viewer:




Friday, March 20, 2020

Looking for JPN > ENG Translator!

Dear readers,

aside from needing help with the MIPS hacking we're also looking for someone who would like to help us translate the game from Japanese to English.
Currently we are only 2 guys using the available script from the Growlanser Realm and Machine Translation tools to translate the game to English.
If someone with Japanese and English skills would like to help us out and create a proper translation let us know!
You can find our current progress on the repository:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/

Monday, March 16, 2020

Help needed and progress update

Dear readers,

i am still breaking my head on trying to change the displayed position of text in the ELF file.
Using PCSX2dis and Ghidra (and also IDA Pro) i managed to understand the program a bit better, but having next to no assembly language experience i'm currently in need of some help.
If you are able to understand the picture below and know how to hack/modify Emotion Engine (MIPS5900) assembly language, then kindly lend us your knowledge so we can create a better fan translation for GL6!



Aside from that Mako managed to translate more image files and i made some pretty nice progress on translating the ELF File.
After fully translating the ELF file we can concentrate on the scripts of the main game and continue there.

I compiled our up to date translation and put it up again on the repository:

https://bitbucket.org/Risae/growlanser-6-english-translation/downloads/GL6_0.2.rar


Heres how you can unpack the GL6 ISO, overwrite the files and repack it:

https://growlanser6english.blogspot.com/2019/03/growlanser-6-unpack-iso.html

https://growlanser6english.blogspot.com/2019/03/growlanser-6-repack-iso.html

Thursday, February 27, 2020

Don't tell my Wife, but i want to propose to Ghidra

For the last 2 weeks i was breaking my head on an issue where a Kanji was somehow still showing up even after being deleted in the game files.
When you defeat an enemy you get information on how much EXP, Money and Knack Points you receive.
When i went on to translate that, i only found 2 things, the Kanji 技 and P:

I didn't think much of it and just translated it and tested it ingame, but somehow the Kanji 能 was still popping up (AP and KP are just debugging text):



I changed every single hex string that could result in the Kanji, but nomatter what i tried i couldn't remove it from that spot.
So, with my newfound Ghidra skills i decided to tackle this issue again.
First, i looked for my strings:

(At first Ghidra didn't recognize them as strings so i had to manually edit them to show up as a normal string)
I noticed that my strings both had 4 references to 2 functions which looked very similar.
So, i decided to go to the funktions and check out the really cool "Function Graph" tool:


I am by no means a programmer, but this looked like a graph that shows how the EXP screen is build together in code.
I found both of my strings in the graph and i slowly tried to understand what i am looking at.



Since i had 2 reference points again i could figure out that these 2 are probably the code that will display "AP" and "KP" in the EXP screen.
In the middle of those 2, just like ingame where the stupid ass Kanji was giving me troubles, lies code that has a different function put in between:

So, i thought that i could just delete the code and see what happens ingame, maybe the Kanji will finally be gone and i can have a properly translated EXP screen.
I looked at what HEX Address the code is in and just put a lot of 0's in its place:


(I had to do this for 2 functions, it seems like there are 2 different EXP screens in GL6)
It looked like this in Ghidra after doing that:


And lo and behold, it actually worked:


Heres hoping i didn't actually break anything critical in some other part of the game.....
But so far the game didn't crash after killing some monsters.

Knowing that things like this work will help me figure out how to change other parts of the game, for example the equipping screen which is not great right now:


Heres what it looked like in GL5:


I wanted to do a 1 to 1 copy of it, but i couldn't change the line in which the item name is place.
Maybe now i have the chance to just switch it around with the help of Ghidra.

Tuesday, February 25, 2020

The Adventures of NSA grade Reverse-Engineering

The last few days had been very exciting for me since i made a lot of progress on reverse-engineering the Growlanser 6 ELF (executable) file.

One problem that we had in the past was the fact that in the GL6 ELF file "SLPM_667.16" there was a lot of text that we couldn't find the corresponding pointers for.
So, whenever i wanted to translate a text string, i had to be careful not to "clip" into the next text:





This made some text look squished in, like in the examples above.

So, i spent hours on trying to figure out how this stupid-ass file works.
Using tools like the PCSX2 debugger to see what the hell is going on while the game is running (but having no idea what the hell i'm actually looking at).
Using tools like "ps2dis" to check out the ELF file, but, again, having no idea what i'm looking at  since i have no experience in programming or assembly.
Searching the internet once again for guides/tutorials on how to figure out how assembly and the PS2s Emotion Engine works....

After many, many hours of reading, trial'n'error, and some more reading i found this blog post:

https://aloshi.com/archives/46

And this very passage:


I used ps2dis before, but all the things on screen made no sense to me.
But i knew that when i searched for "Victory Cond." i could find my text in ps2dis.
With "SPACE" i marked it and then used F3 to let me jump to the place that points to this position, just like the guy in the tutorial.
I found a place in the ELF file that actually points to my text:



At first i couldn't really figure out what the different numbers and text meant.
But, according to ps2dis the hex row "24 84 CC 00" was pointing to my text.
Since i had a 2nd reference point (the Defeat Cond. below) i was doing some more trial'n'error to see if this is really the famous pointers that i was looking for.
I checked if i could find my hex array through a hex editor, and after having a positive result i was certain that i might have found my holy grail:


So, as a little test i switched the pointers for both of them around to check if it would switch the references around in the disassembler too - And oh boy it did!
Ingame the text was changed and no errors of any kind occured.
I can't believe that all of that was right in front of my eyes... ^^'

ps2dis was quite an old tool and i remembered that a year ago i tried to use the new NSA open-source reverse-engineering tool called "Ghidra":

https://github.com/NationalSecurityAgency/ghidra

Sadly at that point the Ghidra tool had no MIPS 5900 (PS2s Emotion Engine) processor, which can fully reverse-engineer the ELF file, and i couldn't find/figure out anything worthwile.
But, looking at it again earlier this month i saw that somebody actually started a project on github to add an Emotion Engine processor for Ghidra:

https://github.com/beardypig/ghidra-emotionengine

(sadly the github releases page is not up-to-date, i compiled the latest files into a Ghidra Processor and put it on the translation repository:

https://bitbucket.org/Risae/growlanser-6-english-translation/downloads/ghidra_9.1.2_PUBLIC_20200225_ghidra-emotionengine-master.zip)

With that processor i was able to analyze a lot of functions of the ELF, which made me see even more of what is going on inside of it:


Sadly searching for SHIFT-JIS encoded strings didn't really seem to work, or at least i couldn't find out how to make it work for now...
But i was able to find pretty much every pointer for the strings, and how to modify them to give the text enough space to write.

Here are some examples, before and after:





(the textbox clipping will be fixed at some other time)


Feels good that i'm making progress on de-mystifying the ELF file.
The Ghidra tool is really god damn powerful, some of the options that you can use in there gives a really good overview of what is happening in the ELF file.
With a lot of luck and time i hope i can find a way to rewrite/change the code that draws the text and make it variable width like in GL5.