Fix bug for small encrypted regions

This commit is contained in:
Deterous
2024-03-12 19:42:23 +09:00
parent f7879bf9e8
commit c175fedbdb
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
<LangVersion>latest</LangVersion>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>0.7.1</Version>
<Version>0.8.0</Version>
<!-- Package Properties -->
<Authors>Deterous</Authors>
+5 -1
View File
@@ -1056,6 +1056,10 @@ namespace LibIRD
CountFiles(dirInfo);
}
#endregion
#region Hashing
/// <summary>
/// Calculate hashes for all region and file extents
/// </summary>
@@ -1201,7 +1205,7 @@ namespace LibIRD
// Don't decrypt last sectors if the encrypted region ends within this buffer
if (RegionEnd[i] < currentSector + bufSectors)
encCount -= (int)(currentSector + bufSectors - RegionEnd[i] + 1);
encCount -= (int)(currentSector + bufSectors - RegionEnd[i] - 1);
// Decrypt encrypted sectors
DecryptSectors(ref buf, (int)currentSector + encOffset, encOffset, encCount);
+1 -1
View File
@@ -7,7 +7,7 @@
<LangVersion>latest</LangVersion>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>0.7.1</Version>
<Version>0.8.0</Version>
<PackageOutputPath>../nupkg</PackageOutputPath>
<!-- Package Properties -->