X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/0956e0dba568044b63636151999c817e76f47964..07291f87d8c6cfa3a7179776937df9eadc20f04d:/client/cmdhf14a.c diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index f94296c0..33a4234c 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -25,8 +25,7 @@ #include "mifare.h" #include "cmdhfmfu.h" #include "nonce2key/nonce2key.h" - -#define llx PRIx64 +#include "cmdhf.h" static int CmdHelp(const char *Cmd); static void waitCmd(uint8_t iLen); @@ -171,7 +170,8 @@ int usage_hf_14a_raw(void){ int CmdHF14AList(const char *Cmd) { - PrintAndLog("Deprecated command, use 'hf list 14a' instead"); + //PrintAndLog("Deprecated command, use 'hf list 14a' instead"); + CmdHFList("14a"); return 0; } @@ -574,7 +574,7 @@ int CmdHF14ASim(const char *Cmd) int len = (resp.arg[1] > sizeof(data)) ? sizeof(data) : resp.arg[1]; memcpy(data, resp.d.asBytes, len); tryMfk32(uid, data, key); - tryMfk32_moebius(uid, data, key); + //tryMfk32_moebius(uid, data, key); //tryMfk64(uid, data, key); PrintAndLog("--"); } @@ -729,9 +729,11 @@ int CmdHF14ACmdRaw(const char *cmd) { if(topazmode) c.arg[0] |= ISO14A_TOPAZMODE; - + // Max buffer is USB_CMD_DATA_SIZE - c.arg[1] = (datalen & 0xFFFF) | (numbits << 16); + datalen = (datalen > USB_CMD_DATA_SIZE) ? USB_CMD_DATA_SIZE : datalen; + + c.arg[1] = (datalen & 0xFFFF) | (uint32_t)(numbits << 16); memcpy(c.d.asBytes,data,datalen); clearCommandBuffer(); @@ -786,7 +788,8 @@ static command_t CommandTable[] = int CmdHF14A(const char *Cmd) { // flush - WaitForResponseTimeout(CMD_ACK,NULL,100); + clearCommandBuffer(); + //WaitForResponseTimeout(CMD_ACK,NULL,100); // parse CmdsParse(CommandTable, Cmd);