ROM Hack [Release] Every File Explorer

Gericom

Well-Known Member
OP
Member
Joined
Jun 30, 2011
Messages
1,381
Trophies
2
Age
25
XP
4,685
Country
Netherlands
Coverted a wav to bcstm, and imported using the theme tool. It plays, but does this...
(m4a file)

It's nice that it plays, but it shouldn't have all the weird sounds. For the record, I converted from a mono wav file.

edit:
And rebooting the 3ds fixed it. Odd.

If you could figure out how to set the bcstm's to loop, that would be very nice! I also don't know much about audio compression, but a way to lower the file size would also be amazing. I don't know how any of this works, so if what I ask is impossible, I apologize.

I know how to do it, but I need to make it configurable. For filesize, once I implement DSPADPCM compression, it will be smaller.
 
D

Deleted User

Guest
Would you possibly be able to take a look into these files?

They're from Final Fantasy Explorers and are used in a few square Enix games, if memory serves, back on the original DS.

These are 2 different files, both have blz headers and no extensions, but one is a CGFX file and the other is a BCH file (within what I assume is blz compression?).

https://dl.dropboxusercontent.com/u/7797280/1169173603
https://dl.dropboxusercontent.com/u/7797280/1893811619

I can decompress them using a blz tool (I've supplied to the source and exe too), they're a lot cleaner but I still can't make most of it out, I can see that its models, textures and various other files (including bclim) but this is where my knowledge ends really).

blz.exe
blz.c
 

ouioui2003

Well-Known Member
Member
Joined
Feb 19, 2012
Messages
204
Trophies
0
XP
98
Country
France
Hi,

A bug in the CreateNew NDS function.
With Ninokuni Japanese rom, some filenames haven't good chars and raise a error when create the project.

System.ArgumentException: illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.File.Create(String path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at NDS.NDSProject.CreateNew()
at EveryFileExplorer.Form1.CreateNewProject_Click(Object sender, EventArgs e)



I have modified the Export function in SFSDirectory.cs, to replace all illlegalCharacters in the filename, and the project is correctly exported.

But now, this project cannot use the build function because the names are not correct, and generate a OutofMemory Error.

Maybe you could store in the project function all the illegal filenames, and use them intead of those found on the disk.
Have you got another solution ?



Code:
        private static string MakeValidFileName(string name)
        {
            string invalidChars = System.Text.RegularExpressions.Regex.Escape(new string(System.IO.Path.GetInvalidFileNameChars()));
            string invalidRegStr = string.Format(@"([{0}]*\.+$)|([{0}]+)", invalidChars);
 
            return System.Text.RegularExpressions.Regex.Replace(name, invalidRegStr, "_");
        } 
 
        public void Export(String Path)
        {
           
 
            foreach (var v in Files)
            {
 
                System.IO.File.Create(Path + "\\" + MakeValidFileName(v.FileName)).Close();
                System.IO.File.WriteAllBytes(Path + "\\" + MakeValidFileName(v.FileName), v.Data);
            }
            foreach (var v in SubDirectories)
            {
                System.IO.Directory.CreateDirectory(Path + "\\" + v.DirectoryName);
                v.Export(Path + "\\" + v.DirectoryName);
            }
        }
 

Gericom

Well-Known Member
OP
Member
Joined
Jun 30, 2011
Messages
1,381
Trophies
2
Age
25
XP
4,685
Country
Netherlands
Would you possibly be able to take a look into these files?

They're from Final Fantasy Explorers and are used in a few square Enix games, if memory serves, back on the original DS.

These are 2 different files, both have blz headers and no extensions, but one is a CGFX file and the other is a BCH file (within what I assume is blz compression?).

https://dl.dropboxusercontent.com/u/7797280/1169173603
https://dl.dropboxusercontent.com/u/7797280/1893811619

I can decompress them using a blz tool (I've supplied to the source and exe too), they're a lot cleaner but I still can't make most of it out, I can see that its models, textures and various other files (including bclim) but this is where my knowledge ends really).

blz.exe
blz.c

These are archives? It sounds interesting. I will have a look at them.
Hi,

A bug in the CreateNew NDS function.
With Ninokuni Japanese rom, some filenames haven't good chars and raise a error when create the project.

System.ArgumentException: illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.File.Create(String path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at LibEveryFileExplorer.Files.SimpleFileSystem.SFSDirectory.Export(String Path)
at NDS.NDSProject.CreateNew()
at EveryFileExplorer.Form1.CreateNewProject_Click(Object sender, EventArgs e)


I have modified the Export function in SFSDirectory.cs, to replace all illlegalCharacters in the filename, and the project is correctly exported.

But now, this project cannot use the build function because the names are not correct, and generate a OutofMemory Error.

Maybe you could store in the project function all the illegal filenames, and use them intead of those found on the disk.
Have you got another solution ?



Code:
        private static string MakeValidFileName(string name)
        {
            string invalidChars = System.Text.RegularExpressions.Regex.Escape(new string(System.IO.Path.GetInvalidFileNameChars()));
            string invalidRegStr = string.Format(@"([{0}]*\.+$)|([{0}]+)", invalidChars);
 
            return System.Text.RegularExpressions.Regex.Replace(name, invalidRegStr, "_");
        }
 
        public void Export(String Path)
        {
         
 
            foreach (var v in Files)
            {
 
                System.IO.File.Create(Path + "\\" + MakeValidFileName(v.FileName)).Close();
                System.IO.File.WriteAllBytes(Path + "\\" + MakeValidFileName(v.FileName), v.Data);
            }
            foreach (var v in SubDirectories)
            {
                System.IO.Directory.CreateDirectory(Path + "\\" + v.DirectoryName);
                v.Export(Path + "\\" + v.DirectoryName);
            }
        }

Are the names read correctly from the rom (aka if you open the rom, do you see the names correctly)? If yes, how did they ever pack the rom with invalid characters?
 

mustafag32g

Well-Known Member
Member
Joined
Jul 30, 2014
Messages
806
Trophies
0
Age
34
XP
2,331
Country
Argentina
These are archives? It sounds interesting. I will have a look at them.


Are the names read correctly from the rom (aka if you open the rom, do you see the names correctly)? If yes, how did they ever pack the rom with invalid characters?


Ccould you post an exe file of your updated program, that would be very nice :D
 

tyons

Well-Known Member
Member
Joined
Jul 11, 2012
Messages
657
Trophies
1
XP
282
Country
Italy

the same thing happened to me and what solved the problem was opening the wav with audacity, delete all the metadata and save the changes (everyfileexplorer still gave the second error when closing, but it wasn't a problem, since the creation of the bcstm was successful).
 
  • Like
Reactions: I pwned U!

Gericom

Well-Known Member
OP
Member
Joined
Jun 30, 2011
Messages
1,381
Trophies
2
Age
25
XP
4,685
Country
Netherlands
the same thing happened to me and what solved the problem was opening the wav with audacity, delete all the metadata and save the changes (everyfileexplorer still gave the second error when closing, but it wasn't a problem, since the creation of the bcstm was successful).

That error is related to playing audio. I think it is not closed correctly or something.
 
  • Like
Reactions: tyons

I pwned U!

I am pleased to beat you!
Member
Joined
Jun 14, 2013
Messages
927
Trophies
3
Age
28
Website
gbatemp.net
XP
680
Country
United States
the same thing happened to me and what solved the problem was opening the wav with audacity, delete all the metadata and save the changes (everyfileexplorer still gave the second error when closing, but it wasn't a problem, since the creation of the bcstm was successful).

Thank you! I will try this when I have the chance.
 
  • Like
Reactions: The Cringe
D

Deleted User

Guest
These are archives? It sounds interesting. I will have a look at them.

Yes, or at least they appear to be, I'm not expert at any of this but I'm pretty sure they are, having no file extension is a bit irritating though, having no filenames evenmore so though, but thats how they came out of the ROMFS.bin unfortunatly.

I've actually got a number of model formats ready to be checked out, from Fantasy Life, Attack of the Friday Monsters, Final Fantasy Explorers and Yokai Watch, along with PersonaQ.

Figured I'd just post one every now and then if the interest in the files is high enough, some of them I have scripts to extract most of the data, others I've got nothing at all.

So far this tool has been super useful in checking out the Bravely Default files, though when a scenes polycount is a bit high things start to really slow down bigtime, I've got a powerful machine here so I know its not that, but eitherway its a minor problem, doesn't stop me or anyone else using this awesome tool of yours.
 

ouioui2003

Well-Known Member
Member
Joined
Feb 19, 2012
Messages
204
Trophies
0
XP
98
Country
France
Are the names read correctly from the rom (aka if you open the rom, do you see the names correctly)? If yes, how did they ever pack the rom with invalid characters?

The rom is correctly open with other tools like nitroexplorer or tinke, and i don't know the way these tools handle this trouble.
I suspect that the rom use one japanese char in some filenames. Your tool use the system, and mine is from europe that don't have that kind of chars intalled. In debug mode, the first incorrect Filename show two question-marks in the name, and that hang the export process.
With my custom export function, all ? are replaced with _ and export is sucessful, but no way to rebuild after.
 

Gericom

Well-Known Member
OP
Member
Joined
Jun 30, 2011
Messages
1,381
Trophies
2
Age
25
XP
4,685
Country
Netherlands
The rom is correctly open with other tools like nitroexplorer or tinke, and i don't know the way these tools handle this trouble.
I suspect that the rom use one japanese char in some filenames. Your tool use the system, and mine is from europe that don't have that kind of chars intalled. In debug mode, the first incorrect Filename show two question-marks in the name, and that hang the export process.
With my custom export function, all ? are replaced with _ and export is sucessful, but no way to rebuild after.

Maybe I should read the names with UTF8 instead of ASCII. I never tested japanese roms.
 

ouioui2003

Well-Known Member
Member
Joined
Feb 19, 2012
Messages
204
Trophies
0
XP
98
Country
France
Maybe I should read the names with UTF8 instead of ASCII. I never tested japanese roms.

For the Outofmemory Error with the build function, i have solve it. I just compile EFE in 64b mode instead of x86.
the rom is simply too big with x86, and the buffer is too large. So WriteBuffer(count, 1) in function Write in EndianBinaryWriter.cs hang.
I will try to change the way you handle the buffer, to see if that change something.

For the export function, i have try UTF8 and it's not the correct solution. The export process work, but the filename isn't the same on the filesystem and in the rom built after. So i suspect the game could hang with that.
 

Gericom

Well-Known Member
OP
Member
Joined
Jun 30, 2011
Messages
1,381
Trophies
2
Age
25
XP
4,685
Country
Netherlands
For the Outofmemory Error with the build function, i have solve it. I just compile EFE in 64b mode instead of x86.
the rom is simply too big with x86, and the buffer is too large. So WriteBuffer(count, 1) in function Write in EndianBinaryWriter.cs hang.
I will try to change the way you handle the buffer, to see if that change something.

For the export function, i have try UTF8 and it's not the correct solution. The export process work, but the filename isn't the same on the filesystem and in the rom built after. So i suspect the game could hang with that.
How big is that rom? (it might also be that something goes wrong due to the names)

You would have to read the names in UTF8 in NitroFS.cs (edit both EntryNameTableFileEntry and EntryNameTableDirectoryEntry).
 

Gericom

Well-Known Member
OP
Member
Joined
Jun 30, 2011
Messages
1,381
Trophies
2
Age
25
XP
4,685
Country
Netherlands
For the Outofmemory Error with the build function, i have solve it. I just compile EFE in 64b mode instead of x86.
the rom is simply too big with x86, and the buffer is too large. So WriteBuffer(count, 1) in function Write in EndianBinaryWriter.cs hang.
I will try to change the way you handle the buffer, to see if that change something.

For the export function, i have try UTF8 and it's not the correct solution. The export process work, but the filename isn't the same on the filesystem and in the rom built after. So i suspect the game could hang with that.
I had a look at it, and it seems to contain some names with invalid characters indeed. I have no idea how these names have ended up in the rom. I think it is a problem of the rom and not a problem of EFE. Regarding the OutOfMemory Exception, this is because the rom is very big. The one I downloaded was 512 MB! I have never seen such a big NDS Rom to be honest. I was quite surprised that EFE did not even crash when opening it.
 
D

Deleted User

Guest
Would it be possible to request support for bctex files at all?

Currently the editor is fantastic for viewing anything 3D but it only tries to accept this as a 3d file eventhough its not, I can share a bctex or 2 if you don't have any to test with.

Thankyou.
 

Gericom

Well-Known Member
OP
Member
Joined
Jun 30, 2011
Messages
1,381
Trophies
2
Age
25
XP
4,685
Country
Netherlands
Would it be possible to request support for bctex files at all?

Currently the editor is fantastic for viewing anything 3D but it only tries to accept this as a 3d file eventhough its not, I can share a bctex or 2 if you don't have any to test with.

Thankyou.
BCTEX support is on the planning already, but I need to change the GUI like the NSBMD viewer to support different sections. I will do that soon.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtu.be/MddR6PTmGKg?si=mU2EO5hoE7XXSbSr