ggpk

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryEntry

type DirectoryEntry struct {
	NameHash uint32
	Offset   uint64
}

type DirectoryRecord

type DirectoryRecord struct {
	Offset  uint64
	Name    string
	Hash    [32]byte
	Entries []DirectoryEntry
}

type FileRecord

type FileRecord struct {
	Offset     uint64
	Name       string
	Hash       [32]byte
	DataOffset uint64
	DataLength uint64
}

type GgpkRecord

type GgpkRecord struct {
	Version    uint32
	RootOffset uint64
	FreeOffset uint64
}

type Reader

type Reader struct {
	RootOffset uint64
	Version    uint32
	// contains filtered or unexported fields
}

func Open

func Open(path string) (*Reader, error)

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) FileReaderAt

func (r *Reader) FileReaderAt(rec *FileRecord) io.ReaderAt

FileReaderAt returns an io.ReaderAt scoped to the file's data region within the GGPK.

func (*Reader) FindFile

func (r *Reader) FindFile(path string) (*FileRecord, error)

FindFile locates a file by path in the GGPK directory tree. Path components are separated by '/'. Lookup is case-insensitive.

func (*Reader) ListDirectory

func (r *Reader) ListDirectory(path string) (dirs []string, files []string, err error)

ListDirectory returns entries at a given path in the GGPK tree.

func (*Reader) ReadFileData

func (r *Reader) ReadFileData(rec *FileRecord) ([]byte, error)

ReadFileData reads the raw data bytes of a file record.

type RecordHeader

type RecordHeader struct {
	Length uint32
	Tag    RecordTag
}

type RecordTag

type RecordTag uint32
const (
	TagGGPK RecordTag = 0x4B504747
	TagPDIR RecordTag = 0x52494450
	TagFILE RecordTag = 0x454C4946
	TagFREE RecordTag = 0x45455246
)

Jump to

Keyboard shortcuts

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