| 156 | } |
| 157 | |
| 158 | void * LoadSqpTable(TMPQArchive * ha, DWORD dwByteOffset, DWORD cbTableSize, DWORD dwKey) |
| 159 | { |
| 160 | ULONGLONG ByteOffset; |
| 161 | LPBYTE pbSqpTable; |
| 162 | |
| 163 | // Allocate buffer for the table |
| 164 | pbSqpTable = STORM_ALLOC(BYTE, cbTableSize); |
| 165 | if(pbSqpTable != NULL) |
| 166 | { |
| 167 | // Load the table |
| 168 | ByteOffset = ha->MpqPos + dwByteOffset; |
| 169 | if(FileStream_Read(ha->pStream, &ByteOffset, pbSqpTable, cbTableSize)) |
| 170 | { |
| 171 | // Decrypt the SQP table |
| 172 | DecryptMpqBlock(pbSqpTable, cbTableSize, dwKey); |
| 173 | return pbSqpTable; |
| 174 | } |
| 175 | |
| 176 | // Free the table |
| 177 | STORM_FREE(pbSqpTable); |
| 178 | } |
| 179 | |
| 180 | return NULL; |
| 181 | } |
| 182 | |
| 183 | TMPQHash * LoadSqpHashTable(TMPQArchive * ha) |
| 184 | { |
no test coverage detected