MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / LoadEncodingCKeyPage

Function LoadEncodingCKeyPage

src/External/CascLib/src/CascOpenStorage.cpp:407–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407static DWORD LoadEncodingCKeyPage(TCascStorage * hs, CASC_ENCODING_HEADER & EnHeader, LPBYTE pbPageBegin, LPBYTE pbEndOfPage)
408{
409 PFILE_CKEY_ENTRY pFileEntry;
410 LPBYTE pbFileEntry = pbPageBegin;
411
412 // Sanity checks
413 assert(hs->CKeyMap.IsInitialized());
414 assert(hs->EKeyMap.IsInitialized());
415
416 // Parse all encoding entries
417 while(pbFileEntry < pbEndOfPage)
418 {
419 // Get pointer to the encoding entry
420 pFileEntry = (PFILE_CKEY_ENTRY)pbFileEntry;
421 if(pFileEntry->EKeyCount == 0)
422 break;
423
424 // Example of a file entry with multiple EKeys:
425 // Overwatch build 24919, CKey: 0e 90 94 fa d2 cb 85 ac d0 7c ea 09 f9 c5 ba 00
426// BREAKIF(pFileEntry->EKeyCount > 1);
427// BREAK_ON_XKEY3(pFileEntry->CKey, 0x34, 0x82, 0x1f);
428
429 // Insert the entry to the central CKey table
430 InsertCKeyEntry(hs, pFileEntry);
431
432 // Move to the next encoding entry
433 pbFileEntry = pbFileEntry + 2 + 4 + EnHeader.CKeyLength + (pFileEntry->EKeyCount * EnHeader.EKeyLength);
434 }
435 return ERROR_SUCCESS;
436}
437
438static DWORD LoadEncodingManifest(TCascStorage * hs)
439{

Callers 1

LoadEncodingManifestFunction · 0.85

Calls 2

InsertCKeyEntryFunction · 0.85
IsInitializedMethod · 0.45

Tested by

no test coverage detected