style
This commit is contained in:
1 parent
dc7649241a
commit
8293b81217
9 files changed
+57
-38
No files matched your search
@@ -24,7 +24,7 @@ p = pm3.pm3()
|
||||
for bk in BACKDOOR_KEYS:
|
||||
p.console(f"hf mf rdbl -c 4 --blk 0 --key {bk}")
|
||||
output = p.grabbed_output.split('\n')
|
||||
|
||||
|
||||
if "auth error" in output[0].lower():
|
||||
continue
|
||||
elif "can't select card" in output[0].lower():
|
||||
@@ -37,7 +37,7 @@ for bk in BACKDOOR_KEYS:
|
||||
else:
|
||||
WORKING_KEY = bk
|
||||
break
|
||||
|
||||
|
||||
if not WORKING_KEY:
|
||||
print("None of the backdoor keys seem to work with this tag.")
|
||||
exit()
|
||||
@@ -52,7 +52,7 @@ header = False
|
||||
# Read every sector
|
||||
for i in range(TOTAL_SECTORS):
|
||||
p.console(f"hf mf rdsc -c 4 --key {WORKING_KEY} -s {i}")
|
||||
|
||||
|
||||
start = False
|
||||
for line in p.grabbed_output.split('\n'):
|
||||
if not header:
|
||||
@@ -60,11 +60,11 @@ for i in range(TOTAL_SECTORS):
|
||||
elif start and len(line) > 0:
|
||||
print(line)
|
||||
continue
|
||||
|
||||
|
||||
if "----------" in line:
|
||||
start = True
|
||||
header = True
|
||||
continue
|
||||
else:
|
||||
continue
|
||||
|
||||
|
||||
@@ -465,10 +465,10 @@ static int print_atqb_resp(uint8_t *data, uint8_t cid) {
|
||||
PrintAndLogEx(SUCCESS, "Tag :");
|
||||
PrintAndLogEx(SUCCESS, " Max Buf Length: %u (MBLI) %s", cid >> 4, (cid & 0xF0) ? "" : "chained frames not supported");
|
||||
PrintAndLogEx(SUCCESS, " CID : %u", cid & 0x0f);
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
|
||||
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;
|
||||
uint8_t out[PM3_CMD_DATA_SIZE] = {0};
|
||||
@@ -479,7 +479,7 @@ static int print_atqb_resp(uint8_t *data, uint8_t cid) {
|
||||
} else {
|
||||
PrintAndLogEx(SUCCESS, "Tiananxin TCOS CPU card... " _RED_("n/a"));
|
||||
}
|
||||
PrintAndLogEx(SUCCESS, "Magic capabilities........ most likely");
|
||||
PrintAndLogEx(SUCCESS, "Magic capabilities........ most likely");
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -2935,8 +2935,8 @@ static int CmdHF14BSetUID(const char *Cmd) {
|
||||
return switch_off_field_14b();
|
||||
}
|
||||
|
||||
iso14b_card_select_t *card = (iso14b_card_select_t*)select;
|
||||
if (memcmp(card->atqb, "\x54\x43\x4F\x53", 4) ) {
|
||||
iso14b_card_select_t *card = (iso14b_card_select_t *)select;
|
||||
if (memcmp(card->atqb, "\x54\x43\x4F\x53", 4)) {
|
||||
PrintAndLogEx(FAILED, "None supported tag");
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
return switch_off_field_14b();
|
||||
|
||||
@@ -529,7 +529,7 @@ static int CmdEM410xBrute(const char *Cmd) {
|
||||
// load keys
|
||||
uint8_t *uidblock = NULL;
|
||||
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) {
|
||||
free(uidblock);
|
||||
return res;
|
||||
|
||||
+14
-14
@@ -210,8 +210,8 @@ static void print_error(int8_t reason) {
|
||||
PrintAndLogEx(FAILED, "Write to page failed!");
|
||||
break;
|
||||
default:
|
||||
// PM3_REASON_UNKNOWN
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Hitag S failed");
|
||||
// PM3_REASON_UNKNOWN
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Hitag S failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ static int CmdLFHitagSRead(const char *Cmd) {
|
||||
PrintAndLogEx(INFO, "---+-------------+-------");
|
||||
|
||||
const int hts_mem_sizes[] = {1, 8, 64, 64};
|
||||
|
||||
|
||||
if (count == 0) {
|
||||
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, " 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",
|
||||
(const char *[]) {
|
||||
@@ -467,16 +467,16 @@ void hitags_config_print(hitags_config_t config) {
|
||||
}[config.TTFDR]);
|
||||
|
||||
PrintAndLogEx(INFO, " TTF mode......... %s",
|
||||
(const char *[]){
|
||||
"TTF Mode disabled (= RTF Mode)",
|
||||
"Page 4, Page 5",
|
||||
"Page 4, Page 5, Page 6, Page 7",
|
||||
"Page 4",
|
||||
"TTF Mode disabled (= RTF Mode)",
|
||||
"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 9, Page 10, Page 11",
|
||||
}[config.RES0 << 2 | config.TTFM]);
|
||||
(const char *[]) {
|
||||
"TTF Mode disabled (= RTF Mode)",
|
||||
"Page 4, Page 5",
|
||||
"Page 4, Page 5, Page 6, Page 7",
|
||||
"Page 4",
|
||||
"TTF Mode disabled (= RTF Mode)",
|
||||
"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 9, Page 10, Page 11",
|
||||
}[config.RES0 << 2 | config.TTFM]);
|
||||
|
||||
PrintAndLogEx(INFO, " Config locked.... %s", config.LCON ? _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)) {
|
||||
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) {
|
||||
JsonSaveStr(root, "FileType", "fm11rf08s_nonces_with_data");
|
||||
} 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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -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_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);
|
||||
|
||||
|
||||
@@ -176,6 +176,7 @@ const static vocabulary_t vocabulary[] = {
|
||||
{ 1, "hf 14b valid" },
|
||||
{ 0, "hf 14b calypso" },
|
||||
{ 0, "hf 14b mobib" },
|
||||
{ 0, "hf 14b setuid" },
|
||||
{ 1, "hf 15 help" },
|
||||
{ 1, "hf 15 list" },
|
||||
{ 1, "hf 15 demod" },
|
||||
|
||||
Reference in new issue
Block a user