]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
minor bugfixes to hf mf sniff and hf 14a snoop
authorpwpiwi <pwpiwi@users.noreply.github.com>
Tue, 15 Jul 2014 06:39:56 +0000 (08:39 +0200)
committerpwpiwi <pwpiwi@users.noreply.github.com>
Tue, 15 Jul 2014 06:39:56 +0000 (08:39 +0200)
- tracing was not always enabled when starting hf mf sniff or hf 14a snoop
- ATQA was displayed in wrong byte order in hf mf sniff
- 4 Byte UIDs were displayed as 7 Byte UIDs (padded with 0x000000) in hf mf sniff
- same for logfile names.
- assignment (=) had been used instead of == in comparisons (shouldn't have been relevant though)

armsrc/iso14443a.c
client/cmdhfmf.c

index fe284352dfb0a46e8f41db99b462faf1fb58e63a..c5bcc8d4365d559018eacbd9cc0ce30ec6023023 100644 (file)
@@ -507,6 +507,7 @@ void RAMFUNC SnoopIso14443a(uint8_t param) {
        LEDsoff();
        // init trace buffer
        iso14a_clear_trace();
+       iso14a_set_tracing(TRUE);
 
        // We won't start recording the frames that we acquire until we trigger;
        // a good trigger condition to get started is probably when we see a
@@ -2623,7 +2624,8 @@ void RAMFUNC SniffMifare(uint8_t param) {
        // C(red) A(yellow) B(green)
        LEDsoff();
        // init trace buffer
-    iso14a_clear_trace();
+       iso14a_clear_trace();
+       iso14a_set_tracing(TRUE);
 
        // The command (reader -> tag) that we're receiving.
        // The length of a received command will in most cases be no more than 18 bytes.
index a26652566e812d353a6a1f739ed4a296902561f6..d9fd80922b84ac539cd7c5e761e49d4042155819 100644 (file)
@@ -1848,7 +1848,8 @@ int CmdHF14AMfSniff(const char *Cmd){
        int blockLen = 0;\r
        int num = 0;\r
        int pckNum = 0;\r
-       uint8_t uid[8];\r
+       uint8_t uid[7];\r
+       uint8_t uid_len;\r
        uint8_t atqa[2];\r
        uint8_t sak;\r
        bool isTag;\r
@@ -1926,14 +1927,19 @@ int CmdHF14AMfSniff(const char *Cmd){
                                        bufPtr += 4;\r
                                        len = bufPtr[0];\r
                                        bufPtr++;\r
-                                       if ((len == 14) && (bufPtr[0] = 0xff) && (bufPtr[1] = 0xff)) {\r
+                                       if ((len == 14) && (bufPtr[0] == 0xff) && (bufPtr[1] == 0xff)) {\r
                                                memcpy(uid, bufPtr + 2, 7);\r
                                                memcpy(atqa, bufPtr + 2 + 7, 2);\r
+                                               uid_len = (atqa[0] & 0xC0) == 0x40 ? 7 : 4;\r
                                                sak = bufPtr[11];\r
                                                \r
-                                               PrintAndLog("tag select uid:%s atqa:%02x %02x sak:0x%02x", sprint_hex(uid, 7), atqa[0], atqa[1], sak);\r
+                                               PrintAndLog("tag select uid:%s atqa:0x%02x%02x sak:0x%02x", \r
+                                                       sprint_hex(uid + (7 - uid_len), uid_len),\r
+                                                       atqa[1], \r
+                                                       atqa[0], \r
+                                                       sak);\r
                                                if (wantLogToFile || wantDecrypt) {\r
-                                                       FillFileNameByUID(logHexFileName, uid, ".log", 7);\r
+                                                       FillFileNameByUID(logHexFileName, uid + (7 - uid_len), ".log", uid_len);\r
                                                        AddLogCurrentDT(logHexFileName);\r
                                                }                                               \r
                                                if (wantDecrypt) mfTraceInit(uid, atqa, sak, wantSaveToEmlFile);\r
Impressum, Datenschutz