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

Compressed UnityWeb AssetBundles ignores asset header #80

Open
jnsnow opened this issue Apr 21, 2019 · 0 comments
Open

Compressed UnityWeb AssetBundles ignores asset header #80

jnsnow opened this issue Apr 21, 2019 · 0 comments

Comments

@jnsnow
Copy link

jnsnow commented Apr 21, 2019

Hi, as seen in asset.py:

"# FIXME: this offset needs to be explored more"

I have some information on this; the header appears to look something like:

struct asset_header {
    uint32_t num_assets;
    string   name;
    uint32_t offset;
    uint32_t size;
    uint8_t  padding[3]; /* ??? */
}

I'm not very familiar with UnityWeb files (except the ones in front of my own face), but these all have num_assets = 1 and a names of "CAB-{SHA1}". I assume that the name/offset/size objects are repeated for num_assets, and then we pad out to the nearest 4 byte boundary.

I assume that this logic could be hoisted up to AssetBundle, instead of assuming that compressed bundles always have one asset, and then the Asset constructor can take something like a decompressed buffer slice for [offset:offset+size] and be given the name from the header.

I don't have good testing infrastructure, though, so I'm afraid I will cause a regression for files I don't have in front of my face. Suggestions welcome.

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

No branches or pull requests

1 participant