casc

package
v0.0.0-...-382259f Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package casc [soon™] implements the Content-Addressable Storage Container (CASC) format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCDNList

func ParseCDNList(i *etc.Buffer) map[string]*CDNListing

func ParseVersionList

func ParseVersionList(i *etc.Buffer) map[string]*VersionListing

Types

type Archive

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

func Open

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

Open a CASC archive, assuming it already exists.

func (*Archive) GetEncodingFile

func (a *Archive) GetEncodingFile() (*EncodingFile, error)

func (*Archive) OpenFile

func (a *Archive) OpenFile(fileID FileID) (*File, error)

func (*Archive) Sync

func (a *Archive) Sync(path string) error

type CDNListing

type CDNListing struct {
	Path    string
	Domains []string
}

type EncodingFile

type EncodingFile struct {
	Version        uint8
	ChecksumSizeA  uint8
	ChecksumSizeB  uint8
	FlagsA, FlagsB uint16
	SizeA, SizeB   uint32
	Unk1           uint8

	LayoutStrings      []string
	KeyTableIndex      []KeyTable
	KeyTableEntries    []KeyEntry
	LayoutTableIndex   []KeyTable
	LayoutTableEntries []LayoutEntry
}

type File

type File struct{}

type FileID

type FileID uint64

type KeyEntry

type KeyEntry struct {
	KeyCount         uint16
	DecompressedSize uint32
	Hash             []byte
	Keys             [][]byte
}

type KeyTable

type KeyTable struct {
	FirstHash []byte
	EntryHash []byte
}

type LayoutEntry

type LayoutEntry struct {
	Key            []byte
	StringIndex    uint32
	Unk1           uint8
	CompressedSize uint32
}

type NGDP

type NGDP struct {
	ProgramCode string
	URL         *url.URL
}

func NewNGDP

func NewNGDP(o Opts) (*NGDP, error)

func (*NGDP) GetCDNs

func (n *NGDP) GetCDNs() map[string]*CDNListing

func (*NGDP) GetVersions

func (n *NGDP) GetVersions() map[string]*VersionListing

func (*NGDP) OpenArchive

func (n *NGDP) OpenArchive(path, server string, v *VersionListing) (*Archive, error)

type Opts

type Opts struct {
	ProgramCode, URL string
}

type VersionListing

type VersionListing struct {
	BuildConfig string
	CDNConfig   string
	Keyring     string
	BuildID     string
	Version     string
}

Jump to

Keyboard shortcuts

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