mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 22:33:48 -07:00
chg: 'hf mfu ndef' - text record now correctly decode language and text parts. Thanks @bettse!
This commit is contained in:
parent
ae44e21f93
commit
4418281284
1 changed files with 25 additions and 18 deletions
|
@ -45,7 +45,6 @@ static const char *ndefSigType_s[] = {
|
||||||
"ECDSA-B233",
|
"ECDSA-B233",
|
||||||
"ECDSA-P256",
|
"ECDSA-P256",
|
||||||
"n/a"
|
"n/a"
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *ndefCertificateFormat_s[] = {
|
static const char *ndefCertificateFormat_s[] = {
|
||||||
|
@ -307,15 +306,24 @@ static int ndefDecodePayload(NDEFHeader_t *ndef) {
|
||||||
switch (ndef->TypeNameFormat) {
|
switch (ndef->TypeNameFormat) {
|
||||||
case tnfWellKnownRecord:
|
case tnfWellKnownRecord:
|
||||||
PrintAndLogEx(INFO, "Well Known Record");
|
PrintAndLogEx(INFO, "Well Known Record");
|
||||||
PrintAndLogEx(INFO, "\ttype : %.*s", (int)ndef->TypeLen, ndef->Type);
|
PrintAndLogEx(INFO, "\ttype\t: %.*s", (int)ndef->TypeLen, ndef->Type);
|
||||||
|
|
||||||
if (!strncmp((char *)ndef->Type, "T", ndef->TypeLen)) {
|
if (!strncmp((char *)ndef->Type, "T", ndef->TypeLen)) {
|
||||||
PrintAndLogEx(INFO, "\ttext : " _GREEN_("%.*s"), (int)ndef->PayloadLen, ndef->Payload);
|
uint8_t utf8 = (ndef->Payload[0] >> 7);
|
||||||
|
uint8_t lc_len = ndef->Payload[0] & 0x3F;
|
||||||
|
PrintAndLogEx(INFO,
|
||||||
|
"\tUTF %d\t: " _GREEN_("%.*s") ", " _GREEN_("%.*s"),
|
||||||
|
(utf8 == 0) ? 8 : 16,
|
||||||
|
lc_len,
|
||||||
|
ndef->Payload + 1,
|
||||||
|
(int)ndef->PayloadLen - 1 - lc_len,
|
||||||
|
ndef->Payload + 1 + lc_len
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strncmp((char *)ndef->Type, "U", ndef->TypeLen)) {
|
if (!strncmp((char *)ndef->Type, "U", ndef->TypeLen)) {
|
||||||
PrintAndLogEx(INFO
|
PrintAndLogEx(INFO
|
||||||
, "\turi : " _GREEN_("%s%.*s")
|
, "\turi\t: " _GREEN_("%s%.*s")
|
||||||
, (ndef->Payload[0] <= 0x23 ? URI_s[ndef->Payload[0]] : "[err]")
|
, (ndef->Payload[0] <= 0x23 ? URI_s[ndef->Payload[0]] : "[err]")
|
||||||
, (int)(ndef->PayloadLen - 1)
|
, (int)(ndef->PayloadLen - 1)
|
||||||
, &ndef->Payload[1]
|
, &ndef->Payload[1]
|
||||||
|
@ -436,7 +444,6 @@ int NDEFDecodeAndPrint(uint8_t *ndef, size_t ndefLen, bool verbose) {
|
||||||
case 0x00: {
|
case 0x00: {
|
||||||
indx++;
|
indx++;
|
||||||
uint16_t len = ndefTLVGetLength(&ndef[indx], &indx);
|
uint16_t len = ndefTLVGetLength(&ndef[indx], &indx);
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "-- NDEF NULL block.");
|
PrintAndLogEx(SUCCESS, "-- NDEF NULL block.");
|
||||||
if (len)
|
if (len)
|
||||||
PrintAndLogEx(WARNING, "NDEF NULL block size must be 0, got %d bytes", len);
|
PrintAndLogEx(WARNING, "NDEF NULL block size must be 0, got %d bytes", len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue