Romhacking.net

Romhacking => Newcomer's Board => Topic started by: Nyxos on May 30, 2013, 10:56:30 pm

Title: A Question about UTF-16 LE
Post by: Nyxos on May 30, 2013, 10:56:30 pm
I know that this may seem to be a insane question since UTF-16 stores text as surrogate pairs xD, Is there in any such way that we can translate a file which has a LBA measure (meaning no changes to the filesize). I know that this is insane but UTF-16 stores the letter A as (00 41) which is crazy meaning one UTF-16 character is equal to a single ASCII character in size.
Title: Re: A Question about UTF-16 LE
Post by: LostTemplar on May 31, 2013, 03:55:29 am
I don't really understand what your actual question is, but if you want to know whether you can reduce the space needed by the text, then yes. However, you'll have to reprogram parts of the game's text decoding routines.

But first you might rather want to look for a way to change the file's size instead. This should be possible almost always.
Title: Re: A Question about UTF-16 LE
Post by: Nyxos on May 31, 2013, 04:59:49 am
I don't really understand what your actual question is, but if you want to know whether you can reduce the space needed by the text, then yes. However, you'll have to reprogram parts of the game's text decoding routines.

But first you might rather want to look for a way to change the file's size instead. This should be possible almost always.

Exactly as you said, my problem really is the LBA measure and I am finding a way on how to alter it. To be more specific its the PSP's LBA routine, since an EBOOT.BIN is not allowed to change in size. In a way that you mean, "decoding routine" meaning the font used or the process on how the main executable reads the text?
Title: Re: A Question about UTF-16 LE
Post by: LostTemplar on May 31, 2013, 11:26:57 am
since an EBOOT.BIN is not allowed to change in size.

Of course it can change. Look up a tutorial on ELF files and PSP relocatable sections. Other than that, it's just a normal file.

Quote
the process on how the main executable reads the text?

This. Just locate to what address the text gets loaded into RAM and set a write break point on that location. For UTF-16 (it's probably rather UCS2) it's probably using the assembly instruction "lhu ..." and later adding 2 to some offset. Change that to "lbu ..." and only add 1 to the offset. Depending on how the game is written, that might be all there is to it. If you have no idea what I'm talking about it's probably too early for you and you should read up on assembly programming.
Title: Re: A Question about UTF-16 LE
Post by: Nyxos on May 31, 2013, 02:06:43 pm
Of course it can change. Look up a tutorial on ELF files and PSP relocatable sections. Other than that, it's just a normal file.

This. Just locate to what address the text gets loaded into RAM and set a write break point on that location. For UTF-16 (it's probably rather UCS2) it's probably using the assembly instruction "lhu ..." and later adding 2 to some offset. Change that to "lbu ..." and only add 1 to the offset. Depending on how the game is written, that might be all there is to it. If you have no idea what I'm talking about it's probably too early for you and you should read up on assembly programming.

Thank You. I will try all of those that you recommended to me.