mcpk

package
v0.0.0-...-0cda8e5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringID

func StringID(input string) uint32

replicates _Z8StringIDPKc https://github.com/elnx/0x9BE74448

func Unpack

func Unpack(dat []byte, path string) error

Types

type DirectoryEntry

type DirectoryEntry struct {
	Id     uint32
	Offset uint32
	Size   uint32
}

type FileEntry

type FileEntry struct {
	Id      uint32
	Offset  uint32
	Size    uint32
	Unknown uint32
}

type MCPKFileSystem

type MCPKFileSystem struct {
	DirectoryEntryList []DirectoryEntry
	FileEntries        map[uint32][]FileEntry
	// contains filtered or unexported fields
}

I don't want to mess its name with ModCoderPack

func NewMCPKFileSystem

func NewMCPKFileSystem(data []byte) (*MCPKFileSystem, error)

replicates _ZN13MCPFileSystem5_InitEPKc

func (*MCPKFileSystem) Open

func (fs *MCPKFileSystem) Open(name string) ([]byte, error)

type RotorObj

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

func NewRotorObj

func NewRotorObj(numRotors int, key string) *RotorObj

func (*RotorObj) Advances

func (r *RotorObj) Advances()

rtrAdvances sets the number of positions to advance the rotors at a time.

func (*RotorObj) DChar

func (r *RotorObj) DChar(c byte) byte

rtrDChar decrypts a byte c with the current rotor machine.

func (*RotorObj) DRegion

func (r *RotorObj) DRegion(data []byte, doInit bool)

rtrDRegion performs a rotor decryption of a byte slice data using the given rotor machine.

func (*RotorObj) DRotors

func (r *RotorObj) DRotors()

rtrDRotors sets the current set of decryption rotors.

func (*RotorObj) EChar

func (r *RotorObj) EChar(p byte) byte

rtrEChar encrypts a byte p with the current rotor machine.

func (*RotorObj) ERegion

func (r *RotorObj) ERegion(data []byte, doInit bool)

rtrERegion performs a rotor encryption of a byte slice data using the given rotor machine.

func (*RotorObj) ERotors

func (r *RotorObj) ERotors()

rtrERotors sets the current set of encryption rotors.

func (*RotorObj) Init

func (r *RotorObj) Init()

rtrInit initializes the rotor machine given a key.

func (*RotorObj) MakeIDRotor

func (r *RotorObj) MakeIDRotor(rtr []byte)

rtrMakeIDRotor sets ROTOR to the identity permutation.

func (*RotorObj) PermuteRotor

func (r *RotorObj) PermuteRotor(e, d []byte)

rtrPermuteRotor permutes the E rotor and makes the D rotor its inverse.

func (*RotorObj) Positions

func (r *RotorObj) Positions()

rtrPositions sets the positions of the rotors at this time.

Jump to

Keyboard shortcuts

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