mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
style
This commit is contained in:
parent
dc7649241a
commit
8293b81217
9 changed files with 57 additions and 38 deletions
|
@ -24,7 +24,7 @@ p = pm3.pm3()
|
||||||
for bk in BACKDOOR_KEYS:
|
for bk in BACKDOOR_KEYS:
|
||||||
p.console(f"hf mf rdbl -c 4 --blk 0 --key {bk}")
|
p.console(f"hf mf rdbl -c 4 --blk 0 --key {bk}")
|
||||||
output = p.grabbed_output.split('\n')
|
output = p.grabbed_output.split('\n')
|
||||||
|
|
||||||
if "auth error" in output[0].lower():
|
if "auth error" in output[0].lower():
|
||||||
continue
|
continue
|
||||||
elif "can't select card" in output[0].lower():
|
elif "can't select card" in output[0].lower():
|
||||||
|
@ -37,7 +37,7 @@ for bk in BACKDOOR_KEYS:
|
||||||
else:
|
else:
|
||||||
WORKING_KEY = bk
|
WORKING_KEY = bk
|
||||||
break
|
break
|
||||||
|
|
||||||
if not WORKING_KEY:
|
if not WORKING_KEY:
|
||||||
print("None of the backdoor keys seem to work with this tag.")
|
print("None of the backdoor keys seem to work with this tag.")
|
||||||
exit()
|
exit()
|
||||||
|
@ -52,7 +52,7 @@ header = False
|
||||||
# Read every sector
|
# Read every sector
|
||||||
for i in range(TOTAL_SECTORS):
|
for i in range(TOTAL_SECTORS):
|
||||||
p.console(f"hf mf rdsc -c 4 --key {WORKING_KEY} -s {i}")
|
p.console(f"hf mf rdsc -c 4 --key {WORKING_KEY} -s {i}")
|
||||||
|
|
||||||
start = False
|
start = False
|
||||||
for line in p.grabbed_output.split('\n'):
|
for line in p.grabbed_output.split('\n'):
|
||||||
if not header:
|
if not header:
|
||||||
|
@ -60,11 +60,11 @@ for i in range(TOTAL_SECTORS):
|
||||||
elif start and len(line) > 0:
|
elif start and len(line) > 0:
|
||||||
print(line)
|
print(line)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "----------" in line:
|
if "----------" in line:
|
||||||
start = True
|
start = True
|
||||||
header = True
|
header = True
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -465,10 +465,10 @@ static int print_atqb_resp(uint8_t *data, uint8_t cid) {
|
||||||
PrintAndLogEx(SUCCESS, "Tag :");
|
PrintAndLogEx(SUCCESS, "Tag :");
|
||||||
PrintAndLogEx(SUCCESS, " Max Buf Length: %u (MBLI) %s", cid >> 4, (cid & 0xF0) ? "" : "chained frames not supported");
|
PrintAndLogEx(SUCCESS, " Max Buf Length: %u (MBLI) %s", cid >> 4, (cid & 0xF0) ? "" : "chained frames not supported");
|
||||||
PrintAndLogEx(SUCCESS, " CID : %u", cid & 0x0f);
|
PrintAndLogEx(SUCCESS, " CID : %u", cid & 0x0f);
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "--- " _CYAN_("Fingerprint"));
|
PrintAndLogEx(INFO, "--- " _CYAN_("Fingerprint"));
|
||||||
if (memcmp(data, "\x54\x43\x4F\x53",4) == 0) {
|
if (memcmp(data, "\x54\x43\x4F\x53", 4) == 0) {
|
||||||
|
|
||||||
int outlen = 0;
|
int outlen = 0;
|
||||||
uint8_t out[PM3_CMD_DATA_SIZE] = {0};
|
uint8_t out[PM3_CMD_DATA_SIZE] = {0};
|
||||||
|
@ -479,7 +479,7 @@ static int print_atqb_resp(uint8_t *data, uint8_t cid) {
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(SUCCESS, "Tiananxin TCOS CPU card... " _RED_("n/a"));
|
PrintAndLogEx(SUCCESS, "Tiananxin TCOS CPU card... " _RED_("n/a"));
|
||||||
}
|
}
|
||||||
PrintAndLogEx(SUCCESS, "Magic capabilities........ most likely");
|
PrintAndLogEx(SUCCESS, "Magic capabilities........ most likely");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -2935,8 +2935,8 @@ static int CmdHF14BSetUID(const char *Cmd) {
|
||||||
return switch_off_field_14b();
|
return switch_off_field_14b();
|
||||||
}
|
}
|
||||||
|
|
||||||
iso14b_card_select_t *card = (iso14b_card_select_t*)select;
|
iso14b_card_select_t *card = (iso14b_card_select_t *)select;
|
||||||
if (memcmp(card->atqb, "\x54\x43\x4F\x53", 4) ) {
|
if (memcmp(card->atqb, "\x54\x43\x4F\x53", 4)) {
|
||||||
PrintAndLogEx(FAILED, "None supported tag");
|
PrintAndLogEx(FAILED, "None supported tag");
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
return switch_off_field_14b();
|
return switch_off_field_14b();
|
||||||
|
|
|
@ -529,7 +529,7 @@ static int CmdEM410xBrute(const char *Cmd) {
|
||||||
// load keys
|
// load keys
|
||||||
uint8_t *uidblock = NULL;
|
uint8_t *uidblock = NULL;
|
||||||
uint32_t uidcount = 0;
|
uint32_t uidcount = 0;
|
||||||
int res = loadFileDICTIONARY_safe_ex(filename, suffix, (void**)&uidblock, 5, &uidcount, false);
|
int res = loadFileDICTIONARY_safe_ex(filename, suffix, (void **)&uidblock, 5, &uidcount, false);
|
||||||
if (res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
free(uidblock);
|
free(uidblock);
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -210,8 +210,8 @@ static void print_error(int8_t reason) {
|
||||||
PrintAndLogEx(FAILED, "Write to page failed!");
|
PrintAndLogEx(FAILED, "Write to page failed!");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// PM3_REASON_UNKNOWN
|
// PM3_REASON_UNKNOWN
|
||||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Hitag S failed");
|
PrintAndLogEx(DEBUG, "DEBUG: Error - Hitag S failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ static int CmdLFHitagSRead(const char *Cmd) {
|
||||||
PrintAndLogEx(INFO, "---+-------------+-------");
|
PrintAndLogEx(INFO, "---+-------------+-------");
|
||||||
|
|
||||||
const int hts_mem_sizes[] = {1, 8, 64, 64};
|
const int hts_mem_sizes[] = {1, 8, 64, 64};
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
count = hts_mem_sizes[config.MEMT] - page;
|
count = hts_mem_sizes[config.MEMT] - page;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +458,7 @@ void hitags_config_print(hitags_config_t config) {
|
||||||
PrintAndLogEx(INFO, " Authenticaion.... %s", config.auth ? _YELLOW_("Yes") : "No");
|
PrintAndLogEx(INFO, " Authenticaion.... %s", config.auth ? _YELLOW_("Yes") : "No");
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " TTF coding....... %s",
|
PrintAndLogEx(INFO, " TTF coding....... %s",
|
||||||
config.RES3 ? "FSK 0=RF/10 1=RF/8" : (const char *[]){"Manchester", "Biphase"}[config.TTFC]);
|
config.RES3 ? "FSK 0=RF/10 1=RF/8" : (const char *[]) {"Manchester", "Biphase"}[config.TTFC]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " TTF data rate.... %s",
|
PrintAndLogEx(INFO, " TTF data rate.... %s",
|
||||||
(const char *[]) {
|
(const char *[]) {
|
||||||
|
@ -467,16 +467,16 @@ void hitags_config_print(hitags_config_t config) {
|
||||||
}[config.TTFDR]);
|
}[config.TTFDR]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " TTF mode......... %s",
|
PrintAndLogEx(INFO, " TTF mode......... %s",
|
||||||
(const char *[]){
|
(const char *[]) {
|
||||||
"TTF Mode disabled (= RTF Mode)",
|
"TTF Mode disabled (= RTF Mode)",
|
||||||
"Page 4, Page 5",
|
"Page 4, Page 5",
|
||||||
"Page 4, Page 5, Page 6, Page 7",
|
"Page 4, Page 5, Page 6, Page 7",
|
||||||
"Page 4",
|
"Page 4",
|
||||||
"TTF Mode disabled (= RTF Mode)",
|
"TTF Mode disabled (= RTF Mode)",
|
||||||
"Page 4, Page 5, Page 6",
|
"Page 4, Page 5, Page 6",
|
||||||
"Page 4, Page 5, Page 6, Page 7, Page 8",
|
"Page 4, Page 5, Page 6, Page 7, Page 8",
|
||||||
"Page 4, Page 5, Page 6, Page 7, Page 8, Page 9, Page 10, Page 11",
|
"Page 4, Page 5, Page 6, Page 7, Page 8, Page 9, Page 10, Page 11",
|
||||||
}[config.RES0 << 2 | config.TTFM]);
|
}[config.RES0 << 2 | config.TTFM]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " Config locked.... %s", config.LCON ? _RED_("Yes") : _GREEN_("No"));
|
PrintAndLogEx(INFO, " Config locked.... %s", config.LCON ? _RED_("Yes") : _GREEN_("No"));
|
||||||
PrintAndLogEx(INFO, " Key/PWD locked... %s", config.LKP ? _RED_("Yes") : _GREEN_("No"));
|
PrintAndLogEx(INFO, " Key/PWD locked... %s", config.LKP ? _RED_("Yes") : _GREEN_("No"));
|
||||||
|
|
|
@ -717,7 +717,7 @@ int saveFileJSONex(const char *preferredName, JSONFileType ftype, uint8_t *data,
|
||||||
if (datalen != sizeof(iso14a_fm11rf08s_nonces_with_data_t)) {
|
if (datalen != sizeof(iso14a_fm11rf08s_nonces_with_data_t)) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
iso14a_fm11rf08s_nonces_with_data_t * p = (iso14a_fm11rf08s_nonces_with_data_t *)data;
|
iso14a_fm11rf08s_nonces_with_data_t *p = (iso14a_fm11rf08s_nonces_with_data_t *)data;
|
||||||
if (ftype == jsfFM11RF08SNoncesWithData) {
|
if (ftype == jsfFM11RF08SNoncesWithData) {
|
||||||
JsonSaveStr(root, "FileType", "fm11rf08s_nonces_with_data");
|
JsonSaveStr(root, "FileType", "fm11rf08s_nonces_with_data");
|
||||||
} else {
|
} else {
|
||||||
|
@ -2317,7 +2317,7 @@ int loadFileDICTIONARY_safe(const char *preferredName, void **pdata, uint8_t key
|
||||||
return loadFileDICTIONARY_safe_ex(preferredName, ".dic", pdata, keylen, keycnt, true);
|
return loadFileDICTIONARY_safe_ex(preferredName, ".dic", pdata, keylen, keycnt, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int loadFileDICTIONARY_safe_ex(const char *preferredName, const char* suffix, void **pdata, uint8_t keylen, uint32_t *keycnt, bool verbose) {
|
int loadFileDICTIONARY_safe_ex(const char *preferredName, const char *suffix, void **pdata, uint8_t keylen, uint32_t *keycnt, bool verbose) {
|
||||||
|
|
||||||
int retval = PM3_SUCCESS;
|
int retval = PM3_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ int loadFileDICTIONARYEx(const char *preferredName, void *data, size_t maxdatale
|
||||||
*/
|
*/
|
||||||
int loadFileDICTIONARY_safe(const char *preferredName, void **pdata, uint8_t keylen, uint32_t *keycnt);
|
int loadFileDICTIONARY_safe(const char *preferredName, void **pdata, uint8_t keylen, uint32_t *keycnt);
|
||||||
|
|
||||||
int loadFileDICTIONARY_safe_ex(const char *preferredName, const char* suffix, void **pdata, uint8_t keylen, uint32_t *keycnt, bool verbose);
|
int loadFileDICTIONARY_safe_ex(const char *preferredName, const char *suffix, void **pdata, uint8_t keylen, uint32_t *keycnt, bool verbose);
|
||||||
|
|
||||||
int loadFileBinaryKey(const char *preferredName, const char *suffix, void **keya, void **keyb, size_t *alen, size_t *blen);
|
int loadFileBinaryKey(const char *preferredName, const char *suffix, void **keya, void **keyb, size_t *alen, size_t *blen);
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,7 @@ const static vocabulary_t vocabulary[] = {
|
||||||
{ 1, "hf 14b valid" },
|
{ 1, "hf 14b valid" },
|
||||||
{ 0, "hf 14b calypso" },
|
{ 0, "hf 14b calypso" },
|
||||||
{ 0, "hf 14b mobib" },
|
{ 0, "hf 14b mobib" },
|
||||||
|
{ 0, "hf 14b setuid" },
|
||||||
{ 1, "hf 15 help" },
|
{ 1, "hf 15 help" },
|
||||||
{ 1, "hf 15 list" },
|
{ 1, "hf 15 list" },
|
||||||
{ 1, "hf 15 demod" },
|
{ 1, "hf 15 demod" },
|
||||||
|
|
|
@ -1613,6 +1613,19 @@
|
||||||
],
|
],
|
||||||
"usage": "hf 14b restore [-h] [-f <fn>] [--512] [--4k]"
|
"usage": "hf 14b restore [-h] [-f <fn>] [--512] [--4k]"
|
||||||
},
|
},
|
||||||
|
"hf 14b setuid": {
|
||||||
|
"command": "hf 14b setuid",
|
||||||
|
"description": "Set UID for magic card (only works with such cards)",
|
||||||
|
"notes": [
|
||||||
|
"hf 14b setuid -u 11223344"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help This help",
|
||||||
|
"-u, --uid <hex> UID, 4 hex bytes"
|
||||||
|
],
|
||||||
|
"usage": "hf 14b setuid [-h] -u <hex>"
|
||||||
|
},
|
||||||
"hf 14b sim": {
|
"hf 14b sim": {
|
||||||
"command": "hf 14b sim",
|
"command": "hf 14b sim",
|
||||||
"description": "Simulate a ISO/IEC 14443 type B tag with 4 byte UID / PUPI",
|
"description": "Simulate a ISO/IEC 14443 type B tag with 4 byte UID / PUPI",
|
||||||
|
@ -3221,12 +3234,14 @@
|
||||||
"options": [
|
"options": [
|
||||||
"-h, --help This help",
|
"-h, --help This help",
|
||||||
"--ci <dec> use config slot at index",
|
"--ci <dec> use config slot at index",
|
||||||
"--ki <dec> Key index to select key from memory 'hf iclass managekeys'",
|
"--ki <dec> Card Key - index to select key from memory 'hf iclass managekeys'",
|
||||||
|
"--krki <dec> Elite Keyroll Key - index to select key from memory 'hf iclass managekeys'",
|
||||||
|
"--elite Use elite key for the the Card Key ki",
|
||||||
"-g generate card dump file",
|
"-g generate card dump file",
|
||||||
"-l load available cards",
|
"-l load available cards",
|
||||||
"-p print available cards"
|
"-p print available cards"
|
||||||
],
|
],
|
||||||
"usage": "hf iclass configcard [-hglp] [--ci <dec>] [--ki <dec>]"
|
"usage": "hf iclass configcard [-hglp] [--ci <dec>] [--ki <dec>] [--krki <dec>] [--elite]"
|
||||||
},
|
},
|
||||||
"hf iclass creditepurse": {
|
"hf iclass creditepurse": {
|
||||||
"command": "hf iclass creditepurse",
|
"command": "hf iclass creditepurse",
|
||||||
|
@ -5111,9 +5126,10 @@
|
||||||
"",
|
"",
|
||||||
"FM11RF08S specific options: Incompatible with above options, except -k; output in JSON",
|
"FM11RF08S specific options: Incompatible with above options, except -k; output in JSON",
|
||||||
"--collect_fm11rf08s collect all nT/{nT}/par_err.",
|
"--collect_fm11rf08s collect all nT/{nT}/par_err.",
|
||||||
"--collect_fm11rf08s_with_data collect all nT/{nT}/par_err and data blocks."
|
"--collect_fm11rf08s_with_data collect all nT/{nT}/par_err and data blocks.",
|
||||||
|
"-f, --file <fn> Specify a filename for collected data"
|
||||||
],
|
],
|
||||||
"usage": "hf mf isen [-hab] [--blk <dec>] [-c <dec>] [-k <hex>] [--blk2 <dec>] [--a2] [--b2] [--c2 <dec>] [--key2 <hex>] [-n <dec>] [--reset] [--hardreset] [--addread] [--addauth] [--incblk2] [--corruptnrar] [--corruptnrarparity] FM11RF08S specific options: [--collect_fm11rf08s] [--collect_fm11rf08s_with_data]"
|
"usage": "hf mf isen [-hab] [--blk <dec>] [-c <dec>] [-k <hex>] [--blk2 <dec>] [--a2] [--b2] [--c2 <dec>] [--key2 <hex>] [-n <dec>] [--reset] [--hardreset] [--addread] [--addauth] [--incblk2] [--corruptnrar] [--corruptnrarparity] FM11RF08S specific options: [--collect_fm11rf08s] [--collect_fm11rf08s_with_data] [-f <fn>]"
|
||||||
},
|
},
|
||||||
"hf mf mad": {
|
"hf mf mad": {
|
||||||
"command": "hf mf mad",
|
"command": "hf mf mad",
|
||||||
|
@ -9793,9 +9809,10 @@
|
||||||
"--nrar <hex> nonce / answer writer, 8 hex bytes",
|
"--nrar <hex> nonce / answer writer, 8 hex bytes",
|
||||||
"--crypto crypto mode",
|
"--crypto crypto mode",
|
||||||
"-k, --key <hex> pwd or key, 4 or 6 hex bytes",
|
"-k, --key <hex> pwd or key, 4 or 6 hex bytes",
|
||||||
"-p, --page <dec> page address to read from"
|
"-p, --page <dec> page address to read from",
|
||||||
|
"-c, --count <dec> how many pages to read. '0' reads all pages up to the end page (default: 1)"
|
||||||
],
|
],
|
||||||
"usage": "lf hitag hts rdbl [-h8] [--nrar <hex>] [--crypto] [-k <hex>] -p <dec>"
|
"usage": "lf hitag hts rdbl [-h8] [--nrar <hex>] [--crypto] [-k <hex>] [-p <dec>] [-c <dec>]"
|
||||||
},
|
},
|
||||||
"lf hitag hts reader": {
|
"lf hitag hts reader": {
|
||||||
"command": "lf hitag hts reader",
|
"command": "lf hitag hts reader",
|
||||||
|
@ -12954,8 +12971,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 747,
|
"commands_extracted": 748,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2024-10-04T07:43:15"
|
"extracted_on": "2024-10-12T11:55:26"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,7 @@ Check column "offline" for their availability.
|
||||||
|`hf 14b valid `|Y |`SRIX4 checksum test`
|
|`hf 14b valid `|Y |`SRIX4 checksum test`
|
||||||
|`hf 14b calypso `|N |`Read contents of a Calypso card`
|
|`hf 14b calypso `|N |`Read contents of a Calypso card`
|
||||||
|`hf 14b mobib `|N |`Read contents of a Mobib card`
|
|`hf 14b mobib `|N |`Read contents of a Mobib card`
|
||||||
|
|`hf 14b setuid `|N |`Set UID for magic card`
|
||||||
|
|
||||||
|
|
||||||
### hf 15
|
### hf 15
|
||||||
|
@ -1078,9 +1079,9 @@ Check column "offline" for their availability.
|
||||||
|`lf hitag hts help `|Y |`This help`
|
|`lf hitag hts help `|Y |`This help`
|
||||||
|`lf hitag hts list `|Y |`List Hitag S trace history`
|
|`lf hitag hts list `|Y |`List Hitag S trace history`
|
||||||
|`lf hitag hts reader `|N |`Act like a Hitag S reader`
|
|`lf hitag hts reader `|N |`Act like a Hitag S reader`
|
||||||
|`lf hitag hts rdbl `|N |`Read Hitag S memory`
|
|`lf hitag hts rdbl `|N |`Read Hitag S page`
|
||||||
|`lf hitag hts wrbl `|N |`Write Hitag S page`
|
|`lf hitag hts wrbl `|N |`Write Hitag S page`
|
||||||
|`lf hitag hts sim `|N |`Simulate Hitag transponder`
|
|`lf hitag hts sim `|N |`Simulate Hitag S transponder`
|
||||||
|
|
||||||
|
|
||||||
### lf idteck
|
### lf idteck
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue