11 #ifndef __CASC_MNDX_ROOT__
12 #define __CASC_MNDX_ROOT__
16 #define CASC_MAX_MAR_FILES 3 // Maximum of 3 MAR files are supported
17 #define CASC_MNDX_SIGNATURE 0x58444E4D // 'MNDX'
19 #define CASC_MAX_ENTRIES(type) (0xFFFFFFFF / sizeof(type))
21 #define CASC_SEARCH_INITIALIZING 0
22 #define CASC_SEARCH_SEARCHING 2
23 #define CASC_SEARCH_FINISHED 4
62 #define ByteArray ArrayPointer.Bytes
63 #define CharArray ArrayPointer.Chars
64 #define Uint32Array ArrayPointer.Uint32s
65 #define TripletArray ArrayPointer.Triplets
66 #define NameFragArray ArrayPointer.NameFrags
152 dwResult = (
Uint32Array[dwItemIndex + 1] << (0x20 - dwStartBit)) | (
Uint32Array[dwItemIndex] >> dwStartBit);
198 int SetSearchPath(
const char * szNewSearchPath,
size_t cchNewSearchPath);
222 return (
ItemBits.Uint32Array[ItemIndex >> 0x05] & (1 << (ItemIndex & 0x1F)));
356 return ((Table.NameFragArray[ItemIndex].FragOffs & 0xFFFFFF00) == 0xFFFFFF00);
359 #endif // __CASC_MNDX_ROOT__
DWORD GetItemValue(DWORD ItemIndex)
Definition: CascRootFile_Mndx.cpp:1034
DWORD sub_1959CB0(DWORD dwHashValue)
Definition: CascRootFile_Mndx.cpp:1485
int sub_1957800(DWORD dwBitMask)
Definition: CascRootFile_Mndx.cpp:1429
int GetArray_NameTable(PARRAY_POINTER PtrArray, DWORD ItemCount)
Definition: CascRootFile_Mndx.cpp:395
struct _PATH_STOP * PPATH_STOP
Definition: CascMndx.h:49
int FindFileInDatabase(TMndxFindResult *pStruct1C)
Definition: CascRootFile_Mndx.cpp:2665
void sub_19583A0(DWORD NewItemCount)
Definition: CascRootFile_Mndx.cpp:615
TStruct10()
Definition: CascRootFile_Mndx.cpp:1324
struct _NAME_FRAG NAME_FRAG
void * HANDLE
Definition: CascPort.h:146
DWORD field_8
Definition: CascMndx.h:44
const char * szSearchMask
Definition: CascMndx.h:200
ARRAY_POINTER FirstValid
Definition: CascMndx.h:126
int SetSearchPath(const char *szNewSearchPath, size_t cchNewSearchPath)
Definition: CascRootFile_Mndx.cpp:307
DWORD * PDWORD
Definition: CascPort.h:151
Definition: CascMndx.h:289
struct _MAR_FILE * PMAR_FILE
DWORD BitsPerEntry
Definition: CascMndx.h:167
DWORD sub_1959F50(DWORD arg_0)
Definition: CascRootFile_Mndx.cpp:1688
~TNameIndexStruct()
Definition: CascRootFile_Mndx.cpp:1122
TByteStream()
Definition: CascRootFile_Mndx.cpp:326
void CopyNameFragment(TMndxFindResult *pStruct1C, DWORD dwFragOffs)
Definition: CascRootFile_Mndx.cpp:1254
ARRAY_POINTER DataBuffer
Definition: CascMndx.h:125
DWORD ItemIndex
Definition: CascMndx.h:34
DWORD field_C
Definition: CascMndx.h:45
TNameIndexStruct()
Definition: CascRootFile_Mndx.cpp:1118
DWORD CharIndex
Definition: CascMndx.h:183
int CreateStruct40()
Definition: CascRootFile_Mndx.cpp:290
DWORD GetBitEntry(DWORD EntryIndex)
Definition: CascMndx.h:141
Definition: CascMndx.h:272
void ExchangeWith(TNameIndexStruct &Target)
Definition: CascRootFile_Mndx.cpp:1286
Definition: CascMndx.h:172
TByteStream MarStream
Definition: CascMndx.h:340
DWORD field_214
Definition: CascMndx.h:338
TStruct40 * pStruct40
Definition: CascMndx.h:206
struct _NAME_FRAG * PNAME_FRAG
bool sub_1959460(TMndxFindResult *pStruct1C)
Definition: CascRootFile_Mndx.cpp:2245
ARRAY_POINTER ArrayPointer
Definition: CascMndx.h:128
void ExchangeWith(TGenericArray &Target)
Definition: CascRootFile_Mndx.cpp:483
struct _TRIPLET * PTRIPLET
DWORD BaseValue
Definition: CascMndx.h:27
TStruct10 Struct10
Definition: CascMndx.h:339
int GetArray_DWORDs(PARRAY_POINTER PtrArray, DWORD ItemCount)
Definition: CascRootFile_Mndx.cpp:362
DWORD field_C
Definition: CascMndx.h:88
int SetDatabase(TFileNameDatabase *pNewDB)
Definition: CascRootFile_Mndx.cpp:2741
DWORD ItemCount
Definition: CascMndx.h:184
int sub_1956FD0(DWORD dwBitMask)
Definition: CascRootFile_Mndx.cpp:1342
~TFileNameDatabasePtr()
Definition: CascRootFile_Mndx.cpp:2659
int LoadStringsWithCopy(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:814
int CreateDatabase(LPBYTE pbMarData, DWORD cbMarData)
Definition: CascRootFile_Mndx.cpp:2714
int GetArray_BYTES(PARRAY_POINTER PtrArray, DWORD ItemCount)
Definition: CascRootFile_Mndx.cpp:384
int LoadFragmentInfos(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:714
Definition: CascMndx.h:235
void * pvMappedFile
Definition: CascMndx.h:86
int LoadDwordsArray_Copy(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:758
DWORD field_0
Definition: CascMndx.h:266
DWORD ItemIndex
Definition: CascMndx.h:182
int GetValue_DWORD(DWORD &Value)
Definition: CascRootFile_Mndx.cpp:428
TGenericArray ArrayDwords_50
Definition: CascMndx.h:232
Definition: CascMndx.h:209
void InsertOneItem_CHAR(char OneChar)
Definition: CascRootFile_Mndx.cpp:563
TSparseArray Struct68
Definition: CascMndx.h:251
DWORD TotalEntries
Definition: CascMndx.h:169
int LoadFromStream(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:982
int LoadByteArray(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:692
DWORD field_10
Definition: CascMndx.h:46
BYTE * LPBYTE
Definition: CascPort.h:152
bool CheckNameFragment(TMndxFindResult *pStruct1C, DWORD dwFragOffs)
Definition: CascRootFile_Mndx.cpp:1126
DWORD Value3
Definition: CascMndx.h:29
#define Uint32Array
Definition: CascMndx.h:64
int LoadFromStream(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:851
void ExchangeWith(TByteStream &Target)
Definition: CascRootFile_Mndx.cpp:337
PULONGLONG Int64Ptr
Definition: CascMndx.h:57
void CopyFrom(TStruct10 &Target)
Definition: CascRootFile_Mndx.cpp:1333
TGenericArray BaseValues
Definition: CascMndx.h:230
DWORD field_8
Definition: CascMndx.h:268
Definition: CascMndx.h:93
int LoadFromStream_Exchange(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:1020
int LoadTripletsArray(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:670
TFileNameDatabase()
Definition: CascRootFile_Mndx.cpp:1446
TStruct40()
Definition: CascRootFile_Mndx.cpp:902
Definition: CascMndx.h:134
void sub_1958D70(TMndxFindResult *pStruct1C, DWORD arg_4)
Definition: CascRootFile_Mndx.cpp:2084
TFileNameDatabasePtr * pDatabasePtr
Definition: CascMndx.h:345
TBitEntryArray()
Definition: CascRootFile_Mndx.cpp:830
unsigned long long * PULONGLONG
Definition: CascPort.h:145
PDWORD Uint32s
Definition: CascMndx.h:53
Definition: CascMndx.h:343
TGenericArray ArrayDwords_38
Definition: CascMndx.h:231
void SetMaxItems_CHARS(DWORD NewMaxItemCount)
Definition: CascRootFile_Mndx.cpp:515
Definition: CascMndx.h:188
HANDLE hMap
Definition: CascMndx.h:90
DWORD cbMarData
Definition: CascMndx.h:347
int LoadFromStream(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:2557
int GetFileNameCount(PDWORD PtrFileNameCount)
Definition: CascRootFile_Mndx.cpp:2704
DWORD FileNameIndex
Definition: CascMndx.h:205
bool CheckNextPathFragment(TMndxFindResult *pStruct1C)
Definition: CascRootFile_Mndx.cpp:1874
int LoadFragmentInfos_Copy(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:800
DWORD FragOffs
Definition: CascMndx.h:36
int LoadBytes_Copy(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:786
TGenericArray NameFragTable
Definition: CascMndx.h:335
bool bIsValidArray
Definition: CascMndx.h:131
TGenericArray FrgmDist_LoBits
Definition: CascMndx.h:329
TFileNameDatabasePtr()
Definition: CascRootFile_Mndx.cpp:2654
DWORD field_8
Definition: CascMndx.h:202
Definition: CascMndx.h:254
~TMndxFindResult()
Definition: CascRootFile_Mndx.cpp:284
int GetBytes(DWORD cbByteCount, PARRAY_POINTER PtrArray)
Definition: CascRootFile_Mndx.cpp:347
TBitEntryArray FrgmDist_HiBits
Definition: CascMndx.h:330
Definition: CascMndx.h:32
void SetMaxItems_PATH_STOP(DWORD NewMaxItemCount)
Definition: CascRootFile_Mndx.cpp:539
int sub_1957050(DWORD dwBitMask)
Definition: CascRootFile_Mndx.cpp:1375
DWORD Value2
Definition: CascMndx.h:28
int sub_19572E0(DWORD dwBitMask)
Definition: CascRootFile_Mndx.cpp:1396
~TGenericArray()
Definition: CascRootFile_Mndx.cpp:476
DWORD ItemCount
Definition: CascMndx.h:129
DWORD field_4
Definition: CascMndx.h:43
int sub_1956CE0(TMndxFindResult *pStruct1C, bool *pbFindResult)
Definition: CascRootFile_Mndx.cpp:2684
int LoadFromStream_Exchange(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:2624
PTRIPLET Triplets
Definition: CascMndx.h:54
TGenericArray NameFragments
Definition: CascMndx.h:250
TGenericArray array_00
Definition: CascMndx.h:180
TNameIndexStruct IndexStruct_174
Definition: CascMndx.h:332
unsigned int DWORD
Definition: CascPort.h:139
DWORD IsItemPresent(DWORD ItemIndex)
Definition: CascMndx.h:220
PPATH_STOP PathStopPtr
Definition: CascMndx.h:56
Definition: CascMndx.h:25
TFileNameDatabase * pDB
Definition: CascMndx.h:286
DWORD NameFragIndexMask
Definition: CascMndx.h:337
TFileNameDatabasePtr NextDB
Definition: CascMndx.h:333
int GetValue_ItemCount(DWORD &NumberOfBytes, DWORD &ItemCount, DWORD ItemSize)
Definition: CascRootFile_Mndx.cpp:441
LPBYTE Bytes
Definition: CascMndx.h:51
DWORD TotalItemCount
Definition: CascMndx.h:228
TSparseArray()
Definition: CascRootFile_Mndx.cpp:965
DWORD GetNameFragmentOffset(DWORD LoBitsIndex)
Definition: CascMndx.h:310
DWORD cbByteData
Definition: CascMndx.h:87
PNAME_FRAG NameFrags
Definition: CascMndx.h:55
void CopyFrom(TGenericArray &Source)
Definition: CascRootFile_Mndx.cpp:493
int LoadDwordsArray(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:648
DWORD field_4
Definition: CascMndx.h:267
Definition: CascMndx.h:68
Definition: CascMndx.h:40
TSparseArray FileNameIndexes
Definition: CascMndx.h:325
TMndxFindResult()
Definition: CascRootFile_Mndx.cpp:272
void ExchangeWith(TBitEntryArray &Target)
Definition: CascRootFile_Mndx.cpp:841
void ExchangeWith(TSparseArray &TargetObject)
Definition: CascRootFile_Mndx.cpp:972
void InsertOneItem_PATH_STOP(PATH_STOP &NewItem)
Definition: CascRootFile_Mndx.cpp:589
int LoadTripletsArray_Copy(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:772
DWORD GetNameFragmentOffsetEx(DWORD LoBitsIndex, DWORD HiBitsIndex)
Definition: CascMndx.h:304
void InitSearchBuffers()
Definition: CascRootFile_Mndx.cpp:911
DWORD field_C
Definition: CascMndx.h:269
DWORD ItemIndex
Definition: CascMndx.h:42
DWORD EntryBitMask
Definition: CascMndx.h:168
int SkipBytes(DWORD cbByteCount)
Definition: CascRootFile_Mndx.cpp:406
const char * szFoundPath
Definition: CascMndx.h:203
int SetByteBuffer(LPBYTE pbNewMarData, DWORD cbNewMarData)
Definition: CascRootFile_Mndx.cpp:414
char * Chars
Definition: CascMndx.h:52
int LoadFromStream_Exchange(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:1308
size_t cchFoundPath
Definition: CascMndx.h:204
int GetArray_Triplets(PARRAY_POINTER PtrArray, DWORD ItemCount)
Definition: CascRootFile_Mndx.cpp:373
void FreeStruct40()
Definition: CascRootFile_Mndx.cpp:299
DWORD MaxItemCount
Definition: CascMndx.h:130
int LoadFromStream_Exchange(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:886
LPBYTE pbMarData
Definition: CascMndx.h:346
TSparseArray Struct68_00
Definition: CascMndx.h:324
int SetArrayValid()
Definition: CascRootFile_Mndx.cpp:504
TGenericArray ItemBits
Definition: CascMndx.h:227
bool sub_1959010(TMndxFindResult *pStruct1C, DWORD arg_4)
Definition: CascRootFile_Mndx.cpp:2155
LPBYTE pbByteData
Definition: CascMndx.h:85
union _ARRAY_POINTER ARRAY_POINTER
void ExchangeWith(TFileNameDatabase &Target)
Definition: CascRootFile_Mndx.cpp:1453
DWORD SearchPhase
Definition: CascMndx.h:185
bool CheckAndCopyNameFragment(TMndxFindResult *pStruct1C, DWORD dwFragOffs)
Definition: CascRootFile_Mndx.cpp:1178
union _ARRAY_POINTER * PARRAY_POINTER
bool IS_SINGLE_CHAR_MATCH(TGenericArray &Table, DWORD ItemIndex)
Definition: CascMndx.h:354
TSparseArray Struct68_D0
Definition: CascMndx.h:326
struct _PATH_STOP PATH_STOP
struct _MAR_FILE MAR_FILE
int LoadStrings(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:736
TGenericArray()
Definition: CascRootFile_Mndx.cpp:466
bool FindFileInDatabase(TMndxFindResult *pStruct1C)
Definition: CascRootFile_Mndx.cpp:2528
TGenericArray PathStops
Definition: CascMndx.h:181
DWORD ValidItemCount
Definition: CascMndx.h:229
~TBitEntryArray()
Definition: CascRootFile_Mndx.cpp:837
HANDLE hFile
Definition: CascMndx.h:89
DWORD NextIndex
Definition: CascMndx.h:35
bool sub_1957B80(TMndxFindResult *pStruct1C, DWORD dwKey)
Definition: CascRootFile_Mndx.cpp:1992
bool sub_1958B00(TMndxFindResult *pStruct1C)
Definition: CascRootFile_Mndx.cpp:2416
size_t cchSearchMask
Definition: CascMndx.h:201
int LoadFromStream(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:1296