메소드 | 설명 | |
---|---|---|
DecryptData ( byte data, uint key ) : byte[] |
Decrypts the given input data. Bytes outside of an even 4-byte boundary are not decrypted, and are considered not encrypted.
|
|
DecryptSectorOffsetTable ( |
Decrypts the sector offset table using rolling decryption - it starts where the input BinaryReader is, reads and decrypts offsets until the decrypted offset equals the input block size.
|
|
EncryptData ( byte data, uint key ) : byte[] |
Encrypts the given input data. Bytes outside of an even 4-byte boundary are not encrypted, and are simply appended at the end of the data block.
|
|
GetFileKey ( string fileName, bool isAdjusted = false, uint blockOffset, uint fileSize ) : uint |
Calculates the decryption key for a file sector.
|
|
Hash ( string inputString, HashType hashType ) : uint |
Hashes an input string, given a hash type. This function is case-insensitive, and treats all input as being in ALL UPPER CASE.
|
|
VerifySectorChecksum ( byte sector, uint checksum ) : bool |
Verifies the integrity of a file sector using an adler32 checksum.
|
메소드 | 설명 | |
---|---|---|
InitializeEncryptionTable ( ) : void |
Initializes the encryption table.
|
|
InternalEncryptDecrypt ( byte data, uint key ) : byte[] |
Internal XOR function that encrypts and decrypts a block of data.
|
|
MPQCrypt ( ) : System |
public static DecryptData ( byte data, uint key ) : byte[] | ||
data | byte | Data to be decrypted. |
key | uint | The decryption key to use. |
리턴 | byte[] |
public static DecryptSectorOffsetTable ( |
||
br | The archive's BinaryReader | |
sectorOffsets | List |
The output sector offsets. |
blockSize | uint | The size of the block to be decrypted. |
key | uint | The decryption key for the offset table. |
리턴 | void |
public static EncryptData ( byte data, uint key ) : byte[] | ||
data | byte | Data to be encrypted. |
key | uint | The encryption key to use. |
리턴 | byte[] |
public static GetFileKey ( string fileName, bool isAdjusted = false, uint blockOffset, uint fileSize ) : uint | ||
fileName | string | The name of the file the sector belongs to |
isAdjusted | bool | If set to |
blockOffset | uint | The block offset of the file. |
fileSize | uint | The size of the file. |
리턴 | uint |
public static Hash ( string inputString, HashType hashType ) : uint | ||
inputString | string | Input string. |
hashType | HashType | Hash type. |
리턴 | uint |
public static VerifySectorChecksum ( byte sector, uint checksum ) : bool | ||
sector | byte | Sector data. |
checksum | uint | Sector checksum. |
리턴 | bool |