Hacking Legend of Heroes Translation

Status
Not open for further replies.

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
When I get a chance to look into this, it should prove the be very helpful. Thanks for the information.
 

neoxephon

Well-Known Member
Member
Joined
Jul 13, 2009
Messages
437
Trophies
0
Age
35
Location
USA
XP
547
Country
United States
Ah, yeah I see what you mean. PPSSPP does have issues with Assemble Opcode and certain instructions. I suppose you could edit the opcode by changing the value in memory. When you get it the way you want it, take that value and use it in the EBOOT.BIN to apply it permanently.
 

JamRules

.....
Member
Joined
Jan 9, 2014
Messages
527
Trophies
1
XP
2,204
Country
United States
Ah, yeah I see what you mean. PPSSPP does have issues with Assemble Opcode and certain instructions. I suppose you could edit the opcode by changing the value in memory. When you get it the way you want it, take that value and use it in the EBOOT.BIN to apply it permanently.

Yeah this is exactly what I did, the position should be fairly obvious in the instruction.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
The example JamRules gave is:
li a1,0x08A68044

That compiles to:
0xA708053C 4480A524

Can someone explain to me why the actual address/immediate is 0x08A68044? From the bolded parts, it looks like it should be 0x08A78044.

The next question I have is re: searching. I want to search for this value, 08A68044. In order to do so, I need to actually search for A708+(two random bytes)+8044. You need to use regular expressions to do this?
 

JamRules

.....
Member
Joined
Jan 9, 2014
Messages
527
Trophies
1
XP
2,204
Country
United States
I'm guessing you mean searching in the eboot since you've seen the instruction?
I think you can find it just by coping the 8 bytes and using ctrl-f in your hex editor
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
Any idea why the addresses don't match?

I looked in the eboot for 0xa708053C and didn't find it.
How can I find out what happens when the game is loaded? I unchecked "run on load" and that value (0xa708053C) is in memory at 0x8811c64 from the start.

You said memory addresses are EBOOT plus 0x880000. So taking the converse, that means EBOOT addresses are memory minus 0x8800000. Taking that value, the eboot address for 0x8811c64 should be 0x11c64. The value at address 0x11c64 in the eboot is 0x98460008. Something went wrong. There's something I'm missing.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
There are tables in the eboot that have something to do with these things. I am not sure what value they play but when edited before, they definitely triggered something in the game (and caused it to break).

dialog.png

pointers.png

In the two screen shots above I have put boxes around the matching sets. The red box stuff is the normal pointer that you would either add or subtract xC0 to get what you are looking for. If you are coming from the table, you add it to find the position and if you are coming from the dialog, you would subtract. They are set up in little edian format. The blue box stuff are the weird ones. I don't know how they work exactly and have not successfully managed to edit any of them to make what I need work. Henceforth calling out for some help from more experienced people. If you notice the difference in how to dialog in the boxes are set up. The red box is pretty clean with no real wasted apace. The blue box has plenty of wasted (and much needed for other stuff) space. The red box pointers refer to the following texts : Wanna play the Slots?; Wanna play Roulette?; Wanna play Black Jack?;Wanna play Poker?.... Then you notice empty space (x00 - which normally I put a bunch of XXXXX in to let me know later it is empty for quick reference). Next you can see the text of "Character has been unlocked.%c" etc.... These have space that could be better served. Later on in the eboot, I know for sure I will need the empty space and the ability to move it around. Especially when trying to shove "Ambushed from behind" in this very tight spot [背後をとられた!] or Surprise Attack! into [奇襲攻撃!].


Here is what I know about the eboot. The pointer tables begin at around x25a177 (search for user_main) and you will be in the general area. The dialog stuff begins around x2635dc (search for _exit or exit from the beginning of the file) and it will get you where your going. There is two different kind of dialog - the easily modified & transplanted (yep, you can stick anything where there is open space in the dialog section.... as long as you know the pointers) and the pain in the a** stuff [blue box] (can also probably be moved once the whole pointer system is figured out). The eboot likes to mix them up. You may be chugging along down through editing text when you have to change up the pattern to make sure you start in the exact position as the japanese and can not run over unless you want to see the wrong stuff in the wrong spot. Well not exactly wrong per se, just not what is supposed to look like. LOL. I hope this helps to clarify this a little bit and add some insight into the eboot. Also when you get finished with the dialog stuff, there is a HUGE list of pointers for either in game files or more eboot junk.
 

neoxephon

Well-Known Member
Member
Joined
Jul 13, 2009
Messages
437
Trophies
0
Age
35
Location
USA
XP
547
Country
United States
A7 08 05 3C 44 80 A5 24

A7 = 2nd byte in the li address/value.
08 = 1st byte in the li address/value.
05 3C = The opcode type.
44 = 4th byte in the li address/value.
80 = 3rd byte in the li address/value.
A5 24 = The opcode type.

