mnf

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorNotValidRecord = errors.New("not valid record")

Functions

This section is empty.

Types

type Archive

type Archive struct {
	// contains filtered or unexported fields
}

func NewArchive

func NewArchive(path string) (*Archive, error)

func (*Archive) Close

func (archive *Archive) Close() error

func (*Archive) GetSize

func (archive *Archive) GetSize() int64

func (*Archive) IsValid

func (archive *Archive) IsValid(record *Block3Record) bool

func (*Archive) Read

func (archive *Archive) Read(record *Block3Record) ([]byte, error)

func (*Archive) ReadRaw

func (archive *Archive) ReadRaw(record *Block3Record) ([]byte, error)

type Block1Record

type Block1Record struct {
	Index uint32
	Flag  uint8
}

type Block2Record

type Block2Record struct {
	Id     uint32
	Field2 []byte
	Flags  []byte
}

type Block3Record

type Block3Record struct {
	UncompressedSize uint32
	CompressedSize   uint32
	Hash             uint32
	Offset           uint32
	ArchiveIndex     uint16
	CompressionType  uint16
}

type Index0

type Index0 struct {
	Field1 []byte

	Block1Size uint32
	Block1Data []byte

	Block2Size uint32
	Block2Data []byte
}

type Index3

type Index3 struct {
	Field1 []byte
	Count1 uint32
	Count2 uint32
	Count3 uint32

	UncompressedBlock1Size uint32
	CompressedBlock1Size   uint32
	Block1Records          []*Block1Record

	UncompressedBlock2Size uint32
	CompressedBlock2Size   uint32
	Block2Records          []*Block2Record

	UncompressedBlock3Size uint32
	CompressedBlock3Size   uint32
	Block3Records          []*Block3Record
}

type Mnf

type Mnf struct {
	Path     string
	Archives map[uint16]*Archive

	Signature    string
	Version      uint16
	ArchiveCount uint16
	ArchiveIds   map[uint16]uint16
	Field5       uint32
	DataSize     uint32
	Index0       *Index0
	Index3       *Index3
}

func Parse

func Parse(path string) (*Mnf, error)

func (*Mnf) GetZosft

func (mnfData *Mnf) GetZosft() (*zosft.Zosft, error)

func (*Mnf) IsDepot

func (mnfData *Mnf) IsDepot() bool

func (*Mnf) IsGame

func (mnfData *Mnf) IsGame() bool

func (*Mnf) Read

func (mnfData *Mnf) Read(record *Block3Record) ([]byte, error)

func (*Mnf) ReadRaw added in v0.0.3

func (mnfData *Mnf) ReadRaw(record *Block3Record) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL