mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-25 07:35:40 -07:00
emrtd: Dump image from EF_DG7 too
This commit is contained in:
parent
bdcf84f90d
commit
6ca472fc8f
1 changed files with 20 additions and 1 deletions
|
@ -735,7 +735,6 @@ static bool emrtd_dump_ef_dg2(uint8_t *file_contents, int file_length) {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
static bool emrtd_dump_ef_dg5(uint8_t *file_contents, int file_length) {
|
||||
uint8_t data[EMRTD_MAX_FILE_SIZE];
|
||||
int datalen = 0;
|
||||
|
@ -754,6 +753,24 @@ static bool emrtd_dump_ef_dg5(uint8_t *file_contents, int file_length) {
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool emrtd_dump_ef_dg7(uint8_t *file_contents, int file_length) {
|
||||
uint8_t data[EMRTD_MAX_FILE_SIZE];
|
||||
int datalen = 0;
|
||||
|
||||
// If we can't find image in EF_DG7, return false.
|
||||
if (emrtd_lds_get_data_by_tag(file_contents, file_length, data, &datalen, 0x5F, 0x42, true) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (datalen < EMRTD_MAX_FILE_SIZE) {
|
||||
saveFile("EF_DG7", ".jpg", data, datalen);
|
||||
} else {
|
||||
PrintAndLogEx(ERR, "error (emrtd_dump_ef_dg7) datalen out-of-bounds");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool emrtd_dump_ef_sod(uint8_t *file_contents, int file_length) {
|
||||
int fieldlen = emrtd_get_asn1_field_length(file_contents, file_length, 1);
|
||||
int datalen = emrtd_get_asn1_data_length(file_contents, file_length, 1);
|
||||
|
@ -783,6 +800,8 @@ static bool emrtd_dump_file(uint8_t *ks_enc, uint8_t *ks_mac, uint8_t *ssc, cons
|
|||
emrtd_dump_ef_dg2(response, resplen);
|
||||
} else if (strcmp(file, EMRTD_EF_DG5) == 0) {
|
||||
emrtd_dump_ef_dg5(response, resplen);
|
||||
} else if (strcmp(file, EMRTD_EF_DG7) == 0) {
|
||||
emrtd_dump_ef_dg7(response, resplen);
|
||||
} else if (strcmp(file, EMRTD_EF_SOD) == 0) {
|
||||
emrtd_dump_ef_sod(response, resplen);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue