Skip to content

Commit

Permalink
FMCB minimal check on slims only
Browse files Browse the repository at this point in the history
  • Loading branch information
AKuHAK committed Apr 30, 2022
1 parent c84e333 commit f47bbeb
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,50 @@ char isPatchKnown()
return ret;
}

void checkFMCB()
{
uint8_t version[4];
uint8_t isSlim = 0;
getMechaVersion(version);
if (version[1] == 5)
isSlim = 0;
else if (version[1] == 6)

This comment has been minimized.

Copy link
@israpps

israpps Apr 30, 2022

Contributor

In addition to the Mecha check to determine if it's a slim

You should check if the console actually needs jap, European or Chinese folders.

American and Asian slims already use American folder, so technically they won't be affected

This comment has been minimized.

Copy link
@AKuHAK

AKuHAK Apr 30, 2022

Author Contributor

DEX option will force American folder regardless of region so there is no need to check for other options. CEX option was always more risky, this is really minimal check, so DEX will not fail.

This comment has been minimized.

Copy link
@israpps

israpps Apr 30, 2022

Contributor

DEX option will force American folder regardless of region so there is no need to check for other options. CEX option was always more risky, this is really minimal check, so DEX will not fail.

I'm saying this because if the console is American there is no need to make them crazy with exploit changes

This comment has been minimized.

Copy link
@AKuHAK

AKuHAK May 1, 2022

Author Contributor

Do not quite understand. All this check is doing, check that one file exist on the memory card, if it exist, then dex option will not break fmcb, thats all. Ofc it will exist on usa region, and mechapwn will see that. This will also exist in crossregion and mechapwn will see that. Do not understand why this check should be made more complicated.

isSlim = 1;
if (isSlim)
{
// Check for NA FMCB folder on slims, this is minimal check
FILE *f = fopen("mc0:/BAEXEC-SYSTEM/osdmain.elf", "rb");
if (f) // FMCB mc0 is ok, skipping
fclose(f);
else
{
f = fopen("mc1:/BAEXEC-SYSTEM/osdmain.elf", "rb");
if (f) // FMCB mc1 is ok, skipping
fclose(f);
else
{
gsKit_clear(gsGlobal, Black);
struct GSTEXTURE_holder *errorTextures1 = draw_text(8, 8 + big_size + big_size / 2 + 0 * (reg_size + 4), reg_size, 0xFFFFFF, "FMCB Cross-region not found!!!\n");
struct GSTEXTURE_holder *errorTextures2 = draw_text(8, 8 + big_size + big_size / 2 + 1 * (reg_size + 4), reg_size, 0xFFFFFF, "FMCB may stop to work after installation.\n");
struct GSTEXTURE_holder *exitTextures = draw_text(8, 8 + big_size + big_size / 2 + 7 * (reg_size + 4), reg_size, 0xFFFFFF, "Press X to continue.\n");
drawFrame();

freeGSTEXTURE_holder(exitTextures);
freeGSTEXTURE_holder(errorTextures2);
freeGSTEXTURE_holder(errorTextures1);

while (1)
{
u32 new_pad = ReadCombinedPadStatus();

if (new_pad & PAD_CROSS)
break;
}
}
}
}
}

void checkUnsupportedVersion()
{
uint8_t version[4];
Expand Down Expand Up @@ -1334,7 +1378,6 @@ void checkUnsupportedVersion()
}
}


char isPatchAlreadyInstalled()
{
uint8_t build_date[5];
Expand Down Expand Up @@ -1476,6 +1519,7 @@ int main()

drawLogo();

checkFMCB();
checkUnsupportedVersion();

uint8_t *powerTexture = getPowerTexture();
Expand Down

0 comments on commit f47bbeb

Please sign in to comment.