Python library for parsing binary files from Halo Infinite.
Project description
libpyinfinite
LibPyInfinite is a typed python library for parsing Halo Infinite binary files. It implements a module and tag reader that can be used indepently or in conjunction.
Installation
Libpyinfinite is available on pypi.
pip install libpyinfinite
Example Usage
Reading a module instance:
from libpyinfinite.module.module import HiModule
def read_module():
with open(modulepath, "rb") as file:
module_instance = HiModule()
module_instance.read(file)
Creating a Oodle Decompressor:
Oodle is a decompression library used to pack module files, requiring DLL calls to oo2core_8_win64.dll. This is achieved by either directly specifying the DLL or in Linux systems, using linoodle.
from libpyinfinite.module.oodle.oodleDecompressor import OodleDecompressor
decompressor = OodleDecompressor("./oo2core_8_win64.dll") # Windows 64-Bit
decompressor = OodleDecompressor("./linoodle.so") # Linux/Linux-like. (Requires DLL to be in the same directory.)
Reading the third tag from a module instance:
from libpyinfinite.tag.tag import HiTag
# File handle of module, index of tag, decompressor
tagData = moduleInstance.read_tag(file, 3, decompressor)
tagInstance = HiTag()
tagInstance.read(tagData)
Accessing values from a tag:
print(tagInstance.Header.magic)
>>> "ucsh"
for ref in tagInstance.Dependencies:
print(f"Tag Reference: {ref.globalId}")
>>> "Tag Reference: 0xFFFFFFF"
>>> "Tag Reference: 0x0A00000"
Using defined tag structures
# Reading "RUCY" tag
from libpyinfinite.tag.definitions.rucy import RuntimeCoatingStyleTag
rucy = RuntimeCoatingStyleTag()
rucy.read(tagData)
# What's the emissive intensity of this tag?
print(rucy.info.emissiveIntensity)
>>> 0.00
Credits
- MontagueM for OodleDecompressor
- Gamergotten for TagFramework
- Coreforge for libinfinite
- Z-15 for HITE
- Urium86 for pyhirtlib and LibHIRT
- Shockfire for Ausardocs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
libpyinfinite-0.0.2.tar.gz
(37.1 kB
view hashes)
Built Distribution
Close
Hashes for libpyinfinite-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f1e692606641d4791cc73009fccb2b7862f53ef37b759bbde84edf546c40128 |
|
MD5 | 7e1aec5f299eb1636050bf243ff59c12 |
|
BLAKE2b-256 | 13fac6b9b9e82cfd7cb78b92ecc2d853abe41449c787caba4593a372f6df4c44 |