]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
ADD: added some identification on between old Desfire, Desfire EV1 and Desfire EV2
authoriceman1001 <iceman@iuse.se>
Mon, 13 Jun 2016 17:05:50 +0000 (19:05 +0200)
committericeman1001 <iceman@iuse.se>
Mon, 13 Jun 2016 17:05:50 +0000 (19:05 +0200)
DEL: removed two old des-commands files which wasn't used.

client/Makefile
client/cmdhfdes.c [deleted file]
client/cmdhfdes.h [deleted file]
client/cmdhfmfdes.c
client/cmdhfmfdes.h
client/cmdhfmfdesfire.c

index f76c955659f70d51bfaed973af025da4f1ec133e..8ccd1ceaeb5d8c623217c19051d06dd7b3ab1a21 100644 (file)
@@ -92,6 +92,7 @@ CMDSRCS =     nonce2key/crapto1.c \
                        ui.c \
                        cmddata.c \
                        lfdemod.c \
+                       cmdanalyse.c \
                        cmdhf.c \
                        cmdhf14a.c \
                        cmdhf14b.c \
@@ -140,8 +141,7 @@ CMDSRCS =   nonce2key/crapto1.c \
                        tea.c \
                        prng.c \
                        radixsort.c \
-                       bucketsort.c \
-                       cmdanalyse.c
+                       bucketsort.c
                
 ZLIBSRCS = deflate.c adler32.c trees.c zutil.c inflate.c inffast.c inftrees.c
 ZLIB_FLAGS = -DZ_SOLO -DZ_PREFIX -DNO_GZIP -DZLIB_PM3_TUNED 
