mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
HF15FindAfi now uses reply_ng and added LeaveFieldOn option for HF15Raw
This commit is contained in:
parent
cef28ad241
commit
931d115ef8
3 changed files with 26 additions and 3 deletions
|
@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
|
||||||
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
|
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
|
||||||
|
|
||||||
## [unreleased][unreleased]
|
## [unreleased][unreleased]
|
||||||
|
- Added `hf 15 writeafi`, `hf 15 writedsfid` and detailed info for SLIX2 tags in `hf 15 info`. Also did some refactoring in HF15 commands. (@grspy)
|
||||||
- Fix hf list felica and hf felica sniff (@7homasSutter)
|
- Fix hf list felica and hf felica sniff (@7homasSutter)
|
||||||
- Added hf felica wrunencrypted (@7homasSutter)
|
- Added hf felica wrunencrypted (@7homasSutter)
|
||||||
- Added hf felica rdunencrypted (@7homasSutter)
|
- Added hf felica rdunencrypted (@7homasSutter)
|
||||||
|
|
|
@ -929,6 +929,7 @@ void BruteforceIso15693Afi(uint32_t speed) {
|
||||||
uint8_t buf[ISO15_MAX_FRAME];
|
uint8_t buf[ISO15_MAX_FRAME];
|
||||||
memset(buf, 0x00, sizeof(buf));
|
memset(buf, 0x00, sizeof(buf));
|
||||||
int datalen = 0, recvlen = 0;
|
int datalen = 0, recvlen = 0;
|
||||||
|
bool aborted = false;
|
||||||
|
|
||||||
Iso15693InitReader();
|
Iso15693InitReader();
|
||||||
|
|
||||||
|
@ -968,12 +969,19 @@ void BruteforceIso15693Afi(uint32_t speed) {
|
||||||
|
|
||||||
if (BUTTON_PRESS()) {
|
if (BUTTON_PRESS()) {
|
||||||
DbpString("button pressed, aborting..");
|
DbpString("button pressed, aborting..");
|
||||||
|
aborted = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DbpString("AFI Bruteforcing done.");
|
DbpString("AFI Bruteforcing done.");
|
||||||
switch_off();
|
switch_off();
|
||||||
|
|
||||||
|
if (aborted) {
|
||||||
|
reply_ng(CMD_ACK, PM3_EOPABORTED, NULL, 0);
|
||||||
|
} else {
|
||||||
|
reply_ng(CMD_ACK, PM3_SUCCESS, NULL, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allows to directly send commands to the tag via the client
|
// Allows to directly send commands to the tag via the client
|
||||||
|
|
|
@ -412,6 +412,7 @@ static int usage_15_raw(void) {
|
||||||
{"-r", "do not read response" },
|
{"-r", "do not read response" },
|
||||||
{"-2", "use slower '1 out of 256' mode" },
|
{"-2", "use slower '1 out of 256' mode" },
|
||||||
{"-c", "calculate and append CRC" },
|
{"-c", "calculate and append CRC" },
|
||||||
|
{"-p", "leave the signal field ON" },
|
||||||
{"", "Tip: turn on debugging for verbose output"},
|
{"", "Tip: turn on debugging for verbose output"},
|
||||||
};
|
};
|
||||||
PrintAndLogEx(NORMAL, "Usage: hf 15 raw [-r] [-2] [-c] <0A 0B 0C ... hex>\n");
|
PrintAndLogEx(NORMAL, "Usage: hf 15 raw [-r] [-2] [-c] <0A 0B 0C ... hex>\n");
|
||||||
|
@ -949,6 +950,7 @@ static int CmdHF15Sim(const char *Cmd) {
|
||||||
// (There is no standard way of reading the AFI, although some tags support this)
|
// (There is no standard way of reading the AFI, although some tags support this)
|
||||||
// helptext
|
// helptext
|
||||||
static int CmdHF15FindAfi(const char *Cmd) {
|
static int CmdHF15FindAfi(const char *Cmd) {
|
||||||
|
PacketResponseNG resp;
|
||||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||||
if (cmdp == 'h') return usage_15_findafi();
|
if (cmdp == 'h') return usage_15_findafi();
|
||||||
|
|
||||||
|
@ -956,8 +958,14 @@ static int CmdHF15FindAfi(const char *Cmd) {
|
||||||
|
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommandMIX(CMD_HF_ISO15693_FINDAFI, strtol(Cmd, NULL, 0), 0, 0, NULL, 0);
|
SendCommandMIX(CMD_HF_ISO15693_FINDAFI, strtol(Cmd, NULL, 0), 0, 0, NULL, 0);
|
||||||
|
|
||||||
|
if (WaitForResponseTimeout(CMD_ACK, &resp, 120000)) { // 2 minutes should be enough
|
||||||
|
DropField();
|
||||||
|
return resp.status; // PM3_EOPABORTED or PM3_SUCCESS
|
||||||
|
}
|
||||||
|
|
||||||
DropField();
|
DropField();
|
||||||
return PM3_SUCCESS;
|
return PM3_ETIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Writes the AFI (Application Family Identifier) of a card
|
// Writes the AFI (Application Family Identifier) of a card
|
||||||
|
@ -1225,7 +1233,7 @@ static int CmdHF15Raw(const char *Cmd) {
|
||||||
|
|
||||||
PacketResponseNG resp;
|
PacketResponseNG resp;
|
||||||
int reply = 1, fast = 1, i = 0;
|
int reply = 1, fast = 1, i = 0;
|
||||||
bool crc = false;
|
bool crc = false, leaveSignalON = false;
|
||||||
char buf[5] = "";
|
char buf[5] = "";
|
||||||
uint8_t data[100];
|
uint8_t data[100];
|
||||||
uint32_t datalen = 0, temp;
|
uint32_t datalen = 0, temp;
|
||||||
|
@ -1248,6 +1256,10 @@ static int CmdHF15Raw(const char *Cmd) {
|
||||||
case 'C':
|
case 'C':
|
||||||
crc = true;
|
crc = true;
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
case 'P':
|
||||||
|
leaveSignalON = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
PrintAndLogEx(WARNING, "Invalid option");
|
PrintAndLogEx(WARNING, "Invalid option");
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
|
@ -1292,7 +1304,9 @@ static int CmdHF15Raw(const char *Cmd) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DropField();
|
if (!leaveSignalON)
|
||||||
|
DropField();
|
||||||
|
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue