X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/c2d25819d8c55b568814da61d116fda9b4ad53d1..d3a22c7dfa87bf5e21d228849a602194be4a0895:/client/cmdhf15.c diff --git a/client/cmdhf15.c b/client/cmdhf15.c index bdc08521..25ae2a82 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -26,7 +26,7 @@ #include #include #include -//#include "proxusb.h" + #include "proxmark3.h" #include "data.h" #include "graph.h" @@ -298,7 +298,28 @@ int CmdHF15Reader(const char *Cmd) // Simulation is still not working very good int CmdHF15Sim(const char *Cmd) { - UsbCommand c = {CMD_SIMTAG_ISO_15693, {strtol(Cmd, NULL, 0), 0, 0}}; + char cmdp = param_getchar(Cmd, 0); + uint8_t uid[8] = {0x00}; + + //E0 16 24 00 00 00 00 00 + if (cmdp == 'h' || cmdp == 'H') { + PrintAndLog("Usage: hf 15 sim "); + PrintAndLog(""); + PrintAndLog(" sample: hf 15 sim E016240000000000"); + return 0; + } + + if (param_gethex(Cmd, 0, uid, 16)) { + PrintAndLog("UID must include 16 HEX symbols"); + return 0; + } + + PrintAndLog("Starting simulating UID %02X %02X %02X %02X %02X %02X %02X %02X", + uid[0],uid[1],uid[2],uid[3],uid[4], uid[5], uid[6], uid[7]); + + UsbCommand c = {CMD_SIMTAG_ISO_15693, {0, 0, 0}}; + memcpy(c.d.asBytes,uid,8); + SendCommand(&c); return 0; } @@ -561,8 +582,9 @@ int CmdHF15CmdRaw (const char *cmd) { */ int prepareHF15Cmd(char **cmd, UsbCommand *c, uint8_t iso15cmd[], int iso15cmdlen) { int temp; - uint8_t *req=c->d.asBytes, uid[8]; - uint32_t reqlen=0; + uint8_t *req = c->d.asBytes; + uint8_t uid[8] = {0x00}; + uint32_t reqlen = 0; // strip while (**cmd==' ' || **cmd=='\t') (*cmd)++;