X-Git-Url: https://sfsrealm.hopto.org/projects/gitweb.cgi?p=SFmpqapi.git;a=blobdiff_plain;f=MpqCrypt.h;fp=MpqCrypt.h;h=c730d5815b84b63596539476787bbb64c789b72f;hp=0000000000000000000000000000000000000000;hb=7214af3eb69acdaef221c1846157ed07438bd0c1;hpb=1c63ef2a5d9f881e1006c4c674a81cebd9596c5e diff --git a/MpqCrypt.h b/MpqCrypt.h new file mode 100644 index 0000000..c730d58 --- /dev/null +++ b/MpqCrypt.h @@ -0,0 +1,23 @@ +// License information for this code is in license.txt + +#ifndef MPQCRYPT_INCLUDED +#define MPQCRYPT_INCLUDED + +#include "SFTypes.h" + +#define HASH_POSITION 0 +#define HASH_NAME_A 1 +#define HASH_NAME_B 2 +#define HASH_KEY 3 + +extern UInt32 dwHashTableKey; +extern UInt32 dwBlockTableKey; + +bool InitCryptTable(); +UInt32 HashString(const char *lpszString, UInt32 dwHashType); +bool EncryptData(UInt8 *lpbyBuffer, UInt32 dwLength, UInt32 dwKey); +bool DecryptData(UInt8 *lpbyBuffer, UInt32 dwLength, UInt32 dwKey); +UInt32 DetectFileSeed(UInt32 * block, UInt32 decrypted, UInt32 blocksize); + +#endif // #ifndef MPQCRYPT_INCLUDED +