]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - client/cmdhfdes.c
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2012 nuit
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
8 // High frequency MIFARE DESfire commands
9 //-----------------------------------------------------------------------------
12 #include "proxmark3.h"
15 static int CmdHelp(const char *Cmd
);
17 int CmdHFDESReader(const char *Cmd
)
19 UsbCommand c
= { CMD_MIFARE_DES_READER
, {3, 0x60, 0} };
22 if (!WaitForResponseTimeout(CMD_ACK
,&resp
,2000) ){
23 PrintAndLog("Command time-out");
29 int CmdHFDESDbg(const char *Cmd
)
31 int dbgMode
= param_get32ex(Cmd
, 0, 0, 10);
33 PrintAndLog("Max debud mode parameter is 4 \n");
36 if (strlen(Cmd
) < 1 || !param_getchar(Cmd
, 0) || dbgMode
> 4) {
37 PrintAndLog("Usage: hf des dbg <debug level>");
38 PrintAndLog(" 0 - no debug messages");
39 PrintAndLog(" 1 - error messages");
40 PrintAndLog(" 2 - all messages");
41 PrintAndLog(" 4 - extended debug mode");
45 UsbCommand c
= {CMD_MIFARE_SET_DBGMODE
, {dbgMode
, 0, 0}};
51 static command_t CommandTable
[] =
53 {"help", CmdHelp
, 1, "This help"},
54 {"dbg", CmdHFDESDbg
, 0, "Set default debug mode"},
55 {"reader", CmdHFDESReader
, 0, "Reader"},
59 int CmdHFDES(const char *Cmd
)
63 //WaitForResponseTimeout(CMD_ACK,NULL,100);
64 CmdsParse(CommandTable
, Cmd
);
68 int CmdHelp(const char *Cmd
)
70 CmdsHelp(CommandTable
);