import io import UnityPy # all of the following would work src = "file_path" src = b "bytes" src = io. Which itself is a simple recursive iterator. The all objects of the loaded assets can be easily accessed via. files, which is a dict consisting of asset-name : asset.
UnityPy can detect itself if the file is a WebFile, BundleFile, Asset or APK itself. a bytes object - will be loaded into a stream.a folder path - loads all files in that folder (bad idea for folders with a lot of files).a file path - apk files can be loaded as well.Important Classes EnvironmentĮnvironment loads and parses the files that are given to it. It can also be used as general template or simply as importable tool. People who have slightly advanced python skills should take a look at UnityPy/tools/extractor.py for a more advanced example. You probably have to read Important ClassesĪnd Important Object Types to understand how it works. splitext ( dest ) dest = dest + ".png" data. dirname ( dest ), exist_ok = True ) # correct extension dest, ext = os. split ( "/" )) # make sure that the dir of that path exists os. read () # create dest based on original path dest = os. save ( dest ) # alternative way which keeps the original path for path, obj in env. splitext ( dest ) dest = dest + ".png" img = data. name ) # make sure that the extension is correct # you probably only want to do so with images/textures dest, ext = os. read () # create destination path dest = os. name in : # parse the object data data = obj. objects : # process specific object types if obj. load ( file_path ) # iterate over internal objects for obj in env. join ( root, file_name ) # load that file via UnityPy.load env = UnityPy. walk ( source_folder ): for file_name in files : # generate file_path file_path = os. import os import UnityPy def unpack_all_assets ( source_folder : str, destination_folder : str ): # iterate over all files in source folder for root, dirs, files in os. Visual C++ Redistributable is required for the brotli dependency.
Or download/clone the git and use python setup.py install
Python 3.6.0 or higher is required pip install UnityPy Please donate a small part to it to a charitable cause of your choice or sponsor this project with a small amount. If you're making an income by using UnityPy, If you need advice or if you want to talk about (game) data-mining,