Hacking Legend of Heroes Translation

Status
Not open for further replies.

GHANMI

Well-Known Member
Member
Joined
Jun 10, 2012
Messages
969
Trophies
0
XP
914
Country
x0026B480 - GURUguruMinmIN

Just thought it was a funny find "Gurumin" in the eboot. This makes 2 weird finds in it. The first was the cat ascii art.


Pics or it didn't happen :P

(Good luck on the real-life front, man ;) Your son must be fortunate to have such caring parents - don't push yourself too hard though)
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Edited part:
Look what I found in the eboot. A cat. 0x1EDBFO
(^-^)
(-_-)
(__)/~

After looking for it again to show it, apparently I had the wrong address. Gotta figure out the reason I even had that address in the first place.

kittyebootlol.png
 
  • Like
Reactions: GHANMI

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
The Gurumin one is in the Nayuta rom.
Also in the Nayuta rom, there are various exclamations in Japanese, as if the programmer were lamenting what just happened during the run of the game program. Like "Yabai" (Jap:this is bad) and such.
 
  • Like
Reactions: GHANMI

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
So I have been working on trying to learn some PYTHON. Today I decided to take a chance at making my own dumper. I have been looking over various codes around the net and the ones that Flame made for the zero stuff (well there is one dumper and it has a bunch of stuff going on). To complex for what I am looking to do right now. I was wondering if somebody could give me a heads up on where I would input the line(s) for having this linebreak on x00 and xFD (well FD is basically padding in the file since all the items have the exact amount of space to use for them)). I did copy some of flames code for testing purposes but have since modified other parts to suit my needs. Now I don't want a re-write, just a general idea of where I need to head with it. After I get that done, I am gonna see if I can figure out how to extract pointer locations just for fun when there is no table involved.

Another thing I just noticed. It cuts the file off way before it ends. Is there another piece of code I need to look into... like some kind of loop routine?

import os
import sys
import struct
import functools

def get_data(filename):
totalbytes = os.path.getsize(filename)
infile = open(filename, 'rb')
totalfiledata = infile.readline(totalbytes)
return totalfiledata

filename = 'item'
filedata = get_data(filename + '.tbl')

outfile = open(filename + '_dumped.txt','wb')
outfile.write(filedata)
outfile.close()


Also, if anybody is interested in sharing tools they have made in python. I would love to take a chance to dissect them. A mixture of videos on youtube and trial & error are how I am getting this far.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
This forum doesn't properly indent code samples. Use a link to an external site like pastebin (there are others available too if you don't like pastebin).
I don't see any obvious mistakes.

There's a way to run a script and then dump you off at the python prompt ">>>" when it finishes. You could look into that.
I like using IDLE. There are probably better tools out there, probably.

For debugging you can try various commands after your program finishes running. Try:
print len(filedata)
print hex(len(filedata))

You can type in the names of various variables for various data on them. Try:
filename
outfile

It can give you a clue into what's wrong.

For debugging inserted scripts, I like setting a breakpoint in PPSSPP just after the opcode read line in the game program to see where it loses track. That can give you clues as to a missing or wrong pointer.
-------------------------------
Was this some kind of programming test?
If so, I failed. It should be read, not readline.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
It exports to a different file. I was basically trying to look into how to set up a split type command so that it would break on the end of the line. For the item file in the game, pointers aren't really important. Each section is exactly the same. 24 bytes for the item name and 64 for the description. Well 23 + x00 and 63 + x00 (got to have that null at the end).

It may be read instead of readline. I have been all over the net looking into coding samples to take a part trying to find my answer because most of the time, programming sites a) frown on game hacking or b) really don't have much information on tools like we use.

Here is a breakdown of what I am trying to accomplish with this:

Step 1 - Open file -> Got this
Step 2 - Read contents->...and this...
Step 3 - Take said contents and export it to a file-> ...kind of have this...
[Step 3.2 - breaking on the end of line & remove the excess padding (0xFD)] ->...this is where it gets sticky...
Step 4 - Read to the end of the file -> ...having trouble here as well...
Save File -> ...but I do get an exported file with the contents somehow. I'm not sure if it is just opening and re-saving the file or what... but I got one. LOL!

