MeltyTool icon indicating copy to clipboard operation
MeltyTool copied to clipboard

Verify if a ROM is supported based on its hash

Open DLDrago opened this issue 3 years ago • 17 comments

I've done the setup, and first, it looked like it hung up so I canceled it, and now every time I try to decompress the CIA, it says Unhandled Exception and that it couldn't create the RomFS folder.

This is what I get when trying to run the program:

E:\ROMS\3DS\FinModelUtility-main\cli>tools\universal_model_extractor\universal_model_extractor.exe ocarina_of_time_3d
Dumping ROM E:\ROMS\3DS\FinModelUtility-main\cli\roms\ocarina_of_time_3d.cia...
Unhandled exception. fin.util.asserts.Asserts+AssertionException: Directory was not created: E:\ROMS\3DS\FinModelUtility-main\cli\tools\HackingToolkit9DSv12\ExtractedRomFS
   at uni.platforms.threeDs.tools.HackingToolkit9ds.Run(IFile romFile, IFileHierarchy& hierarchy) in R:\Documents\CSharpWorkspace\Pikmin2Utility\FinModelUtility\UniversalModelExtractor\src\platforms\threeDs\tools\HackingToolkit9ds.cs:line 49
   at uni.platforms.threeDs.ThreeDsFileHierarchyExtractor.ExtractFromRom(IFile romFile, ISet`1 junkTerms) in R:\Documents\CSharpWorkspace\Pikmin2Utility\FinModelUtility\UniversalModelExtractor\src\platforms\threeDs\ThreeDsFileHierarchyExtractor.cs:line 16
   at uni.games.ocarina_of_time_3d.OcarinaOfTime3dExtractor.ExtractAll() in R:\Documents\CSharpWorkspace\Pikmin2Utility\FinModelUtility\UniversalModelExtractor\src\games\ocarina_of_time_3d\OcarinaOfTime3dExtractor.cs:line 114
   at uni.cli.Cli.<>c.<Main>b__0_6(OcarinaOfTime3dOptions _) in R:\Documents\CSharpWorkspace\Pikmin2Utility\FinModelUtility\UniversalModelExtractor\src\cli\Cli.cs:line 62
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at uni.cli.Cli.Main(String[] args) in R:\Documents\CSharpWorkspace\Pikmin2Utility\FinModelUtility\UniversalModelExtractor\src\cli\Cli.cs:line 26

E:\ROMS\3DS\FinModelUtility-main\cli>pause
Press any key to continue . . .

DLDrago avatar Feb 13 '22 04:02 DLDrago

Thanks for reporting this issue! I just tested this out myself and was able to reproduce these results by not having HackingToolkit9ds installed, so it looks like your setup did fail unfortunately.

I've improved this error message in commit c6b67f684770d3cfa286cef32407cbb3238b8ea8, so it's more clear that not having HackingToolkit9ds installed is the cause of the problem.

Can you try installing HackingToolkit9ds again and see if it works this time?

MeltyPlayer avatar Feb 13 '22 09:02 MeltyPlayer

I've tried to install the Hacking Toolkit with the new branch, but the command still fails. Same error. A bunch of files starting with "Decrypted" do show up in the directory of the hacking toolkit, though:

DLDrago avatar Feb 13 '22 13:02 DLDrago

Thanks for giving that a try.

Could you post the error message(s) you're getting, is it exactly the same message? It's still "ExtractedRomFS" that's missing? I ask because there are a couple of error checks in a row that look fairly similar but have different directory names.

MeltyPlayer avatar Feb 13 '22 18:02 MeltyPlayer

Yeah, it's the same message.

On Sun, Feb 13, 2022 at 12:30 PM MeltyPlayer @.***> wrote:

Could you post the error message(s) you're getting, is it exactly the same message? It's still "ExtractedRomFS" that's missing?

— Reply to this email directly, view it on GitHub https://github.com/MeltyPlayer/FinModelUtility/issues/1#issuecomment-1038323986, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBYUYIOPEHSNLSRQYVF4ITU272DTANCNFSM5OIFNB6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

DLDrago avatar Feb 13 '22 18:02 DLDrago

I haven't been able to reproduce the error you're describing, unfortunately, but given that you're seeing "Decrypted" files it looks like you must have been able to install HackingToolkit9ds.

Can you delete those extra files and try to run HackingToolkit9ds directly (cli\tools\HackingToolkit9DSv12\HackingToolkit9DS.exe) to see what happens when you extract the contents of the ROM? Does it give any error messages?

MeltyPlayer avatar Feb 19 '22 02:02 MeltyPlayer

It says "Extraction Done' after less than a second.

On Fri, Feb 18, 2022 at 8:54 PM MeltyPlayer @.***> wrote:

I haven't been able to reproduce the error you're describing, unfortunately, but given that you're seeing "Decrypted" files it looks like you must have been able to install HackingToolkit9ds.

Can you try to run HackingToolkit9ds directly ( cli\tools\HackingToolkit9DSv12\HackingToolkit9DS.exe) and see what happens when you extract the contents of the ROM? Does it give any error messages?

— Reply to this email directly, view it on GitHub https://github.com/MeltyPlayer/FinModelUtility/issues/1#issuecomment-1045616099, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBYUYLWWQIPC6AMEOQ6KR3U34A6DANCNFSM5OIFNB6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

DLDrago avatar Feb 19 '22 15:02 DLDrago

Hmm, sounds like it's not throwing any errors then.

Could you give more details on the file you're using and the output?

  • Is this the North American release of Ocarina of Time 3D? If so, could you calculate the SHA of the .cia to verify it's the same as the one I'm working with? (I think dragging the file onto the following site should work to calculate this: https://emn178.github.io/online-tools/sha256_checksum.html)
  • Could you include screenshot(s) of what files are within cli\tools\HackingToolkit9DSv12 directory and its subdirectories? I'm expecting a very specific file structure to be created here, but it's generating something different on your machine.

MeltyPlayer avatar Feb 19 '22 17:02 MeltyPlayer

It's the North American release, dumped from my own copy. Screenshot attached.

On Sat, Feb 19, 2022 at 11:33 AM MeltyPlayer @.***> wrote:

Hmm, sounds like it's not throwing any errors then.

Could you give more details on the file you're using and the output?

  • Is this the North American release of Ocarina of Time 3D?
  • Could you include screenshot(s) of what files are within cli\tools\HackingToolkit9DSv12 directory and its subdirectories? I'm expecting a very specific file structure to be created here, but it's generating something different on your machine.

— Reply to this email directly, view it on GitHub https://github.com/MeltyPlayer/FinModelUtility/issues/1#issuecomment-1046068017, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBYUYPP54WE7DMY2FCUOP3U37H6VANCNFSM5OIFNB6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

DLDrago avatar Feb 19 '22 17:02 DLDrago

Use this rom instead. https://www.mediafire.com/file/v7x1mvvd69bt4si/ocarina_of_time_3d.cia/file Dumps flawlessly.

Alvin9301 avatar Feb 20 '22 02:02 Alvin9301

That worked. Thank you.

On Sat, Feb 19, 2022 at 8:21 PM Alvin @.***> wrote:

Use this rom instead. https://www.mediafire.com/file/v7x1mvvd69bt4si/ocarina_of_time_3d.cia/file Dumps flawlessly.

— Reply to this email directly, view it on GitHub https://github.com/MeltyPlayer/FinModelUtility/issues/1#issuecomment-1046145648, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBYUYL6HC7KUS3G2L6JN5LU4BFZFANCNFSM5OIFNB6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

DLDrago avatar Feb 20 '22 02:02 DLDrago

Glad to hear it's working now. Thanks for the help with figuring this out, @Alvin9301!

I've been considering adding a line that verifies checksums for each ROM, look like this is indeed an issue. I'll need to look into adding this check so I can display a better error message here.

MeltyPlayer avatar Feb 20 '22 08:02 MeltyPlayer

Glad to help. :) I wasn't sure how I got it working on my end. But I remember it being trail and error regarding obtaining the correct rom. Vaguely recall that it had to do with some of the pre-decrypted ones being bad. This rom I got was one of these US unaltered rom uploads. I think it was this one: https://www.cia-3ds.com/2019/08/the-legend-of-zelda-ocarina-of-time-3d.html

Alvin9301 avatar Feb 20 '22 09:02 Alvin9301

Ah. Yeah, I used GodMode9 to extract my game. I think I read on a guide that it shouldn't be a version extracted by GodMode9,

DLDrago avatar Feb 20 '22 14:02 DLDrago

Does this Utility only convert the Actor Models to FBX and GLTF? Because I just ran utility using all the help here, and the program stops after converting just the actors, it doesn't seem to convert the "scene" files -- which is what I'm interested in.

The full RomFS folder is properly extracted, but the "out" folder for the game only contains a single "actor" folder. No "scenes".

The last couple lines of the command prompt looks like this:

Extracting model \actor\zelda_zl1\Model\childzelda.cmb
Writing to Z:\OoT-Dump\FinModelUtility-main\cli\out\ocarina_of_time_3d\actor\zelda_zl1\childzelda.glb...
Writing to Z:\OoT-Dump\FinModelUtility-main\cli\out\ocarina_of_time_3d\actor\zelda_zl1\childzelda_gltf.glb...

Extracting model \actor\zelda_zl2\Model\zelda.cmb
Writing to Z:\OoT-Dump\FinModelUtility-main\cli\out\ocarina_of_time_3d\actor\zelda_zl2\zelda.glb...
Writing to Z:\OoT-Dump\FinModelUtility-main\cli\out\ocarina_of_time_3d\actor\zelda_zl2\zelda_gltf.glb...

Extracting model \actor\zelda_zl4\Model\childzelda.cmb
Writing to Z:\OoT-Dump\FinModelUtility-main\cli\out\ocarina_of_time_3d\actor\zelda_zl4\childzelda.glb...
Writing to Z:\OoT-Dump\FinModelUtility-main\cli\out\ocarina_of_time_3d\actor\zelda_zl4\childzelda_gltf.glb...

Extracting model \actor\zelda_zo\Model\zorapeople.cmb
Writing to Z:\OoT-Dump\FinModelUtility-main\cli\out\ocarina_of_time_3d\actor\zelda_zo\zorapeople.glb...
Writing to Z:\OoT-Dump\FinModelUtility-main\cli\out\ocarina_of_time_3d\actor\zelda_zo\zorapeople_gltf.glb...


Z:\OoT-Dump\FinModelUtility-main\cli>pause
Press any key to continue . . .

So after it extracts the Zora People models, it just runs into a PAUSE command. Pressing enter just closes the CMD prompt. Can I not get the SCENE models from this utility?

JamesO2x avatar Jun 28 '22 22:06 JamesO2x

I was having the same issue until I realized you were specific in the video about "a local directory on your machine." I was doing this on an SD card previously.

MasterKingSirPlease avatar Jul 30 '22 03:07 MasterKingSirPlease

Any chance on an update for this issue? I'm looking to export the Majora's Mask 3D scene files. My problem is that I don't know anything about C#, or much about working in binary... so I don't have a clue on how to use this. And about half of Majora's Mask "scene" files are in .zsi files, but appear to be LZSS compressed (first 3 bytes of the file are LzS, before the ZSI header)

Let me clarify my question a bit:

  • So you've already created a LZSS decompressor for FinModelUtility. Which currently only supports OoT3D
  • I'm guessing that LZSS decompressor is this file: https://github.com/MeltyPlayer/FinModelUtility/blob/792c183a42761cc72f4a93dddff2faf607b9e309/FinModelUtility/UniversalModelExtractor/src/platforms/threeDs/tools/LzssDecompressor.cs
  • The tools are already here, but I have no idea how to use them.

I just need a simple tool to convert a compressed MM3D ZSI scene file, into an uncompressed one. It doesn't need to be a robust "do everything on the whole ROM all at once" utility. I've already extracted the ROM FS into individual ZSI files. I just need a tool to uncompress them, and I can't seem to find one. Every tool currently out there does Decompression AND a bunch of other things.

Is there any chance you could compile the decompressor into its own simple exe that can be run on the command line? That way I could just do something like decode.exe C:\myfile.zsi ?

Either that or explain how I might go about creating a BAT file myself for FinModelUtility that would run the decompressor on a select few Majora ZSI files?

JamesO2x avatar Nov 02 '22 23:11 JamesO2x

Never mind, I figured it out myself and wrote a python tool that decodes ZSI files: JamesO2x/Py-MM3D-LZSS-decompressor-to-CMB

JamesO2x avatar Nov 04 '22 02:11 JamesO2x