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

Function SupplyFakeFileName

src/External/CascLib/src/CascFindFile.cpp:36–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static void SupplyFakeFileName(PCASC_FIND_DATA pFindData, PCASC_CKEY_ENTRY pCKeyEntry)
37{
38 // If there is a file data ID, create fake file name
39 if(pFindData->dwFileDataId != CASC_INVALID_ID)
40 {
41 CascStrPrintf(pFindData->szFileName, _countof(pFindData->szFileName), CASC_FILEID_FORMAT, pFindData->dwFileDataId);
42 pFindData->NameType = CascNameDataId;
43 return;
44 }
45
46 // If there is a CKey, convert the CKey to file name
47 if(pCKeyEntry->Flags & CASC_CE_HAS_CKEY)
48 {
49 StringFromBinary(pFindData->CKey, MD5_HASH_SIZE, pFindData->szFileName);
50 pFindData->NameType = CascNameCKey;
51 return;
52 }
53
54 // EKey should be always present
55 if(pCKeyEntry->Flags & CASC_CE_HAS_EKEY)
56 {
57 StringFromBinary(pFindData->EKey, MD5_HASH_SIZE, pFindData->szFileName);
58 pFindData->NameType = CascNameEKey;
59 return;
60 }
61
62 assert(false);
63}
64
65static bool CopyCKeyEntryToFindData(PCASC_FIND_DATA pFindData, PCASC_CKEY_ENTRY pCKeyEntry)
66{

Callers 1

CopyCKeyEntryToFindDataFunction · 0.85

Calls 2

CascStrPrintfFunction · 0.85
StringFromBinaryFunction · 0.85

Tested by

no test coverage detected