Skip to content

Commit

Permalink
Merge pull request #50 from LittleBigRefresh/use-eboot-backup
Browse files Browse the repository at this point in the history
Use original EBOOT backup for patching instead of active copy
  • Loading branch information
jvyden authored Jan 30, 2024
2 parents e73476a + 2d099e2 commit eaace4e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Refresher/UI/IntegratedPatchForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,21 @@ protected virtual void GameChanged(object? sender, EventArgs ev)
Debug.Assert(this.Accessor != null);

this._usrDir = Path.Combine("game", game.TitleId, "USRDIR");
string ebootPath = Path.Combine(this._usrDir, "EBOOT.BIN");

string ebootPath = Path.Combine(this._usrDir, "EBOOT.BIN.ORIG"); // Prefer original backup over active copy

// If the backup doesn't exist, use the EBOOT.BIN
if (!this.Accessor.FileExists(ebootPath))
{
this.FailVerify("The EBOOT.BIN file does not exist. Try pressing 'Revert EBOOT' to see if that helps.");
return;
this.LogMessage("Couldn't find an original backup of the EBOOT, using active copy. This is not an error.");
ebootPath = Path.Combine(this._usrDir, "EBOOT.BIN");

// If we land here, then we have no valid patch target without any way to recover.
// This is very inconvenient for us and the user.
if (!this.Accessor.FileExists(ebootPath))
{
this.FailVerify("The EBOOT.BIN file does not exist, nor does the original backup exist. Something has gone horribly wrong.");
return;
}
}

string downloadedFile = this.Accessor.DownloadFile(ebootPath);
Expand Down

0 comments on commit eaace4e

Please sign in to comment.