TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CascCommon.h
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* CascCommon.h Copyright (c) Ladislav Zezula 2014 */
3 /*---------------------------------------------------------------------------*/
4 /* Common functions for CascLib */
5 /*---------------------------------------------------------------------------*/
6 /* Date Ver Who Comment */
7 /* -------- ---- --- ------- */
8 /* 29.04.14 1.00 Lad The first version of CascCommon.h */
9 /*****************************************************************************/
10 
11 #ifndef __CASCCOMMON_H__
12 #define __CASCCOMMON_H__
13 
14 //-----------------------------------------------------------------------------
15 // Compression support
16 
17 // Include functions from zlib
18 #ifndef __SYS_ZLIB
19  #include "zlib/zlib.h"
20 #else
21  #include <zlib.h>
22 #endif
23 
24 #include "CascPort.h"
25 #include "common/Common.h"
26 #include "common/DynamicArray.h"
27 #include "common/Map.h"
28 #include "common/FileStream.h"
29 #include "common/Directory.h"
30 #include "common/ListFile.h"
31 #include "common/DumpContext.h"
32 #include "common/RootHandler.h"
33 
34 // Headers from LibTomCrypt
36 
37 // For HashStringJenkins
38 #include "jenkins/lookup.h"
39 
40 //-----------------------------------------------------------------------------
41 // CascLib private defines
42 
43 #define CASC_GAME_HOTS 0x00010000 // Heroes of the Storm
44 #define CASC_GAME_WOW6 0x00020000 // World of Warcraft - Warlords of Draenor
45 #define CASC_GAME_DIABLO3 0x00030000 // Diablo 3 since PTR 2.2.0
46 #define CASC_GAME_OVERWATCH 0x00040000 // Overwatch since PTR 24919
47 #define CASC_GAME_STARCRAFT2 0x00050000 // Starcraft II - Legacy of the Void, since build 38996
48 #define CASC_GAME_MASK 0xFFFF0000 // Mask for getting game ID
49 
50 #define CASC_INDEX_COUNT 0x10
51 #define CASC_FILE_KEY_SIZE 0x09 // Size of the file key
52 #define CASC_MAX_DATA_FILES 0x100
53 #define CASC_EXTRA_FILES 0x20 // Number of extra entries to be reserved for additionally inserted files
54 
55 #define CASC_SEARCH_HAVE_NAME 0x0001 // Indicated that previous search found a name
56 
57 #define BLTE_HEADER_SIGNATURE 0x45544C42 // 'BLTE' header in the data files
58 #define BLTE_HEADER_DELTA 0x1E // Distance of BLTE header from begin of the header area
59 #define MAX_HEADER_AREA_SIZE 0x2A // Length of the file header area
60 
61 // File header area in the data.xxx:
62 // BYTE HeaderHash[MD5_HASH_SIZE]; // MD5 of the frame array
63 // DWORD dwFileSize; // Size of the file (see comment before CascGetFileSize for details)
64 // BYTE SomeSize[4]; // Some size (big endian)
65 // BYTE Padding[6]; // Padding (?)
66 // DWORD dwSignature; // Must be "BLTE"
67 // BYTE HeaderSizeAsBytes[4]; // Header size in bytes (big endian)
68 // BYTE MustBe0F; // Must be 0x0F. Optional, only if HeaderSizeAsBytes != 0
69 // BYTE FrameCount[3]; // Frame count (big endian). Optional, only if HeaderSizeAsBytes != 0
70 
71 // Prevent problems with CRT "min" and "max" functions,
72 // as they are not defined on all platforms
73 #define CASCLIB_MIN(a, b) ((a < b) ? a : b)
74 #define CASCLIB_MAX(a, b) ((a > b) ? a : b)
75 #define CASCLIB_UNUSED(p) ((void)(p))
76 
77 #define CASC_PACKAGE_BUFFER 0x1000
78 
79 #ifndef _maxchars
80 #define _maxchars(buff) ((sizeof(buff) / sizeof(buff[0])) - 1)
81 #endif
82 
83 //-----------------------------------------------------------------------------
84 // In-memory structures
85 // See http://pxr.dk/wowdev/wiki/index.php?title=CASC for more information
86 
87 struct TFileStream;
88 
89 typedef enum _CBLD_TYPE
90 {
91  CascBuildNone = 0, // No build type found
92  CascBuildInfo, // .build.info
93  CascBuildDb, // .build.db (older storages)
95 
96 typedef struct _ENCODING_KEY
97 {
98  BYTE Value[MD5_HASH_SIZE]; // MD5 of the file
99 
101 
102 typedef struct _CASC_INDEX_ENTRY
103 {
104  BYTE IndexKey[CASC_FILE_KEY_SIZE]; // The first 9 bytes of the encoding key
105  BYTE FileOffsetBE[5]; // Index of data file and offset within (big endian).
106  BYTE FileSizeLE[4]; // Size occupied in the storage file (data.###). See comment before CascGetFileSize for details
108 
109 typedef struct _CASC_MAPPING_TABLE
110 {
111  TCHAR * szFileName; // Name of the key mapping file
112  LPBYTE pbFileData; // Pointer to the file data
113  DWORD cbFileData; // Length of the file data
114  BYTE ExtraBytes; // (?) Extra bytes in the key record
115  BYTE SpanSizeBytes; // Size of field with file size
116  BYTE SpanOffsBytes; // Size of field with file offset
117  BYTE KeyBytes; // Size of the file key
118  BYTE SegmentBits; // Number of bits for the file offset (rest is archive index)
120 
121  PCASC_INDEX_ENTRY pIndexEntries; // Sorted array of index entries
122  DWORD nIndexEntries; // Number of index entries
123 
125 
126 typedef struct _CASC_FILE_FRAME
127 {
128  DWORD FrameArchiveOffset; // Archive file pointer corresponding to the begin of the frame
129  DWORD FrameFileOffset; // File pointer corresponding to the begin of the frame
130  DWORD CompressedSize; // Compressed size of the file
131  DWORD FrameSize; // Size of the frame
132  BYTE md5[MD5_HASH_SIZE]; // MD5 hash of the file sector
134 
135 // The encoding file is in the form of:
136 // * File header
137 // * String block #1
138 // * Table A header
139 // * Table A entries
140 // * Table B header
141 // * Table B entries
142 // * String block #2
143 // http://pxr.dk/wowdev/wiki/index.php?title=CASC#Key_CASC_Files
144 typedef struct _CASC_ENCODING_HEADER
145 {
146  BYTE Magic[2]; // "EN"
147  BYTE Version; // Expected to be 1 by CascLib
148  BYTE ChecksumSizeA; // The length of the checksums in Encoding Table
149  BYTE ChecksumSizeB; // The length of the checksums in Encoding Layout Table
150  BYTE Flags_TableA[2]; // Flags for Encoding Table
151  BYTE Flags_TableB[2]; // Flags for Encoding Layout Table
152  BYTE Entries_TableA[4]; // Number of segments in Encoding Table (big endian)
153  BYTE Entries_TableB[4]; // Number of segments in Encoding Layout Table (big endian)
155  BYTE Size_StringTable1[4]; // Size of the string block #1
156 
158 
159 typedef struct _CASC_ENCODING_ENTRY
160 {
161  USHORT KeyCount; // Number of index keys
162  BYTE FileSizeBE[4]; // Compressed file size (header area + frame headers + compressed frames), in bytes
163  BYTE EncodingKey[MD5_HASH_SIZE]; // File encoding key
164 
165  // Followed by the index keys
166  // (number of items = KeyCount)
167  // Followed by the index keys (number of items = KeyCount)
169 
170 // A version of CASC_ENCODING_ENTRY with one index key
172 {
173  USHORT KeyCount; // Number of index keys
174  BYTE FileSizeBE[4]; // Compressed file size (header area + frame headers + compressed frames), in bytes
175  BYTE EncodingKey[MD5_HASH_SIZE]; // File encoding key
176  BYTE IndexKey[MD5_HASH_SIZE]; // File index key
177 
179 
180 #define GET_INDEX_KEY(pEncodingEntry) (pEncodingEntry->EncodingKey + MD5_HASH_SIZE)
181 #define FAKE_ENCODING_ENTRY_SIZE (sizeof(CASC_ENCODING_ENTRY) + MD5_HASH_SIZE)
182 
183 //-----------------------------------------------------------------------------
184 // Structures for CASC storage and CASC file
185 
186 typedef struct _TCascStorage
187 {
188  const char * szClassName; // "TCascStorage"
189  const TCHAR * szIndexFormat; // Format of the index file name
190  TCHAR * szRootPath; // This is the game directory
191  TCHAR * szDataPath; // This is the directory where data files are
192  TCHAR * szBuildFile; // Build file name (.build.info or .build.db)
193  TCHAR * szIndexPath; // This is the directory where index files are
194  TCHAR * szUrlPath; // URL to the Blizzard servers
195  DWORD dwRefCount; // Number of references
196  DWORD dwGameInfo; // Game type
197  DWORD dwBuildNumber; // Game build number
198  DWORD dwFileBeginDelta; // This is number of bytes to shift back from archive offset (from index entry) to actual begin of file data
199  DWORD dwDefaultLocale; // Default locale, read from ".build.info"
200 
201  CBLD_TYPE BuildFileType; // Type of the build file
202 
205  QUERY_KEY ArchivesGroup; // Key array of the "archive-group"
206  QUERY_KEY ArchivesKey; // Key array of the "archives"
207  QUERY_KEY PatchArchivesKey; // Key array of the "patch-archives"
213 
215 
217  PCASC_MAP pIndexEntryMap; // Map of index entries
218 
219  QUERY_KEY EncodingFile; // Content of the ENCODING file
220  PCASC_MAP pEncodingMap; // Map of encoding entries
221  DYNAMIC_ARRAY ExtraEntries; // Extra encoding entries
222 
223  TRootHandler * pRootHandler; // Common handler for various ROOT file formats
224 
225 } TCascStorage;
226 
227 typedef struct _TCascFile
228 {
229  TCascStorage * hs; // Pointer to storage structure
230  TFileStream * pStream; // An open data stream
231  const char * szClassName; // "TCascFile"
232 
233  DWORD FilePointer; // Current file pointer
234 
235  DWORD ArchiveIndex; // Index of the archive (data.###)
236  DWORD HeaderOffset; // Offset of the BLTE header, relative to the begin of the archive
237  DWORD HeaderSize; // Length of the BLTE header
238  DWORD FramesOffset; // Offset of the frame data, relative to the begin of the archive
239  DWORD CompressedSize; // Compressed size of the file (in bytes)
240  DWORD FileSize; // Size of file, in bytes
241  BYTE FrameArrayHash[MD5_HASH_SIZE]; // MD5 hash of the frame array
242 
243  PCASC_FILE_FRAME pFrames; // Array of file frames
244  DWORD FrameCount; // Number of the file frames
245 
246  LPBYTE pbFileCache; // Pointer to file cache
247  DWORD cbFileCache; // Size of the file cache
248  DWORD CacheStart; // Starting offset in the cache
249  DWORD CacheEnd; // Ending offset in the cache
250 
251 #ifdef CASCLIB_TEST // Extra fields for analyzing the file size problem
252  DWORD FileSize_RootEntry; // File size, from the root entry
253  DWORD FileSize_EncEntry; // File size, from the encoding entry
254  DWORD FileSize_IdxEntry; // File size, from the index entry
255  DWORD FileSize_HdrArea; // File size, as stated in the file header area
256  DWORD FileSize_FrameSum; // File size as sum of frame sizes
257 #endif
258 
259 } TCascFile;
260 
261 typedef struct _TCascSearch
262 {
263  TCascStorage * hs; // Pointer to the storage handle
264  const char * szClassName; // Contains "TCascSearch"
265  TCHAR * szListFile; // Name of the listfile
266  void * pCache; // Listfile cache
267  char * szMask; // Search mask
268  char szFileName[MAX_PATH]; // Buffer for the file name
269 
270  // Provider-specific data
271  void * pRootContext; // Root-specific search context
272  size_t IndexLevel1; // Root-specific search context
273  size_t IndexLevel2; // Root-specific search context
274  DWORD dwState; // Pointer to the search state (0 = listfile, 1 = nameless, 2 = done)
275 
276  BYTE BitArray[1]; // Bit array of encoding keys. Set for each entry that has already been reported
277 
278 } TCascSearch;
279 
280 //-----------------------------------------------------------------------------
281 // Memory management
282 //
283 // We use our own macros for allocating/freeing memory. If you want
284 // to redefine them, please keep the following rules:
285 //
286 // - The memory allocation must return NULL if not enough memory
287 // (i.e not to throw exception)
288 // - The allocating function does not need to fill the allocated buffer with zeros
289 // - The reallocating function must support NULL as the previous block
290 // - Memory freeing function doesn't have to test the pointer to NULL
291 //
292 
293 #if defined(_MSC_VER) && defined(_DEBUG)
294 
295 #define CASC_REALLOC(type, ptr, count) (type *)HeapReAlloc(GetProcessHeap(), 0, ptr, ((count) * sizeof(type)))
296 #define CASC_ALLOC(type, count) (type *)HeapAlloc(GetProcessHeap(), 0, ((count) * sizeof(type)))
297 #define CASC_FREE(ptr) HeapFree(GetProcessHeap(), 0, ptr)
298 
299 #else
300 
301 #define CASC_REALLOC(type, ptr, count) (type *)realloc(ptr, (count) * sizeof(type))
302 #define CASC_ALLOC(type, count) (type *)malloc((count) * sizeof(type))
303 #define CASC_FREE(ptr) free(ptr)
304 
305 #endif
306 
307 //-----------------------------------------------------------------------------
308 // Big endian number manipulation
309 
310 DWORD ConvertBytesToInteger_3(LPBYTE ValueAsBytes);
311 DWORD ConvertBytesToInteger_4(LPBYTE ValueAsBytes);
314 
315 void ConvertIntegerToBytes_4(DWORD Value, LPBYTE ValueAsBytes);
316 void FreeCascBlob(PQUERY_KEY pQueryKey);
317 
318 //-----------------------------------------------------------------------------
319 // Text file parsing (CascFiles.cpp)
320 
321 int LoadBuildInfo(TCascStorage * hs);
322 int CheckGameDirectory(TCascStorage * hs, TCHAR * szDirectory);
323 
324 int GetRootVariableIndex(const char * szLinePtr, const char * szLineEnd, const char * szVariableName, int * PtrIndex);
325 int ParseRootFileLine(const char * szLinePtr, const char * szLineEnd, int nFileNameIndex, PQUERY_KEY pEncodingKey, char * szFileName, size_t nMaxChars);
326 
327 //-----------------------------------------------------------------------------
328 // Internal file functions
329 
332 
333 PCASC_ENCODING_ENTRY FindEncodingEntry(TCascStorage * hs, PQUERY_KEY pEncodingKey, PDWORD PtrIndex);
334 PCASC_INDEX_ENTRY FindIndexEntry(TCascStorage * hs, PQUERY_KEY pIndexKey);
335 
336 int CascDecompress(LPBYTE pvOutBuffer, PDWORD pcbOutBuffer, LPBYTE pvInBuffer, DWORD cbInBuffer);
337 int CascDecrypt (LPBYTE pbOutBuffer, PDWORD pcbOutBuffer, LPBYTE pbInBuffer, DWORD cbInBuffer, DWORD dwFrameIndex);
338 int CascDirectCopy(LPBYTE pbOutBuffer, PDWORD pcbOutBuffer, LPBYTE pbInBuffer, DWORD cbInBuffer);
339 
340 //-----------------------------------------------------------------------------
341 // Support for ROOT file
342 
343 int RootHandler_CreateMNDX(TCascStorage * hs, LPBYTE pbRootFile, DWORD cbRootFile);
344 int RootHandler_CreateDiablo3(TCascStorage * hs, LPBYTE pbRootFile, DWORD cbRootFile);
345 int RootHandler_CreateOverwatch(TCascStorage * hs, LPBYTE pbRootFile, DWORD cbRootFile);
346 int RootHandler_CreateWoW6(TCascStorage * hs, LPBYTE pbRootFile, DWORD cbRootFile, DWORD dwLocaleMask);
347 
348 //-----------------------------------------------------------------------------
349 // Dumping CASC data structures
350 
351 #ifdef _DEBUG
352 void CascDumpSparseArray(const char * szFileName, void * pvSparseArray);
353 void CascDumpNameFragTable(const char * szFileName, void * pvMarFile);
354 void CascDumpFileNames(const char * szFileName, void * pvMarFile);
355 void CascDumpIndexEntries(const char * szFileName, TCascStorage * hs);
356 void CascDumpEncodingEntry(TCascStorage * hs, TDumpContext * dc, PCASC_ENCODING_ENTRY pEncodingEntry, int nDumpLevel);
357 void CascDumpFile(const char * szFileName, HANDLE hFile);
358 #endif // _DEBUG
359 
360 #endif // __CASCCOMMON_H__
int CascDirectCopy(LPBYTE pbOutBuffer, PDWORD pcbOutBuffer, LPBYTE pbInBuffer, DWORD cbInBuffer)
Definition: CascDecrypt.cpp:289
TRootHandler * pRootHandler
Definition: CascCommon.h:223
DWORD CacheEnd
Definition: CascCommon.h:249
Definition: CascCommon.h:96
DWORD FrameSize
Definition: CascCommon.h:131
QUERY_KEY RootKey
Definition: CascCommon.h:208
BYTE SpanSizeBytes
Definition: CascCommon.h:115
BYTE ChecksumSizeA
Definition: CascCommon.h:148
struct _TCascFile TCascFile
const char * szClassName
Definition: CascCommon.h:231
DWORD HeaderOffset
Definition: CascCommon.h:236
BYTE ChecksumSizeB
Definition: CascCommon.h:149
struct _TCascStorage TCascStorage
DWORD dwDefaultLocale
Definition: CascCommon.h:199
struct _CASC_ENCODING_ENTRY_1 * PCASC_ENCODING_ENTRY_1
void * HANDLE
Definition: CascPort.h:146
unsigned long long ULONGLONG
Definition: CascPort.h:144
DWORD dwState
Definition: CascCommon.h:274
DWORD * PDWORD
Definition: CascPort.h:151
_CBLD_TYPE
Definition: CascCommon.h:89
BYTE SegmentBits
Definition: CascCommon.h:118
struct _CASC_MAPPING_TABLE CASC_MAPPING_TABLE
CASC_MAPPING_TABLE KeyMapping[CASC_INDEX_COUNT]
Definition: CascCommon.h:216
int CascDecrypt(LPBYTE pbOutBuffer, PDWORD pcbOutBuffer, LPBYTE pbInBuffer, DWORD cbInBuffer, DWORD dwFrameIndex)
Definition: CascDecrypt.cpp:205
BYTE KeyBytes
Definition: CascCommon.h:117
int RootHandler_CreateMNDX(TCascStorage *hs, LPBYTE pbRootFile, DWORD cbRootFile)
Definition: CascRootFile_Mndx.cpp:3139
DWORD ConvertBytesToInteger_4_LE(LPBYTE ValueAsBytes)
Definition: CascCommon.cpp:43
struct _TCascSearch TCascSearch
#define CASC_MAX_DATA_FILES
Definition: CascCommon.h:52
Definition: RootHandler.h:66
QUERY_KEY ArchivesKey
Definition: CascCommon.h:206
Definition: CascCommon.h:109
BYTE FileSizeBE[4]
Definition: CascCommon.h:162
TCascStorage * hs
Definition: CascCommon.h:263
QUERY_KEY DownloadKey
Definition: CascCommon.h:210
DWORD ConvertBytesToInteger_4(LPBYTE ValueAsBytes)
Definition: CascCommon.cpp:31
CBLD_TYPE BuildFileType
Definition: CascCommon.h:201
ULONGLONG MaxFileOffset
Definition: CascCommon.h:119
Definition: CascLib.h:138
BYTE field_11
Definition: CascCommon.h:154
#define MAX_PATH
Definition: CascPort.h:160
struct _CASC_MAPPING_TABLE * PCASC_MAPPING_TABLE
ULONGLONG ConvertBytesToInteger_5(LPBYTE ValueAsBytes)
Definition: CascCommon.cpp:56
PCASC_MAP pIndexEntryMap
Definition: CascCommon.h:217
int LoadBuildInfo(TCascStorage *hs)
Definition: CascFiles.cpp:826
BYTE IndexKey[MD5_HASH_SIZE]
Definition: CascCommon.h:176
char TCHAR
Definition: CascPort.h:148
DWORD FileSize
Definition: CascCommon.h:240
struct _ENCODING_KEY ENCODING_KEY
LPBYTE pbFileData
Definition: CascCommon.h:112
struct _CASC_ENCODING_ENTRY CASC_ENCODING_ENTRY
void * pCache
Definition: CascCommon.h:266
struct _CASC_INDEX_ENTRY * PCASC_INDEX_ENTRY
int ParseRootFileLine(const char *szLinePtr, const char *szLineEnd, int nFileNameIndex, PQUERY_KEY pEncodingKey, char *szFileName, size_t nMaxChars)
Definition: CascFiles.cpp:982
Definition: CascCommon.h:92
QUERY_KEY CdnBuildKey
Definition: CascCommon.h:204
int RootHandler_CreateWoW6(TCascStorage *hs, LPBYTE pbRootFile, DWORD cbRootFile, DWORD dwLocaleMask)
Definition: CascRootFile_WoW6.cpp:487
PCASC_INDEX_ENTRY pIndexEntries
Definition: CascCommon.h:121
BYTE Flags_TableA[2]
Definition: CascCommon.h:150
TCascFile * IsValidFileHandle(HANDLE hFile)
Definition: CascOpenFile.cpp:18
QUERY_KEY ArchivesGroup
Definition: CascCommon.h:205
BYTE Magic[2]
Definition: CascCommon.h:146
BYTE * LPBYTE
Definition: CascPort.h:152
DWORD dwFileBeginDelta
Definition: CascCommon.h:198
LPBYTE pbFileCache
Definition: CascCommon.h:246
DYNAMIC_ARRAY ExtraEntries
Definition: CascCommon.h:221
BYTE SpanOffsBytes
Definition: CascCommon.h:116
TCHAR * szUrlPath
Definition: CascCommon.h:194
unsigned short USHORT
Definition: CascPort.h:137
DWORD FrameCount
Definition: CascCommon.h:244
const TCHAR * szIndexFormat
Definition: CascCommon.h:189
DWORD nIndexEntries
Definition: CascCommon.h:122
#define CASC_INDEX_COUNT
Definition: CascCommon.h:50
struct _CASC_FILE_FRAME CASC_FILE_FRAME
void FreeCascBlob(PQUERY_KEY pQueryKey)
Definition: CascCommon.cpp:80
DWORD ArchiveIndex
Definition: CascCommon.h:235
DWORD FramesOffset
Definition: CascCommon.h:238
void * pRootContext
Definition: CascCommon.h:271
#define MD5_HASH_SIZE
Definition: CascLib.h:105
Definition: DumpContext.h:21
Definition: DynamicArray.h:17
BYTE Flags_TableB[2]
Definition: CascCommon.h:151
struct _CASC_ENCODING_ENTRY * PCASC_ENCODING_ENTRY
BYTE Version
Definition: CascCommon.h:147
TCHAR * szRootPath
Definition: CascCommon.h:190
PCASC_FILE_FRAME pFrames
Definition: CascCommon.h:243
DWORD cbFileCache
Definition: CascCommon.h:247
DWORD HeaderSize
Definition: CascCommon.h:237
BYTE FrameArrayHash[MD5_HASH_SIZE]
Definition: CascCommon.h:241
USHORT KeyCount
Definition: CascCommon.h:173
int RootHandler_CreateDiablo3(TCascStorage *hs, LPBYTE pbRootFile, DWORD cbRootFile)
Definition: CascRootFile_Diablo3.cpp:1079
Definition: CascCommon.h:186
int RootHandler_CreateOverwatch(TCascStorage *hs, LPBYTE pbRootFile, DWORD cbRootFile)
Definition: CascRootFile_Ovr.cpp:133
int CheckGameDirectory(TCascStorage *hs, TCHAR *szDirectory)
Definition: CascFiles.cpp:909
TCHAR * szFileName
Definition: CascCommon.h:111
Definition: CascCommon.h:93
QUERY_KEY PatchArchivesKey
Definition: CascCommon.h:207
struct _CASC_ENCODING_HEADER * PCASC_ENCODING_HEADER
QUERY_KEY EncodingFile
Definition: CascCommon.h:219
BYTE md5[MD5_HASH_SIZE]
Definition: CascCommon.h:132
struct _CASC_INDEX_ENTRY CASC_INDEX_ENTRY
const char * szClassName
Definition: CascCommon.h:264
char * szMask
Definition: CascCommon.h:267
PCASC_MAP pEncodingMap
Definition: CascCommon.h:220
Definition: CascCommon.h:261
QUERY_KEY EncodingKey
Definition: CascCommon.h:212
QUERY_KEY CdnConfigKey
Definition: CascCommon.h:203
TCascStorage * hs
Definition: CascCommon.h:229
DWORD cbFileData
Definition: CascCommon.h:113
TCHAR * szIndexPath
Definition: CascCommon.h:193
char szFileName[MAX_PATH]
Definition: CascCommon.h:268
TCHAR * szBuildFile
Definition: CascCommon.h:192
struct _ENCODING_KEY * PENCODING_KEY
DWORD dwGameInfo
Definition: CascCommon.h:196
unsigned int DWORD
Definition: CascPort.h:139
Definition: Map.h:19
int CascDecompress(LPBYTE pvOutBuffer, PDWORD pcbOutBuffer, LPBYTE pvInBuffer, DWORD cbInBuffer)
Definition: CascDecompress.cpp:18
BYTE Entries_TableA[4]
Definition: CascCommon.h:152
BYTE Entries_TableB[4]
Definition: CascCommon.h:153
BYTE BitArray[1]
Definition: CascCommon.h:276
Definition: CascCommon.h:102
BYTE EncodingKey[MD5_HASH_SIZE]
Definition: CascCommon.h:163
DWORD dwRefCount
Definition: CascCommon.h:195
Definition: CascCommon.h:91
DWORD CacheStart
Definition: CascCommon.h:248
Definition: CascCommon.h:171
BYTE FileOffsetBE[5]
Definition: CascCommon.h:105
DWORD ConvertBytesToInteger_3(LPBYTE ValueAsBytes)
Definition: CascCommon.cpp:19
enum _CBLD_TYPE CBLD_TYPE
struct _CASC_ENCODING_ENTRY_1 CASC_ENCODING_ENTRY_1
DWORD FrameArchiveOffset
Definition: CascCommon.h:128
Definition: CascCommon.h:126
DWORD FrameFileOffset
Definition: CascCommon.h:129
Definition: CascCommon.h:144
#define CASC_FILE_KEY_SIZE
Definition: CascCommon.h:51
Definition: FileStream.h:153
enum _CBLD_TYPE * PCBLD_TYPE
TCHAR * szDataPath
Definition: CascCommon.h:191
USHORT KeyCount
Definition: CascCommon.h:161
BYTE EncodingKey[MD5_HASH_SIZE]
Definition: CascCommon.h:175
DWORD CompressedSize
Definition: CascCommon.h:239
Definition: CascCommon.h:159
BYTE Size_StringTable1[4]
Definition: CascCommon.h:155
const char * szClassName
Definition: CascCommon.h:188
BYTE FileSizeBE[4]
Definition: CascCommon.h:174
PCASC_ENCODING_ENTRY FindEncodingEntry(TCascStorage *hs, PQUERY_KEY pEncodingKey, PDWORD PtrIndex)
Definition: CascOpenFile.cpp:35
unsigned char BYTE
Definition: CascPort.h:136
Definition: CascCommon.h:227
DWORD FilePointer
Definition: CascCommon.h:233
TFileStream * DataFileArray[CASC_MAX_DATA_FILES]
Definition: CascCommon.h:214
TCascStorage * IsValidStorageHandle(HANDLE hStorage)
Definition: CascOpenStorage.cpp:100
int GetRootVariableIndex(const char *szLinePtr, const char *szLineEnd, const char *szVariableName, int *PtrIndex)
Definition: CascFiles.cpp:953
size_t IndexLevel1
Definition: CascCommon.h:272
void ConvertIntegerToBytes_4(DWORD Value, LPBYTE ValueAsBytes)
Definition: CascCommon.cpp:69
QUERY_KEY PatchKey
Definition: CascCommon.h:209
struct _CASC_ENCODING_HEADER CASC_ENCODING_HEADER
size_t IndexLevel2
Definition: CascCommon.h:273
PCASC_INDEX_ENTRY FindIndexEntry(TCascStorage *hs, PQUERY_KEY pIndexKey)
Definition: CascOpenFile.cpp:25
TFileStream * pStream
Definition: CascCommon.h:230
BYTE IndexKey[CASC_FILE_KEY_SIZE]
Definition: CascCommon.h:104
BYTE FileSizeLE[4]
Definition: CascCommon.h:106
QUERY_KEY InstallKey
Definition: CascCommon.h:211
DWORD dwBuildNumber
Definition: CascCommon.h:197
struct _CASC_FILE_FRAME * PCASC_FILE_FRAME
BYTE ExtraBytes
Definition: CascCommon.h:114
DWORD CompressedSize
Definition: CascCommon.h:130
TCHAR * szListFile
Definition: CascCommon.h:265