]>
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}};
23 WaitForResponseTimeout(CMD_ACK
,&resp
,2000);
27 int CmdHFDESDbg(const char *Cmd
)
29 int dbgMode
= param_get32ex(Cmd
, 0, 0, 10);
31 PrintAndLog("Max debud mode parameter is 4 \n");
34 if (strlen(Cmd
) < 1 || !param_getchar(Cmd
, 0) || dbgMode
> 4) {
35 PrintAndLog("Usage: hf des dbg <debug level>");
36 PrintAndLog(" 0 - no debug messages");
37 PrintAndLog(" 1 - error messages");
38 PrintAndLog(" 2 - all messages");
39 PrintAndLog(" 4 - extended debug mode");
43 UsbCommand c
= {CMD_MIFARE_SET_DBGMODE
, {dbgMode
, 0, 0}};
49 static command_t CommandTable
[] =
51 {"help", CmdHelp
, 1, "This help"},
52 {"dbg", CmdHFDESDbg
, 0, "Set default debug mode"},
53 {"reader", CmdHFDESReader
, 0, "Reader"},
57 int CmdHFDES(const char *Cmd
)
60 WaitForResponseTimeout(CMD_ACK
,NULL
,100);
61 CmdsParse(CommandTable
, Cmd
);
65 int CmdHelp(const char *Cmd
)
67 CmdsHelp(CommandTable
);