Skip to content

Commit c175fed

Browse files
committed
Fix bug for small encrypted regions
1 parent f7879bf commit c175fed

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

IRDKit/IRDKit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<LangVersion>latest</LangVersion>
1212
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
1313
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
14-
<Version>0.7.1</Version>
14+
<Version>0.8.0</Version>
1515

1616
<!-- Package Properties -->
1717
<Authors>Deterous</Authors>

LibIRD/IRD.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,10 @@ private void CountFiles(DiscDirectoryInfo dir)
10561056
CountFiles(dirInfo);
10571057
}
10581058

1059+
#endregion
1060+
1061+
#region Hashing
1062+
10591063
/// <summary>
10601064
/// Calculate hashes for all region and file extents
10611065
/// </summary>
@@ -1201,7 +1205,7 @@ private void HashISO(FileStream fs, bool redump)
12011205

12021206
// Don't decrypt last sectors if the encrypted region ends within this buffer
12031207
if (RegionEnd[i] < currentSector + bufSectors)
1204-
encCount -= (int)(currentSector + bufSectors - RegionEnd[i] + 1);
1208+
encCount -= (int)(currentSector + bufSectors - RegionEnd[i] - 1);
12051209

12061210
// Decrypt encrypted sectors
12071211
DecryptSectors(ref buf, (int)currentSector + encOffset, encOffset, encCount);

LibIRD/LibIRD.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<LangVersion>latest</LangVersion>
88
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
99
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
10-
<Version>0.7.1</Version>
10+
<Version>0.8.0</Version>
1111
<PackageOutputPath>../nupkg</PackageOutputPath>
1212

1313
<!-- Package Properties -->

0 commit comments

Comments
 (0)