diff --git a/client/cmdhfdes.c b/client/cmdhfdes.c
deleted file mode 100644 (file)
index 200270f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (C) 2012 nuit
-//
-// 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.
-//-----------------------------------------------------------------------------
-// High frequency MIFARE DESfire commands
-//-----------------------------------------------------------------------------
-
-#include "cmdhfdes.h"
-#include "proxmark3.h"
-#include "cmdmain.h"
-
-static int CmdHelp(const char *Cmd);
-
-int CmdHFDESReader(const char *Cmd)
-{
-    UsbCommand c = { CMD_MIFARE_DES_READER, {3, 0x60, 0} };
-    SendCommand(&c);
-    UsbCommand resp;
-       if (!WaitForResponseTimeout(CMD_ACK,&resp,2000) ){
-               PrintAndLog("Command time-out");
-               return 1;
-       }
-    return 0;
-}  
-
-int CmdHFDESDbg(const char *Cmd)
-{
-    int dbgMode = param_get32ex(Cmd, 0, 0, 10);
-    if (dbgMode > 4) {
-        PrintAndLog("Max debud mode parameter is 4 \n");
-    }
-
-    if (strlen(Cmd) < 1 || !param_getchar(Cmd, 0) || dbgMode > 4) {
-        PrintAndLog("Usage:  hf des dbg  <debug level>");
-        PrintAndLog(" 0 - no debug messages");
-        PrintAndLog(" 1 - error messages");
-        PrintAndLog(" 2 - all messages");
-        PrintAndLog(" 4 - extended debug mode");
-        return 0;
-    }
-
-  UsbCommand c = {CMD_MIFARE_SET_DBGMODE, {dbgMode, 0, 0}};
-  SendCommand(&c);
-
-  return 0;
-}
-
-static command_t CommandTable[] = 
-{
-    {"help",    CmdHelp,    1,  "This help"},
-    {"dbg",     CmdHFDESDbg, 0, "Set default debug mode"},
-    {"reader",  CmdHFDESReader, 0, "Reader"},
-  {NULL, NULL, 0, NULL}
-};
-
-int CmdHFDES(const char *Cmd)
-{
-    //flush
-       clearCommandBuffer();
-    //WaitForResponseTimeout(CMD_ACK,NULL,100);
-    CmdsParse(CommandTable, Cmd);
-    return 0;
-}
-
-int CmdHelp(const char *Cmd)
-{
-    CmdsHelp(CommandTable);
-    return 0;
-}
diff --git a/client/cmdhfdes.h b/client/cmdhfdes.h
deleted file mode 100644 (file)
index e51797c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (C) 2012 nuit
-//
-// 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.
-//-----------------------------------------------------------------------------
-// High frequency MIFARE DESfire commands
-//-----------------------------------------------------------------------------
-
-#ifndef CMDHFDES_H__
-#define CMDHFDES_H__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "proxmark3.h"
-#include "data.h"
-#include "ui.h"
-#include "cmdparser.h"
-#include "common.h"
-#include "util.h"
-int CmdHFDES(const char *Cmd);
-int CmdHFDESReader(const char *Cmd);
-int CmdHFDESDbg(const char *Cmd);
-#endif
index 9ab5a4af21cefa99a2e1e3eba4fab44ac081e410..e30407af240892f17cb21e8f206ea61fc8e33342 100644 (file)
@@ -159,7 +159,7 @@ int CmdHF14ADesInfo(const char *Cmd){
        PrintAndLog("      Vendor Id      : %s", getTagInfo(resp.d.asBytes[7]));
        PrintAndLog("      Type           : 0x%02X",resp.d.asBytes[8]);
        PrintAndLog("      Subtype        : 0x%02X",resp.d.asBytes[9]);
-       PrintAndLog("      Version        : %d.%d",resp.d.asBytes[10], resp.d.asBytes[11]);
+       PrintAndLog("      Version        : %s",GetVersionStr(resp.d.asBytes[10], resp.d.asBytes[11]) );
        PrintAndLog("      Storage size   : %s",GetCardSizeStr(resp.d.asBytes[12]));
        PrintAndLog("      Protocol       : %s",GetProtocolStr(resp.d.asBytes[13]));
        PrintAndLog("  -----------------------------------------------------------");
@@ -217,7 +217,7 @@ int CmdHF14ADesInfo(const char *Cmd){
 */
 char * GetCardSizeStr( uint8_t fsize ){
  
-       static char buf[30];
+       static char buf[30] = {0x00};
        char *retStr = buf;
 
        uint16_t usize = 1 << ((fsize >>1) + 1);
@@ -233,7 +233,7 @@ char * GetCardSizeStr( uint8_t fsize ){
 
 char * GetProtocolStr(uint8_t id){
 
-       static char buf[30];
+       static char buf[30] = {0x00};
        char *retStr = buf;
 
        if ( id == 0x05)
@@ -243,6 +243,22 @@ char * GetProtocolStr(uint8_t id){
        return buf;
 }
 
+char * GetVersionStr(uint8_t major, uint8_t minor){
+
+       static char buf[30] = {0x00};
+       char *retStr = buf;
+
+       if ( major == 0)
+               sprintf(retStr,"%d.%d (Desfire MF3ICD40)", major, minor);       
+       else if ( major == 1 && minor == 1)
+               sprintf(retStr,"%d.%d (Desfire EV1)", major, minor);
+       else if ( major == 1 && minor == 2)
+               sprintf(retStr,"%d.%d (Desfire EV2)", major, minor);
+       else
+               sprintf(retStr,"%d.%d (Unknown)", major, minor);
+       return buf;
+}
+
 void GetKeySettings( uint8_t *aid){
        
        char messStr[512] = {0x00};
@@ -649,7 +665,6 @@ static command_t CommandTable[] = {
 int CmdHFMFDes(const char *Cmd) {
    // flush
        clearCommandBuffer();
-       //WaitForResponseTimeout(CMD_ACK,NULL,100);
        CmdsParse(CommandTable, Cmd);
        return 0;
 }
index c05f15d609c5e2252c6c9143846592b49bed65f3..46e401d4c163afd39658eb8c3f3770d0866b9136 100644 (file)
@@ -16,8 +16,9 @@ int CmdHF14ADesInfo(const char *Cmd);
 int CmdHF14ADesEnumApplications(const char *Cmd);
 
 char * GetCardSizeStr( uint8_t fsize );
-char * GetProtocolStr(uint8_t id);
-void GetKeySettings( uint8_t * aid);
+char * GetProtocolStr( uint8_t id );
+char * GetVersionStr( uint8_t major, uint8_t minor );
+void GetKeySettings( uint8_t * aid );
 
 // Command options for Desfire behavior.
 enum  {
index 5eada6e9f1df8f175e9ba77f77a5aa24c5a744be..89784da26bd8448cee97ab3444c50fb176b539c2 100644 (file)
@@ -240,7 +240,6 @@ static command_t CommandTable[] =
 int CmdHFMFDesfire(const char *Cmd){
     // flush
        clearCommandBuffer();
-    //WaitForResponseTimeout(CMD_ACK,NULL,100);
     CmdsParse(CommandTable, Cmd);
     return 0;
 }
Impressum, Datenschutz