0x0047270B
| 386 | |
| 387 | // 0x0047270B |
| 388 | static bool computeObjectChecksum(const ObjectHeader& object, std::span<const std::byte> data) |
| 389 | { |
| 390 | // Compute the checksum of header and data |
| 391 | |
| 392 | // Annoyingly the header you need to only compute the first byte of the flags |
| 393 | const auto headerFlag = std::span(reinterpret_cast<const std::byte*>(&object), 1); |
| 394 | auto checksum = computeChecksum(headerFlag, objectChecksumMagic); |
| 395 | |
| 396 | // And then the name |
| 397 | const auto headerName = std::span(reinterpret_cast<const std::byte*>(&object.name), sizeof(ObjectHeader::name)); |
| 398 | checksum = computeChecksum(headerName, checksum); |
| 399 | |
| 400 | // Finally compute the data's checksum |
| 401 | checksum = computeChecksum(data, checksum); |
| 402 | |
| 403 | return checksum == object.checksum; |
| 404 | } |
| 405 | |
| 406 | // 0x00471B95 |
| 407 | void freeTemporaryObject() |
no test coverage detected