fix some ndef decoding

This commit is contained in:
iceman1001 2023-11-01 07:57:13 +01:00
commit 9f439fde4e

View file

@ -634,6 +634,7 @@ static const char *ndef_wifi_auth_lookup(uint8_t *d) {
return ""; return "";
} }
static int ndefDecodeMime_wifi_wsc(NDEFHeader_t *ndef) { static int ndefDecodeMime_wifi_wsc(NDEFHeader_t *ndef) {
if (ndef->PayloadLen == 0) { if (ndef->PayloadLen == 0) {
PrintAndLogEx(INFO, "no payload"); PrintAndLogEx(INFO, "no payload");
@ -713,7 +714,7 @@ static int ndefDecodeMime_wifi_wsc(NDEFHeader_t *ndef) {
pos += len; pos += len;
} }
// NETWORK_IDX // NETWORK_IDX - always set to 1, deprecated
if (memcmp(&ndef->Payload[pos], "\x10\x26", 2) == 0) { if (memcmp(&ndef->Payload[pos], "\x10\x26", 2) == 0) {
// 10 26 00 01 01 // 10 26 00 01 01
uint8_t len = 3; uint8_t len = 3;
@ -776,10 +777,16 @@ static int ndefDecodeMime_wifi_wsc(NDEFHeader_t *ndef) {
pos += len; pos += len;
} }
// unknown the length. // rf-bands
if (memcmp(&ndef->Payload[pos], "\x10\x3C", 2) == 0) { if (memcmp(&ndef->Payload[pos], "\x10\x3C", 2) == 0) {
uint8_t len = 3; uint8_t len = 3;
PrintAndLogEx(INFO, "Unknown......... %s", sprint_hex(&ndef->Payload[pos + 2], len));
if (ndef->Payload[pos + 2 + 2] == 0x01) {
PrintAndLogEx(INFO, "RF Bands........ %s ( " _YELLOW_("2.4 GHZ")" )", sprint_hex(&ndef->Payload[pos + 2], len));
} else if (ndef->Payload[pos + 2 + 2] == 0x02) {
PrintAndLogEx(INFO, "RF Bands........ %s ( " _YELLOW_("5.0 GHZ")" )", sprint_hex(&ndef->Payload[pos + 2], len));
}
n -= 2; n -= 2;
n -= len; n -= len;
pos += 2; pos += 2;
@ -791,13 +798,12 @@ static int ndefDecodeMime_wifi_wsc(NDEFHeader_t *ndef) {
ap-channel 0, 6 ap-channel 0, 6
+ credential + credential
device-name device-name
mac-address
manufacturer manufacturer
model-name model-name
model-number model-number
+ oob-password + oob-password
primary-device-type primary-device-type
rf-bands
secondary-device-type-list secondary-device-type-list
serial-number serial-number
ssid ssid