Skip to content

Commit

Permalink
Fix bug for small encrypted regions
Browse files Browse the repository at this point in the history
  • Loading branch information
Deterous committed Mar 12, 2024
1 parent f7879bf commit c175fed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion IRDKit/IRDKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 5 additions & 1 deletion LibIRD/IRD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,10 @@ private void CountFiles(DiscDirectoryInfo dir)
CountFiles(dirInfo);
}

#endregion

#region Hashing

/// <summary>
/// Calculate hashes for all region and file extents
/// </summary>
Expand Down Expand Up @@ -1201,7 +1205,7 @@ private void HashISO(FileStream fs, bool redump)

// 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);
Expand Down
2 changes: 1 addition & 1 deletion LibIRD/LibIRD.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down

0 comments on commit c175fed

Please sign in to comment.