xor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: BSD-3-Clause Imports: 2 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": {
		MagicBytes: [...]byte{
			0x4F, 0xD0, 0xA0, 0xAC, 0x4A, 0x5B, 0xB9, 0xE5,
			0x93, 0x79, 0x45, 0xA5, 0xC1, 0xCB, 0x31, 0x93,
		},
		Multiplier: 0x6D,
	},
	"566d": {
		MagicBytes: [...]byte{
			0x4F, 0xD0, 0xA0, 0xAC, 0x4A, 0x56, 0xB9, 0xE5,
			0x93, 0x79, 0x45, 0xA5, 0xC1, 0xCB, 0x31, 0x93,
		},
		Multiplier: 0x6D,
	},
	"5bad": {
		MagicBytes: [...]byte{
			0x4F, 0xD0, 0xA0, 0xAC, 0x4A, 0x5B, 0xB9, 0xE5,
			0x93, 0x79, 0x45, 0xA5, 0xC1, 0xCB, 0x31, 0x93,
		},
		Multiplier: 0xAD,
	},
	"56ad": {
		MagicBytes: [...]byte{
			0x4F, 0xD0, 0xA0, 0xAC, 0x4A, 0x56, 0xB9, 0xE5,
			0x93, 0x79, 0x45, 0xA5, 0xC1, 0xCB, 0x31, 0x93,
		},
		Multiplier: 0xAD,
	},
}

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

func DecodingReader

func DecodingReader(r io.Reader, key *Key, expectedSize int64) io.Reader

func EncodingWriter

func EncodingWriter(w io.Writer, key *Key, expectedSize int64) io.Writer

Types

type Key

type Key struct {
	MagicBytes [16]byte
	Multiplier byte
}

Jump to

Keyboard shortcuts

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