]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
FIX: Coverity, strlen(Cmd) can never be lesser than zero.. *douh*
[proxmark3-svn] / client / cmdhfmf.c
index 267f323cce9e551ca29374c2c2ffd70ac465a47b..0caa60b9d9a08ca14fdf201512d2cd1923eddfd1 100644 (file)
@@ -804,7 +804,7 @@ int CmdHF14AMfNestedHard(const char *Cmd)
        char ctmp;\r
        ctmp = param_getchar(Cmd, 0);\r
 \r
-       if (ctmp != 'R' && ctmp != 'r' && strlen(Cmd) < 20) {\r
+       if (ctmp != 'R' && ctmp != 'r' && ctmp != 'T' && ctmp != 't' && strlen(Cmd) < 20) {\r
                PrintAndLog("Usage:");\r
                PrintAndLog("      hf mf hardnested <block number> <key A|B> <key (12 hex symbols)>");\r
                PrintAndLog("                       <target block number> <target key A|B> [known target key (12 hex symbols)] [w] [s]");\r
@@ -829,15 +829,17 @@ int CmdHF14AMfNestedHard(const char *Cmd)
        bool nonce_file_read = false;\r
        bool nonce_file_write = false;\r
        bool slow = false;\r
+       int tests = 0;\r
+       \r
        \r
        if (ctmp == 'R' || ctmp == 'r') {\r
                nonce_file_read = true;\r
                if (!param_gethex(Cmd, 1, trgkey, 12)) {\r
                        know_target_key = true;\r
                }\r
-\r
+       } else if (ctmp == 'T' || ctmp == 't') {\r
+               tests = param_get32ex(Cmd, 1, 100, 10);\r
        } else {\r
-\r
                blockNo = param_get8(Cmd, 0);\r
                ctmp = param_getchar(Cmd, 1);\r
                if (ctmp != 'a' && ctmp != 'A' && ctmp != 'b' && ctmp != 'B') {\r
@@ -883,15 +885,16 @@ int CmdHF14AMfNestedHard(const char *Cmd)
                }\r
        }\r
 \r
-       PrintAndLog("--target block no:%3d, target key type:%c, known target key: 0x%02x%02x%02x%02x%02x%02x%s, file action: %s, Slow: %s ", \r
+       PrintAndLog("--target block no:%3d, target key type:%c, known target key: 0x%02x%02x%02x%02x%02x%02x%s, file action: %s, Slow: %s, Tests: %d ", \r
                        trgBlockNo, \r
                        trgKeyType?'B':'A', \r
                        trgkey[0], trgkey[1], trgkey[2], trgkey[3], trgkey[4], trgkey[5],\r
                        know_target_key?"":" (not set)",\r
                        nonce_file_write?"write":nonce_file_read?"read":"none",\r
-                       slow?"Yes":"No");\r
+                       slow?"Yes":"No",\r
+                       tests);\r
 \r
-       int16_t isOK = mfnestedhard(blockNo, keyType, key, trgBlockNo, trgKeyType, know_target_key?trgkey:NULL, nonce_file_read, nonce_file_write, slow);\r
+       int16_t isOK = mfnestedhard(blockNo, keyType, key, trgBlockNo, trgKeyType, know_target_key?trgkey:NULL, nonce_file_read, nonce_file_write, slow, tests);\r
 \r
        if (isOK) {\r
                switch (isOK) {\r
Impressum, Datenschutz