style
This commit is contained in:
1 parent
9a114815d1
commit
4c97151ecc
9 files changed
+67
-67
No files matched your search
@@ -1960,8 +1960,8 @@ static int detect_nxp_card_print(uint8_t sak, uint16_t atqa, uint64_t select_sta
|
||||
|
||||
if (
|
||||
((atqa & 0x0001) == 0x0001) ||
|
||||
((atqa & 0x0004) == 0x0004)
|
||||
) {
|
||||
((atqa & 0x0004) == 0x0004)
|
||||
) {
|
||||
printTag("HID SEOS (smartmx / javacard)");
|
||||
type |= HID_SEOS;
|
||||
|
||||
@@ -2386,8 +2386,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||
if (
|
||||
(card.ats_len == 7 && memcmp(card.ats, "\x05\x78\x77\x80\x02\x9C\x3A", 7) == 0) ||
|
||||
(card.ats_len == 7 && memcmp(card.ats, "\x05\x78\x77\x94\x02\x6D\xC8", 7) == 0)
|
||||
)
|
||||
{
|
||||
) {
|
||||
isSEOS = true;
|
||||
isNTAG424 = false;
|
||||
isMifareDESFire = false;
|
||||
|
||||
@@ -2755,7 +2755,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
has_staticnonce = detect_classic_static_encrypted_nonce(0, MF_KEY_A, g_mifare_default_key);
|
||||
}
|
||||
|
||||
@@ -2768,9 +2768,9 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
|
||||
PrintAndLogEx(INFO, " keytype ....... " _YELLOW_("%c"), (keytype == MF_KEY_B) ? 'B' : 'A');
|
||||
PrintAndLogEx(INFO, " known key ..... " _YELLOW_("%s"), sprint_hex_inrow(key, sizeof(key)));
|
||||
|
||||
switch(has_staticnonce) {
|
||||
switch (has_staticnonce) {
|
||||
case NONCE_STATIC: {
|
||||
PrintAndLogEx(INFO, " card PRNG ..... " _YELLOW_("STATIC"));
|
||||
PrintAndLogEx(INFO, " card PRNG ..... " _YELLOW_("STATIC"));
|
||||
break;
|
||||
}
|
||||
case NONCE_STATIC_ENC: {
|
||||
@@ -2778,11 +2778,11 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
|
||||
break;
|
||||
}
|
||||
case NONCE_NORMAL: {
|
||||
PrintAndLogEx(INFO, " card PRNG ..... " _YELLOW_("%s"), prng_type ? "WEAK" : "HARD");
|
||||
PrintAndLogEx(INFO, " card PRNG ..... " _YELLOW_("%s"), prng_type ? "WEAK" : "HARD");
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
PrintAndLogEx(INFO, " card PRNG ..... " _YELLOW_("Could not determine PRNG,") " " _RED_("read failed."));
|
||||
PrintAndLogEx(INFO, " card PRNG ..... " _YELLOW_("Could not determine PRNG,") " " _RED_("read failed."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2956,9 +2956,9 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
|
||||
noValidKeyFound:
|
||||
PrintAndLogEx(FAILED, "No usable key was found!");
|
||||
if (use_flashmemory == false && fnlen == 0) {
|
||||
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("hf mf autopwn -f mfc_default_keys")"` i.e. the Randy special");
|
||||
PrintAndLogEx(HINT, "Hint: Try `" _YELLOW_("hf mf autopwn -f mfc_default_keys")"` i.e. the Randy special");
|
||||
}
|
||||
|
||||
|
||||
if (has_staticnonce == NONCE_STATIC_ENC) {
|
||||
PrintAndLogEx(HINT, "Hint: Static encrypted nonce detected, run `" _YELLOW_("script run fm11rf08s_recovery.py") "`");
|
||||
}
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ void SendCommandOLD(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, c
|
||||
PrintAndLogEx(WARNING, "Sending " _RED_("%zu") " bytes of payload is too much for OLD frames, abort", len);
|
||||
return;
|
||||
// return PM3_EOUTOFBOUND;
|
||||
}
|
||||
}
|
||||
|
||||
c.cmd = cmd;
|
||||
c.arg[0] = arg0;
|
||||
|
||||
@@ -2433,7 +2433,7 @@ int loadFileDICTIONARY_safe_ex(const char *preferredName, const char *suffix, vo
|
||||
fclose(f);
|
||||
|
||||
if (verbose) {
|
||||
PrintAndLogEx(SUCCESS, "Loaded " _GREEN_("%2d") " keys from dictionary file `" _YELLOW_("%s") "`", *keycnt, path);
|
||||
PrintAndLogEx(SUCCESS, "Loaded " _GREEN_("%d") " keys from dictionary file `" _YELLOW_("%s") "`", *keycnt, path);
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -262,12 +262,12 @@ int mf_check_keys_fast_ex(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastCh
|
||||
// send keychunk
|
||||
clearCommandBuffer();
|
||||
SendCommandOLD(CMD_HF_MIFARE_CHKKEYS_FAST
|
||||
, (sectorsCnt | (firstChunk << 8) | (lastChunk << 12) | (singleSectorParams << 16))
|
||||
, ((use_flashmemory << 8) | strategy)
|
||||
, size
|
||||
, keyBlock
|
||||
, (MIFARE_KEY_SIZE * size)
|
||||
);
|
||||
, (sectorsCnt | (firstChunk << 8) | (lastChunk << 12) | (singleSectorParams << 16))
|
||||
, ((use_flashmemory << 8) | strategy)
|
||||
, size
|
||||
, keyBlock
|
||||
, (MIFARE_KEY_SIZE * size)
|
||||
);
|
||||
PacketResponseNG resp;
|
||||
|
||||
uint32_t timeout = 0;
|
||||
@@ -382,8 +382,8 @@ int mf_check_keys_fast_ex(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastCh
|
||||
}
|
||||
|
||||
int mf_check_keys_fast(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk, uint8_t strategy
|
||||
, uint32_t size, uint8_t *keyBlock, sector_t *e_sector, bool use_flashmemory
|
||||
, bool verbose) {
|
||||
, uint32_t size, uint8_t *keyBlock, sector_t *e_sector, bool use_flashmemory
|
||||
, bool verbose) {
|
||||
return mf_check_keys_fast_ex(sectorsCnt, firstChunk, lastChunk, strategy, size, keyBlock, e_sector, use_flashmemory, verbose, false, 0);
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ int mf_check_keys_fast(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk
|
||||
int mf_check_keys_file(uint8_t *destfn, uint64_t *key) {
|
||||
|
||||
if (key) {
|
||||
*key = -1;
|
||||
*key = -1;
|
||||
}
|
||||
|
||||
struct {
|
||||
@@ -483,7 +483,7 @@ int mf_key_brute(uint8_t blockNo, uint8_t keyType, const uint8_t *key, uint64_t
|
||||
// progress
|
||||
if (counter % 20 == 0) {
|
||||
PrintAndLogEx(SUCCESS, "tried %s.. \t %u keys", sprint_hex(candidates + i, 6), counter * KEYS_IN_BLOCK);
|
||||
}
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
@@ -1190,10 +1190,10 @@ int mf_chinese_wipe(uint8_t *uid, const uint8_t *atqa, const uint8_t *sak, uint8
|
||||
res = mf_chinese_set_block(blockNo, blockK, NULL, params);
|
||||
} else {
|
||||
res = mf_chinese_set_block(blockNo, blockD, NULL, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (res == PM3_SUCCESS) {
|
||||
if (res == PM3_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1221,25 +1221,25 @@ int mf_chinese_set_block(uint8_t blockNo, uint8_t *data, uint8_t *uid, uint8_t p
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
uint8_t isOK = resp.oldarg[0] & 0xFF;
|
||||
if (uid != NULL) {
|
||||
memcpy(uid, resp.data.asBytes, 4);
|
||||
}
|
||||
uint8_t isOK = resp.oldarg[0] & 0xFF;
|
||||
if (uid != NULL) {
|
||||
memcpy(uid, resp.data.asBytes, 4);
|
||||
}
|
||||
|
||||
if (isOK == 0) {
|
||||
|
||||
uint8_t reason = (resp.oldarg[1] & 0xFF);
|
||||
if (reason == 4) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(WARNING, "GDM magic write signature block failed");
|
||||
} else if (reason == 5) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(WARNING, "Write block failed");
|
||||
}
|
||||
|
||||
return PM3_EUNDEF;
|
||||
uint8_t reason = (resp.oldarg[1] & 0xFF);
|
||||
if (reason == 4) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(WARNING, "GDM magic write signature block failed");
|
||||
} else if (reason == 5) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(WARNING, "Write block failed");
|
||||
}
|
||||
|
||||
return PM3_EUNDEF;
|
||||
}
|
||||
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1284,10 +1284,10 @@ int mf_chinese_gen_3_block(uint8_t *block, int blockLen, uint8_t *newBlock) {
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
|
||||
if (resp.status == PM3_SUCCESS && newBlock) {
|
||||
memcpy(newBlock, resp.data.asBytes, MFBLOCK_SIZE);
|
||||
}
|
||||
return resp.status;
|
||||
if (resp.status == PM3_SUCCESS && newBlock) {
|
||||
memcpy(newBlock, resp.data.asBytes, MFBLOCK_SIZE);
|
||||
}
|
||||
return resp.status;
|
||||
}
|
||||
|
||||
int mf_chinese_gen_3_freeze(void) {
|
||||
@@ -1446,7 +1446,7 @@ int detect_classic_nackbug(bool verbose) {
|
||||
default: {
|
||||
PrintAndLogEx(ERR, "errorcode from device " _RED_("[%i]"), ok);
|
||||
return PM3_EUNDEF;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1486,10 +1486,10 @@ returns:
|
||||
3 = has encrypted nonce
|
||||
*/
|
||||
int detect_classic_static_encrypted_nonce_ex(uint8_t block_no, uint8_t key_type, const uint8_t *key, uint8_t block_no_nested
|
||||
, uint8_t key_type_nested, const uint8_t *key_nested
|
||||
, uint8_t nr_nested, bool reset, bool hardreset
|
||||
, bool addread, bool addauth, bool incblk2
|
||||
, bool corruptnrar, bool corruptnrarparity, bool verbose) {
|
||||
, uint8_t key_type_nested, const uint8_t *key_nested
|
||||
, uint8_t nr_nested, bool reset, bool hardreset
|
||||
, bool addread, bool addauth, bool incblk2
|
||||
, bool corruptnrar, bool corruptnrarparity, bool verbose) {
|
||||
|
||||
uint8_t cdata[1 + 1 + MIFARE_KEY_SIZE + 1 + 1 + MIFARE_KEY_SIZE + 1 + 1 + 1 + 1 + 1 + 1 + 1] = { 0 };
|
||||
cdata[0] = block_no;
|
||||
|
||||
@@ -112,9 +112,9 @@ int detect_classic_nackbug(bool verbose);
|
||||
uint16_t detect_mf_magic(bool is_mfc, uint8_t key_type, uint64_t key);
|
||||
int detect_classic_static_nonce(void);
|
||||
int detect_classic_static_encrypted_nonce_ex(uint8_t block_no, uint8_t key_type, const uint8_t *key
|
||||
, uint8_t block_no_nested, uint8_t key_type_nested, const uint8_t *key_nested
|
||||
, uint8_t nr_nested, bool reset, bool hardreset, bool addread, bool addauth
|
||||
, bool incblk2, bool corruptnrar, bool corruptnrarparity, bool verbose);
|
||||
, uint8_t block_no_nested, uint8_t key_type_nested, const uint8_t *key_nested
|
||||
, uint8_t nr_nested, bool reset, bool hardreset, bool addread, bool addauth
|
||||
, bool incblk2, bool corruptnrar, bool corruptnrarparity, bool verbose);
|
||||
int detect_classic_static_encrypted_nonce(uint8_t block_no, uint8_t key_type, const uint8_t *key);
|
||||
bool detect_mfc_ev1_signature(void);
|
||||
int read_mfc_ev1_signature(uint8_t *signature);
|
||||
|
||||
Reference in new issue
Block a user