Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify if a ROM is supported based on its hash #1

Open
DLDrago opened this issue Feb 13, 2022 · 17 comments
Open

Verify if a ROM is supported based on its hash #1

DLDrago opened this issue Feb 13, 2022 · 17 comments

Comments

@DLDrago
Copy link

DLDrago commented Feb 13, 2022

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 . . .
@MeltyPlayer
Copy link
Owner

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 c6b67f6, 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?

@DLDrago
Copy link
Author

DLDrago commented Feb 13, 2022

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:

@MeltyPlayer
Copy link
Owner

MeltyPlayer commented Feb 13, 2022

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.

@DLDrago
Copy link
Author

DLDrago commented Feb 13, 2022 via email

@MeltyPlayer
Copy link
Owner

MeltyPlayer commented Feb 19, 2022

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?

@DLDrago
Copy link
Author

DLDrago commented Feb 19, 2022 via email

@MeltyPlayer
Copy link
Owner

MeltyPlayer commented Feb 19, 2022

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.

@DLDrago
Copy link
Author

DLDrago commented Feb 19, 2022 via email

@Alvin9301
Copy link

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

@DLDrago
Copy link
Author

DLDrago commented Feb 20, 2022 via email

@MeltyPlayer
Copy link
Owner

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.

@Alvin9301
Copy link

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

@DLDrago
Copy link
Author

DLDrago commented Feb 20, 2022

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,

@JamesO2x
Copy link

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?

@MasterKingSirPlease
Copy link

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.

@JamesO2x
Copy link

JamesO2x commented Nov 2, 2022

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:

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
Copy link

JamesO2x commented Nov 4, 2022

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

@MeltyPlayer MeltyPlayer changed the title Unhandled Exception when trying to dump Ocarina of Time 3D Verify if a ROM is supported based on its hash Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants