News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Script dump  (Read 6892 times)

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Script dump
« on: January 28, 2014, 08:51:59 am »
So I'm trying to learn how to do a script dump, but I have some doubts. Look at the image below. What is this "Script Information" for? What is this "Clean" option? Also, which extension should I choose to dump the text (.txt, .bin...)? I asked BRPXQZME about this, but I couldn't understand well. He told me it's a complex thing. By the way, I already calculated the text length in hex, and I'm using FF9's rom only as an example.

« Last Edit: January 30, 2014, 06:06:56 am by Thisguyaresick2 »

Scio

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Re: Script dump
« Reply #1 on: February 01, 2014, 04:33:29 pm »
Did you try reading the help file of the program you're using?
If I had to guess, Script Information is a title you can give to this particular script dump, and clean removes something... maybe control codes?

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Re: Script dump
« Reply #2 on: February 02, 2014, 07:24:36 am »
Did you try reading the help file of the program you're using?
Yeah. I click on 'Help', 'Contents', and then nothing happens. There are only 2 options available: that one and 'About'. I read the readme to see if there was any valuable information, but no information about how to do the dumping.

Quote
If I had to guess, Script Information is a title you can give to this particular script dump, and clean removes something... maybe control codes?
Well, you can give a name to the file when you click on 'Browse', so I still don't know what the Script Information is about.

Scio

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Re: Script dump
« Reply #3 on: February 02, 2014, 06:56:52 pm »
Well, if there's no documentation, the best way to spot differences is to create two files (with different options set) and compare them.

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Re: Script dump
« Reply #4 on: February 02, 2014, 07:35:11 pm »
I just learned how to do a script dump, as well as how to insert it. But I didn't learn with Hexecute, I used romjuice to dump the text. It was really simple. And well, it's the .txt format indeed. But the script inserter must have the table support. Fortunately, Hexecute has it. :)

About the Script Information, I think it's used only to add a header to the text, so I suppose it's not needed. My mistake. "Script Information" is just the location of the file (C:/User...) and its name, so it's nothing special.
« Last Edit: February 02, 2014, 07:45:20 pm by Thisguyaresick2 »

Scio

  • Full Member
  • ***
  • Posts: 155
    • View Profile
Re: Script dump
« Reply #5 on: February 02, 2014, 07:48:12 pm »
Well, that's nice. Good luck on your project.

naxis

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
Re: Script dump
« Reply #6 on: February 09, 2014, 01:19:20 am »
Thisguyaresick2,

Could you tell us how you were able to script dump and re-insert? Maybe others could learn from your example.

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Re: Script dump
« Reply #7 on: February 09, 2014, 06:26:55 am »
Oh, ok.

To do a dump, I'd say that it depends on which program you are using. With Hexecute, for instance, you'll have to input the starting address and the text length in hex, so you'll have to calculate it using this formula: end address - start address = length (yeah, this part is pure Math; if you're not good at calculating hex yet, the Windows calculator is good enough. To calculate hex with the Windows calculator, click on View>Programmer, and then switch from Dec to Hex). Some dumpers are simpler, like romjuice, but it's a command-line tool (it's still easy, you'll have to input a simple command line to dump everything). To open it with Windows Vista or Windows 7, open cmd.exe, and then drag and drop the tool inside the cmd window, and press Enter.

The command line for romjuice: "romjuice <rom.bin> <table.tbl> <start address> <end address> <output.txt>" (without the quotes and brackets)
For example: romjuice ff9.bin ff9.tbl 75da0 76387 ff9dump.txt

IIRC, the files must be in the same folder (at least that's how it worked for me).

To edit the text, I'd recommend using Notepad++, especially if you're translating a game from Japanese to English. Do not use Notepad, Notepad++ is superior.

To re-insert the text (with Hexecute), you'll have to input the starting address of the text and the table used to dump that text. But be careful, re-inserting text isn't as easy as you might think. You have to find a way to, like, memorize how much of the text you have changed, or you'll end up overwriting the data located right after the text block, ruining the ROM for good. If that happens, be sure to have backups, and try again.

Also, some hex editors don't have the insert text option, like Windhex, so you'll have to use Atlas to insert them (I haven't learned how to use it yet, but there must be a tutorial somewhere in the internet, maybe here at RHDN). Windhex (more commonly used for SNES and GBA games) can dump text, but it can't insert them. Well, I guess that's it.
« Last Edit: February 09, 2014, 06:36:19 am by Thisguyaresick2 »

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Script dump
« Reply #8 on: February 09, 2014, 11:56:29 am »
I recommend doing your own tool. You are going to find some game specific data anyway. Stuff like compression, archives, level tilemaps, custom stuff.

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Re: Script dump
« Reply #9 on: February 09, 2014, 01:23:52 pm »
Easy for you to say. I'm no programmer, and I have absolutely NO idea of how to make a tool. Looks hard.

naxis

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
Re: Script dump
« Reply #10 on: February 09, 2014, 04:17:19 pm »
Thanks for the in-depth explanation Thisguyaresick2.

How were you able to make the table?

Almagest

  • Sr. Member
  • ****
  • Posts: 302
  • ファーストエイド
    • View Profile
    • Almagest's ROM Hacking Blog
Re: Script dump
« Reply #11 on: February 09, 2014, 05:18:01 pm »
I created FF9's table using Table Manager (at the time, I didn't know how to make one without it). I found the first characters doing a Relative Search with a hex editor (Ami-Sk), but then I discovered that the table was already available at Qhimm's Wiki.