Skip to content

Instantly share code, notes, and snippets.

@ITotalJustice
Last active May 20, 2023 22:49
Show Gist options
  • Save ITotalJustice/e899a700c5a5d0f85b68c7ab3def502d to your computer and use it in GitHub Desktop.
Save ITotalJustice/e899a700c5a5d0f85b68c7ab3def502d to your computer and use it in GitHub Desktop.
example of how to detect emunand
struct EmummcPaths {
char unk[0x80];
char nintendo[0x80];
};
void smcAmsGetEmunandConfig(EmummcPaths* out_paths) {
SecmonArgs args{};
args.X[0] = 0xF0000404; /* smcAmsGetEmunandConfig */
args.X[1] = 0; /* EXO_EMUMMC_MMC_NAND*/
args.X[2] = (u64)out_paths; /* out path */
svcCallSecureMonitor(&args);
}
bool isEmunand() {
EmummcPaths paths{};
smcAmsGetEmunandConfig(&paths);
return (paths.unk[0] != '\0') || (paths.nintendo[0] != '\0');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment