make style

This commit is contained in:
Philippe Teuwen 2020-10-06 18:41:15 +02:00
commit 3f9ddf9b29
7 changed files with 70 additions and 69 deletions

View file

@ -783,7 +783,7 @@ static RAMFUNC int Handle14443bSamplesFromTag(int ci, int cq) {
// While we get a constant signal // While we get a constant signal
if (AMPLITUDE(ci, cq) > SUBCARRIER_DETECT_THRESHOLD) { if (AMPLITUDE(ci, cq) > SUBCARRIER_DETECT_THRESHOLD) {
if (((ABS(Demod.sumI) > ABS(Demod.sumQ)) && (((ci > 0) && (Demod.sumI > 0)) || ((ci < 0) && (Demod.sumI < 0)))) || // signal closer to horizontal, polarity check based on on I if (((ABS(Demod.sumI) > ABS(Demod.sumQ)) && (((ci > 0) && (Demod.sumI > 0)) || ((ci < 0) && (Demod.sumI < 0)))) || // signal closer to horizontal, polarity check based on on I
((ABS(Demod.sumI) <= ABS(Demod.sumQ)) && (((cq > 0) && (Demod.sumQ > 0)) || ((cq < 0) && (Demod.sumQ < 0))))) { // signal closer to vertical, polarity check based on on Q ((ABS(Demod.sumI) <= ABS(Demod.sumQ)) && (((cq > 0) && (Demod.sumQ > 0)) || ((cq < 0) && (Demod.sumQ < 0))))) { // signal closer to vertical, polarity check based on on Q
if (Demod.posCount < 10) { // refine signal approximation during first 10 samples if (Demod.posCount < 10) { // refine signal approximation during first 10 samples
Demod.sumI += ci; Demod.sumI += ci;
@ -927,12 +927,12 @@ static RAMFUNC int Handle14443bSamplesFromTag(int ci, int cq) {
* Demodulate the samples we received from the tag, also log to tracebuffer * Demodulate the samples we received from the tag, also log to tracebuffer
*/ */
static int Get14443bAnswerFromTag(uint8_t *response, uint16_t max_len, int timeout, uint32_t *eof_time) { static int Get14443bAnswerFromTag(uint8_t *response, uint16_t max_len, int timeout, uint32_t *eof_time) {
int samples = 0, ret = 0; int samples = 0, ret = 0;
// Set up the demodulator for tag -> reader responses. // Set up the demodulator for tag -> reader responses.
Demod14bInit(response, max_len); Demod14bInit(response, max_len);
// Setup and start DMA. // Setup and start DMA.
//FpgaSetupSsc(FPGA_MAJOR_MODE_HF_READER); //FpgaSetupSsc(FPGA_MAJOR_MODE_HF_READER);
@ -996,7 +996,7 @@ static int Get14443bAnswerFromTag(uint8_t *response, uint16_t max_len, int timeo
if (Handle14443bSamplesFromTag(ci, cq)) { if (Handle14443bSamplesFromTag(ci, cq)) {
*eof_time = dma_start_time + (samples ) - DELAY_TAG_TO_ARM; // end of EOF *eof_time = dma_start_time + (samples) - DELAY_TAG_TO_ARM; // end of EOF
if (Demod.len > Demod.max_len) { if (Demod.len > Demod.max_len) {
ret = -2; // overflow ret = -2; // overflow
@ -1044,7 +1044,7 @@ static void TransmitFor14443b_AsReader(uint32_t *start_time) {
if (GetCountSspClk() > *start_time) { // we may miss the intended time if (GetCountSspClk() > *start_time) { // we may miss the intended time
*start_time = (GetCountSspClk() + 32) & 0xfffffff0; // next possible time *start_time = (GetCountSspClk() + 32) & 0xfffffff0; // next possible time
} }
// wait // wait
while (GetCountSspClk() < *start_time); while (GetCountSspClk() < *start_time);
@ -1068,7 +1068,7 @@ static void TransmitFor14443b_AsReader(uint32_t *start_time) {
LED_B_OFF(); LED_B_OFF();
*start_time += DELAY_ARM_TO_TAG; *start_time += DELAY_ARM_TO_TAG;
// wait for last transfer to complete // wait for last transfer to complete
while (!(AT91C_BASE_SSC->SSC_SR & AT91C_SSC_TXEMPTY)) {}; while (!(AT91C_BASE_SSC->SSC_SR & AT91C_SSC_TXEMPTY)) {};
} }
@ -1093,7 +1093,7 @@ static void CodeIso14443bAsReader(const uint8_t *cmd, int len) {
* *
* QUESTION: how long is a 1 or 0 in pulses in the xcorr_848 mode? * QUESTION: how long is a 1 or 0 in pulses in the xcorr_848 mode?
* 1 "stuffbit" = 1ETU (9us) * 1 "stuffbit" = 1ETU (9us)
* *
* TR2 - After the PICC response, the PCD is required to wait the Frame Delay Time (TR2) * TR2 - After the PICC response, the PCD is required to wait the Frame Delay Time (TR2)
before transmission of the next command. The minimum frame delay time required for before transmission of the next command. The minimum frame delay time required for
all commands is 14 ETUs all commands is 14 ETUs
@ -1101,7 +1101,7 @@ static void CodeIso14443bAsReader(const uint8_t *cmd, int len) {
*/ */
int i; int i;
tosend_reset(); tosend_reset();
// Send SOF // Send SOF
// 10-11 ETUs of ZERO // 10-11 ETUs of ZERO
for (i = 0; i < 11; i++) { for (i = 0; i < 11; i++) {
@ -1185,7 +1185,7 @@ int iso14443b_apdu(uint8_t const *msg, size_t msg_len, bool send_chaining, void
real_cmd[0] = 0xA2; // r-block + ACK real_cmd[0] = 0xA2; // r-block + ACK
real_cmd[0] |= iso14b_pcb_blocknum; real_cmd[0] |= iso14b_pcb_blocknum;
} }
AddCrc14B(real_cmd, msg_len + 1); AddCrc14B(real_cmd, msg_len + 1);
// send // send
@ -1269,7 +1269,7 @@ static int iso14443b_select_cts_card(iso14b_cts_card_select_t *card) {
AddCrc14B(cmdLSBUID, 1); AddCrc14B(cmdLSBUID, 1);
uint8_t r[8]; uint8_t r[8];
uint32_t start_time = 0; uint32_t start_time = 0;
uint32_t eof_time = 0; uint32_t eof_time = 0;
CodeAndTransmit14443bAsReader(cmdINIT, sizeof(cmdINIT), &start_time, &eof_time); CodeAndTransmit14443bAsReader(cmdINIT, sizeof(cmdINIT), &start_time, &eof_time);
@ -1842,10 +1842,10 @@ void SendRawCommand14443B_Ex(PacketCommandNG *c) {
iso14443b_setup(); iso14443b_setup();
} }
if ((param & ISO14B_SET_TIMEOUT) == ISO14B_SET_TIMEOUT) { if ((param & ISO14B_SET_TIMEOUT) == ISO14B_SET_TIMEOUT) {
iso14b_set_timeout(timeout); iso14b_set_timeout(timeout);
} }
if ((param & ISO14B_CLEARTRACE) == ISO14B_CLEARTRACE) { if ((param & ISO14B_CLEARTRACE) == ISO14B_CLEARTRACE) {
clear_trace(); clear_trace();
} }
@ -1854,7 +1854,7 @@ void SendRawCommand14443B_Ex(PacketCommandNG *c) {
int status; int status;
uint32_t sendlen = sizeof(iso14b_card_select_t); uint32_t sendlen = sizeof(iso14b_card_select_t);
iso14b_card_select_t card; iso14b_card_select_t card;
memset((void*)&card, 0x00, sizeof(card)); memset((void *)&card, 0x00, sizeof(card));
if ((param & ISO14B_SELECT_STD) == ISO14B_SELECT_STD) { if ((param & ISO14B_SELECT_STD) == ISO14B_SELECT_STD) {
status = iso14443b_select_card(&card); status = iso14443b_select_card(&card);
@ -1877,7 +1877,7 @@ void SendRawCommand14443B_Ex(PacketCommandNG *c) {
reply_mix(CMD_HF_ISO14443B_COMMAND, status, sendlen, 0, (uint8_t *)&cts, sendlen); reply_mix(CMD_HF_ISO14443B_COMMAND, status, sendlen, 0, (uint8_t *)&cts, sendlen);
// 0: OK 2: demod fail, 3:crc fail, // 0: OK 2: demod fail, 3:crc fail,
if (status > 0) goto out; if (status > 0) goto out;
} }
if ((param & ISO14B_APDU) == ISO14B_APDU) { if ((param & ISO14B_APDU) == ISO14B_APDU) {
uint8_t res; uint8_t res;

View file

@ -77,9 +77,9 @@ static bool wait_cmd_14b(bool verbose, bool is_select) {
// 0: OK; -1: attrib fail; -2:crc fail // 0: OK; -1: attrib fail; -2:crc fail
int status = (int)resp.oldarg[0]; int status = (int)resp.oldarg[0];
if (status == 0) { if (status == 0) {
if (verbose) { if (verbose) {
PrintAndLogEx(SUCCESS, "received " _YELLOW_("%u") " bytes", len); PrintAndLogEx(SUCCESS, "received " _YELLOW_("%u") " bytes", len);
PrintAndLogEx(SUCCESS, "%s", sprint_hex(data, len)); PrintAndLogEx(SUCCESS, "%s", sprint_hex(data, len));
} }
return true; return true;
@ -122,32 +122,32 @@ static int CmdHF14BList(const char *Cmd) {
} }
static int CmdHF14BSim(const char *Cmd) { static int CmdHF14BSim(const char *Cmd) {
CLIParserContext *ctx; CLIParserContext *ctx;
CLIParserInit(&ctx, "hf 14b sim", CLIParserInit(&ctx, "hf 14b sim",
"Simulate a ISO/IEC 14443 type B tag with 4 byte UID / PUPI", "Simulate a ISO/IEC 14443 type B tag with 4 byte UID / PUPI",
"hf 14b sim\n" "hf 14b sim\n"
"hf 14b sim -u 11AA33BB" "hf 14b sim -u 11AA33BB"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_strx0("u", "uid", "hex", "4byte UID/PUPI"), arg_strx0("u", "uid", "hex", "4byte UID/PUPI"),
arg_param_end arg_param_end
}; };
CLIExecWithReturn(ctx, Cmd, argtable, true); CLIExecWithReturn(ctx, Cmd, argtable, true);
uint8_t pupi[4]; uint8_t pupi[4];
int n = 0; int n = 0;
int res = CLIParamHexToBuf(arg_get_str(ctx, 1), pupi, sizeof(pupi), &n); int res = CLIParamHexToBuf(arg_get_str(ctx, 1), pupi, sizeof(pupi), &n);
CLIParserFree(ctx); CLIParserFree(ctx);
if (res) { if (res) {
PrintAndLogEx(FAILED, "failed to read pupi"); PrintAndLogEx(FAILED, "failed to read pupi");
return PM3_EINVARG; return PM3_EINVARG;
} }
clearCommandBuffer(); clearCommandBuffer();
SendCommandNG(CMD_HF_ISO14443B_SIMULATE, pupi, sizeof(pupi)); SendCommandNG(CMD_HF_ISO14443B_SIMULATE, pupi, sizeof(pupi));
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -157,36 +157,36 @@ static int CmdHF14BSniff(const char *Cmd) {
CLIParserInit(&ctx, "hf 14b sniff", CLIParserInit(&ctx, "hf 14b sniff",
"Sniff the communication reader and tag", "Sniff the communication reader and tag",
"hf 14b sniff" "hf 14b sniff"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_param_end arg_param_end
}; };
CLIExecWithReturn(ctx, Cmd, argtable, true); CLIExecWithReturn(ctx, Cmd, argtable, true);
CLIParserFree(ctx); CLIParserFree(ctx);
PacketResponseNG resp; PacketResponseNG resp;
clearCommandBuffer(); clearCommandBuffer();
SendCommandNG(CMD_HF_ISO14443B_SNIFF, NULL, 0); SendCommandNG(CMD_HF_ISO14443B_SNIFF, NULL, 0);
WaitForResponse(CMD_HF_ISO14443B_SNIFF, &resp); WaitForResponse(CMD_HF_ISO14443B_SNIFF, &resp);
PrintAndLogEx(HINT, "Try `" _YELLOW_("hf 14b list") "` to view captured tracelog"); PrintAndLogEx(HINT, "Try `" _YELLOW_("hf 14b list") "` to view captured tracelog");
PrintAndLogEx(HINT, "Try `" _YELLOW_("trace save h") "` to save tracelog for later analysing"); PrintAndLogEx(HINT, "Try `" _YELLOW_("trace save h") "` to save tracelog for later analysing");
return PM3_SUCCESS; return PM3_SUCCESS;
} }
static int CmdHF14BCmdRaw(const char *Cmd) { static int CmdHF14BCmdRaw(const char *Cmd) {
CLIParserContext *ctx; CLIParserContext *ctx;
CLIParserInit(&ctx, "hf 14b raw", CLIParserInit(&ctx, "hf 14b raw",
"Sends raw bytes to card ", "Sends raw bytes to card ",
"hf 14b raw -cks --data 0200a40400 -> standard select\n" "hf 14b raw -cks --data 0200a40400 -> standard select\n"
"hf 14b raw -ck --sr --data 0200a40400 -> SRx select\n" "hf 14b raw -ck --sr --data 0200a40400 -> SRx select\n"
"hf 14b raw -ck --cts --data 0200a40400 -> C-ticket select\n" "hf 14b raw -ck --cts --data 0200a40400 -> C-ticket select\n"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_lit0("k", "keep", "leave the signal field ON after receive response"), arg_lit0("k", "keep", "leave the signal field ON after receive response"),
@ -268,7 +268,7 @@ static int CmdHF14BCmdRaw(const char *Cmd) {
return PM3_SUCCESS; return PM3_SUCCESS;
} }
bool success = true; bool success = true;
// Select, device will send back iso14b_card_select_t, don't print it. // Select, device will send back iso14b_card_select_t, don't print it.
if (select_std) { if (select_std) {
@ -620,8 +620,8 @@ static void print_st_general_info(uint8_t *data, uint8_t len) {
static void print_ct_general_info(void *vcard) { static void print_ct_general_info(void *vcard) {
iso14b_cts_card_select_t card; iso14b_cts_card_select_t card;
memcpy(&card, (iso14b_cts_card_select_t *)vcard, sizeof(iso14b_cts_card_select_t)); memcpy(&card, (iso14b_cts_card_select_t *)vcard, sizeof(iso14b_cts_card_select_t));
uint32_t uid32 = (card.uid[0] |card.uid[1] << 8 |card.uid[2] << 16 | card.uid[3] << 24); uint32_t uid32 = (card.uid[0] | card.uid[1] << 8 | card.uid[2] << 16 | card.uid[3] << 24);
PrintAndLogEx(SUCCESS, "ASK C-Ticket"); PrintAndLogEx(SUCCESS, "ASK C-Ticket");
PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s") " ( " _YELLOW_("%010u") " )", sprint_hex(card.uid, sizeof(card.uid)), uid32); PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s") " ( " _YELLOW_("%010u") " )", sprint_hex(card.uid, sizeof(card.uid)), uid32);
PrintAndLogEx(SUCCESS, " Product Code: %02X", card.pc); PrintAndLogEx(SUCCESS, " Product Code: %02X", card.pc);
@ -714,7 +714,7 @@ static int CmdHF14Binfo(const char *Cmd) {
CLIParserInit(&ctx, "hf 14b info", CLIParserInit(&ctx, "hf 14b info",
"Tag information for ISO/IEC 14443 type B based tags", "Tag information for ISO/IEC 14443 type B based tags",
"hf 14b info\n" "hf 14b info\n"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
@ -940,7 +940,7 @@ static int CmdHF14BReader(const char *Cmd) {
CLIParserInit(&ctx, "hf 14b reader", CLIParserInit(&ctx, "hf 14b reader",
"Act as a 14443B reader to identify a tag", "Act as a 14443B reader to identify a tag",
"hf 14b reader\n" "hf 14b reader\n"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
@ -958,20 +958,20 @@ static int CmdHF14BReader(const char *Cmd) {
* this command just dumps the contents of the memory/ * this command just dumps the contents of the memory/
*/ */
static int CmdHF14BReadSri(const char *Cmd) { static int CmdHF14BReadSri(const char *Cmd) {
CLIParserContext *ctx; CLIParserContext *ctx;
CLIParserInit(&ctx, "hf 14b sriread", CLIParserInit(&ctx, "hf 14b sriread",
"Read contents of a SRI512 | SRIX4K tag", "Read contents of a SRI512 | SRIX4K tag",
"hf 14b sriread\n" "hf 14b sriread\n"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_param_end arg_param_end
}; };
CLIExecWithReturn(ctx, Cmd, argtable, true); CLIExecWithReturn(ctx, Cmd, argtable, true);
CLIParserFree(ctx); CLIParserFree(ctx);
iso14b_card_select_t card; iso14b_card_select_t card;
if (get_14b_UID(&card) == false) { if (get_14b_UID(&card) == false) {
PrintAndLogEx(WARNING, "no tag found"); PrintAndLogEx(WARNING, "no tag found");
@ -979,7 +979,7 @@ static int CmdHF14BReadSri(const char *Cmd) {
} }
if (card.uidlen != 8) { if (card.uidlen != 8) {
PrintAndLogEx(FAILED, "current dump command only work with SRI4K / SRI512 tags"); PrintAndLogEx(FAILED, "current dump command only work with SRI4K / SRI512 tags");
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -1071,8 +1071,8 @@ static int CmdHF14BDump(const char *Cmd) {
"Tries to autodetect cardtype, memory size defaults to SRI4K", "Tries to autodetect cardtype, memory size defaults to SRI4K",
"hf 14b dump\n" "hf 14b dump\n"
"hf 14b dump -f myfilename\n" "hf 14b dump -f myfilename\n"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_strx0("f", "file", "<filename>", "(optional) filename, if no <name> UID will be used as filename"), arg_strx0("f", "file", "<filename>", "(optional) filename, if no <name> UID will be used as filename"),
@ -1083,7 +1083,7 @@ static int CmdHF14BDump(const char *Cmd) {
int fnlen = 0; int fnlen = 0;
char filename[FILE_PATH_SIZE] = {0}; char filename[FILE_PATH_SIZE] = {0};
char *fptr = filename; char *fptr = filename;
CLIParamStrToBuf(arg_get_str(ctx, 1), (uint8_t*)filename, FILE_PATH_SIZE, &fnlen); CLIParamStrToBuf(arg_get_str(ctx, 1), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen);
CLIParserFree(ctx); CLIParserFree(ctx);
iso14b_card_select_t card; iso14b_card_select_t card;
@ -1091,9 +1091,9 @@ static int CmdHF14BDump(const char *Cmd) {
PrintAndLogEx(WARNING, "no tag found"); PrintAndLogEx(WARNING, "no tag found");
return PM3_SUCCESS; return PM3_SUCCESS;
} }
if (card.uidlen != 8) { if (card.uidlen != 8) {
PrintAndLogEx(FAILED, "current dump command only work with SRI4K / SRI512 tags"); PrintAndLogEx(FAILED, "current dump command only work with SRI4K / SRI512 tags");
return PM3_SUCCESS; return PM3_SUCCESS;
} }
@ -1358,12 +1358,12 @@ static int select_card_14443b_4(bool disconnect, iso14b_card_select_t *card) {
// Anticollision + SELECT SR card // Anticollision + SELECT SR card
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR, 0, 0, NULL, 0); SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_SR, 0, 0, NULL, 0);
if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, TIMEOUT) == false) { if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, TIMEOUT) == false) {
PrintAndLogEx(INFO, "Trying 14B Select CTS"); PrintAndLogEx(INFO, "Trying 14B Select CTS");
// Anticollision + SELECT ASK C-Ticket card // Anticollision + SELECT ASK C-Ticket card
SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_CTS, 0, 0, NULL, 0); SendCommandMIX(CMD_HF_ISO14443B_COMMAND, ISO14B_CONNECT | ISO14B_SELECT_CTS, 0, 0, NULL, 0);
if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, TIMEOUT) == false) { if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, TIMEOUT) == false) {
PrintAndLogEx(ERR, "connection timeout"); PrintAndLogEx(ERR, "connection timeout");
switch_off_field_14b(); switch_off_field_14b();
return PM3_ESOFT; return PM3_ESOFT;
@ -1430,7 +1430,7 @@ static int handle_14b_apdu(bool chainingin, uint8_t *datain, int datainlen, bool
if (dlen < 0) { if (dlen < 0) {
dlen = 0; dlen = 0;
} }
*dataoutlen += dlen; *dataoutlen += dlen;
if (maxdataoutlen && *dataoutlen > maxdataoutlen) { if (maxdataoutlen && *dataoutlen > maxdataoutlen) {
@ -1499,7 +1499,7 @@ static int exchange_14b_apdu(uint8_t *datain, int datainlen, bool activate_field
// TODO check this one... // TODO check this one...
// check R-block ACK // check R-block ACK
// *dataoutlen!=0. 'A && (!A || B)' is equivalent to 'A && B' // *dataoutlen!=0. 'A && (!A || B)' is equivalent to 'A && B'
if ((*dataoutlen == 0) && (*dataoutlen != 0 || chaining != chainBlockNotLast)) { if ((*dataoutlen == 0) && (*dataoutlen != 0 || chaining != chainBlockNotLast)) {
if (leave_signal_on == false) { if (leave_signal_on == false) {
switch_off_field_14b(); switch_off_field_14b();
} }
@ -1638,11 +1638,11 @@ static int CmdHF14BAPDU(const char *Cmd) {
CLIParserFree(ctx); CLIParserFree(ctx);
PrintAndLogEx(NORMAL, ">>>>[%s%s%s] %s", PrintAndLogEx(NORMAL, ">>>>[%s%s%s] %s",
activate_field ? "sel" : "", activate_field ? "sel" : "",
leave_signal_on ? " keep" : "", leave_signal_on ? " keep" : "",
decode_TLV ? " TLV" : "", decode_TLV ? " TLV" : "",
sprint_hex(data, datalen) sprint_hex(data, datalen)
); );
if (decode_APDU) { if (decode_APDU) {
APDUStruct apdu; APDUStruct apdu;
@ -1674,7 +1674,7 @@ static int CmdHF14BNdef(const char *Cmd) {
CLIParserInit(&ctx, "hf 14b ndef", CLIParserInit(&ctx, "hf 14b ndef",
"Print NFC Data Exchange Format (NDEF)", "Print NFC Data Exchange Format (NDEF)",
"hf 14b ndef" "hf 14b ndef"
); );
void *argtable[] = { void *argtable[] = {
arg_param_begin, arg_param_begin,
arg_param_end arg_param_end
@ -1764,7 +1764,7 @@ static int CmdHF14BNdef(const char *Cmd) {
} }
res = NDEFRecordsDecodeAndPrint(response + 2, resplen - 4); res = NDEFRecordsDecodeAndPrint(response + 2, resplen - 4);
out: out:
switch_off_field_14b(); switch_off_field_14b();
return res; return res;
@ -1772,7 +1772,7 @@ out:
static command_t CommandTable[] = { static command_t CommandTable[] = {
{"help", CmdHelp, AlwaysAvailable, "This help"}, {"help", CmdHelp, AlwaysAvailable, "This help"},
{"apdu", CmdHF14BAPDU, IfPm3Iso14443b, "Send ISO 14443-4 APDU to tag"}, {"apdu", CmdHF14BAPDU, IfPm3Iso14443b, "Send ISO 14443-4 APDU to tag"},
{"dump", CmdHF14BDump, IfPm3Iso14443b, "Read all memory pages of an ISO14443-B tag, save to file"}, {"dump", CmdHF14BDump, IfPm3Iso14443b, "Read all memory pages of an ISO14443-B tag, save to file"},
{"info", CmdHF14Binfo, IfPm3Iso14443b, "Tag information"}, {"info", CmdHF14Binfo, IfPm3Iso14443b, "Tag information"},
{"list", CmdHF14BList, AlwaysAvailable, "List ISO 14443B history"}, {"list", CmdHF14BList, AlwaysAvailable, "List ISO 14443B history"},

View file

@ -253,14 +253,14 @@ main_loop(char *script_cmds_file, char *script_cmd, bool stayInCommandLoop) {
session.history_path = NULL; session.history_path = NULL;
} else { } else {
# if defined(_WIN32) # if defined(_WIN32)
// SetConsoleCtrlHandler((PHANDLER_ROUTINE)terminate_handler, true); // SetConsoleCtrlHandler((PHANDLER_ROUTINE)terminate_handler, true);
# else # else
struct sigaction action; struct sigaction action;
memset(&action, 0, sizeof(action)); memset(&action, 0, sizeof(action));
action.sa_handler = &terminate_handler; action.sa_handler = &terminate_handler;
sigaction(SIGINT, &action, &old_action); sigaction(SIGINT, &action, &old_action);
# endif # endif
rl_catch_signals = 1; rl_catch_signals = 1;
rl_set_signals(); rl_set_signals();
read_history(session.history_path); read_history(session.history_path);

View file

@ -1691,8 +1691,8 @@ read_variable_length(const BYTE **ip, const BYTE *lencheck,
return length; return length;
} }
int LZ4_decompress_generic(const char* const src, char* const dst, int srcSize, int outputSize, endCondition_directive endOnInput, earlyEnd_directive partialDecoding, int LZ4_decompress_generic(const char *const src, char *const dst, int srcSize, int outputSize, endCondition_directive endOnInput, earlyEnd_directive partialDecoding,
dict_directive dict, const BYTE* const lowPrefix, const BYTE* const dictStart, const size_t dictSize ); dict_directive dict, const BYTE *const lowPrefix, const BYTE *const dictStart, const size_t dictSize);
/*! LZ4_decompress_generic() : /*! LZ4_decompress_generic() :
* This generic decompression function covers all use cases. * This generic decompression function covers all use cases.

View file

@ -75,7 +75,8 @@ Check column "offline" for their availability.
|`data samples `|N |`[512 - 40000] -- Get raw samples for graph window (GraphBuffer)` |`data samples `|N |`[512 - 40000] -- Get raw samples for graph window (GraphBuffer)`
|`data save `|Y |`Save trace (from graph window)` |`data save `|Y |`Save trace (from graph window)`
|`data setgraphmarkers `|Y |`[orange_marker] [blue_marker] (in graph window)` |`data setgraphmarkers `|Y |`[orange_marker] [blue_marker] (in graph window)`
|`data scale `|Y |`<int> -- Set cursor display scale in carrier frequency expressed in kHz` |`data timescale `|Y |`Set a timescale to get a differential reading between the yellow and purple markers as time duration
`
|`data setdebugmode `|Y |`<0|1|2> -- Set Debugging Level on client side` |`data setdebugmode `|Y |`<0|1|2> -- Set Debugging Level on client side`
|`data shiftgraphzero `|Y |`<shift> -- Shift 0 for Graphed wave + or - shift value` |`data shiftgraphzero `|Y |`<shift> -- Shift 0 for Graphed wave + or - shift value`
|`data dirthreshold `|Y |`<thres up> <thres down> -- Max rising higher up-thres/ Min falling lower down-thres, keep rest as prev.` |`data dirthreshold `|Y |`<thres up> <thres down> -- Max rising higher up-thres/ Min falling lower down-thres, keep rest as prev.`
@ -241,7 +242,7 @@ Check column "offline" for their availability.
### hf iclass ### hf iclass
{ ICLASS RFIDs... } { ICLASS RFIDs... }
|command |offline |description |command |offline |description
|------- |------- |----------- |------- |------- |-----------
|`hf iclass help `|Y |`This help` |`hf iclass help `|Y |`This help`
@ -266,7 +267,7 @@ Check column "offline" for their availability.
|`hf iclass decrypt `|Y |`[options..] Decrypt given block data or tag dump file` |`hf iclass decrypt `|Y |`[options..] Decrypt given block data or tag dump file`
|`hf iclass managekeys `|Y |`[options..] Manage keys to use with iclass commands` |`hf iclass managekeys `|Y |`[options..] Manage keys to use with iclass commands`
|`hf iclass permute `|N |` Permute function from 'heart of darkness' paper` |`hf iclass permute `|N |` Permute function from 'heart of darkness' paper`
|`hf iclass view `|Y |`[options..] Display content from tag dump file` |`hf iclass view `|Y |`[options..] Display content from tag dump file`
### hf legic ### hf legic
@ -304,7 +305,7 @@ Check column "offline" for their availability.
|`hf lto wrbl `|N |`Write block` |`hf lto wrbl `|N |`Write block`
|`hf lto list `|Y |`List LTO-CM history` |`hf lto list `|Y |`List LTO-CM history`
### hf mf ### hf mf
{ MIFARE RFIDs... } { MIFARE RFIDs... }

View file

@ -111,7 +111,7 @@ bit | 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
cmd | x x x x cmd | x x x x
major| x x x major| x x x
opt | x x x x opt | x x x x
sub | x x sub | x x
divi | x x x x x x x x divi | x x x x x x x x
thres| x x x x x x x x thres| x x x x x x x x
-----+------------------------------------------- -----+-------------------------------------------

View file

@ -546,7 +546,7 @@ assign ssp_din = bit_to_arm;
wire sub_carrier; wire sub_carrier;
assign sub_carrier = ~sub_carrier_cnt[3]; assign sub_carrier = ~sub_carrier_cnt[3];
// in FPGA_HF_ISO14443A_READER_MOD: drop carrier for mod_sig_coil == 1 (pause); // in FPGA_HF_ISO14443A_READER_MOD: drop carrier for mod_sig_coil == 1 (pause);
// in FPGA_HF_ISO14443A_READER_LISTEN: carrier always on; in other modes: carrier always off // in FPGA_HF_ISO14443A_READER_LISTEN: carrier always on; in other modes: carrier always off
assign pwr_hi = (ck_1356meg & (((mod_type == `FPGA_HF_ISO14443A_READER_MOD) & ~mod_sig_coil) || (mod_type == `FPGA_HF_ISO14443A_READER_LISTEN))); assign pwr_hi = (ck_1356meg & (((mod_type == `FPGA_HF_ISO14443A_READER_MOD) & ~mod_sig_coil) || (mod_type == `FPGA_HF_ISO14443A_READER_LISTEN)));