Properly display security mode

This commit is contained in:
Joel16 2017-12-12 01:08:37 -06:00
parent 63d9fce285
commit 5dca409085
3 changed files with 34 additions and 4 deletions

View File

@ -31,5 +31,6 @@ char * getScreenType(void);
u64 getLocalFriendCodeSeed(void);
u8 * getSerialNumber(void);
u64 getSoapId(void);
char * getSecurityMode();
#endif

View File

@ -132,7 +132,9 @@ int main(int argc, char *argv[])
printf("\x1b[32;1m*\x1b[0m WiFi 1 SSID: \x1b[32;1m%s\x1b[0m\n", ssid);
if (R_SUCCEEDED(ACI_GetPassphrase(passphrase)))
printf("\x1b[32;1m*\x1b[0m WiFi 1 pass: \x1b[32;1m%s\x1b[0m\n\n", passphrase);
printf("\x1b[32;1m*\x1b[0m WiFi 1 pass: \x1b[32;1m%s\x1b[0m\n", passphrase);
printf("\x1b[32;1m*\x1b[0m WiFi 1 security: \x1b[32;1m%s\x1b[0m\n\n", getSecurityMode());
}
if (R_SUCCEEDED(ACI_LoadWiFiSlot(1)))
@ -143,7 +145,9 @@ int main(int argc, char *argv[])
printf("\x1b[32;1m*\x1b[0m WiFi 2 SSID: \x1b[32;1m%s\x1b[0m\n", ssid);
if (R_SUCCEEDED(ACI_GetPassphrase(passphrase)))
printf("\x1b[32;1m*\x1b[0m WiFi 2 pass: \x1b[32;1m%s\x1b[0m\n\n", passphrase);
printf("\x1b[32;1m*\x1b[0m WiFi 2 pass: \x1b[32;1m%s\x1b[0m\n", passphrase);
printf("\x1b[32;1m*\x1b[0m WiFi 2 security: \x1b[32;1m%s\x1b[0m\n\n", getSecurityMode());
}
if (R_SUCCEEDED(ACI_LoadWiFiSlot(2)))
@ -154,7 +158,9 @@ int main(int argc, char *argv[])
printf("\x1b[32;1m*\x1b[0m WiFi 3 SSID: \x1b[32;1m%s\x1b[0m\n", ssid);
if (R_SUCCEEDED(ACI_GetPassphrase(passphrase)))
printf("\x1b[32;1m*\x1b[0m WiFi 3 pass: \x1b[32;1m%s\x1b[0m\n\n", passphrase);
printf("\x1b[32;1m*\x1b[0m WiFi 3 pass: \x1b[32;1m%s\x1b[0m\n", passphrase);
printf("\x1b[32;1m*\x1b[0m WiFi 3 security: \x1b[32;1m%s\x1b[0m\n\n", getSecurityMode());
}
printf("\x1b[32;1m> Press any key to exit =)\x1b[0m");

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include "cfgs.h"
#include "ac.h"
#include "system.h"
#include "utils.h"
@ -234,3 +234,26 @@ u64 getSoapId(void)
return 0;
}
char * getSecurityMode()
{
u8 securityMode = 0;
if (R_FAILED(ACI_GetSecurityMode(&securityMode)))
securityMode = 8;
static char * securityString[] =
{
"Not secured",
"WEP 40-bit",
"WEP 104-bit",
"WEP 128-bit",
"WPA TKIP",
"WPA2 TKIP",
"WPA AES",
"WPA2 AES",
"Unknown"
};
return securityString[securityMode];
}