mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
cmdhficlass: change from SendCommandMix to SendCommandNG
This commit is contained in:
parent
5750d47ba3
commit
15aea059ef
2 changed files with 19 additions and 16 deletions
|
@ -325,14 +325,15 @@ out:
|
||||||
* @return Status code indicating success or failure of the operation.
|
* @return Status code indicating success or failure of the operation.
|
||||||
*/
|
*/
|
||||||
int sam_picopass_get_pacs(PacketCommandNG *c) {
|
int sam_picopass_get_pacs(PacketCommandNG *c) {
|
||||||
const bool disconnectAfter = !!(c->oldarg[0] & BITMASK(0));
|
const uint8_t flags = c->data.asBytes[0];
|
||||||
const bool skipDetect = !!(c->oldarg[0] & BITMASK(1));
|
const bool disconnectAfter = !!(flags & BITMASK(0));
|
||||||
const bool breakOnNrMac = !!(c->oldarg[0] & BITMASK(2));
|
const bool skipDetect = !!(flags & BITMASK(1));
|
||||||
const bool preventEpurseUpdate = !!(c->oldarg[0] & BITMASK(3));
|
const bool breakOnNrMac = !!(flags & BITMASK(2));
|
||||||
const bool shallow_mod = !!(c->oldarg[0] & BITMASK(4));
|
const bool preventEpurseUpdate = !!(flags & BITMASK(3));
|
||||||
|
const bool shallow_mod = !!(flags & BITMASK(4));
|
||||||
|
|
||||||
uint8_t *cmd = c->data.asBytes;
|
uint8_t *cmd = c->data.asBytes + 1;
|
||||||
uint16_t cmd_len = (uint16_t) c->oldarg[2];
|
uint16_t cmd_len = c->length - 1;
|
||||||
|
|
||||||
int res = PM3_EFAILED;
|
int res = PM3_EFAILED;
|
||||||
|
|
||||||
|
|
|
@ -5423,16 +5423,18 @@ static int CmdHFiClassSAM(const char *Cmd) {
|
||||||
bool preventEpurseUpdate = arg_get_lit(ctx, 6);
|
bool preventEpurseUpdate = arg_get_lit(ctx, 6);
|
||||||
bool shallow_mod = arg_get_lit(ctx, 7);
|
bool shallow_mod = arg_get_lit(ctx, 7);
|
||||||
|
|
||||||
uint64_t command_flags = 0;
|
uint8_t flags = 0;
|
||||||
if (disconnectAfter) command_flags |= BITMASK(0);
|
if (disconnectAfter) flags |= BITMASK(0);
|
||||||
if (skipDetect) command_flags |= BITMASK(1);
|
if (skipDetect) flags |= BITMASK(1);
|
||||||
if (breakOnNrMac) command_flags |= BITMASK(2);
|
if (breakOnNrMac) flags |= BITMASK(2);
|
||||||
if (preventEpurseUpdate) command_flags |= BITMASK(3);
|
if (preventEpurseUpdate) flags |= BITMASK(3);
|
||||||
if (shallow_mod) command_flags |= BITMASK(4);
|
if (shallow_mod) flags |= BITMASK(4);
|
||||||
|
|
||||||
uint8_t data[PM3_CMD_DATA_SIZE] = {0};
|
uint8_t data[PM3_CMD_DATA_SIZE] = {0};
|
||||||
int datalen = 0;
|
data[0] = flags;
|
||||||
CLIGetHexBLessWithReturn(ctx, 8, data, &datalen, 0);
|
|
||||||
|
int cmdlen = 0;
|
||||||
|
CLIGetHexBLessWithReturn(ctx, 8, data+1, &cmdlen, 0);
|
||||||
|
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
|
@ -5441,7 +5443,7 @@ static int CmdHFiClassSAM(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommandMIX(CMD_HF_SAM_PICOPASS, command_flags, 0, datalen, data, datalen);
|
SendCommandNG(CMD_HF_SAM_PICOPASS, data, cmdlen+1);
|
||||||
PacketResponseNG resp;
|
PacketResponseNG resp;
|
||||||
if (WaitForResponseTimeout(CMD_HF_SAM_PICOPASS, &resp, 4000) == false) {
|
if (WaitForResponseTimeout(CMD_HF_SAM_PICOPASS, &resp, 4000) == false) {
|
||||||
PrintAndLogEx(WARNING, "SAM timeout");
|
PrintAndLogEx(WARNING, "SAM timeout");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue