Documentation
¶
Overview ¶
Package manifest provides types and functions for working with EVR manifest files.
Index ¶
Constants ¶
const ( // DefaultCompressionLevel is the compression level used for building packages. DefaultCompressionLevel = zstd.BestSpeed // MaxPackageSize is the maximum size of a single package file. MaxPackageSize = math.MaxInt32 )
const ( HeaderSize = 192 // Fixed header size: // 4 (PackageCount) + 4 (Unk1) + 8 (Unk2) // + SectionSize (FrameContents) + 16 bytes padding // + SectionSize (Metadata) + 16 bytes padding // + SectionSize (Frames) SectionSize = 48 // 6 * 8 bytes (Section has 6 uint64 fields) FrameContentSize = 32 // 8 + 8 + 4 + 4 + 4 + 4 bytes FileMetadataSize = 40 // 5 * 8 bytes FrameSize = 16 // 4 * 4 bytes )
Binary sizes for manifest structures
Variables ¶
This section is empty.
Functions ¶
func ScanFiles ¶
func ScanFiles(inputDir string) ([][]ScannedFile, error)
ScanFiles walks the input directory and returns files grouped by chunk number. The directory structure is expected to be: <inputDir>/<chunkNum>/<typeSymbol>/<fileSymbol>
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder constructs packages and manifests from a set of files.
func NewBuilder ¶
NewBuilder creates a new package builder.
func (*Builder) Build ¶
func (b *Builder) Build(fileGroups [][]ScannedFile) (*Manifest, error)
Build creates a package and manifest from the given file groups.
func (*Builder) SetCompressionLevel ¶
SetCompressionLevel sets the compression level for the builder.
type ExtractOption ¶
type ExtractOption func(*extractConfig)
ExtractOption configures extraction behavior.
func WithDecimalNames ¶
func WithDecimalNames(decimal bool) ExtractOption
WithDecimalNames uses decimal format for filenames instead of hex.
func WithPreserveGroups ¶
func WithPreserveGroups(preserve bool) ExtractOption
WithPreserveGroups preserves frame grouping in output directory structure.
type FileMetadata ¶
type FileMetadata struct {
TypeSymbol int64 // File type identifier
FileSymbol int64 // File identifier
Unk1 int64 // Unknown - game launches with 0
Unk2 int64 // Unknown - game launches with 0
AssetType int64 // Asset type identifier
}
FileMetadata contains additional file metadata.
type Frame ¶
type Frame struct {
PackageIndex uint32 // Package file index
Offset uint32 // Byte offset within package
CompressedSize uint32 // Compressed frame size
Length uint32 // Decompressed frame size
}
Frame describes a compressed data frame within a package.
type FrameContent ¶
type FrameContent struct {
TypeSymbol int64 // File type identifier
FileSymbol int64 // File identifier
FrameIndex uint32 // Index into Frames array
DataOffset uint32 // Byte offset within decompressed frame
Size uint32 // File size in bytes
Alignment uint32 // Alignment (can be set to 1)
}
FrameContent describes a file within a frame.
type Header ¶
type Header struct {
PackageCount uint32
Unk1 uint32 // Unknown - 524288 on latest builds
Unk2 uint64 // Unknown - 0 on latest builds
FrameContents Section
Metadata Section
Frames Section
// contains filtered or unexported fields
}
Header contains manifest metadata and section information.
type Manifest ¶
type Manifest struct {
Header Header
FrameContents []FrameContent
Metadata []FileMetadata
Frames []Frame
}
Manifest represents a parsed EVR manifest file.
func (*Manifest) BinarySize ¶
BinarySize returns the total binary size of the manifest.
func (*Manifest) EncodeTo ¶
EncodeTo writes the manifest to the given buffer. The buffer must be at least BinarySize() bytes.
func (*Manifest) MarshalBinary ¶
MarshalBinary encodes a manifest to binary data. Pre-allocates buffer for better performance.
func (*Manifest) PackageCount ¶
PackageCount returns the number of packages referenced by this manifest.
func (*Manifest) UnmarshalBinary ¶
UnmarshalBinary decodes a manifest from binary data. Uses direct decoding for better performance.
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
Package represents a multi-part package file set.
func OpenPackage ¶
OpenPackage opens a multi-part package from the given base path. The path should be the package name without the _N suffix.
type ScannedFile ¶
ScannedFile represents a file scanned from an input directory for building packages.
type Section ¶
type Section struct {
Length uint64 // Total byte length of section
Unk1 uint64 // Unknown - 0 on latest builds
Unk2 uint64 // Unknown - 4294967296 on latest builds
ElementSize uint64 // Byte size of single entry
Count uint64 // Number of elements
ElementCount uint64 // Number of elements (can differ from Count)
}
Section describes a section within the manifest.