Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Decompressing .mc files from TOTK #593

Closed
ctvicks opened this issue May 6, 2023 · 32 comments
Closed

Decompressing .mc files from TOTK #593

ctvicks opened this issue May 6, 2023 · 32 comments

Comments

@ctvicks
Copy link

ctvicks commented May 6, 2023

Hi, just wanted to know if anyone knows how to decompress .mc files from TOTK? It seems the models from the game are stored in that file format.

@zoalasaurusrawr
Copy link

I've had luck in reverse engineering parts of the file. The magic bytes are MCPK, but the file itself doesn't adhere to the MCPK format used by other games.

Within, you can find each file entry is actually a ZSTD stream, and most can be decompressed using ZSTD once split out from the original .mc file. All that said, I don't see any intelligible model files yet. I've had similar luck splitting .txtg, and while those files do look like the structure you'd expect from a binary stream of color data, they don't turn into anything interesting. Next up, I hope to try a variety of decoding attempts to see if I can get anything out.

@KillzXGaming
Copy link
Owner

KillzXGaming commented May 7, 2023

I've had luck in reverse engineering parts of the file. The magic bytes are MCPK, but the file itself doesn't adhere to the MCPK format used by other games.

Within, you can find each file entry is actually a ZSTD stream, and most can be decompressed using ZSTD once split out from the original .mc file. All that said, I don't see any intelligible model files yet. I've had similar luck splitting .txtg, and while those files do look like the structure you'd expect from a binary stream of color data, they don't turn into anything interesting. Next up, I hope to try a variety of decoding attempts to see if I can get anything out.

Do you know how the format is structured? I couldn't make out how the zstd data is being done, like where is starts/ends and where the frames are at. It seems different than usual as it lacks the typical zstd identifier.

@zoalasaurusrawr
Copy link

I haven’t gotten that far for .Mc files but I have a bit for txtg!!

https://gist.github.com/zoeysaurusrex/0c8a1ae2e218d1c76959765bf9e9c408

@zoalasaurusrawr
Copy link

@KillzXGaming I misspoke here. I’ve been looking at the data so closely for the last week that I mixed up the model files with txtg. The thing I found in the model files are FMSH tags that seem to separate content, but I haven’t gotten further than that.

I suspect that FMSH stands for caFe Mesh much like with FMDL and FVTX.

@guighub
Copy link

guighub commented May 15, 2023

An update on this? Is there a method to decompress these .mc files yet?

@KillzXGaming
Copy link
Owner

KillzXGaming commented May 16, 2023

