[librvth] verify: KB value for errors should be 1-31, not 0-30.

The first kilobyte of encrypted Wii sectors contains hashes, so we
shouldn't use 0 to prevent confusion.
This commit is contained in:
David Korth 2022-02-12 02:42:55 -05:00
parent ca0292fa85
commit 92c49e34fe
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ typedef struct _RvtH_Verify_Progress_State {
// If RVTH_VERIFY_ERROR_REPORT, what type of error?
uint8_t hash_level; // 0, 1, 2, 3, 4
uint8_t sector; // Sector 0-63 in the current group
uint8_t kb; // Kilobyte 0-31 (H0 only)
uint8_t kb; // Kilobyte 1-31 (H0 only) [KB 0 == hashes]
uint8_t err_type; // Error type (see RvtH_Verify_Error_Type)
bool is_zero; // If true, sector is zeroed. (scrubbed/truncated)
} RvtH_Verify_Progress_State;

View File

@ -567,7 +567,7 @@ int RvtH::verifyWiiPartitions(unsigned int bank,
state.type = RVTH_VERIFY_ERROR_REPORT;
state.hash_level = 0;
state.sector = sector;
state.kb = kb;
state.kb = kb+1;
state.err_type = RVTH_VERIFY_ERROR_BAD_HASH;
callback(&state, userdata);
}