Grabbing the file locations is just an added bonus I wanted to try and figure out how to do down the line for other file types that actually rely on them.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
Welcome to string manipulation.
As with anything, there are multiple ways.

You can use string.find
Info on string.find:
https://docs.python.org/2/library/string.html (search for string.find)

How to make a non printing character string: (this string is 6 characters long)
mystring = '\x0A\x0A\x0A\x0D\x01\x00'

Trimming a string:
Check this example: (one way of many)
http://pastebin.com/0igs2mkM
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
I just noticed that the item.tbl for Ys VS. Sora is almost exactly like the one for Nayuta. Only a few minor differences. The data that is useful is a total of x88 bytes (x24 = item name (ends with x00) and x64 = item descrition). This one uses xFD to pad out the unused bytes in the dialog blocks. Would you mind making a copy with notes so I can get an idea of what is happening?

Here is an example of the Ys vs. Sora no Kiseki one. Very few differences. Downloaded your dumper to see what I could figure out. I'm not sure what the numbers like x18 x74 and x8c are doing other than telling the program where to go. I understand they are doing something, but this dumper makes a sloppy mess of this file. The data is constant through out the file with a bunch of trash stuff I don't need. Not that I mind working the dialog manually, just figured I could make my own dumper in case somebody wanted to take a crack at the stuff for translation.


item_tbl_example.png
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
0x#### is a way to specify a hex number.
If you are not sure (ever):
1) Go to the shell
2) Type in stuff

Try:
0x4
0x10
0xFF
0xFFFF
0xFFFFFFFF

Why use hex?
Because the rows in the hex editor go in hex. So 0x10 is one row. You could say "16." It's exactly the same and the performance will not be different.
This is what we call "readability."
It's obvious that "addr + 0x10" is moving the address pointer down one row in the file. "addr + 16" is not as obvious.

First make a note of your observations.
The first item in the table is at address 0x10. Sometimes you will hear "offset 0x10", that means the same thing.
The next item in table is at + 0x80 from that. You could say "+ 128", but why would you ever do a silly thing like that?
Then note that the description for each item is + 0x18 from the start of the item. That's one row and a half for those keeping score at home.

Still not done! You need to observe still more things to be successful.

Probably you can use the string 00FD to find:
1) The end of the item name string
2) The end of the description string

You will need to investigate the case (if Falcom ever used it) where all 23 letters have been used for the item name, to see how the terminator looks in that case.

Now using these facts, you will need to create a dumper. Good luck!
Hints you probably need:
Break it down into sub problems:
1) If I know start of string address, how do I return the whole string?
2) If I have a string, how do I write it to an output file?
3) What sequence of steps can the computer do over and over to dump the entire file? How will it know when to stop (when the entire file is dumped)?
-------------
You should make another thread for Ys vs. Sora if you want to discuss further.
 

GHANMI

