Skip to content

Commit ea50ee9

Browse files
committed
Fix supernag error triggering even when sysmodule patched it (#9)
1 parent e31f3e5 commit ea50ee9

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ROMFS := RomFs
4040

4141
APP_TITLE := Browser
4242
APP_AUTHOR := For The Users
43-
APP_VERSION := 0.3.0
43+
APP_VERSION := 0.3.1
4444
APP_TITLEID := 0100C4C320C0FFEE
4545
ICON := Control/icon_AmericanEnglish.dat
4646

source/main.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ int main(int argc, char* argv[])
110110
AppletStorage aStore;
111111
LibAppletArgs aArgs;
112112
nsvmInitialize();
113+
pminfoInitialize();
113114
consoleInit(NULL);
114115
strcpy(url, "https://dns.switchbru.com");
115116
printf("Press [L] to choose url\n");
@@ -123,7 +124,24 @@ int main(int argc, char* argv[])
123124
bool nagOn;
124125
nsvmNeedsUpdateVulnerability(&nagOn);
125126
if(nagOn) {
126-
showError("Error: Nag active, check more details", "Browser won't launch if supernag is active\n\nUse gagorder or switch-sys-tweak (the latter is bundled with BrowseNX) to disable supernag.", 0);
127+
u32 pCount;
128+
u64 pids[100];
129+
u64 cId;
130+
u32 i = 0;
131+
bool isPatched = false;
132+
svcGetProcessList(&pCount, pids, 100);
133+
while (i <= pCount-1) {
134+
pminfoGetTitleId(&cId, pids[i]);
135+
if(cId == 0x00FF747765616BFF || cId == 0x01FF415446660000) {
136+
printf(CONSOLE_GREEN "Supernag enabled, but patched via switch-sys-tweak!\n");
137+
isPatched = true;
138+
break;
139+
}
140+
i++;
141+
}
142+
if(!isPatched){
143+
showError("Error: Nag active, check more details", "Browser won't launch if supernag is active\n\nUse gagorder or switch-sys-tweak (the latter is bundled with BrowseNX) to disable supernag.", 0);
144+
}
127145
}
128146
bool forceAuth = false;
129147
while(appletMainLoop()) {
@@ -159,6 +177,7 @@ int main(int argc, char* argv[])
159177
consoleUpdate(NULL);
160178
}
161179
consoleExit(NULL);
180+
pminfoExit();
162181
nsvmExit();
163182

164183
FILE* dUFile = fopen("sdmc:/defUrl.txt", "r");

0 commit comments

Comments
 (0)