mc files can be decompressed with zstd using magicless headers, compressed data starts at 0xC. Though due to strings being externally loaded and the FMSH section (stores additionally compressed data that hasn't been figured out yet) we cannot rip models still and will likely be awhile.

@Rigodron
Copy link

It's meshcodec compressed. I cant really say how to decompress them, but i have some tracks.

@guighub
Copy link

guighub commented May 27, 2023

I tried trimming everything before 0x0C on the .mc file then decompressing with ZSTD, but Toolbox still says the decompression failed. What am I doing wrong? I think I have a tool that can import the compressed bfres, or at least it can with the Splatoon 3 ones. I don't know if the format has been updated since.

@Rigodron
Copy link

It's normal, you have more things to take into account like the dictionary that must be in the executable, the size of the window, etc. For the moment I'm trying to grab the MeshCodecDecompression thread contained in the got.plt.

@KillzXGaming
Copy link
Owner

The zstd is magicless so it can't be decompressed with it and the zstd cli tool doesn't support the magicless setting either. It would have to be manually set in code with the official zstd library or some wrapper for it using the setFormat function.

@Rigodron
Copy link

The zstd is magicless so it can't be decompressed with it and the zstd cli tool doesn't support the magicless setting either. It would have to be manually set in code with the official zstd library or some wrapper for it using the setFormat function.

Of course, but it's better to go and see how it works than to do it blindly.

@DoMx
Copy link

DoMx commented May 27, 2023

Hi all - I know nothing about code and/or ripping. Good start. I did, however, stumble across a person that has claimed to have ripped TOTK models and posted image 'proof' so I thought I'd share in case their method unlocks anything here.

Thread: https://twitter.com/Avovet3D/status/1660886535418552320

Posting here in case they delete/lock their Twitter:

Is that... helpful?

@Rigodron
Copy link

Hi all - I know nothing about code and/or ripping. Good start. I did, however, stumble across a person that has claimed to have ripped TOTK models and posted image 'proof' so I thought I'd share in case their method unlocks anything here.

Thread: https://twitter.com/Avovet3D/status/1660886535418552320

Posting here in case they delete/lock their Twitter:

Is that... helpful?

This isn't bad for those who only want models for other things, however, this technique doesn't allow you to have the native models or a conversion back to the original format.

@XDM-Inc
Copy link

XDM-Inc commented May 28, 2023

Hi all - I know nothing about code and/or ripping. Good start. I did, however, stumble across a person that has claimed to have ripped TOTK models and posted image 'proof' so I thought I'd share in case their method unlocks anything here.

Thread: https://twitter.com/Avovet3D/status/1660886535418552320

Posting here in case they delete/lock their Twitter:

* ok so you know renderdoc right?

* you hook it into ryujinx in vulkan and use an fbx exporter to extract the models

* https://github.com/FXTD-ODYSSEY/renderdoc2fbx

Is that... helpful?

i thought that renderdoc2fbx plugin was abandoned LONG ago, i NEVER got it working on linux OR windows.
i just do the old csv method

@Odinv24
Copy link

Odinv24 commented May 28, 2023

So i used the recommended addon yet, when exporting the fbx its just empty

@CloudOniiKun
Copy link

So i used the recommended addon yet, when exporting the fbx its just empty

Yeah, I've been having the same issue. Not to mention I have to convert it from ASCII to Binary because blender doesn't like ASCII FBX format.

@Odinv24
Copy link

Odinv24 commented May 28, 2023

So i used the recommended addon yet, when exporting the fbx its just empty

Yeah, I've been having the same issue. Not to mention I have to convert it from ASCII to Binary because blender doesn't like ASCII FBX format.

yea idk what that person on twitter did or if they just lied cause that specific link i have seen often

@KillzXGaming
Copy link
Owner

You can now decompress .mc files using https://gamebanana.com/tools/13236

As of the latest version, I've added support for the decompressed .bfres that use external buffer/string data. Editing will not work but may eventually get figured out with some other alteratives.

@Odinv24
Copy link

Odinv24 commented May 28, 2023

You can now decompress .mc files using https://gamebanana.com/tools/13236

As of the latest version, I've added support for the decompressed .bfres that use external buffer/string data. Editing will not work but may eventually get figured out with some other alteratives.

how do we extract the textures now

@Hayden-Fluff
Copy link

I feel like this issue was closed prematurely, as the application itself doesn't yet support decompressing the files to my knowledge, and from what I can tell there's no way to do this without an actual console, of which I cannot mod my own due to it being too recent of a revision.
Are there any other known alternatives that would let me decompress just from the game ROM itself?

@KillzXGaming
Copy link
Owner

At this time I don't plan to support it. Afaik the plugin supports v1.1.2 and works with Ryujinx aswell.

@CloudOniiKun
Copy link

You can now decompress .mc files using https://gamebanana.com/tools/13236
As of the latest version, I've added support for the decompressed .bfres that use external buffer/string data. Editing will not work but may eventually get figured out with some other alteratives.

how do we extract the textures now

If you figure this out, could you give an update? Seems Toolbox can see the textures, but I can't seem to export any. Cheers.

@XDM-Inc
Copy link

XDM-Inc commented May 29, 2023

Brilliant! I got to test this!

@AdamK2003
Copy link

AdamK2003 commented May 29, 2023

You can now decompress .mc files using gamebanana.com/tools/13236
As of the latest version, I've added support for the decompressed .bfres that use external buffer/string data. Editing will not work but may eventually get figured out with some other alteratives.

how do we extract the textures now

If you figure this out, could you give an update? Seems Toolbox can see the textures, but I can't seem to export any. Cheers.

you'll need to extract the .txtg files in the TexToGo folder, they have the textures, I recommend putting both the .dae files and the textures in the same dir without subfolders and messing around with blender scripts to convert to fbx or something (at least that's what I did) if you wanna actually work with the files

here's the script I used

@CloudOniiKun
Copy link

You can now decompress .mc files using gamebanana.com/tools/13236
As of the latest version, I've added support for the decompressed .bfres that use external buffer/string data. Editing will not work but may eventually get figured out with some other alteratives.

how do we extract the textures now

If you figure this out, could you give an update? Seems Toolbox can see the textures, but I can't seem to export any. Cheers.

you'll need to extract the .txtg files in the TexToGo folder, they have the textures, I recommend putting both the .dae files and the textures in the same dir without subfolders and messing around with blender scripts to convert to fbx or something (at least that's what I did) if you wanna actually work with the files

here's the script I used

Much appreciated, got the textures, I was just being dumb and for some reason assumed they were packaged with the mesh data. You're a star!

@XDM-Inc
Copy link

XDM-Inc commented May 30, 2023

You can now decompress .mc files using https://gamebanana.com/tools/13236
As of the latest version, I've added support for the decompressed .bfres that use external buffer/string data. Editing will not work but may eventually get figured out with some other alteratives.

how do we extract the textures now

If you figure this out, could you give an update? Seems Toolbox can see the textures, but I can't seem to export any. Cheers.

I found out a easier way to get textures out from the switch toolbox. Read it HERE pretty much just use switch toolbox to browse that textogo folder and it has all the textures that can be loaded and extracted.

@CharlesRBLX
Copy link

ayo i mantaged to port ganon.

tear and forehead thingy werent workin in blender so i was lazy.
image

@CharlesRBLX
Copy link

its rigged.

@MykytaLialka
Copy link

001
dive in this stuff only for Purah references. Ask if you need help)

@GreatPepperoni
Copy link

How do you extract the models from the .BFRES files? I've tried using Switch Toolbox, but I havent gotten it to work.

@CharlesRBLX
Copy link

its not .bfres, its .mc

@Hayden-Fluff
Copy link

You can now decompress .mc files using https://gamebanana.com/tools/13236

As of the latest version, I've added support for the decompressed .bfres that use external buffer/string data. Editing will not work but may eventually get figured out with some other alteratives.

I can also now confirm that this tool works with Yuzu as well, at least with the 1.1.0 patch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests