Last active
May 20, 2023 22:49
-
-
Save ITotalJustice/e899a700c5a5d0f85b68c7ab3def502d to your computer and use it in GitHub Desktop.
example of how to detect emunand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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