Skip to main content

The tool to pack and unpack UnityWebData 1.0 files

Project description

en kr

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 are brotli, gzip, or none.
    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

unitywebdata_format.png

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

uwd010template.png
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

uwdtool-1.4.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uwdtool-1.4.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file uwdtool-1.4.1.tar.gz.

File metadata

  • Download URL: uwdtool-1.4.1.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

Hashes for uwdtool-1.4.1.tar.gz
Algorithm Hash digest
SHA256 99867222bdbcfdba8dee49d47f13181a499b4e4d44d92289b6b79c752ff1d6ce
MD5 5b66c1be294d0bc798e71037a3aadfe6
BLAKE2b-256 538d257ec1ceb3388cbb86bf7a4ebd0ce29ec92818d15526267fcb25a11a010d

See more details on using hashes here.

File details

Details for the file uwdtool-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: uwdtool-1.4.1-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

Hashes for uwdtool-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4c64caca90d3612946f2b642e122db4b181d0401ddb9295d7a8b896180203a6
MD5 6cf6cf29dfd2fcb78dfaf427d7fc663d
BLAKE2b-256 8eea67438bb781ccd9530c808ad0473679b434338b1260a38960b9208d43b10b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page