mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-07-16 10:03:04 -07:00
style
This commit is contained in:
parent
b135413995
commit
4df743c2a0
18 changed files with 1080 additions and 1006 deletions
|
@ -2526,12 +2526,12 @@ void SendRawCommand14443B_Ex(iso14b_raw_cmd_t *p) {
|
|||
} else {
|
||||
responselen = MIN(responselen, PM3_CMD_DATA_SIZE);
|
||||
|
||||
iso14b_raw_apdu_response_t *payload = (iso14b_raw_apdu_response_t *)BigBuf_calloc( sizeof(iso14b_raw_apdu_response_t) + responselen);
|
||||
iso14b_raw_apdu_response_t *payload = (iso14b_raw_apdu_response_t *)BigBuf_calloc(sizeof(iso14b_raw_apdu_response_t) + responselen);
|
||||
payload->response_byte = response_byte;
|
||||
payload->datalen = responselen;
|
||||
memcpy(payload->data, buf, payload->datalen);
|
||||
|
||||
reply_ng(CMD_HF_ISO14443B_COMMAND, status, (uint8_t*)payload, sizeof(iso14b_raw_apdu_response_t) + responselen);
|
||||
reply_ng(CMD_HF_ISO14443B_COMMAND, status, (uint8_t *)payload, sizeof(iso14b_raw_apdu_response_t) + responselen);
|
||||
BigBuf_free_keep_EM();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#endif
|
||||
|
||||
void iso14443b_setup(void);
|
||||
int iso14443b_apdu(uint8_t const *msg, size_t msg_len, bool send_chaining, void *rxdata, uint16_t rxmaxlen, uint8_t *res, int * responselen);
|
||||
int iso14443b_apdu(uint8_t const *msg, size_t msg_len, bool send_chaining, void *rxdata, uint16_t rxmaxlen, uint8_t *res, int *responselen);
|
||||
|
||||
int iso14443b_select_card(iso14b_card_select_t *card);
|
||||
|
||||
|
|
|
@ -2025,7 +2025,7 @@ int CmdTuneSamples(const char *Cmd) {
|
|||
|
||||
// Q measure with Vlr=Q*(2*Vdd/pi)
|
||||
double lfq2 = (double)package->peak_v * 3.14 / 2 / vdd;
|
||||
PrintAndLogEx(SUCCESS, "Peak voltage............ " _YELLOW_("%.1lf") , lfq2);
|
||||
PrintAndLogEx(SUCCESS, "Peak voltage............ " _YELLOW_("%.1lf"), lfq2);
|
||||
// cross-check results
|
||||
if (lfq1 > 3) {
|
||||
double approx_vdd = (double)package->peak_v * 3.14 / 2 / lfq1;
|
||||
|
@ -2073,7 +2073,7 @@ int CmdTuneSamples(const char *Cmd) {
|
|||
if (package->v_hf >= HF_UNUSABLE_V) {
|
||||
// Q measure with Vlr=Q*(2*Vdd/pi)
|
||||
double hfq = (double)package->v_hf * 3.14 / 2 / vdd;
|
||||
PrintAndLogEx(SUCCESS, "peak voltage............ " _YELLOW_("%.1lf") , hfq);
|
||||
PrintAndLogEx(SUCCESS, "peak voltage............ " _YELLOW_("%.1lf"), hfq);
|
||||
}
|
||||
|
||||
if (package->v_hf < HF_UNUSABLE_V)
|
||||
|
@ -3224,13 +3224,13 @@ static int CmdDiff(const char *Cmd) {
|
|||
fnlenB = strlen(filenameB);
|
||||
}
|
||||
|
||||
if (fnlenA && fnlenB ) {
|
||||
if (fnlenA && fnlenB) {
|
||||
|
||||
snprintf(hdr0, sizeof(hdr0) - 1, " # | " _CYAN_("%.*s"), max_fn_space, filenameA);
|
||||
|
||||
// add space if needed
|
||||
int padding_len = (hdr_sln - fnlenA - 1);
|
||||
if ( padding_len > 0 ) {
|
||||
if (padding_len > 0) {
|
||||
memset(hdr0 + strlen(hdr0), ' ', padding_len);
|
||||
}
|
||||
snprintf(hdr0 + strlen(hdr0), sizeof(hdr0) - 1 - strlen(hdr0), "| " _CYAN_("%.*s"), max_fn_space, filenameB);
|
||||
|
|
|
@ -99,7 +99,7 @@ static void hf14b_aid_search(bool verbose) {
|
|||
uint8_t vaid[200] = {0};
|
||||
int vaidlen = 0;
|
||||
|
||||
if ((AIDGetFromElm(data, vaid, sizeof(vaid), &vaidlen) == false) || (vaidlen == 0 )) {
|
||||
if ((AIDGetFromElm(data, vaid, sizeof(vaid), &vaidlen) == false) || (vaidlen == 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1137,7 +1137,7 @@ static int write_sr_block(uint8_t blockno, uint8_t datalen, uint8_t *data) {
|
|||
free(packet);
|
||||
|
||||
if (wait_14b_response(true, NULL, NULL) == false) {
|
||||
PrintAndLogEx(FAILED, "SRx write block ( " _RED_("failed") " )" );
|
||||
PrintAndLogEx(FAILED, "SRx write block ( " _RED_("failed") " )");
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
return PM3_SUCCESS;
|
||||
|
@ -1163,7 +1163,7 @@ static bool HF14B_st_reader(bool verbose) {
|
|||
}
|
||||
|
||||
switch (resp.status) {
|
||||
case PM3_SUCCESS:{
|
||||
case PM3_SUCCESS: {
|
||||
iso14b_card_select_t card;
|
||||
memcpy(&card, (iso14b_card_select_t *)resp.data.asBytes, sizeof(iso14b_card_select_t));
|
||||
|
||||
|
@ -1297,7 +1297,7 @@ static bool HF14B_other_reader(bool verbose) {
|
|||
SendCommandNG(CMD_HF_ISO14443B_COMMAND, (uint8_t *)packet, sizeof(iso14b_raw_cmd_t) + packet->rawlen);
|
||||
|
||||
// wait for the select message and wait for response
|
||||
if (wait_14b_response(false, NULL, NULL) ) {
|
||||
if (wait_14b_response(false, NULL, NULL)) {
|
||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||
PrintAndLogEx(SUCCESS, "unknown tag type answered to a " _YELLOW_("0x000b3f80") " command");
|
||||
switch_off_field_14b();
|
||||
|
@ -1508,7 +1508,7 @@ static int CmdHF14BWriteSri(const char *Cmd) {
|
|||
status = read_sr_block(blockno, out);
|
||||
if (status == PM3_SUCCESS) {
|
||||
if (memcmp(data, out, 4) == 0) {
|
||||
PrintAndLogEx(SUCCESS, "SRx write block ( " _GREEN_("ok") " )" );
|
||||
PrintAndLogEx(SUCCESS, "SRx write block ( " _GREEN_("ok") " )");
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "Verifying block ( " _RED_("failed") " )");
|
||||
|
@ -1927,7 +1927,7 @@ static int handle_14b_apdu(bool chainingin, uint8_t *datain, int datainlen,
|
|||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
if ( resp.status != PM3_SUCCESS) {
|
||||
if (resp.status != PM3_SUCCESS) {
|
||||
PrintAndLogEx(ERR, "APDU: no APDU response");
|
||||
return resp.status;
|
||||
}
|
||||
|
|
|
@ -482,7 +482,7 @@ static int getUID(bool verbose, bool loop, uint8_t *buf) {
|
|||
int res = PM3_ESOFT;
|
||||
do {
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000)) {
|
||||
|
||||
|
@ -730,7 +730,7 @@ static int NxpTestEAS(uint8_t *uid) {
|
|||
packet->flags = (ISO15_CONNECT | ISO15_HIGH_SPEED | ISO15_READ_RESPONSE);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
free(packet);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000) == false) {
|
||||
|
@ -779,7 +779,7 @@ static int NxpCheckSig(uint8_t *uid) {
|
|||
packet->flags = (ISO15_CONNECT | ISO15_HIGH_SPEED | ISO15_READ_RESPONSE);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
free(packet);
|
||||
PacketResponseNG resp;
|
||||
|
||||
|
@ -836,7 +836,7 @@ static int NxpSysInfo(uint8_t *uid) {
|
|||
packet->flags = (ISO15_CONNECT | ISO15_HIGH_SPEED | ISO15_READ_RESPONSE);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
free(packet);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000) == false) {
|
||||
|
@ -989,7 +989,7 @@ static int CmdHF15Info(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
free(packet);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000) == false) {
|
||||
|
@ -1651,7 +1651,7 @@ static int CmdHF15WriteDsfid(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
free(packet);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000) == false) {
|
||||
|
@ -1801,7 +1801,7 @@ static int CmdHF15Dump(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000)) {
|
||||
|
||||
|
@ -1994,7 +1994,7 @@ static int CmdHF15Raw(const char *Cmd) {
|
|||
memcpy(packet->raw, data, datalen);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(datalen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(datalen));
|
||||
free(packet);
|
||||
|
||||
if (read_respone) {
|
||||
|
@ -2133,7 +2133,7 @@ static int CmdHF15Readmulti(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
free(packet);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000) == false) {
|
||||
|
@ -2281,7 +2281,7 @@ static int CmdHF15Readblock(const char *Cmd) {
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
free(packet);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000) == false) {
|
||||
|
@ -2364,7 +2364,7 @@ static int hf_15_write_blk(uint8_t *pm3flags, uint16_t flags, uint8_t *uid, bool
|
|||
packet->rawlen += 2;
|
||||
|
||||
// PM3 params
|
||||
if (pm3flags ) {
|
||||
if (pm3flags) {
|
||||
packet->flags = *pm3flags;
|
||||
} else {
|
||||
packet->flags = (ISO15_CONNECT | ISO15_READ_RESPONSE | ISO15_LONG_WAIT);
|
||||
|
@ -2374,7 +2374,7 @@ static int hf_15_write_blk(uint8_t *pm3flags, uint16_t flags, uint8_t *uid, bool
|
|||
}
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t*)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
SendCommandNG(CMD_HF_ISO15693_COMMAND, (uint8_t *)packet, ISO15_RAW_LEN(packet->rawlen));
|
||||
free(packet);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_HF_ISO15693_COMMAND, &resp, 2000) == false) {
|
||||
|
|
|
@ -81,11 +81,11 @@ static model_t models[] = {
|
|||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
static uint8_t * map8to1(gdImagePtr img, int color) {
|
||||
static uint8_t *map8to1(gdImagePtr img, int color) {
|
||||
// Calculate width rounding up
|
||||
uint16_t width8 = (gdImageSX(img) + 7) / 8;
|
||||
|
||||
uint8_t * colormap8 = calloc(width8 * gdImageSY(img), sizeof(uint8_t));
|
||||
uint8_t *colormap8 = calloc(width8 * gdImageSY(img), sizeof(uint8_t));
|
||||
if (!colormap8) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -668,14 +668,14 @@ static int CmdHF14AWSLoad(const char *Cmd) {
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t * black_plane = map8to1(pal_img, 1);
|
||||
uint8_t *black_plane = map8to1(pal_img, 1);
|
||||
if (!black_plane) {
|
||||
PrintAndLogEx(WARNING, "Could not convert image to bit plane");
|
||||
gdImageDestroy(pal_img);
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
|
||||
uint8_t * red_plane = NULL;
|
||||
uint8_t *red_plane = NULL;
|
||||
if (model_has_red) {
|
||||
red_plane = map8to1(pal_img, 2);
|
||||
if (!red_plane) {
|
||||
|
|
|
@ -477,7 +477,7 @@ typedef struct {
|
|||
|
||||
// https://gist.github.com/JeroenSteen/4b45886b8d87fa0530af9b0364e6b277
|
||||
static const xerox_part_t xerox_part_mappings[] = {
|
||||
{"cyan", "006R01532" , "DMO", "sold"},
|
||||
{"cyan", "006R01532", "DMO", "sold"},
|
||||
{"cyan", "006R01660", "DMO", "sold"},
|
||||
{"cyan", "006R01739", "DMO", "sold"},
|
||||
{"cyan", "006R01524", "WW", "metered"},
|
||||
|
@ -513,7 +513,7 @@ static const xerox_part_t xerox_part_mappings[] = {
|
|||
|
||||
// get a product description based on the UID
|
||||
// returns description of the best match
|
||||
static const xerox_part_t *get_xerox_part_info(const char* pn) {
|
||||
static const xerox_part_t *get_xerox_part_info(const char *pn) {
|
||||
for (int i = 0; i < ARRAYLEN(xerox_part_mappings); ++i) {
|
||||
if (str_startswith(pn, xerox_part_mappings[i].partnumber) == 0) {
|
||||
return &xerox_part_mappings[i];
|
||||
|
@ -757,7 +757,7 @@ static int CmdHFXeroxDump(const char *Cmd) {
|
|||
uint8_t data[256 * XEROX_BLOCK_SIZE] = {0};
|
||||
|
||||
// set up the read command
|
||||
packet->flags = ( ISO14B_CONNECT | ISO14B_APPEND_CRC | ISO14B_RAW );
|
||||
packet->flags = (ISO14B_CONNECT | ISO14B_APPEND_CRC | ISO14B_RAW);
|
||||
packet->raw[packet->rawlen++] = 0x02;
|
||||
|
||||
// add one for command byte
|
||||
|
|
|
@ -8,7 +8,7 @@ struct ycbcr_t {
|
|||
int cr;
|
||||
};
|
||||
|
||||
static void rgb_to_ycbcr(int rgb, struct ycbcr_t * ycbcr) {
|
||||
static void rgb_to_ycbcr(int rgb, struct ycbcr_t *ycbcr) {
|
||||
int r = gdTrueColorGetRed(rgb);
|
||||
int g = gdTrueColorGetGreen(rgb);
|
||||
int b = gdTrueColorGetBlue(rgb);
|
||||
|
@ -25,7 +25,7 @@ static void rgb_to_ycbcr(int rgb, struct ycbcr_t * ycbcr) {
|
|||
ycbcr->cr = (r * 32768 + g * -27439 + b * -5329) / 65536 + 128;
|
||||
}
|
||||
|
||||
static inline void cap_comp(int * x) {
|
||||
static inline void cap_comp(int *x) {
|
||||
if (*x < 0) {
|
||||
*x = 0;
|
||||
} else if (*x > 255) {
|
||||
|
@ -33,7 +33,7 @@ static inline void cap_comp(int * x) {
|
|||
}
|
||||
}
|
||||
|
||||
gdImagePtr img_palettize(gdImagePtr rgb, int * palette, int palette_size) {
|
||||
gdImagePtr img_palettize(gdImagePtr rgb, int *palette, int palette_size) {
|
||||
assert(rgb != NULL);
|
||||
assert(palette != NULL);
|
||||
assert(palette_size >= 2 && palette_size < 256);
|
||||
|
@ -45,7 +45,7 @@ gdImagePtr img_palettize(gdImagePtr rgb, int * palette, int palette_size) {
|
|||
}
|
||||
|
||||
// Allocate space for palette in YCbCr
|
||||
struct ycbcr_t * pal_ycbcr = calloc(palette_size, sizeof(struct ycbcr_t));
|
||||
struct ycbcr_t *pal_ycbcr = calloc(palette_size, sizeof(struct ycbcr_t));
|
||||
if (!pal_ycbcr) {
|
||||
gdImageDestroy(res);
|
||||
return NULL;
|
||||
|
@ -60,7 +60,7 @@ gdImagePtr img_palettize(gdImagePtr rgb, int * palette, int palette_size) {
|
|||
* To reduce shifts and increase accuracy, each entry is stored with 16x times the error,
|
||||
* and gets divided by that amount when it is read.
|
||||
*/
|
||||
struct ycbcr_t * forward = calloc(gdImageSX(rgb) + 2, sizeof(struct ycbcr_t));
|
||||
struct ycbcr_t *forward = calloc(gdImageSX(rgb) + 2, sizeof(struct ycbcr_t));
|
||||
if (!forward) {
|
||||
free(pal_ycbcr);
|
||||
gdImageDestroy(res);
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* A comparison can be found at https://twitter.com/Socram4x8/status/1733157380097995205/photo/1.
|
||||
*/
|
||||
gdImagePtr img_palettize(gdImagePtr rgb, int * palette, int palette_size);
|
||||
gdImagePtr img_palettize(gdImagePtr rgb, int *palette, int palette_size);
|
||||
|
||||
/*
|
||||
* This function scales and crops the image to the given size.
|
||||
|
|
|
@ -182,6 +182,7 @@ const static vocabulary_t vocabulary[] = {
|
|||
{ 0, "hf 15 restore" },
|
||||
{ 0, "hf 15 samples" },
|
||||
{ 1, "hf 15 view" },
|
||||
{ 0, "hf 15 wipe" },
|
||||
{ 0, "hf 15 wrbl" },
|
||||
{ 0, "hf 15 sim" },
|
||||
{ 0, "hf 15 eload" },
|
||||
|
@ -223,11 +224,11 @@ const static vocabulary_t vocabulary[] = {
|
|||
{ 1, "hf emrtd list" },
|
||||
{ 1, "hf felica help" },
|
||||
{ 1, "hf felica list" },
|
||||
{ 0, "hf felica reader" },
|
||||
{ 0, "hf felica info" },
|
||||
{ 0, "hf felica sniff" },
|
||||
{ 0, "hf felica raw" },
|
||||
{ 0, "hf felica rdbl" },
|
||||
{ 0, "hf felica reader" },
|
||||
{ 0, "hf felica sniff" },
|
||||
{ 0, "hf felica wrbl" },
|
||||
{ 0, "hf felica rqservice" },
|
||||
{ 0, "hf felica rqresponse" },
|
||||
|
@ -502,11 +503,13 @@ const static vocabulary_t vocabulary[] = {
|
|||
{ 0, "hf vas reader" },
|
||||
{ 1, "hf vas decrypt" },
|
||||
{ 1, "hf waveshare help" },
|
||||
{ 0, "hf waveshare loadbmp" },
|
||||
{ 1, "hf waveshare load" },
|
||||
{ 1, "hf xerox help" },
|
||||
{ 1, "hf xerox list" },
|
||||
{ 0, "hf xerox info" },
|
||||
{ 0, "hf xerox reader" },
|
||||
{ 0, "hf xerox dump" },
|
||||
{ 0, "hf xerox reader" },
|
||||
{ 1, "hf xerox view" },
|
||||
{ 1, "hw help" },
|
||||
{ 0, "hw break" },
|
||||
{ 0, "hw bootloader" },
|
||||
|
|
|
@ -391,7 +391,7 @@ static const char *pref_show_status_msg(prefShowOpt_t opt) {
|
|||
}
|
||||
}
|
||||
|
||||
static const char *pref_show_value(prefShowOpt_t opt, const char* msg) {
|
||||
static const char *pref_show_value(prefShowOpt_t opt, const char *msg) {
|
||||
|
||||
static char s[128] = {0};
|
||||
switch (opt) {
|
||||
|
@ -403,7 +403,7 @@ static const char *pref_show_value(prefShowOpt_t opt, const char* msg) {
|
|||
sprintf(s, _GREEN_("%s"), msg);
|
||||
return s;
|
||||
case prefShowNone:
|
||||
if ((strncmp(msg, "off", 3) == 0) || (strncmp(msg, "normal", 6) ==0)) {
|
||||
if ((strncmp(msg, "off", 3) == 0) || (strncmp(msg, "normal", 6) == 0)) {
|
||||
sprintf(s, _WHITE_("%s"), msg);
|
||||
} else {
|
||||
sprintf(s, _GREEN_("%s"), msg);
|
||||
|
@ -461,7 +461,7 @@ static void showClientDebugState(prefShowOpt_t opt) {
|
|||
PrintAndLogEx(INFO, " %s client debug............ %s", pref_show_status_msg(opt), pref_show_value(opt, "simple"));
|
||||
break;
|
||||
case cdbFULL:
|
||||
PrintAndLogEx(INFO, " %s client debug............ %s", pref_show_status_msg(opt), pref_show_value(opt,"full"));
|
||||
PrintAndLogEx(INFO, " %s client debug............ %s", pref_show_status_msg(opt), pref_show_value(opt, "full"));
|
||||
break;
|
||||
default:
|
||||
PrintAndLogEx(INFO, " %s client debug............ %s", pref_show_status_msg(opt), pref_show_value(prefShowUnknown, "unknown"));
|
||||
|
@ -546,14 +546,14 @@ static void showOverlayPosState(void) {
|
|||
static void showHintsState(prefShowOpt_t opt) {
|
||||
PrintAndLogEx(INFO, " %s hints................... %s"
|
||||
, pref_show_status_msg(opt)
|
||||
, (g_session.show_hints) ? pref_show_value(opt,"on") : pref_show_value(opt,"off")
|
||||
, (g_session.show_hints) ? pref_show_value(opt, "on") : pref_show_value(opt, "off")
|
||||
);
|
||||
}
|
||||
|
||||
static void showPlotSliderState(prefShowOpt_t opt) {
|
||||
PrintAndLogEx(INFO, " %s show plot sliders....... %s"
|
||||
, pref_show_status_msg(opt)
|
||||
, (g_session.overlay_sliders) ? pref_show_value(opt,"on") : pref_show_value(opt,"off")
|
||||
, (g_session.overlay_sliders) ? pref_show_value(opt, "on") : pref_show_value(opt, "off")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -561,23 +561,23 @@ static void showBarModeState(prefShowOpt_t opt) {
|
|||
|
||||
switch (g_session.bar_mode) {
|
||||
case STYLE_BAR:
|
||||
PrintAndLogEx(INFO, " %s barmode................. %s", pref_show_status_msg(opt), pref_show_value(opt,"bar"));
|
||||
PrintAndLogEx(INFO, " %s barmode................. %s", pref_show_status_msg(opt), pref_show_value(opt, "bar"));
|
||||
break;
|
||||
case STYLE_MIXED:
|
||||
PrintAndLogEx(INFO, " %s barmode................. %s", pref_show_status_msg(opt), pref_show_value(opt,"mixed"));
|
||||
PrintAndLogEx(INFO, " %s barmode................. %s", pref_show_status_msg(opt), pref_show_value(opt, "mixed"));
|
||||
break;
|
||||
case STYLE_VALUE:
|
||||
PrintAndLogEx(INFO, " %s barmode................. %s", pref_show_status_msg(opt), pref_show_value(opt,"value"));
|
||||
PrintAndLogEx(INFO, " %s barmode................. %s", pref_show_status_msg(opt), pref_show_value(opt, "value"));
|
||||
break;
|
||||
default:
|
||||
PrintAndLogEx(INFO, " %s barmode................. %s", pref_show_status_msg(opt), pref_show_value(prefShowUnknown,"unknown"));
|
||||
PrintAndLogEx(INFO, " %s barmode................. %s", pref_show_status_msg(opt), pref_show_value(prefShowUnknown, "unknown"));
|
||||
}
|
||||
}
|
||||
|
||||
static void showOutputState(prefShowOpt_t opt) {
|
||||
PrintAndLogEx(INFO, " %s output.................. %s"
|
||||
, pref_show_status_msg(opt)
|
||||
, (g_session.dense_output) ? pref_show_value(opt,"dense") : pref_show_value(opt,"normal")
|
||||
, (g_session.dense_output) ? pref_show_value(opt, "dense") : pref_show_value(opt, "normal")
|
||||
);
|
||||
}
|
||||
|
||||
|
|
1722
doc/commands.json
1722
doc/commands.json
File diff suppressed because it is too large
Load diff
|
@ -241,6 +241,7 @@ Check column "offline" for their availability.
|
|||
|`hf 15 restore `|N |`Restore from file to all memory pages of an ISO-15693 tag`
|
||||
|`hf 15 samples `|N |`Acquire samples as reader (enables carrier, sends inquiry)`
|
||||
|`hf 15 view `|Y |`Display content from tag dump file`
|
||||
|`hf 15 wipe `|N |`Wipe card to zeros`
|
||||
|`hf 15 wrbl `|N |`Write a block`
|
||||
|`hf 15 sim `|N |`Fake an ISO-15693 tag`
|
||||
|`hf 15 eload `|N |`Load image file into emulator to be used by 'sim' command`
|
||||
|
@ -314,11 +315,11 @@ Check column "offline" for their availability.
|
|||
|------- |------- |-----------
|
||||
|`hf felica help `|Y |`This help`
|
||||
|`hf felica list `|Y |`List ISO 18092/FeliCa history`
|
||||
|`hf felica reader `|N |`Act like an ISO18092/FeliCa reader`
|
||||
|`hf felica info `|N |`Tag information`
|
||||
|`hf felica sniff `|N |`Sniff ISO 18092/FeliCa traffic`
|
||||
|`hf felica raw `|N |`Send raw hex data to tag`
|
||||
|`hf felica rdbl `|N |`read block data from authentication-not-required Service.`
|
||||
|`hf felica reader `|N |`Act like an ISO18092/FeliCa reader`
|
||||
|`hf felica sniff `|N |`Sniff ISO 18092/FeliCa traffic`
|
||||
|`hf felica wrbl `|N |`write block data to an authentication-not-required Service.`
|
||||
|`hf felica rqservice `|N |`verify the existence of Area and Service, and to acquire Key Version.`
|
||||
|`hf felica rqresponse `|N |`verify the existence of a card and its Mode.`
|
||||
|
@ -761,7 +762,7 @@ Check column "offline" for their availability.
|
|||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`hf waveshare help `|Y |`This help`
|
||||
|`hf waveshare loadbmp `|N |`Load BMP file to Waveshare NFC ePaper`
|
||||
|`hf waveshare load `|Y |`Load image file to Waveshare NFC ePaper`
|
||||
|
||||
|
||||
### hf xerox
|
||||
|
@ -771,9 +772,11 @@ Check column "offline" for their availability.
|
|||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`hf xerox help `|Y |`This help`
|
||||
|`hf xerox list `|Y |`List ISO-14443B history`
|
||||
|`hf xerox info `|N |`Short info on Fuji/Xerox tag`
|
||||
|`hf xerox reader `|N |`Act like a Fuji/Xerox reader`
|
||||
|`hf xerox dump `|N |`Read all memory pages of an Fuji/Xerox tag, save to file`
|
||||
|`hf xerox reader `|N |`Act like a Fuji/Xerox reader`
|
||||
|`hf xerox view `|Y |`Display content from tag dump file`
|
||||
|
||||
|
||||
### hw
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue