tact

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tact reads World of Warcraft game files either out of a local CASC install (.build.info picks the build, then root → encoding → .idx → data.NNN → BLTE resolves a file data id to its bytes) or straight off Blizzard's CDN (see cdn.go), which swaps the .idx/data.NNN step for archive indexes and range reads. Nothing falls back from one to the other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildNumber

func BuildNumber(version string) (uint32, error)

BuildNumber extracts the trailing build number from a 4-part version string.

func KeyName

func KeyName(name uint64) string

KeyName formats a lookup the way the community list and wow.tools spell it.

func LoadConfig

func LoadConfig(baseDir, hash string) (map[string][]string, error)

LoadConfig reads a build/CDN config from the local install's Data/config/<xx>/<yy>/<hash> layout. Values are space-separated (typically `ckey [ekey]`). All keys are kept, including the ~318 unused `vfs-*` TVFS lines.

func RefreshKeyFile

func RefreshKeyFile(path, url string) error

RefreshKeyFile keeps a local copy of the community list current with the same download-if-stale rule as the listfile: a usable existing file is never lost to a network failure, and only a missing file makes the download mandatory.

Types

type AvailableBuild

type AvailableBuild struct {
	BuildConfig string
	Version     string
	Product     string
}

AvailableBuild is one .build.info product entry, reduced to the fields this local-only reader consumes.

func ParseBuildInfo

func ParseBuildInfo(path string) ([]AvailableBuild, error)

ParseBuildInfo reads <BaseDir>/.build.info (typed pipe format: the header line names columns as "Name!TYPE:len") and returns all product entries.

func SelectBuild

func SelectBuild(entries []AvailableBuild, product string) (AvailableBuild, error)

SelectBuild returns the first entry for the given product.

type Build

type Build struct {
	Entry       AvailableBuild
	BuildNumber uint32
	Keys        *KeyStore // TACT keys for encrypted BLTE chunks; nil leaves them zero-filled
	// contains filtered or unexported fields
}

func Open

func Open(baseDir, product string) (*Build, error)

Open loads everything needed to serve OpenFileByFDID from a local install.

func OpenCDN

func OpenCDN(product, region, cacheDir string) (*Build, error)

OpenCDN loads the current build of product from the CDN, using the version service of region (e.g. "us") to find both.

func (*Build) OpenFileByCKey

func (b *Build) OpenFileByCKey(cKey []byte) ([]byte, error)

Resolves a content key through encoding and opens the first encoding key locally.

func (*Build) OpenFileByFDID

func (b *Build) OpenFileByFDID(fdid uint32) ([]byte, error)

OpenFileByFDID opens a file by its file data id via the WoW root.

type KeyStore

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

KeyStore holds TACT keys by their 64-bit lookup name, the value a BLTE 'E' chunk and a WDC5 section header both carry to say which key they need. It also remembers every name a chunk asked for and did not find.

func NewKeyStore

func NewKeyStore() *KeyStore

func (*KeyStore) Add

func (s *KeyStore) Add(name uint64, key [16]byte)

func (*KeyStore) Has

func (s *KeyStore) Has(name uint64) bool

func (*KeyStore) Len

func (s *KeyStore) Len() int

func (*KeyStore) LoadKeyFile

func (s *KeyStore) LoadKeyFile(path string) (int, error)

LoadKeyFile adds every key in a community-format file. Malformed lines are skipped rather than fatal, since the list is hand-maintained.

func (*KeyStore) Missing

func (s *KeyStore) Missing() []uint64

Missing lists the key names decryption asked for and did not have, sorted.

type Listfile

type Listfile struct {
	Path string
	URL  string
	// contains filtered or unexported fields
}

Listfile manages the community listfile.csv with download-if-stale semantics: HEAD + Last-Modified vs local mtime; a failed freshness check triggers a re-download, and a failed download falls back to the existing file when one exists.

func (*Listfile) GetFDID

func (l *Listfile) GetFDID(path string) (uint32, error)

GetFDID resolves a game path (e.g. "dbfilesclient/Spell.db2") to its file data id: static map first, then the listfile. The lookup key is the raw game path, lowercased, never a filesystem-resolved path.

func (*Listfile) Refresh

func (l *Listfile) Refresh() error

Refresh ensures the listfile exists and is current. It never deletes a usable existing file on network failure.

Jump to

Keyboard shortcuts

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