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

Author Topic: Script dumping Radiant Historia (DS)  (Read 856 times)

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Script dumping Radiant Historia (DS)
« on: December 03, 2018, 09:16:19 am »
Hello, I am both incredibly new to this sort of thing and incredibly lost on what to do.

As the thread title suggests, I am trying to dump the script for the NDS version of Radiant Historia. There doesn't seem to be a script floating around on the internet, but I would like to have it around for a non-hacking/non-programming project I want to do. In my search I managed to find an actual script dumper utility for the game I'm trying to extract the script from (https://www.romhacking.net/utilities/883/), so I downloaded that set. It specified I would also need the Atlus Packer utility and the NDS Compressor utility available on the site, as well as a separate Japanese font table, and... that's as far as I have gotten. Any attempt to actually execute the .exe files in any of utilities is met with a short appearance of the familiar black command window, followed by the disappearance of that same command window.

I've tried some other things, like exploring NDSTool (which I don't even know how to begin working it, since there doesn't seem to be any kind of file I can actually use), DS Lazy, and Tahaxan. The latter gives me a .bin, a .idx, and a .ndx, which are mentioned in the Atlus Packer, but I don't know what to do with them. DS Lazy gives me the same three files as Tahaxan, as well as sound files, and a whole bunch of other .bin files (overlay, arm7, arm9, banner, header, y7, and y9), but I don't know what to do with those either.

Now all I want is the full script of the game in a format I can actually access. I'm not interested in inserting another script or anything like that, no. All I'm looking for is the raw text.

What do I do?
« Last Edit: December 11, 2018, 07:07:23 am by Macuelos »

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #1 on: December 03, 2018, 09:58:53 pm »
Any attempt to actually execute the .exe files in any of utilities is met with a short appearance of the familiar black command window, followed by the disappearance of that same command window.
That would be because they are command-line utilities.  Press Win+R and type "cmd" to open a command prompt window, and run the utilities from there. Or try Console Compromise.
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #2 on: December 04, 2018, 03:14:02 am »
I checked out Console Compromise, but I have even less of an idea on how that works. I tried running programs folders, but it didn't seem to do much of anything.

Instead I messed around a bit with command prompts, and while I can technically start the programs, whenever I try to do anything I get a "file open error".

When I try to use the script dumper, it gives this message:
Code: [Select]
DUMP - Copyright (C) 2012 CUE
Script dumper for 'Radiant Historia' - Nintendo DS

- reading font: 'fonttbl.bin'
File open error

...and when I try to use the Atlus Packer, it gives this message:
Code: [Select]
PACKER - Copyright (C) 2012 CUE & Skye
File packer for some Nintendo DS Atlus games

- reading the original NDX file
File open error

And in the case of the compression tool, I don't even know what do in there with six options and the .nds, .bin, .idx, and .ndx seemingly not responding to anything, either.


-----
Edit: I've been trying some things with Cartographer as well since there were a few threads about that around, and it almost feels like something happened. I edited Cartographer.bat to use the Radiant Historia ROM, a different command.txt, and a different name for the script output, so that part should be fine. Then I edited the command.txt to use the rh.tbl I got from the RH Script Dump utility, changed a few names (but not the start and stop points of the script, I have no idea what values that would be), and ran Cartographer.bat, with this result:
Code: [Select]
[location]\Cartographer_PR3>cartographer RH.nds command.txt radiant_script -m
Allocating memory for RH.nds...
Failed to open table rh.tbl
#0: Line 1: First character of the line is not a recognized table character

[location]\Cartographer_PR3>pause
Press any key to continue . . .

I'm pretty sure Cartographer would be a very roundabout way of dumping the script considering there's actually a utility for this specific game, but if I can't figure out how to use that script dumper, Cartographer would be an acceptable fallback plan... if I got working.
« Last Edit: December 04, 2018, 06:50:21 am by Macuelos »

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #3 on: December 04, 2018, 10:18:15 pm »
Instead I messed around a bit with command prompts, and while I can technically start the programs, whenever I try to do anything I get a "file open error".

When I try to use the script dumper, it gives this message:
Code: [Select]
DUMP - Copyright (C) 2012 CUE
Script dumper for 'Radiant Historia' - Nintendo DS

- reading font: 'fonttbl.bin'
File open error
It's quite possible you're not starting the programs correctly, but since I have no idea what you're doing, I can't say.  :-\

For instance, if you have the program in C:\Foo, and you are running it by typing
Code: [Select]
C:\FOO\dump.exe fonttbl tablename filenamethat is never going to work. You would have to type
Code: [Select]
cd \foo
dump.exe fonttbl tablename filename

I'm sure there's no shortage of tutorials out there for using the command prompt.
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #4 on: December 05, 2018, 08:03:09 am »
You would have to type
Code: [Select]
cd \foo
dump.exe fonttbl tablename filename

This was a great help already! I have made some actual progress, allowing me to unpack the the actual files.

Since I have the .bin, .ndx, and .idx files mentioned in the Atlus Packer, I thought it'd be okay to use it. The utility's information is as follows:
Code: [Select]
Usage: PACKER file1 [file2]

- unpack 'file1.bin' into '@file1\' if no 'file2' is specified
- pack files from '@file1\' into 'file2.bin'

* you do not have to specify the '.bin' extensions
* 'file1.bin'/'file1.ndx'/'file1.idx' must be present in the same folder

At my first attempt, I used merely "PACKER file1" and ended up with @file1, as mentioned. Worked like a charm. There's a lot in there and it's not very easy for me to read, so I tried specifying a file2 next. This was the result:
Code: [Select]
\AtlusCue>PACKER file1 [file2]

PACKER - Copyright (C) 2012 CUE & Skye
File packer for some Nintendo DS Atlus games

- reading the original NDX file
- reading the original IDX file
- generating the table of contents
- packing "@file1/Chr2D/"
- packing "@file1/Chr2D/cmp/"
- packing "@file1/Chr2D/cmp/Cell/"
- packing "@file1/Chr2D/cmp/Character/"
- packing "@file1/Chr2D/cmp/ColorPalette/"
- packing "@file1/Chr2D/cmp/csv/"
- packing "@file1/Chr2D/cmp/csv/001.csv"
File open error

I don't see what I'm doing wrong here, as it worked fine when I didn't specify a file2. I don't know if I actually need this fil2, but maybe it will allow me to dump the script more easily? The Script Dumper readme file has these things to say:
Code: [Select]
Usage: DUMP fonttbl tablename filename [filename [...]]\n"

* 'fonttbl' is the font table used by the game
* 'tablename' is the table of conversion
* create the '.txt' file from the '.msg' file
* create the '.new' file from the '.txt' file
* multiple filenames and wildcards are permitted
---
To extract the script:
DUMP fonttbl.bin rh.tbl *.msg

I threw in some of the .msg files that were present in @file1 and tried running DUMP, which did work! That's good, but there really are a lot of .msg files, and I would honestly rather not move all of these files around to create .txt files for everything.

Is there a way to dump everything in a single file, or perhaps create .txt files for the entire folder all at once? Perhaps with the file2 I can't seem to create at the moment?

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #5 on: December 05, 2018, 09:48:29 am »
- unpack 'file1.bin' into '@file1\' if no 'file2' is specified
- pack files from '@file1\' into 'file2.bin'
If you are trying to dump scripts, then there is no point in specifying "file2", as that is only used when you want to pack files that have previously been unpacked.

Quote
That's good, but there really are a lot of .msg files, and I would honestly rather not move all of these files around to create .txt files for everything.
I'm not clear on how moving around all of those files would somehow be an inconvenience.
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #6 on: December 05, 2018, 10:19:53 am »
I'm not clear on how moving around all of those files would somehow be an inconvenience.

I checked the location of the script, @file\Msg\ja, and found it contains nearly 14000 files in 1095 folders. In my mind it would be easiest to dump all .msg files into .txt files in one fell swoop, but I don't how flexible the program is in that regard, whether it would allow me to change .msg files three folders deeper than \ja.

It can be done for each of the 1095 folders separately, certainly, but if there's a method that allows me to not perform the same action 1100 times, so much the better.

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #7 on: December 05, 2018, 10:15:27 pm »
I see.  Well, the readme.txt for DUMP.EXE says

Quote
To extract the script:
DUMP fonttbl.bin rh.tbl *.msg

Does something like that work?
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #8 on: December 06, 2018, 12:49:22 am »
That is what I am doing after finally getting putting two and two together from what you and the readme files said. I even used a .bat file so I don't have to go into cmd.exe every single time, so that's helpful, too.

At this point I am some 80% certain I'll have to go to bat with the 14000-ish .msg files in the package. I've tried running it in the folders containing the folders that actually have some of the .msg files and it's not doing anything, so I guess I have a long road ahead of me that I'll have to overcome with the help of some podcasts.

Added annoyance here is that some of the files seem to be too short. I don't know what's up with that either, and when I run dumper this is the result on the first example I could find:
Code: [Select]
@file1\Msg\ja>dump fonttbl.bin rh.tbl *.msg

DUMP - Copyright (C) 2012 CUE
Script dumper for 'Radiant Historia' - Nintendo DS

- reading font: 'fonttbl.bin'
- reading table: 'rh.tbl'
- MSG->TXT: '.msg'
- MSG->TXT: '=======.msg'
- MSG->TXT: '===============================================================================.msg'
File too short

So I open ===============================================================================.msg and check inside and all I see is this:
Code: [Select]
       ÿ...well, the first character disappeared in the making of this post, but it's "[]" as a single character. ÿ is the entry end or sentence end, I'm not sure which, but it looks like a too-empty file to me, alright.

Anyway, thanks for your help so far, and unless someone has a brilliant idea that lets me dump the script with far fewer actions than I am resigned to perform, I guess my question here is answered now. I'll set the icon to Topic Solved... later.

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #9 on: December 06, 2018, 01:11:15 am »
I'm still not entirely sure what's going on here, but I suspect whatever it is you're trying to do can be easily automated with a few lines of Python.  Assuming you're familiar with the fundamentals of programming, it might take less time to figure out how to write a Python script than it would to do this manually - and it would go even faster if you need to do something similar in the future.
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #10 on: December 06, 2018, 11:38:36 am »
I really don't know much of programming at all, so while there may be some tutorial out there that could help, I'm not sure I know enough of the basics to find a good one.

Don't really know how to explain this any clearer. I guess I'll try illustrating what the folders look like?

So it starts with @file1, then the entire script is in the Msg folder, then in the resulting ja folder, then in a bunch of folders. Like this:
Code: [Select]
-@file1
>\Msg
>>\ja
>>>\000
>>>\001
>>>\002
>>>\...
>>>\025
>>>\100
>>>\Area
>>>\Btl
>>>\Event
>>>\select
>>>\TimeMove

Most all of these folders have folders within in them again, and 95% of thosefolders have the .msg files inside them. But then \ja also has .msg files, and \Btl has various folders with folders with .msg files inside, but also .msg in \Btl... They're all over the place and a large amount of them have (near-)identical names, which means I can't just throw 'em on a single pile and hope for the best.

What I was hoping for is a way to run the DUMP script in a given folder (/ja), but also the folders contained within that folder (/000, /001, /etc), and so on until the 14000 .msg files contained within /ja in some form or another are all dumped in .txt files. Now, if this is possible with programming, I wouldn't know what to write, how to write it, or how to execute it.

Meanwhile I've gotten through all folders in /ja except for /ja/Event during my commute, but there's some 9000 files in that folder alone, so...

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #11 on: December 06, 2018, 10:49:38 pm »
What I was hoping for is a way to run the DUMP script in a given folder (/ja), but also the folders contained within that folder (/000, /001, /etc), and so on until the 14000 .msg files contained within /ja in some form or another are all dumped in .txt files. Now, if this is possible with programming, I wouldn't know what to write, how to write it, or how to execute it.
You're halfway there already!  All you have to do is set it out in logical steps, and then figure out the syntax.

Something like:
Code: [Select]
Get the name of a folder
Get a list of subfolders in that folder
For each subfolder in the list:
    Get the name of the folder
    Get a list of subfolders in that folder
        For each subfolder in the list:
            Get the name of the folder
            Get a list of subfolders in that folder
            If that list is empty:
                 Run DUMP.EXE in that folder

Python actually has a handy function for something exactly like this in the form of "os.walk".  You should be able to find examples of how to use os.walk that you can adapt for your particular purpose just by doing a Google search for "python os.walk" (no quotes).

It might be a teensy bit difficult at first, but I think in the long run this will serve you a whole lot better than spending hours of tedious manual labor while listening to podcasts.
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #12 on: December 07, 2018, 03:54:57 am »
Something like:
Code: [Select]
Get the name of a folder
Get a list of subfolders in that folder
For each subfolder in the list:
    Get the name of the folder
    Get a list of subfolders in that folder
        For each subfolder in the list:
            Get the name of the folder
            Get a list of subfolders in that folder
            If that list is empty:
                 Run DUMP.EXE in that folder

That gives me a good idea of what to do with Python, but it'd be more like...
Code: [Select]
Get the name of a folder
Get a list of subfolders in that folder
***If there are files in that folder, run DUMP.EXE
For each subfolder in the list:
    Get the name of the folder
    Get a list of subfolders in that folder
    ***If there are files in that folder, run DUMP.EXE
        For each subfolder in the list:
            Get the name of the folder
            Get a list of subfolders in that folder
            ***If there are files in that folder, run DUMP.EXE
            If that list is empty:
                 Run DUMP.EXE in that folder

With asterisks to indicate what would need to be different. If the .msg files were only in the final folders, that'd be one thing, but they're not always. Most of the time they are, but it's still a real pain. I don't think there's more than a 100 .msg files not in folders with no subfolders, so it'd be manageable.

A second pain is that some of the files are "too short", causing dump.bat to cancel dumping all .msg files after the too-short file. It just stops right out. When I'm doing it manually, it's easy enough to figure out where the problem lies because the last file named in the command prompt is the problem, but I don't know what Python would do. Would it skip the file, or get hung up on it and stop like dump.bat? Because in that case it'd be a pain to find the culprit in the middle of all these folders.

Also, would DUMP.EXE need to be present in every single folder, or can it be run from a single place?

-----
EDIT: So far I've been able to actually get os.walk working, which, uh... that's a lot of files, alright. Now I just need to run the program from the top down.

-----
EDIT #2: I've taken a small part of the ROM and put it in an easy location, and now I've kind of got it working? But it's not doing the most important part.
My code's like this now:
Code: [Select]
import os

os.chdir = ('F:\\11')

import subprocess

for(path, dirs, files) in os.walk('F:\\11'):
    print('Current location:', path)
    print('Folders:', dirs)
    print('Filenames:', files)
    subprocess.Popen(["dumpus.bat"], shell=True, cwd=r'F:\\11')
    print('*****')

I don't know if everything in there is specifically necessary, but it does execute the batch file, and it even executes it three times! There's two folders in F:\11, so that makes sense.

...the problem is that it executes the batch file three times in F:\11, rather than execute it once in each of the folders. This is what it looks like:
Code: [Select]
Current location: F:\11
Folders: ['Nieuwe map', 'Nieuwe map (2)']
Filenames: ['a.py', 'dump.c', 'dump.exe', 'dumpjp.bat', 'dumpus.bat', 'fnt.bmp', 'font.bin', 'fonttbl.bin', 'fonttbl_jp.bin', 'msg_900_001.msg', 'msg_900_002.msg', 'rh.tbl']
*****
Current location: F:\11\Nieuwe map
Folders: []
Filenames: ['msg_900_001.msg', 'msg_900_002.msg']
*****
Current location: F:\11\Nieuwe map (2)
Folders: []
Filenames: []
*****

F:\11>DUMP fonttbl.bin rh.tbl *.msg

F:\11>DUMP fonttbl.bin rh.tbl *.msg

F:\11>DUMP fonttbl.bin rh.tbl *.msg

DUMP - Copyright (C) 2012 CUE
Script dumper for 'Radiant Historia' - Nintendo DS

- reading font: 'fonttbl.bin'
- reading table: 'rh.tbl'
- MSG->TXT: 'msg_900_001.msg'
- MSG->TXT: 'msg_900_002.msg'

Done

DUMP - Copyright (C) 2012 CUE
Script dumper for 'Radiant Historia' - Nintendo DS

- reading font: 'fonttbl.bin'
- reading table: 'rh.tbl'
- MSG->TXT: 'msg_900_001.msg'
- MSG->TXT: 'msg_900_002.msg'

Done

DUMP - Copyright (C) 2012 CUE
Script dumper for 'Radiant Historia' - Nintendo DS

- reading font: 'fonttbl.bin'
- reading table: 'rh.tbl'
- MSG->TXT: 'msg_900_001.msg'
- MSG->TXT: 'msg_900_002.msg'

Done
[Finished in 0.4s]

It's uh... it's kinda silly that way.
« Last Edit: December 07, 2018, 09:18:03 am by Macuelos »

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #13 on: December 07, 2018, 09:42:50 am »
A second pain is that some of the files are "too short", causing dump.bat to cancel dumping all .msg files after the too-short file. It just stops right out. When I'm doing it manually, it's easy enough to figure out where the problem lies because the last file named in the command prompt is the problem, but I don't know what Python would do. Would it skip the file, or get hung up on it and stop like dump.bat? Because in that case it'd be a pain to find the culprit in the middle of all these folders.
You could always write a program that checks the size of each file and renames it if it is too short (from .msg to .msa, or something).

Quote
Also, would DUMP.EXE need to be present in every single folder, or can it be run from a single place?
I wrote earlier that a command like
Code: [Select]
C:\FOO\dump.exe fonttbl tablename filename would never work, but you could actually use a command like
Code: [Select]
C:\FOO\dump.exe C:\FOO\fonttbl C:\FOO\tablename filename and that should work from any folder.

So, if I'm not mistaken, you should be able to use

Code: [Select]
    subprocess.Popen(["c:\\foo\\dumpus.bat"], shell=True, cwd=(r'F:\\11\\'+path))
(Ideally, you would want to use os.path.join instead of ('F:\\11\\'+path), but let's forgo elegance.)
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #14 on: December 07, 2018, 10:46:53 am »
Fixed the batch file so the command sources the right directory, and it does work from any folder now, so that took me a while to comprehend

So, if I'm not mistaken, you should be able to use

Code: [Select]
    subprocess.Popen(["c:\\foo\\dumpus.bat"], shell=True, cwd=(r'F:\\11\\'+path))
(Ideally, you would want to use os.path.join instead of ('F:\\11\\'+path), but let's forgo elegance.)

It seems it is specifically the "+path" part that is giving me problems with running the script, because without that part it works as before, listing the path, dirs, and files, then running dumpus.bat three times in F:\11. When I do try it as "cwd=(r'F:\\11\\' + path)" I get these messages:

Code: [Select]
Traceback (most recent call last):
  File "F:\11\test.py", line 10, in <module>
    subprocess.Popen(['F:\\11\\dumpus.bat'], shell=True, cwd=(r'F:\\11\\'+path))
  File "C:\Users\Name\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 769, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Name\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1172, in _execute_child
    startupinfo)
NotADirectoryError: [WinError 267]

It seems odd that the subprocess would cause the problem here, so I'm sure I'm doing something wrong somewhere that's causing the entire thing to process it incorrectly... I just have no idea where it's all going wrong.

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #15 on: December 07, 2018, 10:27:47 pm »
The clue you need is here:
Code: [Select]
NotADirectoryError: [WinError 267]

For whatever reason, ('F:\\11\\' + path) is not returning a valid path.  You can check what path it is generating with a "print" command, as before:
Code: [Select]
print(r'F:\\11\\' + path)
But looking again, it's pretty obvious why that doesn't work; I was confusing "path" with "dirs". Oops.

The line you actually need is just:
Code: [Select]
subprocess.Popen(["dumpus.bat"], shell=True, cwd=path)Makes sense?

You can also stop the program from running in an empty folder by writing:
Code: [Select]
if files:
    subprocess.Popen(["dumpus.bat"], shell=True, cwd=path)

(When "files" is an empty list, the if statement evaluates to false.)
« Last Edit: December 07, 2018, 10:33:51 pm by Jorpho »
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #16 on: December 09, 2018, 01:34:16 am »
Oh man, I got it working now! The cwd=path did the trick, so now I can run the script and watch the "MSG->TXT" messages roll in. Thanks so much for your help so far!

Now the only problem I have remaining is that the files that are too small to dump still cause the script to hang, though it only does that for the current folder. This means that I'll probably get 80 to 90% of the script dumped with this method, and then the patches of files that occur after the too-small files remain untouched, which is still a massive improvement over what I had so far.

To illustrate what is happening now:
Code: [Select]
Current location: F:\11\2
Folders: []
Filenames: ['1.msg', '1.txt', '2.msg', '2.txt', '3.msg', '4.msg', '5.msg', '6.msg', '7.msg']

F:\11\2>F:\11\DUMP F:\11\fonttbl.bin F:\11\rh.tbl *.msg

DUMP - Copyright (C) 2012 CUE
Script dumper for 'Radiant Historia' - Nintendo DS

- reading font: 'F:\11\fonttbl.bin'
- reading table: 'F:\11\rh.tbl'
- MSG->TXT: '1.msg'
- MSG->TXT: '2.msg'
- MSG->TXT: '3.msg'
File too short

I renamed some files to make an easier point, but 3.msg here is actually the ===============================================================================.msg I mentioned way earlier in this thread. It is also only 9 bytes large because, uh, I guess that's how many characters are in the file? The smallest file I could find after that was 23 bytes, which is totally fine and gets changed to a .txt file. I can't seem to use Windows Explorer's search function to look into .msg files for whatever, and all attempts to change the standard app for .msg files from Outlook to Notepad or whatever are blocked by an invisible wall, which is pain alright. Why do I even have Outlook? I never use it.

At this point I'm just going to uninstall Outlook if I can, change the standard app to Notepad, and try to cull the responsible files from there, but I don't know if that's going to work. We'll see, I guess.

-----
EDIT: Apparently Windows is being a real bastard here and won't allow me to change .msg files to a standard Notepad even though there is no Outlook. Heck, the extension name doesn't even show up in the part of the settings where you can choose standard apps per file extension. What nonsense.

-----
EDIT #2: Looking into code, I'm guessing I would need an "if os.path.getsize()" in my code to check for the too-short files so they can be skipped. I didn't know what the cut-off point would be, so I decided to go into the dumped ROM and search for .msg and sort them by size. After 9 bytes, there's also two .msg files sized at 10 bytes (too short) and six or so .msg files at 18 bytes.

And then it hit me I could just take all of the 9- and 10-byte files that showed up in the search results (135 of them, and I feel like most of them were in the part I had already changed manually) and delete them from there.

More fool me.

So unless we're all so incredibly invested that we want to do everything with Python code, I'll just back up the dumped ROM again, get rid of the 135 purveyors of dump-breaking doom, and run the code like that.

Thanks so much for your help, Jorpho.
« Last Edit: December 09, 2018, 08:01:18 am by Macuelos »

Jorpho

  • Hero Member
  • *****
  • Posts: 3935
  • The cat screams with the voice of a man.
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #17 on: December 09, 2018, 05:20:58 pm »
Now the only problem I have remaining is that the files that are too small to dump still cause the script to hang, though it only does that for the current folder. This means that I'll probably get 80 to 90% of the script dumped with this method, and then the patches of files that occur after the too-small files remain untouched, which is still a massive improvement over what I had so far.

There are a couple of options here.  One would be to figure out why the script hangs. It's possible there's some option in subprocess.popen that will do the trick, or something you can add to your .bat file, but I don't know what that would be.

Or you could just rename the files that are too small.  I think you can actually do this with the FORFILES command in Windows.  This should do:
Code: [Select]
FORFILES /s /c "cmd /c if @fsize < 20 ren @file *.ms!"Just be very careful you only run that command in the folder with the dumped files.

Quote
and all attempts to change the standard app for .msg files from Outlook to Notepad or whatever are blocked by an invisible wall, which is pain alright.
I'm not sure what you're doing, but the "Default Programs" control panel is the way to do that these days.

Quote
EDIT #2: Looking into code, I'm guessing I would need an "if os.path.getsize()" in my code to check for the too-short files so they can be skipped.
If you try to change your current script to skip individual files, then you'd have to change it so that it runs on every individual file instead of "*.msg".  Considering how many files there are, that could get messy.  Far easier to rename the troublesome files instead.
This depresses me. I feel like a goldfish right now...

Macuelos

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Script dumping Radiant Historia (DS)
« Reply #18 on: December 11, 2018, 07:07:07 am »
In any case, I've actually done what I set out to do and dumped the script with your help and a bit of Windows Explorer nonsense, which means my work here is done only just getting started.

...but not on this forum.