Permalink
Browse files

HydraNFC add command read-mf-ul (Read Mifare UltraLight write to micr…

…oSD filename)

HydraNFC udpate command emul-mf-ul (Emul Tag Mifare Ultralight (optional read from microSD filename))
  • Loading branch information...
1 parent 5b3c28a commit d569fcd853415d7d56e54ef773315abb45015285 @bvernoux bvernoux committed May 26, 2016
Showing with 510 additions and 146 deletions.
  1. +0 −1 common/microsd.c
  2. +3 −1 common/microsd.h
  3. +27 −5 hydrabus/commands.c
  4. +4 −1 hydrabus/commands.h
  5. +131 −87 hydrafwEm.ebp
  6. +187 −6 hydranfc/hydranfc.c
  7. +3 −0 hydranfc/hydranfc.h
  8. +155 −45 hydranfc/hydranfc_emul_mf_ultralight.c
View
@@ -42,7 +42,6 @@ static FATFS SDC_FS;
/* FS mounted and ready.*/
bool fs_ready = FALSE;
-#define FILENAME_SIZE (255)
char filename[FILENAME_SIZE+4] = { 0 };
#define DATA_TEST_SIZE (18)
View
@@ -24,8 +24,10 @@
#include "common.h"
+#define FILENAME_SIZE (255)
+
typedef struct {
- char filename[255];
+ char filename[FILENAME_SIZE];
} filename_t;
bool is_fs_ready(void);
View
@@ -88,10 +88,12 @@ t_token_dict tl_dict[] = {
{ T_TYPEA, "typea" },
{ T_VICINITY, "vicinity" },
{ T_EMUL_MIFARE, "emul-mifare" },
- { T_EMUL_MF_ULTRALIGHT, "emul-mf-ul" },
{ T_EMUL_ISO14443A, "emul-3a" },
{ T_REGISTERS, "registers" },
{ T_SCAN, "scan" },
+ { T_READ_MF_ULTRALIGHT, "read-mf-ul" },
+ { T_EMUL_MF_ULTRALIGHT, "emul-mf-ul" },
+ { T_CLONE_MF_ULTRALIGHT, "clone-mf-ul" },
{ T_SNIFF, "sniff" },
{ T_SNIFF_DBG, "sniff-dbg" },
{ T_DIRECT_MODE_0, "dm0" },
@@ -136,6 +138,7 @@ t_token_dict tl_dict[] = {
{ T_HIGH, "high" },
{ T_THREEWIRE, "3-wire" },
{ T_SCRIPT, "script" },
+ { T_FILE, "filename" },
{ T_LEFT_SQ, "[" },
{ T_RIGHT_SQ, "]" },
@@ -259,6 +262,15 @@ t_token tokens_mode_can_filter[] = {
{ }
};
+t_token tokens_mode_nfc_emul_mf_ul[] = {
+ {
+ T_FILE,
+ .arg_type = T_ARG_STRING,
+ .help = "microSD filename"
+ },
+ { }
+};
+
#define NFC_PARAMETERS \
{\
T_TYPEA,\
@@ -274,6 +286,20 @@ t_token tokens_mode_can_filter[] = {
.help = "Scan"\
},\
{\
+ T_READ_MF_ULTRALIGHT,\
+ .arg_type = T_ARG_STRING,\
+ .help = "Read Mifare UltraLight write to microSD filename"\
+ },\
+ {\
+ T_EMUL_MF_ULTRALIGHT,\
+ .subtokens = tokens_mode_nfc_emul_mf_ul,\
+ .help = "Emul Tag Mifare Ultralight (optional read from microSD filename)"\
+ },\
+ {\
+ T_CLONE_MF_ULTRALIGHT,\
+ .help = "Clone Mifare UltraLight"\
+ },\
+ {\
T_SNIFF,\
.help = "Sniff (ISO14443A only)"\
},\
@@ -287,10 +313,6 @@ t_token tokens_mode_can_filter[] = {
.help = "Emul Tag Mifare UID (uid)"\
},\
{\
- T_EMUL_MF_ULTRALIGHT,\
- .help = "Emul Tag Mifare Ultralight"\
- },\
- {\
T_EMUL_ISO14443A,\
.help = "Emul Tag ISO14443A SDD UID"\
},\
View
@@ -81,10 +81,12 @@ enum {
T_TYPEA,
T_VICINITY,
T_EMUL_MIFARE,
- T_EMUL_MF_ULTRALIGHT,
T_EMUL_ISO14443A,
T_REGISTERS,
T_SCAN,
+ T_READ_MF_ULTRALIGHT,
+ T_EMUL_MF_ULTRALIGHT,
+ T_CLONE_MF_ULTRALIGHT,
T_SNIFF,
T_SNIFF_DBG,
T_DIRECT_MODE_0,
@@ -129,6 +131,7 @@ enum {
T_HIGH,
T_THREEWIRE,
T_SCRIPT,
+ T_FILE,
/* BP-compatible commands */
T_LEFT_SQ,
Oops, something went wrong.

0 comments on commit d569fcd

Please sign in to comment.