C# Class CrystalMpq.CommonMethods

显示文件 Open project: sgraf812/crystalmpq

Private Properties

Property Type Description
BuildEncryptionTable uint[]

Public Methods

Method Description
CompareData ( byte a, byte b ) : bool
CompareData ( byte a, byte b, uint length ) : bool
CompressBlock ( byte inBuffer, byte outBuffer, bool multi ) : int
DecompressBlock ( byte inBuffer, int inLength, byte outBuffer, bool multi ) : int
Decrypt ( byte data, uint hash ) : void
Decrypt ( byte data, uint hash, int length ) : void
Decrypt ( uint data, uint hash ) : void
Decrypt ( uint data, uint hash, int length ) : void
DecryptWithEndianSwap ( uint data, uint hash, int length ) : void
Encrypt ( uint data, uint hash ) : void
Encrypt ( uint data, uint hash, int length ) : void
FourCCToString ( byte fourCC ) : string
FourCCToString ( uint fourCC ) : string
GetSharedBuffer ( int minLength ) : byte[]

Gets a buffer of at least minLength bytes.

While actively using the buffer, you must make sure to not call any other method using the same shared buffer. Also, no references to the buffer should be leaked after the method requesting the buffer has returned. Not following these rules carefully will likely lead to a crash.

Hash ( string text, uint hashOffset ) : uint
SwapBytes ( uint value ) : uint
SwapBytes ( ulong value ) : ulong
SwapBytes ( ushort value ) : ushort
SwapBytes ( uint buffer ) : void
SwapBytes ( uint buffer, int length ) : void
SwapBytes ( uint buffer, ulong length ) : void
SwapBytes ( ulong buffer ) : void
SwapBytes ( ulong buffer, int length ) : void
SwapBytes ( ushort buffer ) : void
SwapBytes ( ushort buffer, int length ) : void
SwapBytes16 ( byte buffer ) : void
SwapBytes32 ( byte buffer ) : void
SwapBytes64 ( byte buffer ) : void
SwapBytesIfNeeded ( uint value ) : uint

Private Methods

Method Description
BuildEncryptionTable ( ) : uint[]

Method Details

CompareData() public static method

public static CompareData ( byte a, byte b ) : bool
a byte
b byte
return bool

CompareData() public static method

public static CompareData ( byte a, byte b, uint length ) : bool
a byte
b byte
length uint
return bool

CompressBlock() public static method

public static CompressBlock ( byte inBuffer, byte outBuffer, bool multi ) : int
inBuffer byte
outBuffer byte
multi bool
return int

DecompressBlock() public static method

public static DecompressBlock ( byte inBuffer, int inLength, byte outBuffer, bool multi ) : int
inBuffer byte
inLength int
outBuffer byte
multi bool
return int

Decrypt() public static method

public static Decrypt ( byte data, uint hash ) : void
data byte
hash uint
return void

Decrypt() public static method

public static Decrypt ( byte data, uint hash, int length ) : void
data byte
hash uint
length int
return void

Decrypt() public static method

public static Decrypt ( uint data, uint hash ) : void
data uint
hash uint
return void

Decrypt() public static method

public static Decrypt ( uint data, uint hash, int length ) : void
data uint
hash uint
length int
return void

DecryptWithEndianSwap() public static method

public static DecryptWithEndianSwap ( uint data, uint hash, int length ) : void
data uint
hash uint
length int
return void

Encrypt() public static method

public static Encrypt ( uint data, uint hash ) : void
data uint
hash uint
return void

Encrypt() public static method

public static Encrypt ( uint data, uint hash, int length ) : void
data uint
hash uint
length int
return void

FourCCToString() public static method

public static FourCCToString ( byte fourCC ) : string
fourCC byte
return string

FourCCToString() public static method

public static FourCCToString ( uint fourCC ) : string
fourCC uint
return string

GetSharedBuffer() public static method

Gets a buffer of at least minLength bytes.
While actively using the buffer, you must make sure to not call any other method using the same shared buffer. Also, no references to the buffer should be leaked after the method requesting the buffer has returned. Not following these rules carefully will likely lead to a crash.
public static GetSharedBuffer ( int minLength ) : byte[]
minLength int Minimum required length.
return byte[]

Hash() public static method

public static Hash ( string text, uint hashOffset ) : uint
text string
hashOffset uint
return uint

SwapBytes() public static method

public static SwapBytes ( uint value ) : uint
value uint
return uint

SwapBytes() public static method

public static SwapBytes ( ulong value ) : ulong
value ulong
return ulong

SwapBytes() public static method

public static SwapBytes ( ushort value ) : ushort
value ushort
return ushort

SwapBytes() public static method

public static SwapBytes ( uint buffer ) : void
buffer uint
return void

SwapBytes() public static method

public static SwapBytes ( uint buffer, int length ) : void
buffer uint
length int
return void

SwapBytes() public static method

public static SwapBytes ( uint buffer, ulong length ) : void
buffer uint
length ulong
return void

SwapBytes() public static method

public static SwapBytes ( ulong buffer ) : void
buffer ulong
return void

SwapBytes() public static method

public static SwapBytes ( ulong buffer, int length ) : void
buffer ulong
length int
return void

SwapBytes() public static method

public static SwapBytes ( ushort buffer ) : void
buffer ushort
return void

SwapBytes() public static method

public static SwapBytes ( ushort buffer, int length ) : void
buffer ushort
length int
return void

SwapBytes16() public static method

public static SwapBytes16 ( byte buffer ) : void
buffer byte
return void

SwapBytes32() public static method

public static SwapBytes32 ( byte buffer ) : void
buffer byte
return void

SwapBytes64() public static method

public static SwapBytes64 ( byte buffer ) : void
buffer byte
return void

SwapBytesIfNeeded() public static method

public static SwapBytesIfNeeded ( uint value ) : uint
value uint
return uint