Well-Known Member
Member
Joined
Jun 10, 2012
Messages
969
Trophies
0
XP
914
Country
I'm shocked Ys vs. Sora no Kiseki even had an item list.
Wasn't it supposed to be a simple crossover with only fights and no dungeons/items?
Or, since Ys Vs Sora was a 2009 game, and it shares the same item table as Nayuta, does that mean that they held down Nayuta for three years? (or maybe nayuta IS the cancelled Zwei 3) :ohnoes: (I'm thankful for the result though :P )
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Ys vs. Sora has about 1000 items, give or take their relevance. Some of it just place holder stuff in the file. But that is a rough estimate. As I am looking at the files in the game, there is a lot of stuff in it. Looks like there is a bunch of unlock able items (psp themes and wallpapers etc..) in it.

---------------------------------------------------------------------------------------
Flame-
Your tool for Nayuta worked great after adjusting the values to fit the file. Still going over it with a fine tooth comb working out what everything does.
 

zero_g_monkey

Well-Known Member
OP
Member
Joined
Aug 9, 2013
Messages
332
Trophies
0
Age
44
XP
321
Country
United States
Added the items for Ys vs Sora no Kiseki in the first post in the spoiler box. I may make a new topic. I may not. I did do a few of them in the list. Shouldn't be a hard list to do. If something doesn't look right in one of my translations. Just stick it to the side in another box so I can learn from my mistranslation.
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
Rename file *.bin to *.orig.
Then (for example): python script.py m3000
It will generate the .data file for you.

Here is the current version of the dumper, it works the same as your version, but dumps more stuff.
http://pastebin.com/wAkhkVBP

You are asking for an inserter? My inserter really sucks, I don't think it's of much use to anyone right now.
 

carl1114

Member
Newcomer
Joined
Nov 19, 2014
Messages
15
Trophies
0
Age
34
XP
97
Country
Rename file *.bin to *.orig.
Then (for example): python script.py m3000
It will generate the .data file for you.

Here is the current version of the dumper, it works the same as your version, but dumps more stuff.
http://pastebin.com/wAkhkVBP

You are asking for an inserter? My inserter really sucks, I don't think it's of much use to anyone right now.


Yes, I mean inserter. And dumper works on Jap version but not Kor patch version.
K_61.jpg


Samples
https://www.sendspace.com/file/lsg2d6

I made completely translated patch for PC version of Joyoland a few months ago but it has some bugs..


I think it might be help your team project. Here is Ao no kiseki python code. It was made by chinese programmer. It works perfectly. I think your team can adjust it to Zero no kiseki.
https://github.com/Ouroboros/Arianrhod/tree/master/Source/Hooks/Falcom/EDAO
 

flame1234

Well-Known Member
Member
Joined
May 17, 2009
Messages
734
Trophies
0
XP
957
Country
United States
You're right. That's absolutely horrible.

The dumper cares a lot about whether the next two bytes "equals" a SHIFT-JIS character. If it does, it directly dumps, and if not, it dumps bytes. It's mainly because none of the text is in Japanese that it's not working.
Can you tell me the name of the Korean character code page? Is it windows code page 949 (that this version uses)?

That's C code, or a least I can't understand it as python code. I don't understand C code at all. Where should the main program be? What kind of free tool can I use for developing C code?
.cpp: Are those the programs?
This is for the Chinese PC version? I don't know any Chinese at all.
---------------------------------------
Here's what you need to do to get things working:
Go to our latest version: http://pastebin.com/wAkhkVBP
Save your file.
Then change line 89 and 92 to say cp949 (the Korean one).
Then run and it will work, at least for m3002.
Link to dumped text:
https://docs.google.com/spreadsheets/d/1MBd1vhQa8RhjRtbRnY1UPtf_8JQEQeoPBhe57NzGSYU/edit?usp=sharing

I don't know any Korean either, sorry... I don't know if Koreans would be satisfied with "Randy" and such in the name column.
 

carl1114

Member
Newcomer
Joined
Nov 19, 2014
Messages
15
Trophies
0
Age
34
XP
97
Country
Thanks a lot. ZnK v3.1 works.

About the python code, in Falcom\EDAO\Decompiler there are
1) ScenarioScript.py - It decompiles scena .bin files. c000.bin<=>c000.bin.py Usage: python ScenarioScript.py c0000.bin
2) BattleActionScript.py - It decompiles battle .dat files.
3) NameList2py.py - It decompiles t_name._dt file.

You need some pyLibs. Here https://www.sendspace.com/file/wcx6g7
Download ED_AO folder and it works on Python 3.3

It also might be help. But it needs chinese version of scena files.
https://code.google.com/p/ed7editor/downloads/list
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    I just want a Pokemon Hell Raiser fan game 😭
  • K3Nv2 @ K3Nv2:
    Anyone wanna play with my joydock
  • BigOnYa @ BigOnYa:
    Biomutant looks cool tho, may have to try that
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
    BigOnYa @ BigOnYa: I had to find and get him an old style flip phone even without text, cause thats what he wanted...