Skip to content

Commit

Permalink
Open installer can install any sighaxed FIRM
Browse files Browse the repository at this point in the history
  • Loading branch information
d0k3 committed Jun 5, 2017
1 parent 49b5b55 commit 6c493ac
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions source/installer.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ u32 SafeB9SInstaller(void) {
ShowInstallerStatus();
u8 firm_sha[0x20];
UINT firm_size;
bool unknown_payload = false;
if ((f_qread(NAME_SIGHAXFIRM, FIRM_BUFFER, 0, FIRM_BUFFER_SIZE, &firm_size) != FR_OK) ||
(firm_size < 0x200)) {
snprintf(msgFirm, 64, "file not found");
Expand All @@ -132,11 +133,14 @@ u32 SafeB9SInstaller(void) {
return 1;
}
if (CheckFirmPayload(FIRM_BUFFER, msgFirm) != 0) {
#ifndef OPEN_INSTALLER
statusFirm = STATUS_RED;
return 1;
#else
unknown_payload = true;
#endif
}
// snprintf(msgFirm, 64, "loaded & verified");
statusFirm = STATUS_GREEN;
statusFirm = unknown_payload ? STATUS_YELLOW : STATUS_GREEN;
ShowInstallerStatus();
// provided FIRM is okay!

Expand Down Expand Up @@ -164,7 +168,7 @@ u32 SafeB9SInstaller(void) {
// secret_sector.bin okay or not required!


// step #3 - check NAND crypto
// step #4 - check NAND crypto
snprintf(msgCrypto, 64, "checking...");
statusCrypto = STATUS_YELLOW;
ShowInstallerStatus();
Expand Down Expand Up @@ -198,7 +202,9 @@ u32 SafeB9SInstaller(void) {


// step #X - point of no return
if (!ShowUnlockSequence(1, "All input files verified.\n \nTo install FIRM, enter the sequence\nbelow or press B to cancel.")) {
if (!ShowUnlockSequence(unknown_payload ? 6 : 1, unknown_payload ?
"!!! FIRM NOT RECOGNIZED !!!\nProceeding may lead to a BRICK!\n \nTo proceed, enter the sequence\nbelow or press B to cancel." :
"All input files verified.\n \nTo install FIRM, enter the sequence\nbelow or press B to cancel.")) {
snprintf(msgBackup, 64, "cancelled by user");
snprintf(msgInstall, 64, "cancelled by user");
statusBackup = STATUS_YELLOW;
Expand Down

0 comments on commit 6c493ac

Please sign in to comment.