A python tool for reading xnb files.
At this point it can only deserialize Texture2DReader
files with the BGRA surface format, but the project should allow for extension of the reader classes. I mostly used this code as a reference for it.
python -m pip install git+https://github.com/Lekuruu/xnb.git
python -m xnb <INPUT> <OUTPUT>
from xnb import XNBReader
import logging
# Initialize the class from a filepath
reader = XNBReader.from_file('./your_file.xnb')
# Initialize the class from bytes
reader = XNBReader(b'...')
# When initializing the class, it will already try
# to automatically deserialize the file. You can
# turn on logging to view the process in detail.
logging.basicConfig(level=logging.INFO)
# Access the deserialized content for each reader
for content in reader.contents:
print(content)
# Save the xnb data into a readable file
reader.save('./your_output')