Documentation ¶
Index ¶
- Variables
- func DecipherChar(b uint8) (r uint8)
- func DecryptBlockXXTEA(A *int32, B *int32, keys []int32)
- func DecryptBufferXXTEA(sourceBuffer []byte, keys []int32) []byte
- func DecryptFileXXTEA(sourceFile string, destFile string, headerLength int, keys []int32) error
- func EncryptBlockXXTEA(A *int32, B *int32, keys []int32)
- func EncryptBufferXXTEA(sourceBuffer []byte, keys []int32) []byte
- func EncryptFileXXTEA(sourceFile string, destFile string, header []byte, keys []int32) error
Constants ¶
This section is empty.
Variables ¶
var LocaleByteToCipher map[byte]byte
Table for converting a Raw Byte to a Ciphered Byte.
var LocaleCipherToByte map[byte]byte = buildCipherKey()
Table for converting a Ciphered Byte to a Raw Byte.
Functions ¶
func DecipherChar ¶
DecipherChar deciphers a byte using the algorithm; please use the tables (CipherToByte and ByteToCipher) instead.
func DecryptBlockXXTEA ¶
DecryptBlockXXTEA decrypts a block using a given key and the game specific delta and sum values.
A block is comprised of two int32s (taken as pointers). There is no return value (it modifies the input values).
func DecryptBufferXXTEA ¶
DecryptBufferXXTEA decrypts bytes from one array into another. There is no errore turn as nothing can really go wrong.
Note: the header should not be included here, this is just XXTea.
func DecryptFileXXTEA ¶
DecryptFileXXTEA decrypts from source to dest, stripping the header (of length 'headerLen'). It requires keys to be passed as an array; these should be 4 int32s.
The header length MUST contain anything unencrypted (typically it will be 20, 16 bytes for the header +4 for the CRC32).
On failure it will return an error (though these will be file related; the decryption system has no way of knowing if it worked or not).
func EncryptBlockXXTEA ¶
EncryptBlockXXTEA encrypts a block using a given key and the game specific delta and sum values.
A block is comprised of two int32s (taken as pointers). There is no return value (it modifies the input values).
func EncryptBufferXXTEA ¶
EncryptBufferXXTEA encrypts bytes from one array into another. There is no errore turn as nothing can really go wrong.
Note: the header should not be included here, this is just XXTea.
func EncryptFileXXTEA ¶
EncryptFileXXTEA takes a source name and a destination name, attempting to convert the source into an encrypted destination. It also requires header bytes (theoretically optional, but in reality required for the game to read it) and keys (also required). At present there appear to be common header and keys (listed in the source at the top of xxtea.go).
The CRC32 will be automatically added prior to the data. If you do not need the CRC32 value you should use the buffer encryption (ExcryptXXTea).
On failure it will return an error (though these will be file related; the encryption system has no way of knowing if it worked or not).
Types ¶
This section is empty.