This commit is contained in:
Shauren
2019-07-13 14:55:54 +02:00
parent 74a801182a
commit 6f7ef6e3f0
5 changed files with 135 additions and 31 deletions

View File

@@ -211,17 +211,27 @@ static CASC_ENCRYPTION_KEY CascKeys[] =
// { 0x5DD92EE32BBF9ABDULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 234 WOW-27004patch8.0.1_Subm filedataid 2238294
{ 0x0B68A7AF5F85F7EEULL, { 0x27, 0xAA, 0x01, 0x10, 0x82, 0xF5, 0xE8, 0xBB, 0xBD, 0x71, 0xD1, 0xBA, 0x04, 0xF6, 0xAB, 0xA4 } }, // 236 WOW-28151patch8.1.0_PTR encrypted06 Flying pig mount
// { 0x01531713C83FCC39ULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 237 WOW-28151patch8.1.0_PTR fdid 2460009, 2460732
// { 0x76E4F6739A35E8D7ULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 238 WOW-28294patch8.1.0_PTR starts at fdid 2492654, total of 12 fdids
{ 0x66033F28DC01923CULL, { 0x9F, 0x95, 0x19, 0x86, 0x14, 0x90, 0xC5, 0xA9, 0xFF, 0xD4, 0xD8, 0x2A, 0x6D, 0x00, 0x67, 0xDB } }, // 239 WOW-28294patch8.1.0_PTR vulpine familiar mount
{ 0xFCF34A9B05AE7E6AULL, { 0xE7, 0xC2, 0xC8, 0xF7, 0x7E, 0x30, 0xAC, 0x24, 0x0F, 0x39, 0xEC, 0x23, 0x97, 0x12, 0x96, 0xE5 } }, // 240 WOW-28151patch8.1.0_PTR fdid 2468985, 2471011, 2471012, 2471014, 2471016, 2471018, 2530045
{ 0xE2F6BD41298A2AB9ULL, { 0xC5, 0xDC, 0x1B, 0xB4, 0x3B, 0x8C, 0xF3, 0xF0, 0x85, 0xD6, 0x98, 0x68, 0x26, 0xB9, 0x28, 0xEC } }, // 241 WOW-28151patch8.1.0_PTR fdid 2468988, 2471019, 2471020, 2471021, 2471022, 2471023
{ 0x76E4F6739A35E8D7ULL, { 0x05, 0xCF, 0x27, 0x67, 0x22, 0xE7, 0x16, 0x5C, 0x5A, 0x4F, 0x65, 0x95, 0x25, 0x6A, 0x0B, 0xFB } }, // 238 WOW-28294patch8.1.0_PTR Sylverian Dreamer mount
{ 0x66033F28DC01923CULL, { 0x9F, 0x95, 0x19, 0x86, 0x14, 0x90, 0xC5, 0xA9, 0xFF, 0xD4, 0xD8, 0x2A, 0x6D, 0x00, 0x67, 0xDB } }, // 239 WOW-28294patch8.1.0_PTR Vulpine Familiar mount
{ 0xFCF34A9B05AE7E6AULL, { 0xE7, 0xC2, 0xC8, 0xF7, 0x7E, 0x30, 0xAC, 0x24, 0x0F, 0x39, 0xEC, 0x23, 0x97, 0x12, 0x96, 0xE5 } }, // 240 WOW-28151patch8.1.0_PTR Alliance fireworks
{ 0xE2F6BD41298A2AB9ULL, { 0xC5, 0xDC, 0x1B, 0xB4, 0x3B, 0x8C, 0xF3, 0xF0, 0x85, 0xD6, 0x98, 0x68, 0x26, 0xB9, 0x28, 0xEC } }, // 241 WOW-28151patch8.1.0_PTR Horde fireworks
{ 0x14C4257E557B49A1ULL, { 0x06, 0x4A, 0x97, 0x09, 0xF4, 0x2D, 0x50, 0xCB, 0x5F, 0x8B, 0x94, 0xBC, 0x1A, 0xCF, 0xDD, 0x5D } }, // 242 WOW-28440patch8.1.0_PTR dor cinematic
{ 0x1254E65319C6EEFFULL, { 0x79, 0xD2, 0xB3, 0xD1, 0xCC, 0xB0, 0x15, 0x47, 0x4E, 0x71, 0x58, 0x81, 0x38, 0x64, 0xB8, 0xE6 } }, // 243 WOW-28440patch8.1.0_PTR akt cinematic
// { 0xC8753773ADF1174CULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 244 WOW-28938patch8.1.5_PTR starts at fdid 2615771, total of 14 fdids
// { 0x2170BCAA9FA96E22ULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 245 WOW-28938patch8.1.5_PTR alpaca mount
// { 0xC8753773ADF1174CULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 244 WOW-28938patch8.1.5_PTR starts at fdid 2615771, total of 15 fdids
// { 0x2170BCAA9FA96E22ULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 245 WOW-28938patch8.1.5_PTR alpaca mount
// { 0x75485627AA225F4DULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 246 WOW-28938patch8.1.5_PTR fdid 2741546, 2741548, 2741549
{ 0x08717B15BF3C7955ULL, { 0x4B, 0x06, 0xBF, 0x9D, 0x17, 0x66, 0x3C, 0xEB, 0x33, 0x12, 0xEA, 0x3C, 0x69, 0xFB, 0xC5, 0xDD } }, // 248 WOW-29220patch8.1.5_PTR fdid 2823166
{ 0x9FD609902B4B2E07ULL, { 0xAB, 0xE0, 0xC5, 0xF9, 0xC1, 0x23, 0xE6, 0xE2, 0x4E, 0x7B, 0xEA, 0x43, 0xC2, 0xBF, 0x00, 0xAC } }, // 250 WOW-29418patch8.1.5_PTR dpr cinematic
{ 0x08717B15BF3C7955ULL, { 0x4B, 0x06, 0xBF, 0x9D, 0x17, 0x66, 0x3C, 0xEB, 0x33, 0x12, 0xEA, 0x3C, 0x69, 0xFB, 0xC5, 0xDD } }, // 248 WOW-29220patch8.1.5_PTR inv_encrypted20.blp (fdid 2823166)
// { 0xD19DCF7ACA8D96D6ULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 249 WOW-30080patch8.2.0_PTR starts at fdid 2843110, total of 10 fdids
{ 0x9FD609902B4B2E07ULL, { 0xAB, 0xE0, 0xC5, 0xF9, 0xC1, 0x23, 0xE6, 0xE2, 0x4E, 0x7B, 0xEA, 0x43, 0xC2, 0xBF, 0x00, 0xAC } }, // 250 WOW-29418patch8.1.5_PTR Derek Proudmoore cinematic (dpr, 5 files)
// { 0xCB26B441FAE4C8CDULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 251 WOW-30080patch8.2.0_PTR fdid 2888623, 2892270, 2892271, 2892272, 2892274, 2892275
// { 0xA98C7594F55C02F0ULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 252 WOW-30080patch8.2.0_PTR starts at fdid 2921871, total of 24 fdids
// { 0x259EE68CD9E76DBAULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 253 WOW-30080patch8.2.0_PTR starts at fdid 2957406, total of 30 fdids
// { 0x6A026290FBDB3754ULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 255 WOW-30080patch8.2.0_PTR starts at fdid 2976294, total of 201 fdids
{ 0xCF72FD04608D36EDULL, { 0xA0, 0xA8, 0x89, 0x97, 0x6D, 0x02, 0xFA, 0x8D, 0x00, 0xF7, 0xAF, 0x00, 0x17, 0xAD, 0x72, 0x1F } }, // 257 WOW-30262patch8.2.0_PTR Azshara Warbringer cinematic (5 files)
// { 0x17F07C2E3A45DB3DULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 258 WOW-30262patch8.2.0_PTR starts at fdid 982457, total of 17 fdids
{ 0xC050FA06BB0538F6ULL, { 0xC5, 0x52, 0xF5, 0xD0, 0xB7, 0x22, 0x31, 0x50, 0x2D, 0x25, 0x47, 0x31, 0x4E, 0x60, 0x15, 0xF7 } }, // 260 WOW-30495patch8.2.0_PTR Crossroads cinematic (5 files)
// { 0xAB5CDD3FC321831FULL, { 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x??, 0x?? } }, // 261 WOW-30495patch8.2.0_PTR Unknown cinematic fdid 3022943-3022947 (5 files)
{ 0xA7B7D1F12395040EULL, { 0x36, 0xAD, 0x3B, 0x31, 0x27, 0x3F, 0x1E, 0xBC, 0xEE, 0x85, 0x20, 0xAA, 0xA7, 0x4B, 0x12, 0xF2 } }, // 262 WOW-30495patch8.2.0_PTR Nazjatar intro cinematics (9 files)
};
//-----------------------------------------------------------------------------

