mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 02:34:48 +08:00
add ndef.c/h
This commit is contained in:
parent
e191219d8a
commit
cbe25f4832
4 changed files with 43 additions and 2 deletions
|
@ -158,6 +158,7 @@ CMDSRCS = crapto1/crapto1.c \
|
|||
emv/emv_roca.c \
|
||||
mifare/mifare4.c \
|
||||
mifare/mad.c \
|
||||
mifare/ndef.c \
|
||||
cmdanalyse.c \
|
||||
cmdhf.c \
|
||||
cmdhflist.c \
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "mifare.h"
|
||||
#include "mifare/mifare4.h"
|
||||
#include "mifare/mad.h"
|
||||
#include "mifare/ndef.h"
|
||||
#include "cliparser/cliparser.h"
|
||||
#include "crypto/libpcrypto.h"
|
||||
#include "emv/dump.h"
|
||||
|
@ -743,7 +744,7 @@ int CmdHFMFPNDEF(const char *cmd) {
|
|||
|
||||
void* argtable[] = {
|
||||
arg_param_begin,
|
||||
arg_lit0("vV", "verbose", "show technical data"),
|
||||
arg_litn("vV", "verbose", 0, 2, "show technical data"),
|
||||
arg_str0("aA", "aid", "replace default aid for NDEF", NULL),
|
||||
arg_str0("kK", "key", "replace default key for NDEF", NULL),
|
||||
arg_lit0("bB", "keyb", "use key B for access sectors (by default: key A)"),
|
||||
|
@ -752,6 +753,7 @@ int CmdHFMFPNDEF(const char *cmd) {
|
|||
CLIExecWithReturn(cmd, argtable, true);
|
||||
|
||||
bool verbose = arg_get_lit(1);
|
||||
bool verbose2 = arg_get_lit(1) > 1;
|
||||
uint8_t aid[2] = {0};
|
||||
int aidlen;
|
||||
CLIGetHexWithReturn(2, aid, &aidlen);
|
||||
|
@ -827,9 +829,12 @@ int CmdHFMFPNDEF(const char *cmd) {
|
|||
return 11;
|
||||
}
|
||||
|
||||
// if (verbose)
|
||||
if (verbose2) {
|
||||
PrintAndLogEx(NORMAL, "NDEF data:");
|
||||
dump_buffer(data, datalen, stdout, 1);
|
||||
}
|
||||
|
||||
NDEFDecodeAndPrint(data, datalen, verbose);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
16
client/mifare/ndef.c
Normal file
16
client/mifare/ndef.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2019 Merlok
|
||||
//
|
||||
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
||||
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||
// the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
// NFC Data Exchange Format (NDEF) functions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "ndef.h"
|
||||
|
||||
int NDEFDecodeAndPrint(uint8_t *ndef, size_t ndefLen, bool verbose) {
|
||||
|
||||
return 0;
|
||||
}
|
19
client/mifare/ndef.h
Normal file
19
client/mifare/ndef.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2019 Merlok
|
||||
//
|
||||
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
||||
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||
// the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
// NFC Data Exchange Format (NDEF) functions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _NDEF_H_
|
||||
#define _NDEF_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
extern int NDEFDecodeAndPrint(uint8_t *ndef, size_t ndefLen, bool verbose);
|
||||
|
||||
#endif // _NDEF_H_
|
Loading…
Reference in a new issue