Skip to main content

Type tree generator from Unity assemblies

Project description

typetree_unity

PyPI Pylint MIT

A standalone type tree generator for Unity assemblies.

Better README coming in the future. Still in early development. Things will be changing rapidly.

Ultimate goal of this project is to provide lighter weight and more easily accessible options for data mining Unity games, and provide outputs in easily transportable formats.

There are two required parameters to generate a type tree:

  • Unity build version
  • Game assembly files built with Mono

Unity build version

The quickest way to determine which version of Unity a game is built against is to open one of the .assets files in the game's directory (typically located at [game_root]/[game]_Data/) in Notepad (pick a small assets file, any will work). One of the first ASCII text will be the version (ex. 2019.4.23f1). For a scripted approach, see UnityVersionFinderPy.

Game assembly files built with Mono

To determine if a game is already built with Mono, look in the game directory for a Assembly-CSharp.dll file (typically located at [game_root]/[game]_Data/Managed). If it does, then the game's assembly files were built with Mono.

If that's not the case, the game was likely built with il2cpp (will instead have a GameAssembly.dll file). To convert from il2cpp to Mono format, see Il2CppDumper.

Install:

pip install typtree_unity

CLI Usage:

usage: python -m typetree_unity [-h] [-c [...]] [-d] [-n] [-o] [-v] assembly_folder unity_version

Generates type trees from Unity assemblies and outputs in JSON format.

positional arguments:
  assembly_folder       folder containing assemblies (game's DLL files)
  unity_version         Unity build version

options:
  -h, --help            show this help message and exit
  -c [ ...], --classes [ ...]
                        classes to dump for the type tree (all if unspecified). Automatically dumps class dependencies.
  -d, --debug           enable debug output
  -n, --namesonly       only output class names (will output as classnames.json if output is not specified)
  -o , --output         type tree output file (default: [script_directory]\output\typetree.json). Supports relative paths.
  -v, --version         version of this package

Library Usage:

See typetree_unity/__main__.py for example usage of the typetree_unity module.

MIT License

Copyright (c) 2021 Jason Robinson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

typetree_unity-0.4.0a0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

typetree_unity-0.4.0a0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file typetree_unity-0.4.0a0.tar.gz.

File metadata

  • Download URL: typetree_unity-0.4.0a0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for typetree_unity-0.4.0a0.tar.gz
Algorithm Hash digest
SHA256 e1dc1014042391f4c3fa7e38dd3635b7f11900a8695fe526238398e8705ff5b6
MD5 effeb35cc40139ce78b2030daad90515
BLAKE2b-256 b20216d86940512dc039a0c76776a859c7782fd2f60dfdf5b9b386b28bd93e73

See more details on using hashes here.

File details

Details for the file typetree_unity-0.4.0a0-py3-none-any.whl.

File metadata

  • Download URL: typetree_unity-0.4.0a0-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for typetree_unity-0.4.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ac8910977cb2643162e9af4f84899a38dfd78c17e0714e1923b66478d205265
MD5 31f0a5d3e6b7dbc4d1a6f988e3adffa2
BLAKE2b-256 0f2ca3f8f11224e28840a93fc09e91cc3ae1307d61e59a5fba6207c70615b078

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