View File

@@ -114,8 +114,6 @@ typedef struct _TVFS_SPAN_ENTRY
//-----------------------------------------------------------------------------
// Handler definition for TVFS root file
//static FILE * fp = NULL;
// Structure for the root handler
struct TRootHandler_TVFS : public TFileTreeRoot
{
@@ -439,15 +437,11 @@ struct TRootHandler_TVFS : public TFileTreeRoot
TVFS_DIRECTORY_HEADER SubHeader;
TVFS_PATH_TABLE_ENTRY PathEntry;
PCASC_CKEY_ENTRY pCKeyEntry;
ENCODED_KEY EKey;
LPBYTE pbVfsSpanEntry;
char * szSavePathPtr = PathBuffer.szPtr;
DWORD dwSpanCount = 0;
int nError;
// Prepare the EKey structure to be filled with zeros
memset(&EKey, 0, sizeof(ENCODED_KEY));
// Parse the file table
while(pbPathTablePtr < pbPathTableEnd)
{
@@ -486,17 +480,17 @@ struct TRootHandler_TVFS : public TFileTreeRoot
pbVfsSpanEntry = CaptureVfsSpanCount(DirHeader, PathEntry.NodeValue, dwSpanCount);
if(pbVfsSpanEntry == NULL)
return ERROR_BAD_FORMAT;
#ifdef _DEBUG
// So far we've only saw entries with 1 span.
// Need to test files with multiple spans. Ignore such files for now.
if(dwSpanCount != 1)
__debugbreak();
// TODO: Need to support multi-span files larger than 4 GB
// Example: CoD: Black Ops 4, file "zone/base.xpak" 0x16 spans, over 15 GB size
assert(dwSpanCount == 1);
dwSpanCount = 1;
#endif
// Parse all span entries
for(DWORD i = 0; i < dwSpanCount; i++)
{
TVFS_SPAN_ENTRY SpanEntry;
ENCODED_KEY EKey = {0};
// Capture the n-th span entry
pbVfsSpanEntry = CaptureVfsSpanEntry(DirHeader, pbVfsSpanEntry, SpanEntry);
@@ -529,12 +523,6 @@ struct TRootHandler_TVFS : public TFileTreeRoot
}
else
{
// if (fp != NULL)
// {
// fwrite(PathBuffer.szBegin, 1, (PathBuffer.szPtr - PathBuffer.szBegin), fp);
// fprintf(fp, "\n");
// }
// Insert the file to the file tree
if((pCKeyEntry = FindCKeyEntry_EKey(hs, EKey.Value)) != NULL)
{

View File

@@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,50,0,155
PRODUCTVERSION 1,50,0,155
FILEVERSION 1,50,0,156
PRODUCTVERSION 1,50,0,156
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -42,12 +42,12 @@ BEGIN
BLOCK "040504b0"
BEGIN
VALUE "FileDescription", "CascLib library for reading Blizzard CASC storages"
VALUE "FileVersion", "1, 50, 0, 155\0"
VALUE "FileVersion", "1, 50, 0, 156\0"
VALUE "InternalName", "CascLib"
VALUE "LegalCopyright", "Copyright (c) 2014 - 2019 Ladislav Zezula"
VALUE "OriginalFilename", "CascLib.dll"
VALUE "ProductName", "CascLib"
VALUE "ProductVersion", "1, 50, 0, 155\0"
VALUE "ProductVersion", "1, 50, 0, 156\0"
END
END
BLOCK "VarFileInfo"

View File

@@ -0,0 +1,106 @@
/*****************************************************************************/
/* IndexMap.h Copyright (c) Ladislav Zezula 2019 */
/*---------------------------------------------------------------------------*/
/* Interface of index-based map for CascLib. This is a map type created */
/* on top of an array of contant-size objects, that is already sorted. */
/*---------------------------------------------------------------------------*/
/* Date Ver Who Comment */
/* -------- ---- --- ------- */
/* 29.04.19 1.00 Lad The first version of Index.h */
/*****************************************************************************/
#ifndef __CASC_INDEX_MAP_H__
#define __CASC_INDEX_MAP_H__
//-----------------------------------------------------------------------------
// Structures
class CASC_INDEX_MAP
{
public:
int Create(size_t MaxItems, size_t ObjectLength_, size_t KeyLength_, size_t KeyOffset_)
{
DWORD IndexBitSize = 8;
// Determine the index size
if(MaxItems >= 0x10000)
IndexBitSize = 16;
if(MaxItems >= 0x100000)
IndexBitSize = 20;
// Save the values
IndexTableSize = (1 << IndexBitSize);
IndexTableMask = IndexTableSize - 1;
ObjectLength = ObjectLength_;
KeyOffset = KeyOffset_;
KeyLength = KeyLength_;
// Allocate the new index object
IndexTable = CASC_ALLOC(void *, IndexTableSize);
if(IndexTable != NULL)
{
memset(IndexTable, 0, IndexTableSize * sizeof(void *));
return ERROR_SUCCESS;
}
return ERROR_NOT_ENOUGH_MEMORY;
}
void * FindObject(void * pvKey)
{
LPBYTE StartObject;
DWORD StartIndex;
// Verify pointer to the map
if(IndexTable != NULL)
{
// Retrieve the index from the key
StartIndex = KeyToIndex(pvKey);
StartObject = (LPBYTE)IndexTable[StartIndex];
if(StartObject == NULL)
return NULL;
// Enumerate the array as long as the index matches
do
{
// Compare the key
if(!memcmp(StartObject + KeyOffset, pvKey, KeyLength))
return StartObject;
// Key mismatch -> go next object
StartObject = StartObject + ObjectLength;
}
while(KeyToIndex(StartObject + KeyOffset) == StartIndex);
}
// Not found
return NULL;
}
protected:
inline DWORD KeyToIndex(void * pvKey)
{
return *((PDWORD)pvKey) & IndexTableMask;
}
void ** IndexTable; // Pointer table. Each entry, if non-NULL, contains a pointer to the first object
// into a sorted array. Search function must then match the entire key.
// In case of no match, the search process must go to the next-in-array object.
size_t ObjectLength; // Length of the single object
size_t KeyOffset; // How far is the key from the begin of the structure (in bytes)
size_t KeyLength; // Length of the key
DWORD IndexTableSize; // Size of the IndexTableSize, in bytes
DWORD IndexTableMask; // Bit mask for conversion from hash to index
};
typedef CASC_INDEX_MAP *PCASC_INDEX_MAP;
//-----------------------------------------------------------------------------
// Functions
bool IndexMap_InsertObject(PCASC_INDEX_MAP pIndexMap, void * pvNewObject, void * pvKey);
void IndexMap_Free(PCASC_INDEX_MAP pIndexMap);
#endif // __CASC_INDEX_MAP_H__

View File

@@ -62,7 +62,7 @@ recastnavigation (Recast is state of the art navigation mesh construction toolse
CascLib (An open-source implementation of library for reading CASC storage from Blizzard games since 2014)
https://github.com/ladislav-zezula/CascLib
Version: c588b7bf538a010fd3376c90bd3a59f2142f05be
Version: b802391cfb9418d5550dc1671f18da1ca1c445d4
rapidjson (A fast JSON parser/generator for C++ with both SAX/DOM style API http://rapidjson.org/)
https://github.com/miloyip/rapidjson