MCPcopy Create free account
hub / github.com/diasurgical/devilution / CreateKeyFromAuthCode

Function CreateKeyFromAuthCode

3rdParty/StormLib/src/FileStream.cpp:1895–1912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1893}
1894
1895static void CreateKeyFromAuthCode(
1896 LPBYTE pbKeyBuffer,
1897 const char * szAuthCode)
1898{
1899 LPDWORD KeyPosition = (LPDWORD)(pbKeyBuffer + 0x10);
1900 LPDWORD AuthCode32 = (LPDWORD)szAuthCode;
1901
1902 memcpy(pbKeyBuffer, szKeyTemplate, MPQE_CHUNK_SIZE);
1903 KeyPosition[0x00] = AuthCode32[0x03];
1904 KeyPosition[0x02] = AuthCode32[0x07];
1905 KeyPosition[0x03] = AuthCode32[0x02];
1906 KeyPosition[0x05] = AuthCode32[0x06];
1907 KeyPosition[0x06] = AuthCode32[0x01];
1908 KeyPosition[0x08] = AuthCode32[0x05];
1909 KeyPosition[0x09] = AuthCode32[0x00];
1910 KeyPosition[0x0B] = AuthCode32[0x04];
1911 BSWAP_ARRAY32_UNSIGNED(pbKeyBuffer, MPQE_CHUNK_SIZE);
1912}
1913
1914static void DecryptFileChunk(
1915 DWORD * MpqData,

Callers 1

MpqeStream_DetectFileKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected