mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
nfc commands
This commit is contained in:
@@ -220,7 +220,7 @@ set (TARGET_SOURCES
|
||||
${PM3_ROOT}/client/src/mifare/mifare4.c
|
||||
${PM3_ROOT}/client/src/mifare/mifaredefault.c
|
||||
${PM3_ROOT}/client/src/mifare/mifarehost.c
|
||||
${PM3_ROOT}/client/src/mifare/ndef.c
|
||||
${PM3_ROOT}/client/src/nfc/ndef.c
|
||||
${PM3_ROOT}/client/src/mifare/desfire_crypto.c
|
||||
${PM3_ROOT}/client/src/uart/uart_posix.c
|
||||
${PM3_ROOT}/client/src/uart/uart_win32.c
|
||||
@@ -291,6 +291,7 @@ set (TARGET_SOURCES
|
||||
${PM3_ROOT}/client/src/cmdlfviking.c
|
||||
${PM3_ROOT}/client/src/cmdlfvisa2000.c
|
||||
${PM3_ROOT}/client/src/cmdmain.c
|
||||
${PM3_ROOT}/client/src/cmdnfc.c
|
||||
${PM3_ROOT}/client/src/cmdparser.c
|
||||
${PM3_ROOT}/client/src/cmdscript.c
|
||||
${PM3_ROOT}/client/src/cmdsmartcard.c
|
||||
|
||||
+2
-1
@@ -523,6 +523,7 @@ SRCS = aiddesfire.c \
|
||||
cmdlfviking.c \
|
||||
cmdlfvisa2000.c \
|
||||
cmdmain.c \
|
||||
cmdnfc.c \
|
||||
cmdparser.c \
|
||||
cmdscript.c \
|
||||
cmdsmartcard.c \
|
||||
@@ -570,7 +571,7 @@ SRCS = aiddesfire.c \
|
||||
mifare/mifare4.c \
|
||||
mifare/mifaredefault.c \
|
||||
mifare/mifarehost.c \
|
||||
mifare/ndef.c \
|
||||
nfc/ndef.c \
|
||||
pm3.c \
|
||||
pm3_binlib.c \
|
||||
pm3_bitlib.c \
|
||||
|
||||
@@ -88,7 +88,7 @@ add_library(pm3rrg_rdv4 SHARED
|
||||
${PM3_ROOT}/client/src/mifare/mifare4.c
|
||||
${PM3_ROOT}/client/src/mifare/mifaredefault.c
|
||||
${PM3_ROOT}/client/src/mifare/mifarehost.c
|
||||
${PM3_ROOT}/client/src/mifare/ndef.c
|
||||
${PM3_ROOT}/client/src/nfc/ndef.c
|
||||
${PM3_ROOT}/client/src/mifare/desfire_crypto.c
|
||||
${PM3_ROOT}/client/src/uart/uart_posix.c
|
||||
${PM3_ROOT}/client/src/uart/uart_win32.c
|
||||
@@ -158,6 +158,7 @@ add_library(pm3rrg_rdv4 SHARED
|
||||
${PM3_ROOT}/client/src/cmdlfviking.c
|
||||
${PM3_ROOT}/client/src/cmdlfvisa2000.c
|
||||
${PM3_ROOT}/client/src/cmdmain.c
|
||||
${PM3_ROOT}/client/src/cmdnfc.c
|
||||
${PM3_ROOT}/client/src/cmdparser.c
|
||||
${PM3_ROOT}/client/src/cmdscript.c
|
||||
${PM3_ROOT}/client/src/cmdsmartcard.c
|
||||
|
||||
@@ -220,7 +220,7 @@ set (TARGET_SOURCES
|
||||
${PM3_ROOT}/client/src/mifare/mifare4.c
|
||||
${PM3_ROOT}/client/src/mifare/mifaredefault.c
|
||||
${PM3_ROOT}/client/src/mifare/mifarehost.c
|
||||
${PM3_ROOT}/client/src/mifare/ndef.c
|
||||
${PM3_ROOT}/client/src/nfc/ndef.c
|
||||
${PM3_ROOT}/client/src/mifare/desfire_crypto.c
|
||||
${PM3_ROOT}/client/src/uart/uart_posix.c
|
||||
${PM3_ROOT}/client/src/uart/uart_win32.c
|
||||
@@ -290,6 +290,7 @@ set (TARGET_SOURCES
|
||||
${PM3_ROOT}/client/src/cmdlfviking.c
|
||||
${PM3_ROOT}/client/src/cmdlfvisa2000.c
|
||||
${PM3_ROOT}/client/src/cmdmain.c
|
||||
${PM3_ROOT}/client/src/cmdnfc.c
|
||||
${PM3_ROOT}/client/src/cmdparser.c
|
||||
${PM3_ROOT}/client/src/cmdscript.c
|
||||
${PM3_ROOT}/client/src/cmdsmartcard.c
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "loclass/cipherutils.h" // for decimating samples in getsamples
|
||||
#include "cmdlfem410x.h" // askem410xdecode
|
||||
#include "fileutils.h" // searchFile
|
||||
#include "mifare/ndef.h"
|
||||
#include "cliparser.h"
|
||||
#include "cmdlft55xx.h" // print...
|
||||
#include "crypto/asn1utils.h" // ASN1 decode / print
|
||||
@@ -2692,44 +2691,6 @@ static int CmdDataIIR(const char *Cmd) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
static int CmdDataNDEF(const char *Cmd) {
|
||||
|
||||
#ifndef MAX_NDEF_LEN
|
||||
#define MAX_NDEF_LEN 2048
|
||||
#endif
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "data ndef",
|
||||
"Decode and print NFC Data Exchange Format (NDEF)",
|
||||
"data ndef -d 9101085402656e48656c6c6f5101085402656e576f726c64\n"
|
||||
"data ndef -d 0103d020240203e02c040300fe\n"
|
||||
);
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
arg_strx0("d", "data", "<hex>", "NDEF data to decode"),
|
||||
arg_lit0("v", "verbose", "verbose mode"),
|
||||
arg_param_end
|
||||
};
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||
|
||||
int datalen = 0;
|
||||
uint8_t data[MAX_NDEF_LEN] = {0};
|
||||
CLIGetHexWithReturn(ctx, 1, data, &datalen);
|
||||
bool verbose = arg_get_lit(ctx, 2);
|
||||
|
||||
CLIParserFree(ctx);
|
||||
if (datalen == 0)
|
||||
return PM3_EINVARG;
|
||||
|
||||
int res = NDEFDecodeAndPrint(data, datalen, verbose);
|
||||
if (res != PM3_SUCCESS) {
|
||||
PrintAndLogEx(INFO, "Trying to parse NDEF records w/o NDEF header");
|
||||
res = NDEFRecordsDecodeAndPrint(data, datalen);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
t55xx_modulation modulation;
|
||||
int bitrate;
|
||||
@@ -2951,7 +2912,6 @@ static command_t CommandTable[] = {
|
||||
{"hexsamples", CmdHexsamples, IfPm3Present, "Dump big buffer as hex bytes"},
|
||||
{"hex2bin", Cmdhex2bin, AlwaysAvailable, "Converts hexadecimal to binary"},
|
||||
{"load", CmdLoad, AlwaysAvailable, "Load contents of file into graph window"},
|
||||
{"ndef", CmdDataNDEF, AlwaysAvailable, "Decode NDEF records"},
|
||||
{"print", CmdPrintDemodBuff, AlwaysAvailable, "Print the data in the DemodBuffer"},
|
||||
{"samples", CmdSamples, IfPm3Present, "Get raw samples for graph window (GraphBuffer)"},
|
||||
{"save", CmdSave, AlwaysAvailable, "Save signal trace data (from graph window)"},
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "cliparser.h"
|
||||
#include "protocols.h" // definitions of ISO14A/7816 protocol, MAGIC_GEN_1A
|
||||
#include "emv/apduinfo.h" // GetAPDUCodeDescription
|
||||
#include "mifare/ndef.h" // NDEFRecordsDecodeAndPrint
|
||||
#include "nfc/ndef.h" // NDEFRecordsDecodeAndPrint
|
||||
|
||||
bool APDUInFramingEnable = true;
|
||||
|
||||
@@ -2346,11 +2346,11 @@ static void print_cc_info(uint8_t *d, uint8_t n) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
}
|
||||
|
||||
static int CmdHF14ANdef(const char *Cmd) {
|
||||
int CmdHF14ANdefRead(const char *Cmd) {
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hf 14a ndef",
|
||||
CLIParserInit(&ctx, "hf 14a ndefread",
|
||||
"Read NFC Data Exchange Format (NDEF) file on Type 4 NDEF tag",
|
||||
"hf 14a ndef\n");
|
||||
"hf 14a ndefread\n");
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
@@ -2539,7 +2539,7 @@ static command_t CommandTable[] = {
|
||||
{"list", CmdHF14AList, AlwaysAvailable, "List ISO 14443-a history"},
|
||||
{"info", CmdHF14AInfo, IfPm3Iso14443a, "Tag information"},
|
||||
{"reader", CmdHF14AReader, IfPm3Iso14443a, "Act like an ISO14443-a reader"},
|
||||
{"ndef", CmdHF14ANdef, IfPm3Iso14443a, "Read an NDEF file from ISO 14443-A Type 4 tag"},
|
||||
{"ndefread", CmdHF14ANdefRead, IfPm3Iso14443a, "Read an NDEF file from ISO 14443-A Type 4 tag"},
|
||||
{"cuids", CmdHF14ACUIDs, IfPm3Iso14443a, "Collect n>0 ISO14443-a UIDs in one go"},
|
||||
{"sim", CmdHF14ASim, IfPm3Iso14443a, "Simulate ISO 14443-a tag"},
|
||||
{"sniff", CmdHF14ASniff, IfPm3Iso14443a, "sniff ISO 14443-a traffic"},
|
||||
|
||||
@@ -25,6 +25,7 @@ typedef struct {
|
||||
int CmdHF14A(const char *Cmd);
|
||||
int CmdHF14ASniff(const char *Cmd); // used by hf topaz sniff
|
||||
int CmdHF14ASim(const char *Cmd); // used by hf mfu sim
|
||||
int CmdHF14ANdefRead(const char *Cmd);
|
||||
|
||||
int hf14a_getconfig(hf14a_config *config);
|
||||
int hf14a_setconfig(hf14a_config *config, bool verbose);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "cmdhf14a.h"
|
||||
#include "protocols.h" // definitions of ISO14B/7816 protocol
|
||||
#include "emv/apduinfo.h" // GetAPDUCodeDescription
|
||||
#include "mifare/ndef.h" // NDEFRecordsDecodeAndPrint
|
||||
#include "nfc/ndef.h" // NDEFRecordsDecodeAndPrint
|
||||
#include "aidsearch.h"
|
||||
|
||||
#define MAX_14B_TIMEOUT_MS (4949U)
|
||||
@@ -1915,12 +1915,12 @@ static int CmdHF14BAPDU(const char *Cmd) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
static int CmdHF14BNdef(const char *Cmd) {
|
||||
int CmdHF14BNdefRead(const char *Cmd) {
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hf 14b ndef",
|
||||
CLIParserInit(&ctx, "hf 14b ndefread",
|
||||
"Print NFC Data Exchange Format (NDEF)",
|
||||
"hf 14b ndef"
|
||||
"hf 14b ndefread"
|
||||
);
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
@@ -2023,7 +2023,7 @@ static command_t CommandTable[] = {
|
||||
{"dump", CmdHF14BDump, IfPm3Iso14443b, "Read all memory pages of an ISO-14443-B tag, save to file"},
|
||||
{"info", CmdHF14Binfo, IfPm3Iso14443b, "Tag information"},
|
||||
{"list", CmdHF14BList, AlwaysAvailable, "List ISO-14443-B history"},
|
||||
{"ndef", CmdHF14BNdef, IfPm3Iso14443b, "Read NDEF file on tag"},
|
||||
{"ndefread", CmdHF14BNdefRead, IfPm3Iso14443b, "Read NDEF file on tag"},
|
||||
{"raw", CmdHF14BCmdRaw, IfPm3Iso14443b, "Send raw hex data to tag"},
|
||||
{"reader", CmdHF14BReader, IfPm3Iso14443b, "Act as a ISO-14443-B reader to identify a tag"},
|
||||
// {"restore", CmdHF14BRestore, IfPm3Iso14443b, "Restore from file to all memory pages of an ISO-14443-B tag"},
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "common.h"
|
||||
|
||||
int CmdHF14B(const char *Cmd);
|
||||
int CmdHF14BNdefRead(const char *Cmd);
|
||||
|
||||
int exchange_14b_apdu(uint8_t *datain, int datainlen, bool activate_field, bool leave_signal_on, uint8_t *dataout, int maxdataoutlen, int *dataoutlen, int user_timeout);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "cmdparser.h"
|
||||
#include "generator.h"
|
||||
#include "base64.h"
|
||||
#include "mifare/ndef.h" // print decode ndef
|
||||
#include "nfc/ndef.h" // print decode ndef
|
||||
#include "mifare/mifarehost.h" // mfemlsetmem_xt
|
||||
#include "cliparser.h"
|
||||
#include "cmdhfmfu.h"
|
||||
@@ -651,7 +651,7 @@ static int CmdHF14AJookiClone(const char *Cmd) {
|
||||
}
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
PrintAndLogEx(HINT, "Try `" _YELLOW_("hf mfu ndef") "` to view");
|
||||
PrintAndLogEx(HINT, "Try `" _YELLOW_("hf mfu ndefread") "` to view");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -20,7 +20,7 @@
|
||||
#include "cliparser.h" // argtable
|
||||
#include "hardnested_bf_core.h" // SetSIMDInstr
|
||||
#include "mifare/mad.h"
|
||||
#include "mifare/ndef.h"
|
||||
#include "nfc/ndef.h"
|
||||
#include "protocols.h"
|
||||
#include "util_posix.h" // msclock
|
||||
#include "cmdhfmfhard.h"
|
||||
@@ -5320,14 +5320,14 @@ static int CmdHF14AMfMAD(const char *Cmd) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
static int CmdHFMFNDEF(const char *Cmd) {
|
||||
int CmdHFMFNDEFRead(const char *Cmd) {
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hf mf ndef",
|
||||
CLIParserInit(&ctx, "hf mf ndefread",
|
||||
"Prints NFC Data Exchange Format (NDEF)",
|
||||
"hf mf ndef -> shows NDEF parsed data\n"
|
||||
"hf mf ndef -vv -> shows NDEF parsed and raw data\n"
|
||||
"hf mf ndef --aid e103 -k ffffffffffff -b -> shows NDEF data with custom AID, key and with key B\n");
|
||||
"hf mf ndefread -> shows NDEF parsed data\n"
|
||||
"hf mf ndefread -vv -> shows NDEF parsed and raw data\n"
|
||||
"hf mf ndefread --aid e103 -k ffffffffffff -b -> shows NDEF data with custom AID, key and with key B\n");
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
@@ -5371,7 +5371,7 @@ static int CmdHFMFNDEF(const char *Cmd) {
|
||||
|
||||
if (mfReadSector(MF_MAD1_SECTOR, MF_KEY_A, (uint8_t *)g_mifare_mad_key, sector0)) {
|
||||
PrintAndLogEx(ERR, "error, read sector 0. card don't have MAD or don't have MAD on default keys");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mf ndef -k `") " with your custom key");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mf ndefread -k `") " with your custom key");
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
@@ -5388,7 +5388,7 @@ static int CmdHFMFNDEF(const char *Cmd) {
|
||||
|
||||
if (mfReadSector(MF_MAD2_SECTOR, MF_KEY_A, (uint8_t *)g_mifare_mad_key, sector10)) {
|
||||
PrintAndLogEx(ERR, "error, read sector 0x10. card don't have MAD or don't have MAD on default keys");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mf ndef -k `") " with your custom key");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mf ndefread -k `") " with your custom key");
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
}
|
||||
@@ -5431,7 +5431,7 @@ static int CmdHFMFNDEF(const char *Cmd) {
|
||||
|
||||
NDEFDecodeAndPrint(data, datalen, verbose);
|
||||
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mf ndef -vv`") " for more details");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mf ndefread -vv`") " for more details");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -6026,7 +6026,7 @@ static command_t CommandTable[] = {
|
||||
{"auth4", CmdHF14AMfAuth4, IfPm3Iso14443a, "ISO14443-4 AES authentication"},
|
||||
{"dump", CmdHF14AMfDump, IfPm3Iso14443a, "Dump MIFARE Classic tag to binary file"},
|
||||
{"mad", CmdHF14AMfMAD, IfPm3Iso14443a, "Checks and prints MAD"},
|
||||
{"ndef", CmdHFMFNDEF, IfPm3Iso14443a, "Prints NDEF records from card"},
|
||||
{"ndefread", CmdHFMFNDEFRead, IfPm3Iso14443a, "Prints NDEF records from card"},
|
||||
{"personalize", CmdHFMFPersonalize, IfPm3Iso14443a, "Personalize UID (MIFARE Classic EV1 only)"},
|
||||
{"rdbl", CmdHF14AMfRdBl, IfPm3Iso14443a, "Read MIFARE Classic block"},
|
||||
{"rdsc", CmdHF14AMfRdSc, IfPm3Iso14443a, "Read MIFARE Classic sector"},
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
int CmdHFMF(const char *Cmd);
|
||||
int CmdHF14AMfELoad(const char *Cmd); // used by cmd hf mfu eload
|
||||
int CmdHF14AMfDbg(const char *Cmd); // used by cmd hf mfu dbg
|
||||
int CmdHFMFNDEFRead(const char *Cmd);
|
||||
|
||||
void showSectorTable(sector_t *k_sector, uint8_t k_sectorsCount);
|
||||
void readerAttack(sector_t *k_sector, uint8_t k_sectorsCount, nonces_t data, bool setEmulatorMem, bool verbose);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "crapto1/crapto1.h"
|
||||
#include "fileutils.h"
|
||||
#include "mifare/mifaredefault.h" // default keys
|
||||
#include "mifare/ndef.h" // NDEF
|
||||
#include "nfc/ndef.h" // NDEF
|
||||
#include "mifare/mad.h"
|
||||
#include "generator.h"
|
||||
#include "aiddesfire.h"
|
||||
@@ -4887,15 +4887,15 @@ static int CmdHF14ADesList(const char *Cmd) {
|
||||
}
|
||||
|
||||
/*
|
||||
static int CmdHF14aDesNDEF(const char *Cmd) {
|
||||
static int CmdHF14aDesNDEFRead(const char *Cmd) {
|
||||
DropFieldDesfire();
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hf mfdes ndef",
|
||||
CLIParserInit(&ctx, "hf mfdes ndefread",
|
||||
"Prints NFC Data Exchange Format (NDEF)",
|
||||
"hf mfdes ndef -> shows NDEF data\n"
|
||||
"hf mfdes ndef -v -> shows NDEF parsed and raw data\n"
|
||||
"hf mfdes ndef -a e103 -k d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7 -> shows NDEF data with custom AID and key");
|
||||
"hf mfdes ndefread -> shows NDEF data\n"
|
||||
"hf mfdes ndefread -v -> shows NDEF parsed and raw data\n"
|
||||
"hf mfdes ndefread -a e103 -k d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7 -> shows NDEF data with custom AID and key");
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
@@ -4984,7 +4984,7 @@ static int CmdHF14aDesNDEF(const char *Cmd) {
|
||||
print_buffer(data, datalen, 1);
|
||||
}
|
||||
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mfdes ndef -vv`") " for more details");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mfdes ndefread -vv`") " for more details");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
*/
|
||||
@@ -5050,7 +5050,7 @@ static command_t CommandTable[] = {
|
||||
{"getuid", CmdHF14ADesGetUID, IfPm3Iso14443a, "Get random uid"},
|
||||
{"info", CmdHF14ADesInfo, IfPm3Iso14443a, "Tag information"},
|
||||
{"list", CmdHF14ADesList, AlwaysAvailable, "List DESFire (ISO 14443A) history"},
|
||||
// {"ndef", CmdHF14aDesNDEF, IfPm3Iso14443a, "Prints NDEF records from card"},
|
||||
// {"ndefread", CmdHF14aDesNDEFRead, IfPm3Iso14443a, "Prints NDEF records from card"},
|
||||
// {"mad", CmdHF14aDesMAD, IfPm3Iso14443a, "Prints MAD records from card"},
|
||||
{"-----------", CmdHelp, IfPm3Iso14443a, "-------------------- " _CYAN_("Applications") " -------------------"},
|
||||
{"bruteaid", CmdHF14ADesBruteApps, IfPm3Iso14443a, "Recover AIDs by bruteforce"},
|
||||
|
||||
+10
-10
@@ -19,7 +19,7 @@
|
||||
#include "cmdhf14a.h"
|
||||
#include "mifare/mifare4.h"
|
||||
#include "mifare/mad.h"
|
||||
#include "mifare/ndef.h"
|
||||
#include "nfc/ndef.h"
|
||||
#include "cliparser.h"
|
||||
#include "mifare/mifaredefault.h"
|
||||
#include "util_posix.h"
|
||||
@@ -1458,14 +1458,14 @@ static int CmdHFMFPMAD(const char *Cmd) {
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
static int CmdHFMFPNDEF(const char *Cmd) {
|
||||
int CmdHFMFPNDEFRead(const char *Cmd) {
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hf mfp ndef",
|
||||
CLIParserInit(&ctx, "hf mfp ndefread",
|
||||
"Prints NFC Data Exchange Format (NDEF)",
|
||||
"hf mfp ndef -> shows NDEF data\n"
|
||||
"hf mfp ndef -vv -> shows NDEF parsed and raw data\n"
|
||||
"hf mfp ndef -a e103 -k d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7 -> shows NDEF data with custom AID and key");
|
||||
"hf mfp ndefread -> shows NDEF data\n"
|
||||
"hf mfp ndefread -vv -> shows NDEF parsed and raw data\n"
|
||||
"hf mfp ndefread -a e103 -k d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7 -> shows NDEF data with custom AID and key");
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
@@ -1509,7 +1509,7 @@ static int CmdHFMFPNDEF(const char *Cmd) {
|
||||
|
||||
if (mfpReadSector(MF_MAD1_SECTOR, MF_KEY_A, (uint8_t *)g_mifarep_mad_key, sector0, verbose)) {
|
||||
PrintAndLogEx(ERR, "error, read sector 0. card don't have MAD or don't have MAD on default keys");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mfp ndef -k `") " with your custom key");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mfp ndefread -k `") " with your custom key");
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
@@ -1527,7 +1527,7 @@ static int CmdHFMFPNDEF(const char *Cmd) {
|
||||
|
||||
if (mfpReadSector(MF_MAD2_SECTOR, MF_KEY_A, (uint8_t *)g_mifarep_mad_key, sector10, verbose)) {
|
||||
PrintAndLogEx(ERR, "error, read sector 0x10. card don't have MAD or don't have MAD on default keys");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mf ndef -k `") " with your custom key");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mfp ndefread -k `") " with your custom key");
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
}
|
||||
@@ -1569,7 +1569,7 @@ static int CmdHFMFPNDEF(const char *Cmd) {
|
||||
}
|
||||
|
||||
NDEFDecodeAndPrint(data, datalen, verbose);
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mfp ndef -vv`") " for more details");
|
||||
PrintAndLogEx(HINT, "Try " _YELLOW_("`hf mfp ndefread -vv`") " for more details");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1585,7 +1585,7 @@ static command_t CommandTable[] = {
|
||||
{"wrbl", CmdHFMFPWrbl, IfPm3Iso14443a, "Write blocks"},
|
||||
{"chk", CmdHFMFPChk, IfPm3Iso14443a, "Check keys"},
|
||||
{"mad", CmdHFMFPMAD, IfPm3Iso14443a, "Checks and prints MAD"},
|
||||
{"ndef", CmdHFMFPNDEF, IfPm3Iso14443a, "Prints NDEF records from card"},
|
||||
{"ndefread", CmdHFMFPNDEFRead, IfPm3Iso14443a, "Prints NDEF records from card"},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
#include "common.h"
|
||||
|
||||
int CmdHFMFP(const char *Cmd);
|
||||
int CmdHFMFPNDEFRead(const char *Cmd);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "fileutils.h"
|
||||
#include "protocols.h"
|
||||
#include "generator.h"
|
||||
#include "mifare/ndef.h"
|
||||
#include "nfc/ndef.h"
|
||||
#include "cliparser.h"
|
||||
#include "cmdmain.h"
|
||||
#include "amiibo.h" // amiiboo fcts
|
||||
@@ -3765,7 +3765,7 @@ static int CmdHF14AMfuEv1CounterTearoff(const char *Cmd) {
|
||||
// 2. magic bytes in the readable payload
|
||||
|
||||
|
||||
static int CmdHF14MfuNDEF(const char *Cmd) {
|
||||
int CmdHF14MfuNDEFRead(const char *Cmd) {
|
||||
|
||||
int keylen;
|
||||
int maxsize = 16, status;
|
||||
@@ -3779,10 +3779,10 @@ static int CmdHF14MfuNDEF(const char *Cmd) {
|
||||
uint8_t pack[4] = {0, 0, 0, 0};
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hf mfu ndef",
|
||||
CLIParserInit(&ctx, "hf mfu ndefread",
|
||||
"Prints NFC Data Exchange Format (NDEF)",
|
||||
"hf mfu ndef -> shows NDEF data\n"
|
||||
"hf mfu ndef -k ffffffff -> shows NDEF data with key");
|
||||
"hf mfu ndefread -> shows NDEF data\n"
|
||||
"hf mfu ndefread -k ffffffff -> shows NDEF data with key");
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
@@ -4014,7 +4014,7 @@ static command_t CommandTable[] = {
|
||||
{"cauth", CmdHF14AMfUCAuth, IfPm3Iso14443a, "Authentication - Ultralight-C"},
|
||||
{"dump", CmdHF14AMfUDump, IfPm3Iso14443a, "Dump MIFARE Ultralight family tag to binary file"},
|
||||
{"info", CmdHF14AMfUInfo, IfPm3Iso14443a, "Tag information"},
|
||||
{"ndef", CmdHF14MfuNDEF, IfPm3Iso14443a, "Prints NDEF records from card"},
|
||||
{"ndefread",CmdHF14MfuNDEFRead, IfPm3Iso14443a, "Prints NDEF records from card"},
|
||||
{"rdbl", CmdHF14AMfURdBl, IfPm3Iso14443a, "Read block"},
|
||||
{"restore", CmdHF14AMfURestore, IfPm3Iso14443a, "Restore a dump onto a MFU MAGIC tag"},
|
||||
{"wrbl", CmdHF14AMfUWrBl, IfPm3Iso14443a, "Write block"},
|
||||
|
||||
@@ -26,6 +26,7 @@ void printMFUdumpEx(mfu_dump_t *card, uint16_t pages, uint8_t startpage);
|
||||
int ul_read_uid(uint8_t *uid);
|
||||
|
||||
int CmdHFMFUltra(const char *Cmd);
|
||||
int CmdHF14MfuNDEFRead(const char *Cmd);
|
||||
|
||||
uint16_t ul_ev1_packgen_VCNEW(uint8_t *uid, uint32_t pwd);
|
||||
uint32_t ul_ev1_otpgenA(uint8_t *uid);
|
||||
|
||||
@@ -38,7 +38,7 @@ static int seos_select(void) {
|
||||
uint8_t response[PM3_CMD_DATA_SIZE];
|
||||
int resplen = 0;
|
||||
|
||||
// --------------- Select NDEF Tag application ----------------
|
||||
// --------------- Select SEOS applet ----------------
|
||||
uint8_t aSELECT_AID[80];
|
||||
int aSELECT_AID_n = 0;
|
||||
param_gethex_to_eol("00a404000aa000000440000101000100", 0, aSELECT_AID, sizeof(aSELECT_AID), &aSELECT_AID_n);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "cmdhf14a.h"
|
||||
#include "protocols.h" // definitions of ISO14A/7816 protocol
|
||||
#include "emv/apduinfo.h" // GetAPDUCodeDescription
|
||||
#include "mifare/ndef.h" // NDEFRecordsDecodeAndPrint
|
||||
#include "nfc/ndef.h" // NDEFRecordsDecodeAndPrint
|
||||
|
||||
#define TIMEOUT 2000
|
||||
|
||||
@@ -203,7 +203,7 @@ static uint16_t get_sw(uint8_t *d, uint8_t n) {
|
||||
}
|
||||
|
||||
// ST rothult
|
||||
int infoHFST(void) {
|
||||
static int infoHFST(void) {
|
||||
|
||||
bool activate_field = true;
|
||||
bool keep_field_on = true;
|
||||
@@ -361,15 +361,15 @@ static int CmdHFSTSim(const char *Cmd) {
|
||||
return CmdHF14ASim(param);
|
||||
}
|
||||
|
||||
static int CmdHFSTNdef(const char *Cmd) {
|
||||
int CmdHFSTNdefRead(const char *Cmd) {
|
||||
int pwdlen = 0;
|
||||
uint8_t pwd[16] = {0};
|
||||
bool with_pwd = false;
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hf st ndef",
|
||||
CLIParserInit(&ctx, "hf st ndefread",
|
||||
"Read NFC Data Exchange Format (NDEF) file on ST25TA",
|
||||
"hf st ndef -p 82E80053D4CA5C0B656D852CC696C8A1\n");
|
||||
"hf st ndefread -p 82E80053D4CA5C0B656D852CC696C8A1\n");
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
@@ -795,7 +795,7 @@ static command_t CommandTable[] = {
|
||||
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
||||
{"info", CmdHFSTInfo, IfPm3Iso14443a, "Tag information"},
|
||||
{"list", CmdHFSTList, AlwaysAvailable, "List ISO 14443A/7816 history"},
|
||||
{"ndef", CmdHFSTNdef, AlwaysAvailable, "read NDEF file on tag"},
|
||||
{"ndefread",CmdHFSTNdefRead, AlwaysAvailable, "read NDEF file on tag"},
|
||||
{"protect", CmdHFSTProtect, IfPm3Iso14443a, "change protection on tag"},
|
||||
{"pwd", CmdHFSTPwd, IfPm3Iso14443a, "change password on tag"},
|
||||
{"sim", CmdHFSTSim, IfPm3Iso14443a, "Fake ISO 14443A/ST tag"},
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
#include "common.h"
|
||||
|
||||
int CmdHFST(const char *Cmd);
|
||||
int CmdHFSTNdefRead(const char *Cmd);
|
||||
|
||||
int infoHFST(void);
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user