The tool to pack and unpack UnityWebData 1.0 files
Project description
This document was translated from Korean to English with the help of ChatGPT.
If you find any mistranslations or unclear expressions, please feel free to open an issue.
UWDTool
A tool for extracting, packing, or inspecting the contents of data files used in Unity WebGL games, including assets and other related resources.
Supports processing of *.unityweb files used in Unity 2019 and earlier versions.
What Is UnityWebData
A UnityWebData file is a file that is loaded and used in conjunction with a WebAssembly file in a WebGL game, primarily a file that combines all of the asset, resource, and metadata files.
Installation and Usage
Installation
[!NOTE] Python 3.9 or higher is required.
pip install uwdtool
CLI
uwdtool [-h] [-p | -u | -isp] [-i ARG_INPUT] [-o ARG_OUTPUT] [-c {brotli,gzip,none}]
-
-h,--help: Displays help and information about the program. -
-p,--pack: Packs the files in the specified input directory into a UnityWebData file and saves it to the output path.
The input should be the path to the folder containing the files to pack. -
-u,--unpack: Unpacks the specified UnityWebData file and saves the extracted files to the output directory.
The input should be the path to the file to unpack, and the output should be the target folder for the extracted files. -
-isp,--inspect: Displays information about the contents of a UnityWebData file, including file names and sizes.
Only the input file is required; the output path is not needed. -
-c: Specifies the compression format.
Available options arebrotli,gzip, ornone.
If omitted, the format is automatically detected.
What is a UnityWebData File?
A UnityWebData file is a bundled resource file used in Unity WebGL games, loaded alongside the WASM file. It typically contains assets, resources, and metadata packed into a single file.
In Unity versions 5.0 through 2019, these files used the .unityweb extension. Starting with later versions, the extension changed to .data. Unity supports compression formats like gzip and Brotli during the build process. Since 2019, the file extension itself (e.g., .data.gz or .data.br) indicates the compression format, making it easy to determine how to decompress it. However, in earlier versions, the .unityweb extension was used regardless of compression type, so the engine had to rely on markers inside the file to determine whether and how the data was compressed.
Importantly, once decompressed, the internal structure of a UnityWebData file is consistent regardless of its compression status.
UnityWebData Structure
Header
| Name | Size (bytes) | Type | Description |
|---|---|---|---|
| Signature | 16 | string | Fixed string: "UnityWebData1.0\0" |
| File Table Offset | 4 | uint32 | Offset to the start of the file data section (same as the first file's offset) |
File Info Header
The following structure is repeated for each file, up until the file data section begins:
| Name | Size (bytes) | Type | Description |
|---|---|---|---|
| File Offset | 4 | uint32 | Offset to the start of the file |
| File Size | 4 | uint32 | Size of the file in bytes |
| Filename Length | 4 | uint32 | Length of the file name (n) |
| Filename | n | string | Name of the file |
File Data Section
After the headers, all the actual file contents are stored sequentially.
To read a specific file, locate its offset and size from the header, then read the corresponding byte range from the data section.
Binary Template for 010 Editor
https://gist.github.com/akio7624/908497ef15a84a436fae9ab5439aa01f
This is a custom binary template for UnityWebData files, designed for use with 010 Editor's binary template system. It provides a visual representation of the internal structure, making it easier to analyze and understand the contents of a UnityWebData file.
If the data file is compressed, you must decompress it before analysis.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uwdtool-1.4.0.tar.gz.
File metadata
- Download URL: uwdtool-1.4.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e7f859f3828618c0a7d3243e45bc9465de8b9cf741861b681569924f2ef9198
|
|
| MD5 |
639331fa85b6753ecc45d6074eee85ab
|
|
| BLAKE2b-256 |
e11409c0b004432ecfec7726bd2b85ee7abfcf8f399a02d3bc6917e633d9dd0f
|
File details
Details for the file uwdtool-1.4.0-py3-none-any.whl.
File metadata
- Download URL: uwdtool-1.4.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e68b902dab6b9bff5dd87cf0aefec9520543eed6c71be6846efa9865d127036
|
|
| MD5 |
6ba93216063a6d5644b33d26ac5f007e
|
|
| BLAKE2b-256 |
2a65822d2e9b8266b57d1b97fdf081eb179cb2530cedbf68f208b0b67ef7d2ec
|