Expand description
Files: what ImportHelper.parse_file builds (helpers/ImportHelper.py:127-156).
A File is a handle (Arc) on an immutable, parsed file. Containers
decode lazily and parse each entry once (BundleFile::entry); the
UnityPy load order, where every entry is parsed and a failing entry fails
the bundle, is BundleFile::load_all.
Memory. Every file charges its input’s Meter for itself and for
every table it keeps, before it allocates them (plan section 3.15): a
top-level load makes the meter and passes it to parse_file, and a
container passes its own to each entry it parses, so one input’s files
share one bound however many there are. Each file keeps its Charge
(the bytes return when the file drops) and answers File::meter.
Owner: package C.
Re-exports§
pub use save::SaveError;pub use save::SaveLayout;pub use save::SaveOptions;pub use bundle::BlockInfo;pub use bundle::BundleCounts;pub use bundle::BundleFile;pub use bundle::BundleHeader;pub use bundle::BundlePacker;pub use bundle::BundleSaveOptions;pub use bundle::DirEntry;pub use bundle::FileSlot;pub use bundle::LayoutKind;pub use serialized::External;pub use serialized::ObjectInfo;pub use serialized::ScriptRef;pub use serialized::SerializedFile;pub use serialized::SerializedHeader;pub use serialized::SerializedType;pub use web::WebFile;pub use web::WebPacker;pub use web::WebSaveOptions;
Modules§
- bundle
BundleFile(files/BundleFile.py), read lazily.- save
- Metered primitives for file and tree writers, following
streams/EndianBinaryWriter.py:41-97. Every growth charges memory; every byte copied or zeroed charges the reader’s cumulative work first. - serialized
SerializedFilemetadata (files/SerializedFile.py:206-360,files/ObjectReader.py:67-130), ported from UnityPy, bytes-native.- web
WebFile(files/WebFile.py:15-56):UnityWebData/TuanjieWebData, plain, gzip or brotli. Inflation is eager, bounded bymax_inflateand charged as decode work; directory members are parsed once on demand.WebFile::load_allprovides UnityPy’s eager directory-order load.
Structs§
- Parent
- What a child knows of its container. A file loaded at top level has none
(
parent: None): UnityPy makes theEnvironmentthat loaded it its parent (environment.py:154), which is the containerPPtr.derefscans (plan section 3.13, rule 4). The input’s meter travels separately, as every file’sFile::meter, top-level ones included. - RawFile
- A file UnityPy keeps as a reader.
- Writeable
Cab - A shared, appendable resource writer. Clones refer to the same bytes.
Enums§
- File
- A parsed file.
- Parent
Kind - A container kind, as the
SerializedFileversion chain andPPtr.derefdistinguish them.
Functions§
- parse_
file parse_file: builds the filetysays, under the name rule (crate::detect::parsed_as), from bytes (UnityPy’s memory reader). A file with aparentis an entry. Everything it keeps is charged tometer, the input’s.- parse_
file_ with_ reader parse_fileby the rules of the reader UnityPy reads the file with:ReaderKind::Streamfor a top-level file loaded from a path (environment.py:136-139;crate::env::Source::Path), whoseSerializedFile, bundle header or kept reader follows them. A container’s entries are memory whatever its reader. WebFile members use memory readers after inflation.