The A7 (first byte of the opcode) is kind of interesting because, whatever hex value that you put there, the value that gets used will be - 1. So, if I put AA, the value used in the address in the opcode will be A9.

li a1, 0x08A68044 is located at offset 0xDD24 in EBOOT.BIN

26 00 05 3C 44 40 A5 24

Take 08 A7 80 44 from the opcode in memory:
0x08A78044 - 0x08814000 = 0x00264044

Take the first 4 bytes, reverse them around and place them in the first 4 bytes of the opcode:
26 00

Take the next 4 bytes, reverse them around and place them in the 5th and 6th bytes of the opcode:
44 40

If you change any of the other bytes in the opcode, it'll cease to be an li.

I tested it and it did indeed change the address in the li opcode.

That's all I found out from looking at it this morning. Hope it helps some. :)
 
  • Like
Reactions: flame1234

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
I finally figured out what the mystery pointer table means. If you take xDD24 - xC0 = xDC64 (The value in the pointer table with the red box I posted a few posts ago. Yay!! Progress.

Thanks to all who are helping with this. A little confusing but making great headway. It is just gonna take some practice.


So I am guessing... that maybe some of the leg work maybe easier since we just might know where the code in the game is. Gonna check that out in just a few minutes. First Popsicle time.


EDITED PART
Made a correction "xDD24" - xC0 = xDC64.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
li a1, 0x08A68044 is located at offset 0xDD24 in EBOOT.BIN
It's located at 0x8811C64 in memory when the program is running.
That's an offset of 8803F40. Any idea where that number comes from?

So I just need to keep track of where this weird quirk happens (-1 to the 2nd [most significant] byte of the address). Because it doesn't happen with all the li pseudo instructions, just some of them. And I have no clue as to why. PPSSPP seems to know when it is happening (not sure how).
The LI pseudo instruction that PPSSPP decodes is:
LUI $t, immediate
ADDIU $t, $t, immediate
There shouldn't be any quirks with this unless I am somehow not understanding how ADDIU works. The ADDIU is just adding the immediate to sixteen zeros. There's shouldn't be any carryover.

There's another LI you will sometimes see, but it isn't decoded by PPSSPP as LI (at least not yet):
LUI $t, immediate (first two bytes)
ORI $t, immediate (last two bytes)

So if I can't find li opcodes raw (as they appear in RAM), I should subtract 0x08804000 from the effective address, rebuild the opcode with that, and then try searching for it.
Incidentally the program (for this game anyway) starts at 0x08804000.

What file specifies how things are loaded into memory when the game is booted? When this game boots, it changes certain opcodes. Does it have to do with firmware or something?
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
I don't have a lot of time right now, but when I get a chance. I will help you figure it out. Since discovering the way the table is in the game, it makes looking this stuff a whole lot easier.




:EDITED PART:
Just created a nice little spreadsheet of the eboot with pointers and all kind of numbers. Will upload later when I can better explain it.
 

Swing

Well-Known Member
Member
Joined
Jun 5, 2011
Messages
336
Trophies
0
XP
616
Country
United States
So my graphic designing gf knows way more about this than I do, but if you want to give me lines of japanese text I can translate them into japanese. It'd be cool if you also gave me the corresponding program or codes or whatever you're doing so I can directly insert translated japanese text right into the game. I would probably translate all katakana first. I don't know if there's a way where when you translate one word you can insert that translated word into every single it's mentioned in the game or at least in certain files? After that I could start busting out the rest. I too have limited time but if you guys gave me the resources and told me to "translate and insert A into B", then I think I could help substantially.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
So my graphic designing gf knows way more about this than I do, but if you want to give me lines of japanese text I can translate them into japanese. It'd be cool if you also gave me the corresponding program or codes or whatever you're doing so I can directly insert translated japanese text right into the game. I would probably translate all katakana first. I don't know if there's a way where when you translate one word you can insert that translated word into every single it's mentioned in the game or at least in certain files? After that I could start busting out the rest. I too have limited time but if you guys gave me the resources and told me to "translate and insert A into B", then I think I could help substantially.

Hm.. Most of the stuff is available for translation in this thread. We believe in posting them publicly for people to use as long as it is not for profit and credit is given. I'm not to sure how I feel about translating Japanese into Japanese. The tools are also placed throughout this topic. For the insertion part, I am a complete tyrant in that department. I have to look over the translation, QC it, edit and then I insert it. I appreciate the offer to help though. If you want to try your hand at translation, feel free to open one of the spreadsheets and stick your translation of whatever in an open box with some kind of signature (so we know it is yours). If it is up to par, then we can talk more.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
I am the master of the universe. LOL! After confusing myself for about 2 hours. I took a break for a little bit and come back to notice my folly. EBOOT is almost slayed. Thanks a million JamRules and Neoxephon.

HEMAN2.jpg


NPJH50311_00005.jpgNPJH50311_00006.jpgNPJH50311_00007.jpgNPJH50311_00008.jpg


Now as soon as the missing/dropped dialog problem is fixed and I can figure out how to clean that sloppy font up. This game will officially be conquered especially with flame really kicking the tools into high gear. Dialog dumps shouldn't be to far off!!!!!
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
The main problem that's left at this point is named monsnote.dt2. I have no idea what's going on there.

The list of solved problems is long and it includes the script. Since posting progress is fun:

Script Gallery:
http://imgur.com/a/X0Qzm
This one is a variable-length insert.

About the script:
There are a bunch of pointers in the script files. Once we found them all, it was a cinch to do variable-length script insertion.
My insertion tool will find some of the pointers automatically at run-time. However, the pointers for the 02 and 03 opcodes can't be found automatically (too many false positives), so I made some tools to give me the list of candidates and then I narrow that down to the real ones by educated guessing.

EBOOT Gallery:
http://imgur.com/a/ZfX5s
This one is a fixed-length insert. Zero G is working on the variable-length insert for this.
 
  • Like
Reactions: Hargrun

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Anybody ever run across a font map with something completely missing like say... the space (x20). I suspect that is the case of the dropping text issue I am having. Is there another way to check something like that other than the fact it just happens when used? Say maybe a way in the code or something?


There is atleast 3 different fonts in the game but 2 are very similar. There is pspfont.dat (the big one that has all the good stuff), sfont.itp and asscii.itp [these two are "almost" identical image style fonts]. One of the itp fonts is the culprit I believe but I can almost never tell them apart when they are used. The text that gets dropped relates to menus and right now battle results screen (eboot stuff).
 

JamRules

.....
Member
Joined
Jan 9, 2014
Messages
527
Trophies
1
XP
2,204
Country
United States
I would have said the dropped text is because it reads till null in some cases and space is 0x0020

Edit: Or not, just looked and in this case it's just 0x20
(the game uses both UTF8 and Shift-JIS it seems)

You might already know but you can use 0x01 instead of space


npjh50311_00016.jpg


To fix it properly just change the li v0,0x20 to something you won't use e.g. li v0,-0x1

eboot - 0x00136C4C
change 0x20000224 to 0xFFFF0224

kiseki-asm.png
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
Are there guidelines on typesetting available somewhere?
re: Scripts
Should I leave the 60-character string in one line, split it into two even lines, or split it into three even lines? Those are all valid options I could choose - how do I choose?
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • LeoTCK @ LeoTCK:
    dammit that thread got moved from offtopic to edge, well since that happened
  • Xdqwerty @ Xdqwerty:
    @LeoTCK, atleast it's still avaliable
  • LeoTCK @ LeoTCK:
    yes but it wasn't meant to be a comedy thread
  • LeoTCK @ LeoTCK:
    and edge of the forum is mostly comedy and games
  • LeoTCK @ LeoTCK:
    so I don't get why it got moved at all
  • Xdqwerty @ Xdqwerty:
    @LeoTCK, mods are probably hating you
  • LeoTCK @ LeoTCK:
    on most sites mods hated me, sooner or later, but usually over time I get either banned or the mods get used to me
  • LeoTCK @ LeoTCK:
    sometimes to the point of thanking me for my quick actions etc against spam and other stuff, but yea...its either they come to respect me or outright hate me
    +1
  • BigOnYa @ BigOnYa:
    If it's not game related, it will be moved to the Egde of the forum. Mods have moved a few of my threads also.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, it was in the off topic chat forum
  • BigOnYa @ BigOnYa:
    Well atleast they didn't delete it completely.
  • LeoTCK @ LeoTCK:
    hmm
  • Xdqwerty @ Xdqwerty:
    uoiea
  • LeoTCK @ LeoTCK:
    huh?
  • Xdqwerty @ Xdqwerty:
    Aeiou backwards
  • BigOnYa @ BigOnYa:
    ?tuw
  • Xdqwerty @ Xdqwerty:
    yltcaxE
    +1
  • AncientBoi @ AncientBoi:
    ¡¡¡ tttoN
  • Xdqwerty @ Xdqwerty:
    ssssey ioBtneicnA@
    +1
  • AncientBoi @ AncientBoi:
    :angry: ¡¡¡¡¡ oooooooooooooooooooooooN
  • Xdqwerty @ Xdqwerty:
    ?draeh ton uoy evaH
  • AncientBoi @ AncientBoi:
    Gives you "The 🖕 BIRD" :tpi::rofl2::rofl2::rofl2:
    +2
  • Xdqwerty @ Xdqwerty:
    :2lfor::2lfor::2lfor::ipt: "DRIB 🖕ehT" uoy seviG. *
    Xdqwerty @ Xdqwerty: :2lfor::2lfor::2lfor::ipt: "DRIB 🖕ehT" uoy seviG. *