style\n Some improvements to trace list -t seos annotations.

This commit is contained in:
iceman1001
2025-03-12 16:41:06 +01:00
parent b66e2e03fd
commit 2137284a93
17 changed files with 366 additions and 126 deletions
+1
View File
@@ -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...
## [unreleased][unreleased]
- Changed `trace list -t seos` - improved annotation (@iceman1001)
- Added `make commands` to regenerate commands documentation files and autocompletion data independently of `make style` (@doegox)
- Added texecom identification, thanks @en4rab ! (@iceman1001)
- Added `hf 15 slixprotectpage` command
+29 -12
View File
@@ -180,8 +180,10 @@ int CLIParserParseStringEx(CLIParserContext *ctx, const char *str, void *vargtab
// parse params
for (int i = 0; i < len; i++) {
switch (state) {
case PS_FIRST: // first char
case PS_FIRST: { // first char
if (!clueData || str[i] == '-') { // first char before space is '-' - next element - option OR not "clueData" for not-option fields
state = PS_OPTION;
@@ -193,24 +195,32 @@ int CLIParserParseStringEx(CLIParserContext *ctx, const char *str, void *vargtab
}
}
spaceptr = NULL;
case PS_ARGUMENT:
if (state == PS_FIRST)
}
case PS_ARGUMENT: {
if (state == PS_FIRST) {
state = PS_ARGUMENT;
if (str[i] == '"') {
}
if (str[i] == '"' || str[i] == '\'') {
state = PS_QUOTE;
break;
}
if (isSpace(str[i])) {
spaceptr = bufptr;
state = PS_FIRST;
}
*bufptr = str[i];
bufptr++;
break;
case PS_OPTION:
}
case PS_OPTION: {
if (isSpace(str[i])) {
state = PS_FIRST;
*bufptr = 0x00;
bufptr++;
argv[argc++] = bufptr;
@@ -220,17 +230,22 @@ int CLIParserParseStringEx(CLIParserContext *ctx, const char *str, void *vargtab
*bufptr = str[i];
bufptr++;
break;
case PS_QUOTE:
if (str[i] == '"') {
}
case PS_QUOTE: {
if (str[i] == '"' || str[i] == '\'') {
*bufptr++ = 0x00;
state = PS_FIRST;
} else {
if (isSpace(str[i]) == false) {
// if (isSpace(str[i]) == false) {
*bufptr++ = str[i];
}
// }
}
break;
}
}
if (bufptr > bufptrend) {
PrintAndLogEx(ERR, "ERROR: Line too long\n");
fflush(stdout);
@@ -296,8 +311,9 @@ int CLIParamBinToBuf(struct arg_str *argstr, uint8_t *data, int maxdatalen, int
int CLIParamStrToBuf(struct arg_str *argstr, uint8_t *data, int maxdatalen, int *datalen) {
*datalen = 0;
if (!argstr->count)
if (!argstr->count) {
return 0;
}
uint8_t tmpstr[MAX_INPUT_ARG_LENGTH + 1] = {0};
int ibuf = 0;
@@ -319,8 +335,9 @@ int CLIParamStrToBuf(struct arg_str *argstr, uint8_t *data, int maxdatalen, int
ibuf = MIN(ibuf, (sizeof(tmpstr) / 2));
tmpstr[ibuf] = 0;
if (ibuf == 0)
if (ibuf == 0) {
return 0;
}
if (ibuf > maxdatalen) {
PrintAndLogEx(ERR, "Parameter error: string too long (%i chars), expected MAX %i chars\n", ibuf, maxdatalen);
+14 -11
View File
@@ -1207,28 +1207,35 @@ static int CmdExchangeAPDU(bool chainingin, const uint8_t *datain, int datainlen
}
uint16_t cmdc = 0;
if (chainingin)
if (chainingin) {
cmdc = ISO14A_SEND_CHAINING;
}
// "Command APDU" length should be 5+255+1, but javacard's APDU buffer might be smaller - 133 bytes
// https://stackoverflow.com/questions/32994936/safe-max-java-card-apdu-data-command-and-respond-size
// here length PM3_CMD_DATA_SIZE=512
// timeout must be authomatically set by "get ATS"
if (datain)
if (datain) {
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, (datainlen & 0x1FF), 0, datain, datainlen & 0x1FF);
else
} else {
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_APDU | ISO14A_NO_DISCONNECT | cmdc, 0, 0, NULL, 0);
}
PacketResponseNG resp;
if (WaitForResponseTimeout(CMD_ACK, &resp, timeout)) {
if (WaitForResponseTimeout(CMD_ACK, &resp, timeout) == false) {
PrintAndLogEx(DEBUG, "ERR: APDU: Reply timeout");
return PM3_EAPDU_FAIL;
}
const uint8_t *recv = resp.data.asBytes;
int iLen = resp.oldarg[0];
uint8_t res = resp.oldarg[1];
int dlen = iLen - 2;
if (dlen < 0)
if (dlen < 0) {
dlen = 0;
}
*dataoutlen += dlen;
if (maxdataoutlen && *dataoutlen > maxdataoutlen) {
@@ -1243,7 +1250,7 @@ static int CmdExchangeAPDU(bool chainingin, const uint8_t *datain, int datainlen
return PM3_SUCCESS;
}
if (!iLen) {
if (iLen == 0) {
PrintAndLogEx(DEBUG, "ERR: APDU: No APDU response");
return PM3_EAPDU_FAIL;
}
@@ -1272,10 +1279,6 @@ static int CmdExchangeAPDU(bool chainingin, const uint8_t *datain, int datainlen
PrintAndLogEx(DEBUG, "ERR: APDU: ISO 14443A CRC error");
return PM3_EAPDU_FAIL;
}
} else {
PrintAndLogEx(DEBUG, "ERR: APDU: Reply timeout");
return PM3_EAPDU_FAIL;
}
return PM3_SUCCESS;
}
@@ -2779,7 +2782,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
if ((isMagic & MAGIC_FLAG_GEN_2) == MAGIC_FLAG_GEN_2) {
PrintAndLogEx(HINT, "Hint: use `" _YELLOW_("hf mf") "` commands");
} else {
PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`hf mf`") " commands");
PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`hf mf info`"));
}
}
+8 -7
View File
@@ -1414,7 +1414,7 @@ static int iclass_decode_credentials_new_pacs(uint8_t *d) {
uint8_t pad = d[offset];
PrintAndLogEx(INFO, "%u , %u", offset, pad);
PrintAndLogEx(DEBUG, "%u , %u", offset, pad);
char *binstr = (char *)calloc((PICOPASS_BLOCK_SIZE * 8) + 1, sizeof(uint8_t));
if (binstr == NULL) {
@@ -1424,17 +1424,16 @@ static int iclass_decode_credentials_new_pacs(uint8_t *d) {
uint8_t n = PICOPASS_BLOCK_SIZE - offset - 2;
bytes_2_binstr(binstr, d + offset + 2, n);
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(SUCCESS, "PACS......... " _GREEN_("%s"), sprint_hex_inrow(d + offset + 2, n));
PrintAndLogEx(SUCCESS, "padded bin... " _GREEN_("%s") " ( %zu )", binstr, strlen(binstr));
PrintAndLogEx(DEBUG, "PACS......... " _GREEN_("%s"), sprint_hex_inrow(d + offset + 2, n));
PrintAndLogEx(DEBUG, "padded bin... " _GREEN_("%s") " ( %zu )", binstr, strlen(binstr));
binstr[strlen(binstr) - pad] = '\0';
PrintAndLogEx(SUCCESS, "bin.......... " _GREEN_("%s") " ( %zu )", binstr, strlen(binstr));
PrintAndLogEx(DEBUG, "bin.......... " _GREEN_("%s") " ( %zu )", binstr, strlen(binstr));
size_t hexlen = 0;
uint8_t hex[16] = {0};
binstr_2_bytes(hex, &hexlen, binstr);
PrintAndLogEx(SUCCESS, "hex.......... " _GREEN_("%s"), sprint_hex_inrow(hex, hexlen));
PrintAndLogEx(DEBUG, "hex.......... " _GREEN_("%s"), sprint_hex_inrow(hex, hexlen));
uint32_t top = 0, mid = 0, bot = 0;
if (binstring_to_u96(&top, &mid, &bot, binstr) != strlen(binstr)) {
@@ -2852,8 +2851,9 @@ static int CmdHFiClass_ReadBlock(const char *Cmd) {
return PM3_SUCCESS;
bool use_sc = IsCardHelperPresent(verbose);
if (use_sc == false)
if (use_sc == false) {
return PM3_SUCCESS;
}
// crypto helper available.
PrintAndLogEx(INFO, "----------------------------- " _CYAN_("Cardhelper") " -----------------------------");
@@ -3234,6 +3234,7 @@ void print_iclass_sio(uint8_t *iclass_dump, size_t dump_len, bool verbose) {
size_t sio_length;
detect_credential(iclass_dump, dump_len, &is_legacy, &is_se, &is_sr, &sio_start, &sio_length);
// sanity checks
if (sio_start == NULL) {
return;
}
+124 -26
View File
@@ -70,8 +70,14 @@ static uint8_t *gs_mfuc_key = NULL;
*/
uint8_t iso14443A_CRC_check(bool isResponse, uint8_t *d, uint8_t n) {
if (n < 3) return 2;
if (isResponse && (n == 5)) return 2;
if (n < 3) {
return 2;
}
if (isResponse && (n == 5)) {
return 2;
}
if (d[1] == 0x50 &&
d[0] >= ISO14443A_CMD_ANTICOLL_OR_SELECT &&
d[0] <= ISO14443A_CMD_ANTICOLL_OR_SELECT_3) {
@@ -80,6 +86,25 @@ uint8_t iso14443A_CRC_check(bool isResponse, uint8_t *d, uint8_t n) {
return check_crc(CRC_14443_A, d, n);
}
uint8_t seos_CRC_check(bool isResponse, uint8_t *d, uint8_t n) {
if (n < 3) {
return 2;
}
// 5 bytes response Card busy 0xFA have crc, the rest is most likely 14a anticollision
if ((n == 5) && (d[0] != 0xFA)) {
return 2;
}
if (d[1] == 0x50 &&
d[0] >= ISO14443A_CMD_ANTICOLL_OR_SELECT &&
d[0] <= ISO14443A_CMD_ANTICOLL_OR_SELECT_3) {
return 2;
}
return check_crc(CRC_14443_A, d, n);
}
uint8_t mifare_CRC_check(bool isResponse, uint8_t *data, uint8_t len) {
switch (MifareAuthState) {
case masNone:
@@ -423,14 +448,14 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool i
snprintf(exp, size, "?");
break;
}
case NTAG_I2C_FASTWRITE:
case NTAG_I2C_FASTWRITE: {
if (cmdsize == 69)
snprintf(exp, size, "FAST WRITE (" _MAGENTA_("%d-%d") ")", cmd[1], cmd[2]);
else
snprintf(exp, size, "?");
break;
default:
}
default: {
if ((cmd[0] & 0xF0) == 0xD0 && (cmdsize == 4 || cmdsize == 5)) {
snprintf(exp, size, "PPS - CID=%x", cmd[0] & 0x0F) ;
} else if ((cmd[0] & 0xF0) == 0x60 && (cmdsize == 4)) {
@@ -440,7 +465,10 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool i
return PM3_ESOFT;
}
}
}
} else {
if (gs_mfuc_state == 1) {
if ((cmd[0] == 0xAF) && (cmdsize == 11)) {
// register RndB
@@ -450,6 +478,7 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool i
gs_mfuc_state = 0;
}
}
if (gs_mfuc_state == 3) {
if ((cmd[0] == 0x00) && (cmdsize == 11)) {
// register RndA'
@@ -1748,49 +1777,115 @@ void annotateCryptoRF(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
}
}
void annotateSeos(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
void annotateSeos(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool isResponse) {
if (cmd[0] == 0xFA && cmdsize == 5) {
snprintf(exp, size, (isResponse) ? "BUSY" : "DONE?");
return;
}
// it's basically a ISO14443a tag, so try annotation from there
if (applyIso14443a(exp, size, cmd, cmdsize, false) != PM3_SUCCESS) {
int pos = 0;
switch (cmd[0]) {
case 2:
case 3:
pos = 2;
break;
case 0:
case 2:
case 3: {
pos = 1;
break;
default:
}
default: {
pos = 2;
break;
}
}
if (memcmp(cmd + pos, "\x00\xa4\x04\x00\x0a", 5) == 0) {
snprintf(exp, size, "SELECT AID");
if (memcmp(cmd + pos, "\x00\xA4\x04\x00", 4) == 0) {
uint8_t n = cmd[pos + 4];
snprintf(exp, size, "SELECT AID " _WHITE_("%s"), sprint_hex_inrow(cmd + pos + 4 + 1, n));
return;
}
if (memcmp(cmd + pos, "\x80\xA5\x00\x00", 4) == 0) {
snprintf(exp, size, "SELECT GDF");
return;
}
if (memcmp(cmd + pos, "\x80\xA5\x04\x00", 4) == 0) {
snprintf(exp, size, "SELECT ADF / OID");
uint8_t n = cmd[pos + 4 + 2];
snprintf(exp, size, "SELECT OID " _WHITE_("%s"), sprint_hex_inrow(cmd + pos + 4 + 2 + 1, n));
return;
}
if (memcmp(cmd + pos, "\x00\x87\x00\x01\x04\x7c\x02\x81\x00", 9) == 0) {
snprintf(exp, size, "GET CHALLENGE");
if (memcmp(cmd + pos, "\x80\xA5\x07", 3) == 0) {
uint8_t ks = cmd[pos + 3];
snprintf(exp, size, "SELECT GDF " _WHITE_("(") " key " _MAGENTA_("%02X") " )", ks);
return;
}
if (memcmp(cmd + pos, "\x00\x87\x00\x01\x2c", 5) == 0) {
snprintf(exp, size, "MUTUAL AUTHENTICATION");
if (memcmp(cmd + pos, "\x00\x87\x00", 3) == 0) {
uint8_t ks = cmd[pos + 3];
if (memcmp(cmd + pos + 3 + 1, "\x04\x7c\x02\x81\x00", 5) == 0) {
snprintf(exp, size, "GET CHALLENGE " _WHITE_("(") " key " _MAGENTA_("%02X") " )", ks);
}
return;
}
if (memcmp(cmd + pos, "\x0c\xcb\x3f\xff", 4) == 0) {
if (memcmp(cmd + pos, "\x00\x87\x00", 3) == 0) {
uint8_t ks = cmd[pos + 3];
if (memcmp(cmd + pos + 3 + 1, "\x2C\x7C\x2A\x82\x28", 5) == 0) {
snprintf(exp, size, "MUTUAL AUTHENTICATION " _WHITE_("(") " key " _MAGENTA_("%02X") " )", ks);
}
return;
}
if (memcmp(cmd + pos, "\x0C\xCB\x3F\xFF", 4) == 0) {
snprintf(exp, size, "GET DATA");
return;
}
// apply ISO7816 annotations?
// if (annotateIso7816(exp, size, cmd, cmdsize) == 0) {
// }
// apply SEOS annotations?
if (memcmp(cmd + pos, "\x0C\xDB\x3F\xFF", 4) == 0) {
snprintf(exp, size, "UPDATE DATA");
return;
}
if (memcmp(cmd + pos, "\x0C\xED\x06\x00", 4) == 0) {
snprintf(exp, size, "DELETE DATA");
return;
}
if (memcmp(cmd + pos, "\x0C\x41\x0C\x03", 4) == 0) {
snprintf(exp, size, "CREATE ADF");
return;
}
if (isResponse) {
if (memcmp(cmd + pos, "\xCD\x02", 2) == 0) {
uint8_t ea = cmd[pos + 2];
uint8_t ha = cmd[pos + 3];
char eas[10] = {0};
if (ea == SEOS_ENCRYPTION_2K3DES) {
strcat(eas, "2K3DES");
} else if (ea == SEOS_ENCRYPTION_3K3DES) {
strcat(eas, "3K3DES");
} else if (ea == SEOS_ENCRYPTION_AES) {
strcat(eas, "AES");
}
char has[10] = {0};
if (ha == SEOS_HASHING_SHA1) {
strcat(has, "SHA1");
} else if (ha == SEOS_HASHING_SHA256) {
strcat(has, "SHA256");
}
snprintf(exp, size, "%s / %s", eas, has);
return;
}
}
}
}
@@ -1830,11 +1925,13 @@ void annotateLegic(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
uint16_t address = (cmd[2] << 7) | cmd[1] >> 1;
if (cmdBit == LEGIC_READ)
if (cmdBit == LEGIC_READ) {
snprintf(exp, size, "READ Byte(%d)", address);
}
if (cmdBit == LEGIC_WRITE)
if (cmdBit == LEGIC_WRITE) {
snprintf(exp, size, "WRITE Byte(%d)", address);
}
break;
}
case 21: {
@@ -1854,8 +1951,9 @@ void annotateLegic(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
break;
}
case 12:
default:
default: {
break;
}
}
}
+2 -1
View File
@@ -46,6 +46,7 @@ uint8_t felica_CRC_check(uint8_t *d, uint8_t n);
uint8_t mifare_CRC_check(bool isResponse, uint8_t *data, uint8_t len);
uint8_t iso15693_CRC_check(uint8_t *d, uint8_t n);
uint8_t iclass_CRC_check(bool isResponse, uint8_t *d, uint8_t n);
uint8_t seos_CRC_check(bool isResponse, uint8_t *d, uint8_t n);
int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool is_response);
@@ -68,7 +69,7 @@ void annotateMifare(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize,
void annotateLTO(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize);
void annotateCryptoRF(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize);
void annotateSeos(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize);
void annotateSeos(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool isResponse);
bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isResponse, uint8_t *mfData, size_t *mfDataLen, const uint64_t *dicKeys, uint32_t dicKeysCount);
bool NTParityChk(AuthData_t *ad, uint32_t ntx);
+1 -1
View File
@@ -682,7 +682,7 @@ static int CmdHfLTOWriteBlock(const char *Cmd) {
int res = wrblLTO(blk, block_data, true);
if (res == PM3_SUCCESS)
PrintAndLogEx(HINT, "Try use 'hf lto rdbl' for verification");
PrintAndLogEx(HINT, "Try `" _YELLOW_("hf lto rdbl") "` to verify");
return res;
}
+1 -2
View File
@@ -8267,7 +8267,7 @@ static int CmdHF14AGen4Load(const char *cmd) {
arg_lit0("v", "verbose", "verbose output"),
arg_str0("f", "file", "<fn>", "Specify a filename for dump file"),
arg_lit0(NULL, "emu", "from emulator memory"),
arg_int0(NULL, "start", "<dec>", "index of block to start writing (default 0)"),
arg_int0(NULL, "start", "<dec>", "index of block to start writing (def 0)"),
arg_int0(NULL, "end", "<dec>", "index of block to end writing (default last block)"),
arg_param_end
};
@@ -10234,7 +10234,6 @@ static command_t CommandTable[] = {
{"gdmparsecfg", CmdHF14AGen4_GDM_ParseCfg, AlwaysAvailable, "Parse config block to card"},
{"gdmsetblk", CmdHF14AGen4_GDM_SetBlk, IfPm3Iso14443a, "Write block to card"},
{"-----------", CmdHelp, IfPm3Iso14443a, "----------------------- " _CYAN_("ndef") " -----------------------"},
// {"ice", CmdHF14AMfice, IfPm3Iso14443a, "collect MIFARE Classic nonces to file"},
{"ndefformat", CmdHFMFNDEFFormat, IfPm3Iso14443a, "Format MIFARE Classic Tag as NFC Tag"},
{"ndefread", CmdHFMFNDEFRead, IfPm3Iso14443a, "Read and print NDEF records from card"},
{"ndefwrite", CmdHFMFNDEFWrite, IfPm3Iso14443a, "Write NDEF records to card"},
+3
View File
@@ -575,11 +575,13 @@ static int CmdHIDBrute(const char *Cmd) {
PrintAndLogEx(INFO, "Facility code.... %u", card_hi.FacilityCode);
PrintAndLogEx(INFO, "Card number...... %" PRIu64, card_hi.CardNumber);
PrintAndLogEx(INFO, "Delay............ " _YELLOW_("%d"), delay);
if (strcmp(field, "fc") == 0) {
PrintAndLogEx(INFO, "Field............ " _YELLOW_("fc"));
} else if (strcmp(field, "cn") == 0) {
PrintAndLogEx(INFO, "Field............ " _YELLOW_("cn"));
}
switch (direction) {
case 0:
PrintAndLogEx(INFO, "Direction........ " _YELLOW_("both"));
@@ -594,6 +596,7 @@ static int CmdHIDBrute(const char *Cmd) {
break;
}
}
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(INFO, "Started bruteforcing HID Prox reader");
PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("<Enter>") " to abort simulation");
+6 -4
View File
@@ -561,9 +561,11 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
case ISO_14443A:
case MFDES:
case LTO:
case SEOS:
crcStatus = iso14443A_CRC_check(hdr->isResponse, frame, data_len);
break;
case SEOS:
crcStatus = seos_CRC_check(hdr->isResponse, frame, data_len);
break;
case ISO_7816_4:
crcStatus = iso14443A_CRC_check(hdr->isResponse, frame, data_len) == 1 ? 3 : 0;
crcStatus = iso14443B_CRC_check(frame, data_len) == 1 ? 4 : crcStatus;
@@ -803,6 +805,9 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
case ICLASS:
annotateIclass(explanation, sizeof(explanation), frame, data_len, hdr->isResponse);
break;
case SEOS:
annotateSeos(explanation, sizeof(explanation), frame, data_len, hdr->isResponse);
break;
default:
break;
}
@@ -839,9 +844,6 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
case PROTO_CRYPTORF:
annotateCryptoRF(explanation, sizeof(explanation), frame, data_len);
break;
case SEOS:
annotateSeos(explanation, sizeof(explanation), frame, data_len);
break;
case PROTO_FMCOS20:
annotateFMCOS20(explanation, sizeof(explanation), frame, data_len);
break;
+1 -1
View File
@@ -2412,7 +2412,6 @@ int loadFileDICTIONARY_safe_ex(const char *preferredName, const char *suffix, vo
// larger keys than expected is skipped
if (strlen(line) > keylen) {
PrintAndLogEx(INFO, "larger %zu - %s", strlen(line), line);
continue;
}
@@ -3085,6 +3084,7 @@ int pm3_load_dump(const char *fn, void **pdump, size_t *dumplen, size_t maxdumpl
PrintAndLogEx(WARNING, "fail, cannot allocate memory");
return PM3_EMALLOC;
}
res = loadFileJSON(fn, *pdump, maxdumplen, dumplen, NULL);
if (res == PM3_SUCCESS) {
return res;
+20 -4
View File
@@ -355,8 +355,16 @@ int MAD1DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose, bool *haveMA
aid
);
} else {
char fmt[60];
snprintf(fmt, sizeof(fmt), (ibs == i) ? _MAGENTA_(" %02d [%04X]%s") : " %02d [" _GREEN_("%04X") "]%s", i, aid, "%s");
char fmt[80];
snprintf(fmt
, sizeof(fmt)
, (ibs == i) ?
_MAGENTA_(" %02d [%04X] %s") :
" %02d [" _GREEN_("%04X") "] %s"
, i
, aid
, "%s"
);
print_aid_description(mad_known_aids, aid, fmt, verbose);
prev_aid = aid;
}
@@ -408,8 +416,16 @@ int MAD2DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose) {
aid
);
} else {
char fmt[60];
snprintf(fmt, sizeof(fmt), (ibs == i) ? _MAGENTA_(" %02d [%04X]%s") : " %02d [" _GREEN_("%04X") "]%s", i + 16, aid, "%s");
char fmt[80];
snprintf(fmt
, sizeof(fmt)
, (ibs == i) ?
_MAGENTA_(" %02d [%04X] %s") :
" %02d [" _GREEN_("%04X") "] %s"
, i + 16
, aid
, "%s"
);
print_aid_description(mad_known_aids, aid, fmt, verbose);
prev_aid = aid;
}
+1
View File
@@ -202,6 +202,7 @@ const static vocabulary_t vocabulary[] = {
{ 0, "hf 15 slixeasenable" },
{ 0, "hf 15 slixprivacydisable" },
{ 0, "hf 15 slixprivacyenable" },
{ 0, "hf 15 slixprotectpage" },
{ 0, "hf 15 passprotectafi" },
{ 0, "hf 15 passprotecteas" },
{ 0, "hf 15 findafi" },
+134 -55
View File
File diff suppressed because it is too large Load Diff
+19 -2
View File
@@ -2064,6 +2064,23 @@
],
"usage": "hf 15 slixprivacyenable [-h] -p <hex>"
},
"hf 15 slixprotectpage": {
"command": "hf 15 slixprotectpage",
"description": "Defines protection pointer address of user mem and access cond. for pages",
"notes": [
"hf 15 slixprotectpage -w deadbeef -p 3 -h 3"
],
"offline": false,
"options": [
"-h, --help This help",
"-r, --readpw <hex> read password, 4 hex bytes",
"-w, --writepw <hex> write password, 4 hex bytes",
"-p, --ptr <dec> protection pointer page (0-78), if 0 entire user mem",
"-l, --lo <dec> page protection flags of lo page (0-None, 1-ReadPR, 2-WritePR)",
"-i, --hi <dec> page protection flags of hi page (0-None, 1-ReadPR, 2-WritePR)"
],
"usage": "hf 15 slixprotectpage [-h] [-r <hex>] [-w <hex>] [-p <dec>] -l <dec> -i <dec>"
},
"hf 15 slixwritepwd": {
"command": "hf 15 slixwritepwd",
"description": "Write a password on a SLIX family ISO-15693 tag.nSome tags do not support all different password types.",
@@ -13213,8 +13230,8 @@
}
},
"metadata": {
"commands_extracted": 759,
"commands_extracted": 760,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2025-03-11T08:20:44"
"extracted_on": "2025-03-12T08:23:41"
}
}
+1
View File
@@ -261,6 +261,7 @@ Check column "offline" for their availability.
|`hf 15 slixeasenable `|N |`Enable EAS mode on SLIX ISO-15693 tag`
|`hf 15 slixprivacydisable`|N |`Disable privacy mode on SLIX ISO-15693 tag`
|`hf 15 slixprivacyenable`|N |`Enable privacy mode on SLIX ISO-15693 tag`
|`hf 15 slixprotectpage `|N |`Protect pages on SLIX ISO-15693 tag`
|`hf 15 passprotectafi `|N |`Password protect AFI - Cannot be undone`
|`hf 15 passprotecteas `|N |`Password protect EAS - Cannot be undone`
|`hf 15 findafi `|N |`Brute force AFI of an ISO-15693 tag`
+1
View File
@@ -1,3 +1,4 @@
//-----------------------------------------------------------------------------
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
//
// This program is free software: you can redistribute it and/or modify