mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-15 19:59:34 +08:00
chg: hexlen is half size..
This commit is contained in:
parent
e536cb082f
commit
f2ad37aa00
1 changed files with 10 additions and 1 deletions
|
@ -477,6 +477,7 @@ int CmdAnalyseA(const char *Cmd){
|
||||||
switch (tolower(param_getchar(Cmd, cmdp))) {
|
switch (tolower(param_getchar(Cmd, cmdp))) {
|
||||||
case 'd':
|
case 'd':
|
||||||
param_gethex_ex(Cmd, cmdp+1, data, &hexlen);
|
param_gethex_ex(Cmd, cmdp+1, data, &hexlen);
|
||||||
|
hexlen >>= 1;
|
||||||
if ( hexlen != sizeof(data) ) {
|
if ( hexlen != sizeof(data) ) {
|
||||||
PrintAndLogEx(WARNING, "Read %d bytes of %u", hexlen, sizeof(data) );
|
PrintAndLogEx(WARNING, "Read %d bytes of %u", hexlen, sizeof(data) );
|
||||||
}
|
}
|
||||||
|
@ -493,13 +494,21 @@ int CmdAnalyseA(const char *Cmd){
|
||||||
//Validations
|
//Validations
|
||||||
if (errors || cmdp == 0 ) return usage_analyse_checksum();
|
if (errors || cmdp == 0 ) return usage_analyse_checksum();
|
||||||
|
|
||||||
// for testing of smart card. Sending raw bytes.
|
// for testing of smart card. Sending raw bytes.
|
||||||
|
|
||||||
UsbCommand c = {CMD_SMART_SEND, {0, 0, 0}};
|
UsbCommand c = {CMD_SMART_SEND, {0, 0, 0}};
|
||||||
c.arg[0] = hexlen;
|
c.arg[0] = hexlen;
|
||||||
memcpy(c.d.asBytes, data, hexlen );
|
memcpy(c.d.asBytes, data, hexlen );
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
|
||||||
|
// reading response from smart card
|
||||||
|
UsbCommand resp;
|
||||||
|
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) {
|
||||||
|
PrintAndLogEx(WARNING, "smart card response failed");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
PrintAndLogEx(SUCCESS,"resp: %s", sprint_hex(resp.d.asBytes, resp.arg[0]));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
PrintAndLogEx(NORMAL, "-- " _BLUE_(its my message) "\n");
|
PrintAndLogEx(NORMAL, "-- " _BLUE_(its my message) "\n");
|
||||||
|
|
Loading…
Reference in a new issue