Documentation
¶
Index ¶
- Constants
- Variables
- func DataFiles(release *ReleaseDesc) (hdFiles, cdFiles []string)
- type DataLocation
- type DataNode
- func NewObjectPropertiesDataNode(parentNode DataNode, name string, provider objprop.Provider, ...) DataNode
- func NewResourceDataNode(parentNode DataNode, name string, provider chunk.Provider, ...) DataNode
- func NewTexturePropertiesDataNode(parentNode DataNode, name string, provider textprop.Provider, ...) DataNode
- type FileDataNodeProvider
- type FileDesc
- type Hacker
- func (hacker *Hacker) ChangeDirectory(path string) (result string)
- func (hacker *Hacker) CurrentDirectory() string
- func (hacker *Hacker) Diff(source string) (result string)
- func (hacker *Hacker) Dump() (result string)
- func (hacker *Hacker) Info() string
- func (hacker *Hacker) Load(path1, path2 string) string
- func (hacker *Hacker) Put(offset uint32, data []byte) (result string)
- func (hacker *Hacker) Save() (result string)
- type MaskingCoder
- type ReleaseDesc
- type Table
Constants ¶
const ( // HD is the data location for often-accessed files HD = DataLocation("hd") // CD is the data location for remaining files CD = DataLocation("cd") )
Variables ¶
var Releases = []*ReleaseDesc{&dosHdDemo, &dosCdDemo, &dosHdRelease, &dosCdRelease}
Releases contains all the release descriptions known to Hacker.
Functions ¶
func DataFiles ¶
func DataFiles(release *ReleaseDesc) (hdFiles, cdFiles []string)
DataFiles maps over the provided release description and returns the names of the data files per file location
Types ¶
type DataLocation ¶
type DataLocation string
DataLocation specifies where data files are stored
func (DataLocation) String ¶
func (location DataLocation) String() string
type DataNode ¶
type DataNode interface { // Parent returns the parent node or nil if none known. Parent() DataNode // Children returns all currently available DataNodes from this node. Children() []DataNode // Info returns human readable information about this node. Info() string // ID returns the identification for this node. The returned value must be // the same by which the parent resolves this node. ID() string // Resolve returns a DataNode this node knows for the given ID. Resolve(string) DataNode // Data returns the data of the given node or nil if no data available. Data() []byte // UnknownData returns a byte array similar to Data(), but with known data // cleared to be 0x00. UnknownData() []byte }
DataNode represents a container with data.
func NewResourceDataNode ¶
type FileDataNodeProvider ¶
type FileDataNodeProvider interface { // Provide tries to resolve and return a DataNode for the given file. Provide(parent DataNode, filePath, fileName string) DataNode }
FileDataNodeProvider is for providing a file specific data node
type FileDesc ¶
type FileDesc struct {
// contains filtered or unexported fields
}
FileDesc is a description of a specific data file
type Hacker ¶
type Hacker struct {
// contains filtered or unexported fields
}
Hacker is the main entry point for the hacker logic.
func (*Hacker) ChangeDirectory ¶
ChangeDirectory changes the currently active node
func (*Hacker) CurrentDirectory ¶
CurrentDirectory returns the absolute path to the current directory in string form
type MaskingCoder ¶
type MaskingCoder struct {
// contains filtered or unexported fields
}
func NewMaskingCoder ¶
func NewMaskingCoder(data []byte) *MaskingCoder
func (*MaskingCoder) CodeByte ¶
func (coder *MaskingCoder) CodeByte(value *byte)
func (*MaskingCoder) CodeBytes ¶
func (coder *MaskingCoder) CodeBytes(value []byte)
func (*MaskingCoder) CodeUint16 ¶
func (coder *MaskingCoder) CodeUint16(value *uint16)
func (*MaskingCoder) CodeUint24 ¶
func (coder *MaskingCoder) CodeUint24(value *uint32)
func (*MaskingCoder) CodeUint32 ¶
func (coder *MaskingCoder) CodeUint32(value *uint32)
type ReleaseDesc ¶
type ReleaseDesc struct {
// contains filtered or unexported fields
}
ReleaseDesc is a description of a certain release
func FindRelease ¶
func FindRelease(hdFiles, cdFiles []string) (release *ReleaseDesc)
FindRelease tries to determine which release the two sets of files represent. Returns nil if none found.
Source Files
¶
- BlockDataNode.go
- ChunkDataNode.go
- CommonPropertyDataNode.go
- DataNode.go
- FileAccess.go
- FileBasedFileDataNodeProvider.go
- FileDataNodeProvider.go
- GenericPropertyDataNode.go
- Hacker.go
- LocationDataNode.go
- MaskingCoder.go
- ObjectPropertiesDataNode.go
- ObjectPropertyDataNode.go
- ParentDataNode.go
- RawDataNode.go
- ReleaseDesc.go
- ResourceDataNode.go
- RootDataNode.go
- Saveable.go
- SpecificPropertyDataNode.go
- TableDataNode.go
- TexturePropertiesDataNode.go
- util.go