xor

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKey = KnownKeys["56ad"]

It is the default key since the author of this package happens to have only ggpack files encrypted with this key.

View Source
var KnownKeys = map[string]Key{
	"5b6d": &twp.Key{
		MagicBytes: []byte{
			0x4F, 0xD0, 0xA0, 0xAC, 0x4A, 0x5B, 0xB9, 0xE5,
			0x93, 0x79, 0x45, 0xA5, 0xC1, 0xCB, 0x31, 0x93,
		},
		Multiplier: 0x6D,
	},
	"566d": &twp.Key{
		MagicBytes: []byte{
			0x4F, 0xD0, 0xA0, 0xAC, 0x4A, 0x56, 0xB9, 0xE5,
			0x93, 0x79, 0x45, 0xA5, 0xC1, 0xCB, 0x31, 0x93,
		},
		Multiplier: 0x6D,
	},
	"5bad": &twp.Key{
		MagicBytes: []byte{
			0x4F, 0xD0, 0xA0, 0xAC, 0x4A, 0x5B, 0xB9, 0xE5,
			0x93, 0x79, 0x45, 0xA5, 0xC1, 0xCB, 0x31, 0x93,
		},
		Multiplier: 0xAD,
	},
	"56ad": &twp.Key{
		MagicBytes: []byte{
			0x4F, 0xD0, 0xA0, 0xAC, 0x4A, 0x56, 0xB9, 0xE5,
			0x93, 0x79, 0x45, 0xA5, 0xC1, 0xCB, 0x31, 0x93,
		},
		Multiplier: 0xAD,
	},
	"delores": &twp.Key{
		MagicBytes: []byte{
			0x3F, 0x41, 0x41, 0x60, 0x95, 0x87, 0x4A, 0xE6,
			0x34, 0xC6, 0x3A, 0x86, 0x29, 0x27, 0x77, 0x8D,
			0x38, 0xB4, 0x96, 0xC9, 0x38, 0xB4, 0x96, 0xC9,
			0x00, 0xE0, 0x0A, 0xC6, 0x00, 0xE0, 0x0A, 0xC6,
			0x00, 0x3C, 0x1C, 0xC6, 0x00, 0x3C, 0x1C, 0xC6,
			0x00, 0xE4, 0x40, 0xC6, 0x00, 0xE4, 0x40, 0xC6,
		},
		Multiplier: 0x6D,
	},
	"rtmi": &rtmi.Key{
		Modifier: 0x78,
	},
}

KnownKeys is a collection of XOR keys for ggpack files found in the wild. These keys differ slightly at MagicBytes[5] (0x5B vs. 0x56) and regarding the multiplier (0x6D vs. 0xAD). This is reflected in the names (e.g. "56ad") by which they can be referenced.

Functions

This section is empty.

Types

type Key

type Key interface {
	DecodingReader(r io.Reader, expectedSize int64) io.Reader
	EncodingWriter(w io.Writer, expectedSize int64) io.Writer
	NeedsLoading() bool
	LoadFrom(execFile string) error
	UsesShortKeyIndices() bool
}

Key is an XOR key for ggpack files.

Directories

Path Synopsis
Package rtmi encodes/decodes data with XOR encryption as used by Return to Monkey Island.
Package rtmi encodes/decodes data with XOR encryption as used by Return to Monkey Island.
Package twp encodes/decodes data with XOR encryption as used by Thimbleweed Park and Delores games.
Package twp encodes/decodes data with XOR encryption as used by Thimbleweed Park and Delores games.

Jump to

Keyboard shortcuts

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