Calculate answer to any integrity question server: check the stored CRC instead of the real exe.
| 156 | // Calculate answer to any integrity question |
| 157 | // server: check the stored CRC instead of the real exe. |
| 158 | unsigned int IntegrityCheckAnswer(IntegrityQuestionType type, const IntegrityQuestion& q, bool server) |
| 159 | { |
| 160 | switch (type) |
| 161 | { |
| 162 | case IQTConfig: |
| 163 | return CalculateConfigCRC(q.name); |
| 164 | case IQTExe: |
| 165 | if (server) |
| 166 | { |
| 167 | return GetReferenceCRC(q.offset, q.size); |
| 168 | } |
| 169 | return CalculateExeCRC(q.offset, q.size); |
| 170 | case IQTData: |
| 171 | return CalculateDataCRC(q.name, q.offset, q.size); |
| 172 | } |
| 173 | return 0; |
| 174 | } |
| 175 | |
| 176 | // General diagnostics level |
| 177 | // - level == 0 - nothing |
no test coverage detected