This commit is contained in:
iceman1001 committed 2022-11-20 16:47:49 +01:00
1 parent 7e114da30f
commit 317ddf42bc
7 files changed
+21 -21

No files matched your search

+2 -2
View File
@@ -1570,10 +1570,10 @@ void annotateMifare(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize,
// get UID
if (MifareAuthState == masNone) {
if (isResponse && cmdsize == 5 ) {
if (isResponse && cmdsize == 5) {
ClearAuthData();
AuthData.uid = bytes_to_num(&cmd[0], 4);
}
}
if (cmdsize == 9 && cmd[0] == ISO14443A_CMD_ANTICOLL_OR_SELECT && cmd[1] == 0x70) {
ClearAuthData();
AuthData.uid = bytes_to_num(&cmd[2], 4);
+5 -5
View File
@@ -1842,7 +1842,7 @@ static int CmdHF14AMfNestedHard(const char *Cmd) {
CLIParserInit(&ctx, "hf mf hardnested",
"Nested attack for hardened MIFARE Classic cards.\n"
"if card is EV1, command can detect and use known key see example below\n"
"\n"
" \n"
"`--i<X>` set type of SIMD instructions. Without this flag programs autodetect it.\n"
" or \n"
" hf mf hardnested -r --tk [known target key]\n"
@@ -7033,8 +7033,8 @@ static int CmdHF14AGen4Load(const char *cmd) {
if (blockno == start) flags |= MAGIC_INIT ;
if (blockno == end) flags |= MAGIC_OFF ;
int res=mfG4SetBlock(pwd, blockno, data + (blockno * MFBLOCK_SIZE), flags);
if ( res != PM3_SUCCESS) {
int res = mfG4SetBlock(pwd, blockno, data + (blockno * MFBLOCK_SIZE), flags);
if (res != PM3_SUCCESS) {
PrintAndLogEx(WARNING, "Can't set magic card block: %d. error=%d", blockno, res);
PrintAndLogEx(HINT, "Verify your card size, and try again or try another tag position");
free(data);
@@ -7195,10 +7195,10 @@ static int CmdHF14AGen4View(const char *Cmd) {
uint8_t flags = 0 ;
if (i == 0) flags |= MAGIC_INIT ;
if (i+1 == block_cnt) flags |= MAGIC_OFF ;
if (i + 1 == block_cnt) flags |= MAGIC_OFF ;
int res = mfG4GetBlock(pwd, i, dump + (i * MFBLOCK_SIZE), flags);
if ( res != PM3_SUCCESS) {
if (res != PM3_SUCCESS) {
PrintAndLogEx(WARNING, "Can't get magic card block: %u. error=%d", i, res);
PrintAndLogEx(HINT, "Verify your card size, and try again or try another tag position");
free(dump);
+2 -2
View File
@@ -2251,7 +2251,7 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc
update_reduction_rate(0.0, true);
int res = simulate_acquire_nonces();
if ( res != PM3_SUCCESS) {
if (res != PM3_SUCCESS) {
return res;
}
@@ -2356,7 +2356,7 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc
init_nonce_memory();
update_reduction_rate(0.0, true);
int res;
int res;
if (nonce_file_read) { // use pre-acquired data from file nonces.bin
res = read_nonce_file(filename);
if (res != PM3_SUCCESS) {
+1 -1
View File
@@ -76,7 +76,7 @@ static const uint8_t g_mifare_default_key[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0x
static const uint8_t g_mifare_mad_key[] = {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5};
static const uint8_t g_mifare_mad_key_b[] = {0x89, 0xEC, 0xA9, 0x7F, 0x8C, 0x2A};
// 16 key B D01AFEEB890A
// 16 key B D01AFEEB890A
static const uint8_t g_mifare_signature_key_a[] = {0x5C, 0x8F, 0xF9, 0x99, 0x0D, 0xA2};
static const uint8_t g_mifare_signature_key_b[] = {0x4b, 0x79, 0x1b, 0xea, 0x7b, 0xcc};
+1 -1
View File
@@ -1425,7 +1425,7 @@ int detect_mf_magic(bool is_mfc) {
bool detect_mfc_ev1_signature(void) {
uint64_t key = 0;
int res = mfCheckKeys(69, MF_KEY_B, false, 1, (uint8_t*)g_mifare_signature_key_b, &key);
int res = mfCheckKeys(69, MF_KEY_B, false, 1, (uint8_t *)g_mifare_signature_key_b, &key);
return (res == PM3_SUCCESS);
}