Skip to content

Commit

Permalink
Always try to decrypt without rif/rap keys as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
jvyden committed Nov 3, 2024
1 parent a6ac53d commit 3d267ce
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Refresher.Core/Pipelines/Steps/DecryptGameEbootStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default)
LibSce sce = this.Encryption.Sce!;
byte[] selfData = File.ReadAllBytes(this.Game.DownloadedEbootPath!);

// if we don't need to decrypt, just don't. ez
if (!this.Game.ShouldUseNpdrmEncryption.GetValueOrDefault())
{
this.Encryption.Self = new Self(sce, selfData);
}
// if we downloaded an act.dat file, we downloaded a rif. use full console decryption.
if (this.Encryption.DownloadedActDatPath != null)
{
Expand All @@ -34,10 +29,10 @@ public override Task ExecuteAsync(CancellationToken cancellationToken = default)
byte[] rapData = File.ReadAllBytes(this.Encryption.DownloadedLicensePath!);
this.Encryption.Self = new Self(sce, selfData, rapData);
}
// otherwise, we're fucked
// otherwise, we're either fucked or this is a free-type npdrm eboot. decrypt it without any rif/rap
else
{
throw new InvalidOperationException("No encryption method could be determined.");
this.Encryption.Self = new Self(sce, selfData);
}

string tempFile = this.Game.DecryptedEbootPath = Path.GetTempFileName();
Expand Down

0 comments on commit 3d267ce

Please sign in to comment.