From 92c49e34fe451d841bbfd5aa116e4730fbc9da7c Mon Sep 17 00:00:00 2001 From: David Korth Date: Sat, 12 Feb 2022 02:42:55 -0500 Subject: [PATCH] [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. --- src/librvth/rvth.hpp | 2 +- src/librvth/verify.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librvth/rvth.hpp b/src/librvth/rvth.hpp index aed34f1..89ef1f4 100644 --- a/src/librvth/rvth.hpp +++ b/src/librvth/rvth.hpp @@ -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; diff --git a/src/librvth/verify.cpp b/src/librvth/verify.cpp index 82ea874..cdb6670 100644 --- a/src/librvth/verify.cpp +++ b/src/librvth/verify.cpp @@ -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); }