static int ParseWowRootFileInternal( TRootHandler_WoW6 * pRootHandler, PARSE_ROOT pfnParseRoot, LPBYTE pbRootFile, LPBYTE pbRootFileEnd, DWORD dwLocaleMask, bool bLoadBlocksWithFlags80, BYTE HighestBitValue) { CASC_ROOT_BLOCK RootBlock; // Now parse the root file while(pbRootFile < pbRootFileEnd) { // Validate the file locale block pbRootFile = VerifyLocaleBlock(&RootBlock, pbRootFile, pbRootFileEnd); if(pbRootFile == NULL) break; // WoW.exe (build 19116): Entries with flag 0x100 set are skipped if(RootBlock.pLocaleBlockHdr->Flags & 0x100) continue; // WoW.exe (build 19116): Entries with flag 0x80 set are skipped if arg_4 is set to FALSE (which is by default) if((RootBlock.pLocaleBlockHdr->Flags & 0x80) && bLoadBlocksWithFlags80 == 0) continue; // WoW.exe (build 19116): Entries with (flags >> 0x1F) not equal to arg_8 are skipped if((RootBlock.pLocaleBlockHdr->Flags >> 0x1F) != HighestBitValue) continue; // WoW.exe (build 19116): Locales other than defined mask are skipped too if((RootBlock.pLocaleBlockHdr->Locales & dwLocaleMask) == 0) continue; // Now call the custom function pfnParseRoot(pRootHandler, &RootBlock); } return ERROR_SUCCESS; }
static int ParseWowRootFileInternal( TRootHandler_WoW6 * pRootHandler, PARSE_ROOT pfnParseRoot, LPBYTE pbRootFile, LPBYTE pbRootFileEnd, DWORD dwLocaleMask, BYTE bOverrideArchive, BYTE bAudioLocale) { CASC_ROOT_BLOCK RootBlock; // Now parse the root file while(pbRootFile < pbRootFileEnd) { // Validate the file locale block pbRootFile = VerifyLocaleBlock(&RootBlock, pbRootFile, pbRootFileEnd); if(pbRootFile == NULL) break; // WoW.exe (build 19116): Entries with flag 0x100 set are skipped if(RootBlock.pLocaleBlockHdr->Flags & 0x100) continue; // WoW.exe (build 19116): Entries with flag 0x80 set are skipped if overrideArchive CVAR is set to FALSE (which is by default in non-chinese clients) if((RootBlock.pLocaleBlockHdr->Flags & 0x80) && bOverrideArchive == 0) continue; // WoW.exe (build 19116): Entries with (flags >> 0x1F) not equal to bAudioLocale are skipped if((RootBlock.pLocaleBlockHdr->Flags >> 0x1F) != bAudioLocale) continue; // WoW.exe (build 19116): Locales other than defined mask are skipped too if((RootBlock.pLocaleBlockHdr->Locales & dwLocaleMask) == 0) continue; // Now call the custom function pfnParseRoot(pRootHandler, &RootBlock); } return ERROR_SUCCESS; }
static void TRootHandlerWoW6_Dump( TCascStorage * hs, TDumpContext * dc, // Pointer to an opened file LPBYTE pbRootFile, DWORD cbRootFile, const TCHAR * szListFile, int nDumpLevel) { PCASC_ENCODING_ENTRY pEncodingEntry; CASC_ROOT_BLOCK BlockInfo; PLISTFILE_MAP pListMap; QUERY_KEY EncodingKey; LPBYTE pbRootFileEnd = pbRootFile + cbRootFile; LPBYTE pbFilePointer; char szOneLine[0x100]; DWORD i; // Create the listfile map pListMap = ListFile_CreateMap(szListFile); // Dump the root entries for(pbFilePointer = pbRootFile; pbFilePointer <= pbRootFileEnd; ) { // Validate the root block pbFilePointer = VerifyLocaleBlock(&BlockInfo, pbFilePointer, pbRootFileEnd); if(pbFilePointer == NULL) break; // Dump the locale block dump_print(dc, "Flags: %08X Locales: %08X NumberOfFiles: %u\n" "=========================================================\n", BlockInfo.pLocaleBlockHdr->Flags, BlockInfo.pLocaleBlockHdr->Locales, BlockInfo.pLocaleBlockHdr->NumberOfFiles); // Dump the hashes and encoding keys for(i = 0; i < BlockInfo.pLocaleBlockHdr->NumberOfFiles; i++) { // Dump the entry dump_print(dc, "%08X %08X-%08X %s %s\n", (DWORD)(BlockInfo.FileDataIds[i]), (DWORD)(BlockInfo.pRootEntries[i].FileNameHash >> 0x20), (DWORD)(BlockInfo.pRootEntries[i].FileNameHash), StringFromMD5(BlockInfo.pRootEntries[i].EncodingKey.Value, szOneLine), ListFile_FindName(pListMap, BlockInfo.pRootEntries[i].FileNameHash)); // Find the encoding entry in the encoding table if(nDumpLevel >= DUMP_LEVEL_ENCODING_FILE) { EncodingKey.pbData = BlockInfo.pRootEntries[i].EncodingKey.Value; EncodingKey.cbData = MD5_HASH_SIZE; pEncodingEntry = FindEncodingEntry(hs, &EncodingKey, NULL); CascDumpEncodingEntry(hs, dc, pEncodingEntry, nDumpLevel); } } // Put extra newline dump_print(dc, "\n"); } ListFile_FreeMap(pListMap); }