+ result->completed_sectors = (uint32_t)(result->output_size / 2048ULL);
+
+ if (result->cancelled &&
+ result->output_size > 0 &&
+ !result->hashes_complete)
+ {
+ printf("\n[HASH] Finalizing controlled partial Xbox output hashes...\n");
+ if (CalculateFileHashes(filename,
+ crc32String, sizeof(crc32String),
+ md5String, sizeof(md5String),
+ fileSha1String, sizeof(fileSha1String),
+ fileSha256String, sizeof(fileSha256String)))
+ {
+ strncpy(result->crc32, crc32String, sizeof(result->crc32) - 1);
+ result->crc32[sizeof(result->crc32) - 1] = '\0';
+ strncpy(result->md5, md5String, sizeof(result->md5) - 1);
+ result->md5[sizeof(result->md5) - 1] = '\0';
+ strncpy(result->sha1, fileSha1String, sizeof(result->sha1) - 1);
+ result->sha1[sizeof(result->sha1) - 1] = '\0';
+ strncpy(result->sha256, fileSha256String, sizeof(result->sha256) - 1);
+ result->sha256[sizeof(result->sha256) - 1] = '\0';
+ result->hashes_complete =
+ result->crc32[0] &&
+ result->md5[0] &&
+ result->sha1[0] &&
+ result->sha256[0];
+ if (result->hashes_complete)
+ printf("[OK] Controlled partial Xbox output hashes captured.\n");
+ }
+ else
+ {
+ printf("[WARN] Controlled partial Xbox output hashing failed.\n");
+ }
+ }