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

Crash reading Bundle #58

Open
johnwhile opened this issue Nov 20, 2021 · 7 comments
Open

Crash reading Bundle #58

johnwhile opened this issue Nov 20, 2021 · 7 comments

Comments

@johnwhile
Copy link

johnwhile commented Nov 20, 2021

Hi, i'm trying to read a bundle file from a game but the code crash at:

        public string GetFileName(int index)
        {
            if (bundleHeader3 != null)
                return assetsLists3.entries[index].name;

            if (bundleHeader6 != null)
                return bundleInf6.dirInf[index].name;

            return null;
        }

with NullExeption for "bundleInf6.dirInf"

var am = new AssetsManager();
var bun = am.LoadBundleFile("shape");
//load first asset from bundle
var assetInst = am.LoadAssetsFileFromBundle(bun, 0, true);

ths file "shape" without extension start with bytes: "UnityFS �5.x.x 2021.1.17f1". It contains a list of fbx files that I have already extracted with the AssetStudioGui program but I would like to manage the extraction in my tool.

@nesrak1
Copy link
Owner

nesrak1 commented Nov 20, 2021

I don't know what would cause this to happen unless the file was still compressed (by default, the bundle is decompressed, so no idea.) It could be a new bundle format for 2021.1, but I would expect a different error than that. Could you double check that bun.file.bundleHeader6.GetCompressionType() is 0?

@johnwhile
Copy link
Author

return 0.
It crash when i set "UnpackIfPacked = false".
If "true" it work.

@johnwhile
Copy link
Author

johnwhile commented Nov 21, 2021 via email

@nesrak1
Copy link
Owner

nesrak1 commented Nov 21, 2021

But i don't understand how read all fbx's file inside this file.

There are no fbx files in assets files, only assets like mesh and material. Tools like AssetStudio combine and convert these assets into fbx. AssetsTools doesn't have any extractors, so you can't do fbx conversion with this tool.

@johnwhile
Copy link
Author

johnwhile commented Nov 21, 2021 via email

@johnwhile
Copy link
Author

johnwhile commented Nov 21, 2021 via email

@johnwhile
Copy link
Author

johnwhile commented Nov 21, 2021 via email

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

2 participants