DEL: removed two old des-commands files which wasn't used.
ui.c \
cmddata.c \
lfdemod.c \
+ cmdanalyse.c \
cmdhf.c \
cmdhf14a.c \
cmdhf14b.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
+++ /dev/null
-//-----------------------------------------------------------------------------
-// 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;
-}
+++ /dev/null
-//-----------------------------------------------------------------------------
-// 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
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(" -----------------------------------------------------------");
*/
char * GetCardSizeStr( uint8_t fsize ){
- static char buf[30];
+ static char buf[30] = {0x00};
char *retStr = buf;
uint16_t usize = 1 << ((fsize >>1) + 1);
char * GetProtocolStr(uint8_t id){
- static char buf[30];
+ static char buf[30] = {0x00};
char *retStr = buf;
if ( id == 0x05)
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};
int CmdHFMFDes(const char *Cmd) {
// flush
clearCommandBuffer();
- //WaitForResponseTimeout(CMD_ACK,NULL,100);
CmdsParse(CommandTable, Cmd);
return 0;
}
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 {
int CmdHFMFDesfire(const char *Cmd){
// flush
clearCommandBuffer();
- //WaitForResponseTimeout(CMD_ACK,NULL,100);
CmdsParse(CommandTable, Cmd);
return 0;
}