mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-09 12:11:44 +00:00
gamecard: disable hash checks on Terra gamecards
This commit is contained in:
parent
b97fb24005
commit
7d5b904835
1 changed files with 12 additions and 2 deletions
|
@ -1365,12 +1365,14 @@ static HashFileSystemContext *gamecardInitializeHashFileSystemContext(const char
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verify Hash FS header (if possible). */
|
/* Verify Hash FS header (if possible). */
|
||||||
if (hash && hash_target_size && (hash_target_offset + hash_target_size) <= hfs_ctx->header_size)
|
/* TODO: enable hash verification on Terra gamecards if we ever find out how to properly calculate matching checksums. */
|
||||||
|
if (hash && hash_target_size && (hash_target_offset + hash_target_size) <= hfs_ctx->header_size && g_gameCardInfoArea.compatibility_type == GameCardCompatibilityType_Normal)
|
||||||
{
|
{
|
||||||
sha256CalculateHash(hfs_header_hash, hfs_ctx->header + hash_target_offset, hash_target_size);
|
sha256CalculateHash(hfs_header_hash, hfs_ctx->header + hash_target_offset, hash_target_size);
|
||||||
if (memcmp(hfs_header_hash, hash, SHA256_HASH_SIZE) != 0)
|
if (memcmp(hfs_header_hash, hash, SHA256_HASH_SIZE) != 0)
|
||||||
{
|
{
|
||||||
LOG_MSG_ERROR("Hash FS header doesn't match expected SHA-256 hash! (\"%s\", offset 0x%lX).", hfs_ctx->name, offset);
|
LOG_MSG_ERROR("Hash FS header doesn't match expected SHA-256 hash! (\"%s\", offset 0x%lX).", hfs_ctx->name, offset);
|
||||||
|
dump_fs_header = true;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1395,7 +1397,15 @@ static HashFileSystemContext *gamecardInitializeHashFileSystemContext(const char
|
||||||
end:
|
end:
|
||||||
if (!success && hfs_ctx)
|
if (!success && hfs_ctx)
|
||||||
{
|
{
|
||||||
if (dump_fs_header) LOG_DATA_DEBUG(&hfs_header, sizeof(HashFileSystemHeader), "Partial Hash FS header dump (\"%s\", offset 0x%lX):", hfs_ctx->name, offset);
|
if (dump_fs_header)
|
||||||
|
{
|
||||||
|
if (hfs_ctx->header)
|
||||||
|
{
|
||||||
|
LOG_DATA_DEBUG(hfs_ctx->header, hfs_ctx->header_size, "Hash FS header dump (\"%s\", offset 0x%lX):", hfs_ctx->name, offset);
|
||||||
|
} else {
|
||||||
|
LOG_DATA_DEBUG(&hfs_header, sizeof(HashFileSystemHeader), "Partial Hash FS header dump (\"%s\", offset 0x%lX):", hfs_ctx->name, offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (hfs_ctx->header) free(hfs_ctx->header);
|
if (hfs_ctx->header) free(hfs_ctx->header);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue