mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-08-28 00:54:25 +00:00
make style
This commit is contained in:
+5
-5
@@ -312,7 +312,7 @@ static const felica_sim_node_record_t *felica_sim_find_node(const felica_sim_mod
|
||||
}
|
||||
|
||||
static const felica_sim_block_record_t *felica_sim_find_block(const felica_sim_model_header_t *hdr, const uint8_t *model,
|
||||
const felica_sim_node_record_t *node, uint16_t block_number) {
|
||||
const felica_sim_node_record_t *node, uint16_t block_number) {
|
||||
const felica_sim_block_record_t *blocks = felica_sim_blocks(hdr, model);
|
||||
const uint16_t end = node->first_block + node->block_count;
|
||||
for (uint16_t i = node->first_block; i < end; i++) {
|
||||
@@ -467,8 +467,8 @@ static uint16_t felica_sim_process_reset_mode(const uint8_t *req, uint16_t req_l
|
||||
}
|
||||
|
||||
static uint16_t felica_sim_process_request_specification_version(const felica_sim_model_header_t *hdr, const uint8_t *model,
|
||||
const uint8_t *req, uint16_t req_len,
|
||||
const felica_sim_system_record_t *active_system, uint8_t *resp) {
|
||||
const uint8_t *req, uint16_t req_len,
|
||||
const felica_sim_system_record_t *active_system, uint8_t *resp) {
|
||||
const uint8_t *specification_version = felica_sim_specification_version_data(hdr, model);
|
||||
if (specification_version == NULL ||
|
||||
req_len != 12 ||
|
||||
@@ -508,8 +508,8 @@ static uint16_t felica_sim_process_get_product_information(const felica_sim_mode
|
||||
}
|
||||
|
||||
static uint16_t felica_sim_process_get_container_issue_information(const felica_sim_model_header_t *hdr, const uint8_t *model,
|
||||
const uint8_t *req, uint16_t req_len,
|
||||
const felica_sim_system_record_t *active_system, uint8_t *resp) {
|
||||
const uint8_t *req, uint16_t req_len,
|
||||
const felica_sim_system_record_t *active_system, uint8_t *resp) {
|
||||
const uint8_t *container_issue_information = felica_sim_container_issue_information_data(hdr, model);
|
||||
if (container_issue_information == NULL ||
|
||||
req_len != 12 ||
|
||||
|
||||
+14
-11
@@ -1302,9 +1302,9 @@ static int reader_single_tag(bool fast, bool loop, uint8_t *afi_buf, int afi_len
|
||||
uint16_t raw_len = 0;
|
||||
|
||||
raw_cmd[raw_len] = ISO15_REQ_SUBCARRIER_SINGLE
|
||||
| ISO15_REQ_DATARATE_HIGH
|
||||
| ISO15_REQ_INVENTORY
|
||||
| ISO15_REQINV_SLOT1;
|
||||
| ISO15_REQ_DATARATE_HIGH
|
||||
| ISO15_REQ_INVENTORY
|
||||
| ISO15_REQINV_SLOT1;
|
||||
if (afi_len > 0)
|
||||
raw_cmd[raw_len] |= ISO15_REQINV_AFI;
|
||||
raw_len++;
|
||||
@@ -1374,9 +1374,12 @@ static void iso15_render_presence_table(const iso15_seen_tag_t *seen, int n,
|
||||
const char *c_off = g_session.supports_colors ? "\x1b[0m" : "";
|
||||
|
||||
int lines = 0;
|
||||
printf("hf 15 --all present %d / %d " _GREEN_("<Enter>") " to exit", present, n); lines++;
|
||||
printf("\n%3s %-25s %-5s %s", "#", "UID", "DSFID", "status"); lines++;
|
||||
printf("\n%3s %-25s %-5s %s", "---", "-------------------------", "-----", "----------------"); lines++;
|
||||
printf("hf 15 --all present %d / %d " _GREEN_("<Enter>") " to exit", present, n);
|
||||
lines++;
|
||||
printf("\n%3s %-25s %-5s %s", "#", "UID", "DSFID", "status");
|
||||
lines++;
|
||||
printf("\n%3s %-25s %-5s %s", "---", "-------------------------", "-----", "----------------");
|
||||
lines++;
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (seen[i].present) {
|
||||
printf("\n%3d %-25s %02X %spresent%s",
|
||||
@@ -1400,9 +1403,9 @@ static int reader_inventory_all(bool fast, bool loop, uint8_t *afi_buf, int afi_
|
||||
uint8_t mask_len; // in bits
|
||||
} inventory_work_item_t;
|
||||
|
||||
#define MAX_WORK_ITEMS 256
|
||||
#define MAX_FOUND_TAGS 64
|
||||
#define MAX_SEEN_TAGS 128
|
||||
#define MAX_WORK_ITEMS 256
|
||||
#define MAX_FOUND_TAGS 64
|
||||
#define MAX_SEEN_TAGS 128
|
||||
|
||||
// Persistent across scans in continuous (-@) mode: every UID seen this session.
|
||||
iso15_seen_tag_t seen[MAX_SEEN_TAGS];
|
||||
@@ -1433,8 +1436,8 @@ static int reader_inventory_all(bool fast, bool loop, uint8_t *afi_buf, int afi_
|
||||
uint16_t raw_len = 0;
|
||||
|
||||
raw_cmd[raw_len] = ISO15_REQ_SUBCARRIER_SINGLE
|
||||
| ISO15_REQ_DATARATE_HIGH
|
||||
| ISO15_REQ_INVENTORY;
|
||||
| ISO15_REQ_DATARATE_HIGH
|
||||
| ISO15_REQ_INVENTORY;
|
||||
// 16-slot: do NOT set ISO15_REQINV_SLOT1
|
||||
if (afi_len > 0)
|
||||
raw_cmd[raw_len] |= ISO15_REQINV_AFI;
|
||||
|
||||
+11
-11
@@ -1251,7 +1251,7 @@ static int felica_request_service_key_versions(uint8_t flags, const uint8_t *idm
|
||||
uint8_t data[1 + 1 + 8 + 1 + (FELICA_REQUEST_SERVICE_DISCOVERY_BATCH_SIZE * 2)] = {0};
|
||||
uint16_t datalen = 0;
|
||||
int ret = felica_build_request_service_payload(FELICA_REQSRV_REQ, idm, node_codes_le, node_count,
|
||||
data, sizeof(data), &datalen);
|
||||
data, sizeof(data), &datalen);
|
||||
if (ret != PM3_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
@@ -1306,7 +1306,7 @@ static int felica_request_service_v2_key_versions(uint8_t flags, const uint8_t *
|
||||
uint8_t data[1 + 1 + 8 + 1 + (FELICA_REQUEST_SERVICE_DISCOVERY_BATCH_SIZE * 2)] = {0};
|
||||
uint16_t datalen = 0;
|
||||
int ret = felica_build_request_service_payload(FELICA_REQSRV2_REQ, idm, node_codes_le, node_count,
|
||||
data, sizeof(data), &datalen);
|
||||
data, sizeof(data), &datalen);
|
||||
if (ret != PM3_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
@@ -1357,14 +1357,14 @@ static int felica_request_service_v2_key_versions(uint8_t flags, const uint8_t *
|
||||
|
||||
for (size_t i = 0; i < returned_nodes; i++) {
|
||||
key_versions_out->aes_key_versions_le[i] = (uint16_t)resp.data.asBytes[offset + i * 2] |
|
||||
((uint16_t)resp.data.asBytes[offset + i * 2 + 1] << 8);
|
||||
((uint16_t)resp.data.asBytes[offset + i * 2 + 1] << 8);
|
||||
}
|
||||
offset += aes_bytes;
|
||||
|
||||
if (has_des_key_versions) {
|
||||
for (size_t i = 0; i < returned_nodes; i++) {
|
||||
key_versions_out->des_key_versions_le[i] = (uint16_t)resp.data.asBytes[offset + i * 2] |
|
||||
((uint16_t)resp.data.asBytes[offset + i * 2 + 1] << 8);
|
||||
((uint16_t)resp.data.asBytes[offset + i * 2 + 1] << 8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3564,7 +3564,7 @@ static bool felica_discover_nodes_with_read_without_encryption(uint8_t *flags,
|
||||
uint32_t *discovered_count,
|
||||
int *stop_status) {
|
||||
return felica_discover_nodes_with_read_without_encryption_ex(flags, idm, retry_count, NULL,
|
||||
visitor, ctx, discovered_count, stop_status);
|
||||
visitor, ctx, discovered_count, stop_status);
|
||||
}
|
||||
|
||||
static const char *felica_node_discovery_method_cli_name(felica_node_discovery_method_t method) {
|
||||
@@ -3629,7 +3629,7 @@ static int felica_discover_nodes(const uint8_t *idm,
|
||||
bool discovered = false;
|
||||
if (info->method == FELICA_NODE_DISCOVERY_READ_WITHOUT_ENCRYPTION) {
|
||||
discovered = felica_discover_nodes_with_read_without_encryption_ex(flags, idm, retry_count, pmm,
|
||||
visitor, ctx, &discovered_count, &stop_status);
|
||||
visitor, ctx, &discovered_count, &stop_status);
|
||||
} else {
|
||||
discovered = info->run(flags, idm, retry_count, visitor, ctx, &discovered_count, &stop_status);
|
||||
}
|
||||
@@ -4291,7 +4291,7 @@ static int felica_dump_collect_key_versions_v2(felica_dump_system_t *system, uin
|
||||
|
||||
felica_request_service_v2_key_versions_t versions;
|
||||
int ret = felica_request_service_v2_key_versions(flags, system->idm, batch_codes, batch_count,
|
||||
retry_count, &versions);
|
||||
retry_count, &versions);
|
||||
if (ret != PM3_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
@@ -4336,7 +4336,7 @@ static int felica_dump_collect_key_versions_v1(felica_dump_system_t *system, uin
|
||||
|
||||
size_t returned_nodes = 0;
|
||||
int ret = felica_request_service_key_versions(flags, system->idm, batch_codes, batch_count,
|
||||
retry_count, key_versions, &returned_nodes);
|
||||
retry_count, key_versions, &returned_nodes);
|
||||
if (ret != PM3_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
@@ -4772,7 +4772,7 @@ static int CmdHFFelicaAuthentication1(const char *Cmd) {
|
||||
PrintAndLogEx(ERR, "response code does not match");
|
||||
return PM3_ERFTRANS;
|
||||
}
|
||||
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Auth1 response:");
|
||||
PrintAndLogEx(SUCCESS, "IDm... %s", sprint_hex(auth1_response.frame_response.IDm, sizeof(auth1_response.frame_response.IDm)));
|
||||
PrintAndLogEx(SUCCESS, "M2C... %s", sprint_hex(auth1_response.m2c, sizeof(auth1_response.m2c)));
|
||||
@@ -5646,7 +5646,7 @@ static int CmdHFFelicaDump(const char *Cmd) {
|
||||
uint32_t public_service_count = 0;
|
||||
felica_dump_system_t *dump_system = &dump_systems[dump_system_count];
|
||||
const int ret = felica_dump_single_system(&discovered_systems.systems[i], dump_system,
|
||||
retry_count, &discovered_nodes, &service_count, &public_service_count);
|
||||
retry_count, &discovered_nodes, &service_count, &public_service_count);
|
||||
|
||||
if (ret == PM3_EOPABORTED) {
|
||||
DropField();
|
||||
@@ -6840,7 +6840,7 @@ static int CmdHFFelicaSim(const char *Cmd) {
|
||||
arg_param_begin,
|
||||
arg_str1("f", "file", "<fn>", "JSON dump file"),
|
||||
arg_str0(NULL, "read-without-encryption-error-location-indication",
|
||||
"<mask|index|flag>", "Read Without Encryption error location indication (default: mask)"),
|
||||
"<mask|index|flag>", "Read Without Encryption error location indication (default: mask)"),
|
||||
arg_lit0("v", "verbose", "verbose output"),
|
||||
arg_param_end
|
||||
};
|
||||
|
||||
@@ -8564,7 +8564,7 @@ static int CmdHF14AMfView(const char *Cmd) {
|
||||
}
|
||||
|
||||
const mad1_sector_t *vigik_s0 = (bytes_read >= sizeof(mad1_sector_t))
|
||||
? (const mad1_sector_t *)dump : NULL;
|
||||
? (const mad1_sector_t *)dump : NULL;
|
||||
|
||||
int sector = vigik_s0 ? DetectHID(vigik_s0, 0x4910) : -1;
|
||||
if (sector > -1) {
|
||||
|
||||
+28
-27
@@ -845,9 +845,9 @@ int mfp_data_crypt(mf4Session_t *mf4session, uint8_t *dati, uint8_t *dato, bool
|
||||
}
|
||||
|
||||
if (rev) {
|
||||
aes_decode(IV, kenc, dati, dato, MFBLOCK_SIZE*bc);
|
||||
aes_decode(IV, kenc, dati, dato, MFBLOCK_SIZE * bc);
|
||||
} else {
|
||||
aes_encode(IV, kenc, dati, dato, MFBLOCK_SIZE*bc);
|
||||
aes_encode(IV, kenc, dati, dato, MFBLOCK_SIZE * bc);
|
||||
}
|
||||
|
||||
return PM3_SUCCESS;
|
||||
@@ -2245,10 +2245,10 @@ static int CmdHFMFPDump(const char *Cmd) {
|
||||
int STRead;
|
||||
uint8_t mac[8] = {0};
|
||||
chunkCycle:
|
||||
ki_pA[1] = sl3Count*2;
|
||||
ki_pA[1] = sl3Count * 2;
|
||||
MifareAuth4(&_session, ki_pA, &aesFoundKeys[MF_KEY_A][sl3Count][1], nonfirst, !nonfirst, true, true, verbose, false);
|
||||
nonfirst = true;
|
||||
MFPReadBlock(&_session, false, false, true, 3+sl3Count*4, 1, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
MFPReadBlock(&_session, false, false, true, 3 + sl3Count * 4, 1, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
if (STRead && STBuffer[0] != 0x90) {
|
||||
PrintAndLogEx(ERR, "\nTrailer read error: %02x %s", STBuffer[0], mfpGetErrorDescription(STBuffer[0]));
|
||||
goto chunkBlank;
|
||||
@@ -2258,17 +2258,17 @@ chunkCycle:
|
||||
}
|
||||
mfp_data_crypt(&_session, &STBuffer[1], &STBuffer[1], true, 1);
|
||||
// Multiblock reads do not allow reading out STs, as such this is the time to save them into the final dump
|
||||
memcpy(carddata + ((3+4*sl3Count) * MFBLOCK_SIZE), &STBuffer[1], 1 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((3 + 4 * sl3Count) * MFBLOCK_SIZE), &STBuffer[1], 1 * MFBLOCK_SIZE);
|
||||
// Check if any block is encrypted only
|
||||
ki_pB[1] = 0x01+sl3Count*2;
|
||||
ki_pB[1] = 0x01+sl3Count * 2;
|
||||
MifareAuth4(&_session, ki_pB, &aesFoundKeys[MF_KEY_B][sl3Count][1], true, false, true, true, verbose, false);
|
||||
if (STBuffer[6] & 0xF0) { // At least one bit is set to force enc. only
|
||||
MFPReadBlock(&_session, false, false, true, sl3Count*4, 3, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
MFPReadBlock(&_session, false, false, true, sl3Count * 4, 3, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
if (STRead && STBuffer[0] != 0x90) {
|
||||
chunkBlank:
|
||||
PrintAndLogEx(ERR, "\nChunk read error: %02x %s", STBuffer[0], mfpGetErrorDescription(STBuffer[0]));
|
||||
memcpy(carddata + (sl3Count * 4 * MFBLOCK_SIZE), nullChunk, 3 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((3+4*sl3Count) * MFBLOCK_SIZE), nullBlock, 1 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((3 + 4 * sl3Count) * MFBLOCK_SIZE), nullBlock, 1 * MFBLOCK_SIZE);
|
||||
PrintAndLogEx(WARNING, "Quick-reading sector %3d / %3d ( " _RED_("fail") " )", sl3Count, numSectors - 1);
|
||||
// Restart auth since a read failure resets it
|
||||
nonfirst = false;
|
||||
@@ -2286,7 +2286,7 @@ chunkBlank:
|
||||
sectorsRead++;
|
||||
sl3Count++;
|
||||
} else {
|
||||
MFPReadBlock(&_session, true, false, true, sl3Count*4, 3, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
MFPReadBlock(&_session, true, false, true, sl3Count * 4, 3, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
if (STRead && STBuffer[0] != 0x90) {
|
||||
PrintAndLogEx(ERR, "Chunk read error: %02x %s", STBuffer[0], mfpGetErrorDescription(STBuffer[0]));
|
||||
memcpy(carddata + (sl3Count * 4 * MFBLOCK_SIZE), nullChunk, 3 * MFBLOCK_SIZE);
|
||||
@@ -2309,12 +2309,12 @@ chunkCycleClean:
|
||||
|
||||
|
||||
|
||||
if (numSectors>32){
|
||||
if (numSectors > 32) {
|
||||
chunkCycle2:
|
||||
ki_pA[1] = sl3Count*2;
|
||||
ki_pA[1] = sl3Count * 2;
|
||||
MifareAuth4(&_session, ki_pA, &aesFoundKeys[MF_KEY_A][sl3Count][1], nonfirst, !nonfirst, true, true, verbose, false);
|
||||
nonfirst = true;
|
||||
MFPReadBlock(&_session, false, false, true, 128+(sl3Count-31)*16-1, 1, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
MFPReadBlock(&_session, false, false, true, 128 + (sl3Count - 31) * 16 - 1, 1, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
if (STRead && STBuffer[0] != 0x90) {
|
||||
PrintAndLogEx(ERR, "Trailer read error: %02x %s", STBuffer[0], mfpGetErrorDescription(STBuffer[0]));
|
||||
goto chunkBlank2;
|
||||
@@ -2325,22 +2325,23 @@ chunkCycle2:
|
||||
}
|
||||
mfp_data_crypt(&_session, &STBuffer[1], &STBuffer[1], true, 1);
|
||||
// Multiblock reads do not allow reading out STs, as such this is the time to save them into the final dump
|
||||
memcpy(carddata + ((128+(sl3Count-31)*16-1) * MFBLOCK_SIZE), &STBuffer[1], 1 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((128 + (sl3Count - 31) * 16 - 1) * MFBLOCK_SIZE), &STBuffer[1], 1 * MFBLOCK_SIZE);
|
||||
int c = 0;
|
||||
// Check if any block is encrypted only
|
||||
ki_pB[1] = 0x01+sl3Count*2;
|
||||
ki_pB[1] = 0x01+sl3Count * 2;
|
||||
MifareAuth4(&_session, ki_pB, &aesFoundKeys[MF_KEY_B][sl3Count][1], true, false, true, true, verbose, false);
|
||||
if (STBuffer[6] & 0xF0) { // At least one bit is set to force enc. only
|
||||
chunkBlank2: // Jumping here will start the cycle which will blank out the remaining 5 chunks anyway
|
||||
for (c=0; c<5; ++c) {
|
||||
MFPReadBlock(&_session, false, false, true, 128+(sl3Count-32)*16+c*3, 3, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
for (c = 0; c < 5; ++c) {
|
||||
MFPReadBlock(&_session, false, false, true, 128 + (sl3Count - 32) * 16 + c * 3, 3, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
if (STRead && STBuffer[0] != 0x90) {
|
||||
PrintAndLogEx(ERR, "Chunk read error: %02x %s", STBuffer[0], mfpGetErrorDescription(STBuffer[0]));
|
||||
PrintAndLogEx(WARNING, "Quick-reading sector %3d / %3d chunk %d ( " _RED_("fail") " )", sl3Count, numSectors - 1, c);
|
||||
memcpy(carddata + ((128+(sl3Count-31)*16-1) * MFBLOCK_SIZE), nullBlock, 1 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((128 + 16*(sl3Count-32)+c*3) * MFBLOCK_SIZE), nullChunk, 3 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((128 + (sl3Count - 31) * 16 - 1) * MFBLOCK_SIZE), nullBlock, 1 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((128 + 16 * (sl3Count - 32) + c * 3) * MFBLOCK_SIZE), nullChunk, 3 * MFBLOCK_SIZE);
|
||||
nonfirst = false;
|
||||
if (c<5) {continue;} else {sl3Count++; goto chunkCycleClean2;};
|
||||
if (c < 5) {continue;}
|
||||
else {sl3Count++; goto chunkCycleClean2;};
|
||||
}
|
||||
if (STRead != 1 + 48 + 2) {
|
||||
PrintAndLogEx(ERR, "Error return length: %d", STRead);
|
||||
@@ -2349,16 +2350,16 @@ chunkBlank2: // Jumping here will start the cycle which will blank out the remai
|
||||
}
|
||||
mfp_data_crypt(&_session, &STBuffer[1], &STBuffer[1], true, 3);
|
||||
PrintAndLogEx(INPLACE, "Quick-reading sector %3d / %3d ( " _GREEN_("ok") " )", sl3Count, numSectors - 1);
|
||||
memcpy(carddata + ((128 + 16*(sl3Count-32)+c*3) * MFBLOCK_SIZE), &STBuffer[1], 3 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((128 + 16 * (sl3Count - 32) + c * 3) * MFBLOCK_SIZE), &STBuffer[1], 3 * MFBLOCK_SIZE);
|
||||
}
|
||||
sectorsRead++;
|
||||
sl3Count++;
|
||||
} else {
|
||||
for (c=0; c<5; ++c) {
|
||||
MFPReadBlock(&_session, true, false, true, 128+(sl3Count-32)*16+c*3, 3, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
for (c = 0; c < 5; ++c) {
|
||||
MFPReadBlock(&_session, true, false, true, 128 + (sl3Count - 32) * 16 + c * 3, 3, false, true, STBuffer, sizeof(STBuffer), &STRead, mac);
|
||||
if (STRead && STBuffer[0] != 0x90) {
|
||||
PrintAndLogEx(ERR, "Chunk read error: %02x %s", STBuffer[0], mfpGetErrorDescription(STBuffer[0]));
|
||||
memcpy(carddata + ((128 + 16*(sl3Count-32)+c*3) * MFBLOCK_SIZE), nullChunk, 3 * MFBLOCK_SIZE);
|
||||
memcpy(carddata + ((128 + 16 * (sl3Count - 32) + c * 3) * MFBLOCK_SIZE), nullChunk, 3 * MFBLOCK_SIZE);
|
||||
PrintAndLogEx(WARNING, "Quick-reading sector %3d / %3d ( " _RED_("fail") " )", sl3Count, numSectors - 1);
|
||||
continue;
|
||||
}
|
||||
@@ -2368,8 +2369,8 @@ chunkBlank2: // Jumping here will start the cycle which will blank out the remai
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
PrintAndLogEx(INPLACE, "Quick-reading sector %3d / %3d ( " _GREEN_("ok") " )", sl3Count, numSectors - 1);
|
||||
memcpy(carddata + ((128 + 16*(sl3Count-32)+c*3) * MFBLOCK_SIZE), &STBuffer[1], 3 * MFBLOCK_SIZE);
|
||||
|
||||
memcpy(carddata + ((128 + 16 * (sl3Count - 32) + c * 3) * MFBLOCK_SIZE), &STBuffer[1], 3 * MFBLOCK_SIZE);
|
||||
|
||||
}
|
||||
sectorsRead++;
|
||||
sl3Count++;
|
||||
@@ -2446,7 +2447,7 @@ chunkCycleClean2:
|
||||
|
||||
DropField();
|
||||
t1 = msclock() - t1;
|
||||
|
||||
|
||||
// ========================================
|
||||
// Print sector summary
|
||||
// ========================================
|
||||
@@ -2547,7 +2548,7 @@ chunkCycleClean2:
|
||||
PrintAndLogEx(HINT, "Partial dump: %d of %d sectors read", sectorsRead, numSectors);
|
||||
PrintAndLogEx(HINT, "Hint: Try " _YELLOW_("`hf mfp chk --dump`") " and/or " _YELLOW_("`hf mf chk`") " to find more keys");
|
||||
}
|
||||
|
||||
|
||||
PrintAndLogEx(INFO, "\ntime in dump " _YELLOW_("%.0f") " seconds\n", (float)t1 / 1000.0);
|
||||
free(carddata);
|
||||
return PM3_SUCCESS;
|
||||
|
||||
@@ -458,7 +458,7 @@ static int CmdCOTAGReader(const char *Cmd) {
|
||||
CLIParserInit(&ctx, "lf cotag reader",
|
||||
"Read a COTAG tag.\n"
|
||||
" - use " _YELLOW_("`lf config`") _CYAN_(" to set parameters except divisor "
|
||||
"(which is assumed " STR(LF_COTAG_DIVISOR) " for cotag. Use --divisor to override).\n")
|
||||
"(which is assumed " STR(LF_COTAG_DIVISOR) " for cotag. Use --divisor to override).\n")
|
||||
_CYAN_(" - use ") _YELLOW_("`data plot`") _CYAN_(" to look at it.\n")
|
||||
_CYAN_(" - use ") _YELLOW_("`lf cotag demod`") _CYAN_(" to try to demodulate it.\n")
|
||||
_CYAN_("If the number of samples is more than the device memory limit (40000 now), ")
|
||||
|
||||
@@ -98,7 +98,9 @@ static uint8_t g_mock_card[MOCK_CARD_SIZE];
|
||||
|
||||
static int mock_read_sector(uint8_t sector_no, uint8_t key_type,
|
||||
const uint8_t *key, uint8_t *buf, bool verbose) {
|
||||
(void)key_type; (void)key; (void)verbose;
|
||||
(void)key_type;
|
||||
(void)key;
|
||||
(void)verbose;
|
||||
uint8_t first_block = mfFirstBlockOfSector(sector_no);
|
||||
uint8_t nblocks = mfNumBlocksPerSector(sector_no);
|
||||
uint32_t offset = first_block * 16;
|
||||
@@ -111,7 +113,9 @@ static int mock_read_sector(uint8_t sector_no, uint8_t key_type,
|
||||
|
||||
static int mock_write_sector_data(uint8_t sector_no, uint8_t key_type,
|
||||
const uint8_t *key, const uint8_t *data, bool verbose) {
|
||||
(void)key_type; (void)key; (void)verbose;
|
||||
(void)key_type;
|
||||
(void)key;
|
||||
(void)verbose;
|
||||
uint8_t first_block = mfFirstBlockOfSector(sector_no);
|
||||
uint8_t ndata = mfNumBlocksPerSector(sector_no) - 1;
|
||||
uint32_t offset = first_block * 16;
|
||||
|
||||
@@ -224,7 +224,8 @@ int MifareAuth4(mf4Session_t *mf4session, const uint8_t *keyn, uint8_t *key, boo
|
||||
}
|
||||
|
||||
uint8_t cmd1[4];
|
||||
if (nonfirst) { cmd1[0] = 0x76; cmd1[1] = keyn[1]; cmd1[2] = keyn[0]; } else { cmd1[0] = 0x70; cmd1[1] = keyn[1]; cmd1[2] = keyn[0]; cmd1[3] = 0x00; }
|
||||
if (nonfirst) { cmd1[0] = 0x76; cmd1[1] = keyn[1]; cmd1[2] = keyn[0]; }
|
||||
else { cmd1[0] = 0x70; cmd1[1] = keyn[1]; cmd1[2] = keyn[0]; cmd1[3] = 0x00; }
|
||||
int res = ExchangeRAW14a(cmd1, nonfirst ? 3 : 4, activateField, true, data, sizeof(data), &datalen, silentMode);
|
||||
if (res != PM3_SUCCESS) {
|
||||
|
||||
@@ -307,7 +308,7 @@ int MifareAuth4(mf4Session_t *mf4session, const uint8_t *keyn, uint8_t *key, boo
|
||||
memcpy(&IVW[12], &mf4session->R_Ctr, 2);
|
||||
memcpy(&IVW[14], &mf4session->W_Ctr, 2);
|
||||
memcpy(IVW, mf4session->TI, 4);
|
||||
|
||||
|
||||
aes_decode(IVR, key, &data[1], RndB, 16);
|
||||
RndB[16] = RndB[0];
|
||||
if (verbose) {
|
||||
@@ -353,7 +354,7 @@ int MifareAuth4(mf4Session_t *mf4session, const uint8_t *keyn, uint8_t *key, boo
|
||||
PrintAndLogEx(INFO, "< phase2: %s", sprint_hex(data, datalen));
|
||||
}
|
||||
|
||||
if (data[0]!=0x90) {
|
||||
if (data[0] != 0x90) {
|
||||
if (silentMode == false) {
|
||||
PrintAndLogEx(ERR, "\nAuthentication FAILED. Card did not ACK response");
|
||||
}
|
||||
@@ -364,7 +365,8 @@ int MifareAuth4(mf4Session_t *mf4session, const uint8_t *keyn, uint8_t *key, boo
|
||||
return PM3_EWRONGANSWER;
|
||||
}
|
||||
|
||||
if (nonfirst) { aes_decode(IVR, key, &data[1], raw, 16); } else { aes_decode(NULL, key, &data[1], raw, 32); }
|
||||
if (nonfirst) { aes_decode(IVR, key, &data[1], raw, 16); }
|
||||
else { aes_decode(NULL, key, &data[1], raw, 32); }
|
||||
|
||||
if (verbose) {
|
||||
if (nonfirst) {
|
||||
|
||||
@@ -431,6 +431,9 @@ const static vocabulary_t vocabulary[] = {
|
||||
{ 0, "hf mf info" },
|
||||
{ 0, "hf mf isen" },
|
||||
{ 1, "hf mf mad" },
|
||||
{ 0, "hf mf madread" },
|
||||
{ 0, "hf mf madwrite" },
|
||||
{ 0, "hf mf madverify" },
|
||||
{ 0, "hf mf personalize" },
|
||||
{ 0, "hf mf rdbl" },
|
||||
{ 0, "hf mf rdsc" },
|
||||
@@ -484,6 +487,9 @@ const static vocabulary_t vocabulary[] = {
|
||||
{ 0, "hf mfp dump" },
|
||||
{ 0, "hf mfp info" },
|
||||
{ 0, "hf mfp mad" },
|
||||
{ 0, "hf mfp madread" },
|
||||
{ 0, "hf mfp madwrite" },
|
||||
{ 0, "hf mfp madverify" },
|
||||
{ 0, "hf mfp rdbl" },
|
||||
{ 0, "hf mfp rdsc" },
|
||||
{ 0, "hf mfp wrbl" },
|
||||
@@ -916,6 +922,13 @@ const static vocabulary_t vocabulary[] = {
|
||||
{ 0, "lf visa2000 reader" },
|
||||
{ 0, "lf visa2000 clone" },
|
||||
{ 0, "lf visa2000 sim" },
|
||||
{ 0, "mad read" },
|
||||
{ 0, "mad write" },
|
||||
{ 0, "mad verify" },
|
||||
{ 1, "mad help" },
|
||||
{ 1, "mad decode" },
|
||||
{ 1, "mad encode" },
|
||||
{ 1, "mad test" },
|
||||
{ 1, "mem help" },
|
||||
{ 0, "mem baudrate" },
|
||||
{ 0, "mem dump" },
|
||||
|
||||
+291
-15
@@ -1170,7 +1170,7 @@
|
||||
},
|
||||
"help": {
|
||||
"command": "help",
|
||||
"description": "help Use `<command> help` for details of a command prefs { Edit client/device preferences... } -------- ----------------------- Technology ----------------------- analyse { Analyse utils... } data { Plot window / data buffer manipulation... } emv { EMV ISO-14443 / ISO-7816... } hf { High frequency commands... } hw { Hardware commands... } lf { Low frequency commands... } mqtt { MQTT commmands... } nfc { NFC commands... } piv { PIV commands... } reveng { CRC calculations from RevEng software... } smart { Smart card ISO-7816 commands... } script { Scripting commands... } trace { Trace manipulation... } wiegand { Wiegand format manipulation... } -------- ----------------------- General ----------------------- clear Clear screen hints Turn hints on / off msleep Add a pause in milliseconds rem Add a text line in log file quit exit Exit program --------------------------------------------------------------------------------------- auto available offline: no Run LF SEARCH / HF SEARCH / DATA PLOT / DATA SAVE",
|
||||
"description": "help Use `<command> help` for details of a command prefs { Edit client/device preferences... } -------- ----------------------- Technology ----------------------- analyse { Analyse utils... } data { Plot window / data buffer manipulation... } emv { EMV ISO-14443 / ISO-7816... } hf { High frequency commands... } hw { Hardware commands... } lf { Low frequency commands... } mad { MAD commands... } mqtt { MQTT commmands... } nfc { NFC commands... } piv { PIV commands... } reveng { CRC calculations from RevEng software... } smart { Smart card ISO-7816 commands... } script { Scripting commands... } trace { Trace manipulation... } wiegand { Wiegand format manipulation... } -------- ----------------------- General ----------------------- clear Clear screen hints Turn hints on / off msleep Add a pause in milliseconds rem Add a text line in log file quit exit Exit program --------------------------------------------------------------------------------------- auto available offline: no Run LF SEARCH / HF SEARCH / DATA PLOT / DATA SAVE",
|
||||
"notes": [
|
||||
"auto"
|
||||
],
|
||||
@@ -2859,16 +2859,18 @@
|
||||
"notes": [
|
||||
"hf felica dump",
|
||||
"hf felica dump --retry 5",
|
||||
"hf felica dump --idm 11100910C11BC407"
|
||||
"hf felica dump --idm 11100910C11BC407",
|
||||
"hf felica dump -f my-felica-dump"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"--no-auth read public services",
|
||||
"-r, --retry <dec> number of retries",
|
||||
"--idm <hex> use custom IDm"
|
||||
"--idm <hex> use custom IDm",
|
||||
"-f, --file <fn> Specify a filename for JSON dump file"
|
||||
],
|
||||
"usage": "hf felica dump [-h] [--no-auth] [-r <dec>] [--idm <hex>]"
|
||||
"usage": "hf felica dump [-h] [--no-auth] [-r <dec>] [--idm <hex>] [-f <fn>]"
|
||||
},
|
||||
"hf felica help": {
|
||||
"command": "hf felica help",
|
||||
@@ -3112,6 +3114,23 @@
|
||||
],
|
||||
"usage": "hf felica seacinfo [-h]"
|
||||
},
|
||||
"hf felica sim": {
|
||||
"command": "hf felica sim",
|
||||
"description": "Emulate a FeliCa Standard card from a JSON dump generated by `hf felica dump`.",
|
||||
"notes": [
|
||||
"hf felica sim -f hf-felica-dump.json",
|
||||
"hf felica sim -f hf-felica-dump --read-without-encryption-error-location-indication index",
|
||||
"hf felica sim -f hf-felica-dump --read-without-encryption-error-location-indication flag -v"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-f, --file <fn> JSON dump file",
|
||||
"--read-without-encryption-error-location-indication <mask|index|flag> Read Without Encryption error location indication (default: mask)",
|
||||
"-v, --verbose verbose output"
|
||||
],
|
||||
"usage": "hf felica sim [-hv] -f <fn> [--read-without-encryption-error-location-indication <mask|index|flag>]"
|
||||
},
|
||||
"hf felica sniff": {
|
||||
"command": "hf felica sniff",
|
||||
"description": "Collect data from the field and save into command buffer. Buffer accessible from `hf felica list`",
|
||||
@@ -6324,6 +6343,74 @@
|
||||
],
|
||||
"usage": "hf mf mad [-hvb] [--aid <hex>] [-k <hex>] [--be] [--dch] [-f <fn>] [--force]"
|
||||
},
|
||||
"hf mf madread": {
|
||||
"command": "hf mf madread",
|
||||
"description": "Read application data from sectors matching a MAD AID",
|
||||
"notes": [
|
||||
"mad read --aid e103 -> read NDEF data (auto-detect card)",
|
||||
"mad read --aid e103 -k ffffffffffff -b -> Classic, key B",
|
||||
"mad read --aid e103 -k d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7 -> Plus",
|
||||
"mad read --aid e103 -v -f mydata.bin -> verbose, save to file"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-f, --file <fn> save raw data to file"
|
||||
],
|
||||
"usage": "hf mf madread [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-f <fn>]"
|
||||
},
|
||||
"hf mf madverify": {
|
||||
"command": "hf mf madverify",
|
||||
"description": "Read back and verify application data against expected content",
|
||||
"notes": [
|
||||
"mad verify --aid e103 -d 0102030405060708 -> verify data",
|
||||
"mad verify --aid e103 -f mydata.bin -> verify against file"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-d, --data <hex> expected data",
|
||||
"-f, --file <fn> load expected data from file"
|
||||
],
|
||||
"usage": "hf mf madverify [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-d <hex>] [-f <fn>]"
|
||||
},
|
||||
"hf mf madwrite": {
|
||||
"command": "hf mf madwrite",
|
||||
"description": "Write application data to sectors matching a MAD AID",
|
||||
"notes": [
|
||||
"mad write --aid e103 -d 0102030405060708 -> write data",
|
||||
"mad write --aid e103 -f mydata.bin -> write from file",
|
||||
"mad write --aid e103 -k ffffffffffff -d 0102030405 -> Classic, custom key"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-d, --data <hex> data to write",
|
||||
"-f, --file <fn> load data from file"
|
||||
],
|
||||
"usage": "hf mf madwrite [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-d <hex>] [-f <fn>]"
|
||||
},
|
||||
"hf mf nack": {
|
||||
"command": "hf mf nack",
|
||||
"description": "Test a MIFARE Classic based card for the NACK bug",
|
||||
@@ -8404,6 +8491,74 @@
|
||||
],
|
||||
"usage": "hf mfp mad [-hvb] [--aid <hex>] [-k <hex>] [--be] [--dch] [--override]"
|
||||
},
|
||||
"hf mfp madread": {
|
||||
"command": "hf mfp madread",
|
||||
"description": "Read application data from sectors matching a MAD AID",
|
||||
"notes": [
|
||||
"mad read --aid e103 -> read NDEF data (auto-detect card)",
|
||||
"mad read --aid e103 -k ffffffffffff -b -> Classic, key B",
|
||||
"mad read --aid e103 -k d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7 -> Plus",
|
||||
"mad read --aid e103 -v -f mydata.bin -> verbose, save to file"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-f, --file <fn> save raw data to file"
|
||||
],
|
||||
"usage": "hf mfp madread [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-f <fn>]"
|
||||
},
|
||||
"hf mfp madverify": {
|
||||
"command": "hf mfp madverify",
|
||||
"description": "Read back and verify application data against expected content",
|
||||
"notes": [
|
||||
"mad verify --aid e103 -d 0102030405060708 -> verify data",
|
||||
"mad verify --aid e103 -f mydata.bin -> verify against file"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-d, --data <hex> expected data",
|
||||
"-f, --file <fn> load expected data from file"
|
||||
],
|
||||
"usage": "hf mfp madverify [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-d <hex>] [-f <fn>]"
|
||||
},
|
||||
"hf mfp madwrite": {
|
||||
"command": "hf mfp madwrite",
|
||||
"description": "Write application data to sectors matching a MAD AID",
|
||||
"notes": [
|
||||
"mad write --aid e103 -d 0102030405060708 -> write data",
|
||||
"mad write --aid e103 -f mydata.bin -> write from file",
|
||||
"mad write --aid e103 -k ffffffffffff -d 0102030405 -> Classic, custom key"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-d, --data <hex> data to write",
|
||||
"-f, --file <fn> load data from file"
|
||||
],
|
||||
"usage": "hf mfp madwrite [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-d <hex>] [-f <fn>]"
|
||||
},
|
||||
"hf mfp ndefformat": {
|
||||
"command": "hf mfp ndefformat",
|
||||
"description": "format MIFARE Plus Tag as a NFC tag with Data Exchange Format (NDEF) If no <name> given, UID will be used as filename. It will try default keys and MAD keys to detect if tag is already formatted in order to write. If not, it will try finding a key file based on your UID. ie, if you ran autopwn before",
|
||||
@@ -10630,31 +10785,35 @@
|
||||
},
|
||||
"lf cotag help": {
|
||||
"command": "lf cotag help",
|
||||
"description": "help This help demod demodulate an COTAG tag --------------------------------------------------------------------------------------- lf cotag demod available offline: yes Try to find COTAG preamble, if found decode / descramble data",
|
||||
"description": "help This help demod demodulate a COTAG tag --------------------------------------------------------------------------------------- lf cotag demod available offline: yes Demodulate COTAG samples from g_GraphBuffer. Try to find COTAG preamble, if found decode / descramble data.",
|
||||
"notes": [
|
||||
"lf cotag demod"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output"
|
||||
"-v, --verbose verbose output",
|
||||
"-c, --clk <dec> set clock manually (def 768)",
|
||||
"-t, --threshold <dec> set high value threshold manually (def: auto-detected)"
|
||||
],
|
||||
"usage": "lf cotag demod [-hv]"
|
||||
"usage": "lf cotag demod [-hv] [-c <dec>] [-t <dec>]"
|
||||
},
|
||||
"lf cotag reader": {
|
||||
"command": "lf cotag reader",
|
||||
"description": "read a COTAG tag, the current support for COTAG is limited.",
|
||||
"description": "Read a COTAG tag. - use `lf config` to set parameters except divisor (which is assumed 90 for cotag. Use --divisor to override). - use `data plot` to look at it. - use `lf cotag demod` to try to demodulate it. If the number of samples is more than the device memory limit (40000 now), it will try to use the real-time sampling mode. Note: Cotag has an extremely slow data rate - RF/768 -- capturing a full 128 bit card read requires a minimum of 128 x 768 samples, or a multiple thereof.",
|
||||
"notes": [
|
||||
"lf cotag reader -2"
|
||||
"lf cotag reader -v -s 700000 -> collect 700000 samples",
|
||||
"lf cotag reader -v --divisor 89 -s 700000 -> use divisor 89, collect 700000 samples"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-1 HIGH/LOW signal; maxlength bigbuff",
|
||||
"-2 translation of HIGH/LOW into bytes with manchester 0,1",
|
||||
"-3 raw signal; maxlength bigbuff"
|
||||
"-s, --samples <dec> number of samples to collect (def 500000)",
|
||||
"-v, --verbose verbose output",
|
||||
"-@ continuous reading mode",
|
||||
"--divisor <19-255> Manually set freq divisor"
|
||||
],
|
||||
"usage": "lf cotag reader [-h123]"
|
||||
"usage": "lf cotag reader [-hv@] [-s <dec>] [--divisor <19-255>]"
|
||||
},
|
||||
"lf destron clone": {
|
||||
"command": "lf destron clone",
|
||||
@@ -13977,6 +14136,123 @@
|
||||
],
|
||||
"usage": "lf visa2000 sim [-h] --cn <dec>"
|
||||
},
|
||||
"mad encode": {
|
||||
"command": "mad encode",
|
||||
"description": "Encode a MAD byte array from AID-to-sector mappings",
|
||||
"notes": [
|
||||
"mad encode --aid E103:1-3 --aid 484D:4 -> MAD1 with NDEF + HID",
|
||||
"mad encode --aid E103:1-3,5 -> non-contiguous sectors",
|
||||
"mad encode --aid E103:1-3,17-18 --aid 484D:4 -> MAD1 + MAD2",
|
||||
"mad encode --aid E103:1-3 -q -> quiet, hex only"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"--aid <hex:sectors> AID and sector ranges (e.g. E103:1-3,5)",
|
||||
"-q, --quiet quiet output, hex bytes only",
|
||||
"--be big-endian AID byte swap"
|
||||
],
|
||||
"usage": "mad encode [-hq] --aid <hex:sectors> [--aid <hex:sectors>]... [--be]"
|
||||
},
|
||||
"mad help": {
|
||||
"command": "mad help",
|
||||
"description": "-------- --------------- MAD ----------------- -------- ------------- General --------------- help This help decode Decode MAD byte array encode Encode MAD byte array from AID mappings test Run MAD regression tests --------------------------------------------------------------------------------------- mad decode available offline: yes Decode a MAD byte array and print the directory",
|
||||
"notes": [
|
||||
"mad decode -d <sector0 hex> -> decode MAD1",
|
||||
"mad decode -d <sector0 hex> --mad2 <sector16 hex> -> decode MAD1 + MAD2"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"-d, --data <hex> MAD1 sector 0 data (64 bytes)",
|
||||
"--mad2 <hex> MAD2 sector 16 data (64 bytes)",
|
||||
"--be big-endian AID byte swap"
|
||||
],
|
||||
"usage": "mad decode [-hv] -d <hex> [--mad2 <hex>] [--be]"
|
||||
},
|
||||
"mad read": {
|
||||
"command": "mad read",
|
||||
"description": "Read application data from sectors matching a MAD AID",
|
||||
"notes": [
|
||||
"mad read --aid e103 -> read NDEF data (auto-detect card)",
|
||||
"mad read --aid e103 -k ffffffffffff -b -> Classic, key B",
|
||||
"mad read --aid e103 -k d3f7d3f7d3f7d3f7d3f7d3f7d3f7d3f7 -> Plus",
|
||||
"mad read --aid e103 -v -f mydata.bin -> verbose, save to file"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-f, --file <fn> save raw data to file"
|
||||
],
|
||||
"usage": "mad read [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-f <fn>]"
|
||||
},
|
||||
"mad test": {
|
||||
"command": "mad test",
|
||||
"description": "Run MAD regression tests (offline, no card needed)",
|
||||
"notes": [
|
||||
"mad test",
|
||||
"mad test -v -> verbose output"
|
||||
],
|
||||
"offline": true,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output"
|
||||
],
|
||||
"usage": "mad test [-hv]"
|
||||
},
|
||||
"mad verify": {
|
||||
"command": "mad verify",
|
||||
"description": "Read back and verify application data against expected content",
|
||||
"notes": [
|
||||
"mad verify --aid e103 -d 0102030405060708 -> verify data",
|
||||
"mad verify --aid e103 -f mydata.bin -> verify against file"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-d, --data <hex> expected data",
|
||||
"-f, --file <fn> load expected data from file"
|
||||
],
|
||||
"usage": "mad verify [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-d <hex>] [-f <fn>]"
|
||||
},
|
||||
"mad write": {
|
||||
"command": "mad write",
|
||||
"description": "Write application data to sectors matching a MAD AID",
|
||||
"notes": [
|
||||
"mad write --aid e103 -d 0102030405060708 -> write data",
|
||||
"mad write --aid e103 -f mydata.bin -> write from file",
|
||||
"mad write --aid e103 -k ffffffffffff -d 0102030405 -> Classic, custom key"
|
||||
],
|
||||
"offline": false,
|
||||
"options": [
|
||||
"-h, --help This help",
|
||||
"-v, --verbose verbose output",
|
||||
"--aid <hex> application ID (2 hex bytes)",
|
||||
"-k, --key <hex> key for data sectors",
|
||||
"-b, --keyb use key B (def: key A)",
|
||||
"--mad-key <hex> key for MAD sectors",
|
||||
"--be big-endian AID byte swap",
|
||||
"--override override failed CRC check",
|
||||
"-d, --data <hex> data to write",
|
||||
"-f, --file <fn> load data from file"
|
||||
],
|
||||
"usage": "mad write [-hvb] --aid <hex> [-k <hex>] [--mad-key <hex>] [--be] [--override] [-d <hex>] [-f <fn>]"
|
||||
},
|
||||
"mem dump": {
|
||||
"command": "mem dump",
|
||||
"description": "Dumps flash memory on device into a file or view in console",
|
||||
@@ -15383,8 +15659,8 @@
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"commands_extracted": 865,
|
||||
"commands_extracted": 878,
|
||||
"extracted_by": "PM3Help2JSON v1.00",
|
||||
"extracted_on": "2026-06-09T23:01:19+00:00"
|
||||
"extracted_on": "2026-06-22T22:01:12+00:00"
|
||||
}
|
||||
}
|
||||
|
||||
+23
-1
@@ -365,6 +365,7 @@ Check column "offline" for their availability.
|
||||
|`hf felica wrbl `|N |`write block data to an authentication-not-required Service.`
|
||||
|`hf felica dump `|N |`Wait for and try dumping FeliCa`
|
||||
|`hf felica discnodes `|N |`discover Area Code and Service Code nodes.`
|
||||
|`hf felica sim `|N |`Emulate FeliCa Standard from dump file`
|
||||
|`hf felica rqservice `|N |`verify the existence of Area and Service, and to acquire Key Version.`
|
||||
|`hf felica rqresponse `|N |`verify the existence of a card and its Mode.`
|
||||
|`hf felica scsvcode `|N |`acquire Area Code and Service Code.`
|
||||
@@ -641,6 +642,9 @@ Check column "offline" for their availability.
|
||||
|`hf mf info `|N |`Tag information`
|
||||
|`hf mf isen `|N |`Information Static Encrypted Nonces`
|
||||
|`hf mf mad `|Y |`Checks and prints MAD`
|
||||
|`hf mf madread `|N |`Read data from MAD AID sectors`
|
||||
|`hf mf madwrite `|N |`Write data to MAD AID sectors`
|
||||
|`hf mf madverify `|N |`Verify data in MAD AID sectors`
|
||||
|`hf mf personalize `|N |`Personalize UID (MIFARE Classic EV1 only)`
|
||||
|`hf mf rdbl `|N |`Read MIFARE Classic block`
|
||||
|`hf mf rdsc `|N |`Read MIFARE Classic sector`
|
||||
@@ -702,6 +706,9 @@ Check column "offline" for their availability.
|
||||
|`hf mfp dump `|N |`Dump MIFARE Plus tag to file`
|
||||
|`hf mfp info `|N |`Tag information`
|
||||
|`hf mfp mad `|N |`Check and print MAD`
|
||||
|`hf mfp madread `|N |`Read data from MAD AID sectors`
|
||||
|`hf mfp madwrite `|N |`Write data to MAD AID sectors`
|
||||
|`hf mfp madverify `|N |`Verify data in MAD AID sectors`
|
||||
|`hf mfp rdbl `|N |`Read blocks from card`
|
||||
|`hf mfp rdsc `|N |`Read sectors from card`
|
||||
|`hf mfp wrbl `|N |`Write block to card`
|
||||
@@ -1044,7 +1051,7 @@ Check column "offline" for their availability.
|
||||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`lf cotag help `|Y |`This help`
|
||||
|`lf cotag demod `|Y |`demodulate an COTAG tag`
|
||||
|`lf cotag demod `|Y |`demodulate a COTAG tag`
|
||||
|`lf cotag reader `|N |`attempt to read and extract tag data`
|
||||
|
||||
|
||||
@@ -1529,6 +1536,21 @@ Check column "offline" for their availability.
|
||||
|`lf visa2000 sim `|N |`simulate Visa2000 tag`
|
||||
|
||||
|
||||
### mad
|
||||
|
||||
{ MAD commands... }
|
||||
|
||||
|command |offline |description
|
||||
|------- |------- |-----------
|
||||
|`mad read `|N |`Read data from MAD AID sectors`
|
||||
|`mad write `|N |`Write data to MAD AID sectors`
|
||||
|`mad verify `|N |`Verify data in MAD AID sectors`
|
||||
|`mad help `|Y |`This help`
|
||||
|`mad decode `|Y |`Decode MAD byte array`
|
||||
|`mad encode `|Y |`Encode MAD byte array from AID mappings`
|
||||
|`mad test `|Y |`Run MAD regression tests`
|
||||
|
||||
|
||||
### mem
|
||||
|
||||
{ Flash memory manipulation... }
|
||||
|
||||
Reference in New Issue
Block a user