This commit is contained in:
iceman1001 2023-06-25 22:30:58 +02:00
commit f64f538519
4 changed files with 30 additions and 31 deletions

View file

@ -2357,7 +2357,7 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) {
// Auth // Auth
if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(s), keytype, ui64Key, AUTH_FIRST)) { if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(s), keytype, ui64Key, AUTH_FIRST)) {
retval = PM3_EPARTIAL; retval = PM3_EPARTIAL;
if (g_dbglevel > DBG_ERROR) { if (g_dbglevel > DBG_ERROR) {
Dbprintf("Sector %2d - Auth error", s); Dbprintf("Sector %2d - Auth error", s);
} }
continue; continue;
@ -2387,7 +2387,7 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) {
if (b < NumBlocksPerSector(s) - 1) { if (b < NumBlocksPerSector(s) - 1) {
emlSetMem(data, FirstBlockOfSector(s) + b, 1); emlSetMem(data, FirstBlockOfSector(s) + b, 1);
} else { } else {
// sector trailer, keep the keys, set only the AC // sector trailer, keep the keys, set only the AC
uint8_t st[16] = {0x00}; uint8_t st[16] = {0x00};
emlGetMem(st, FirstBlockOfSector(s) + b, 1); emlGetMem(st, FirstBlockOfSector(s) + b, 1);

View file

@ -3082,14 +3082,14 @@ static int CmdDiff(const char *Cmd) {
if (inB == NULL) if (inB == NULL)
PrintAndLogEx(INFO, "inB null"); PrintAndLogEx(INFO, "inB null");
int hdr_sln = (width * 4) + 2; int hdr_sln = (width * 4) + 2;
char hdr0[300] = {0}; char hdr0[300] = {0};
int max_fn_space = (width * 5); int max_fn_space = (width * 5);
if (fnlenA && fnlenB && (max_fn_space > fnlenA) && (max_fn_space > fnlenB)) { if (fnlenA && fnlenB && (max_fn_space > fnlenA) && (max_fn_space > fnlenB)) {
snprintf(hdr0, sizeof(hdr0) - 1, " # | " _CYAN_("%.*s"), max_fn_space, filenameA); snprintf(hdr0, sizeof(hdr0) - 1, " # | " _CYAN_("%.*s"), max_fn_space, filenameA);
memset(hdr0 + strlen(hdr0), ' ', hdr_sln - strlen(filenameA) - 1 ); memset(hdr0 + strlen(hdr0), ' ', hdr_sln - strlen(filenameA) - 1);
snprintf(hdr0 + strlen(hdr0), sizeof(hdr0) - 1 - strlen(hdr0), "| " _CYAN_("%.*s"), max_fn_space, filenameB); snprintf(hdr0 + strlen(hdr0), sizeof(hdr0) - 1 - strlen(hdr0), "| " _CYAN_("%.*s"), max_fn_space, filenameB);
} else { } else {
strcat(hdr0, " # | " _CYAN_("a")); strcat(hdr0, " # | " _CYAN_("a"));

View file

@ -231,10 +231,10 @@ void mf_print_block_one(uint8_t blockno, uint8_t *d, bool verbose) {
char ascii[24] = {0}; char ascii[24] = {0};
ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1); ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1);
PrintAndLogEx(INFO, "%3d | " _RED_("%s") "| " _RED_("%s"), PrintAndLogEx(INFO, "%3d | " _RED_("%s") "| " _RED_("%s"),
blockno, blockno,
sprint_hex(d, MFBLOCK_SIZE), sprint_hex(d, MFBLOCK_SIZE),
ascii ascii
); );
} else if (mfIsSectorTrailer(blockno)) { } else if (mfIsSectorTrailer(blockno)) {
char keya[26] = {0}; char keya[26] = {0};
@ -250,13 +250,13 @@ void mf_print_block_one(uint8_t blockno, uint8_t *d, bool verbose) {
ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1); ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1);
PrintAndLogEx(INFO, "%3d | " _YELLOW_("%s") _MAGENTA_("%s") "%02X " _YELLOW_("%s") "| " _YELLOW_("%s"), PrintAndLogEx(INFO, "%3d | " _YELLOW_("%s") _MAGENTA_("%s") "%02X " _YELLOW_("%s") "| " _YELLOW_("%s"),
blockno, blockno,
keya, keya,
acl, acl,
d[9], d[9],
keyb, keyb,
ascii ascii
); );
} else { } else {
int32_t value = 0; int32_t value = 0;
@ -280,11 +280,11 @@ static void mf_print_block(uint8_t blockno, uint8_t *d, bool verbose) {
char ascii[24] = {0}; char ascii[24] = {0};
ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1); ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1);
PrintAndLogEx(INFO, "%s| %3d | " _RED_("%s") "| " _RED_("%s"), PrintAndLogEx(INFO, "%s| %3d | " _RED_("%s") "| " _RED_("%s"),
secstr, secstr,
blockno, blockno,
sprint_hex(d, MFBLOCK_SIZE), sprint_hex(d, MFBLOCK_SIZE),
ascii ascii
); );
} else if (mfIsSectorTrailer(blockno)) { } else if (mfIsSectorTrailer(blockno)) {
@ -301,14 +301,14 @@ static void mf_print_block(uint8_t blockno, uint8_t *d, bool verbose) {
ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1); ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1);
PrintAndLogEx(INFO, "%s| %3d | " _YELLOW_("%s") _MAGENTA_("%s") "%02X " _YELLOW_("%s") "| " _YELLOW_("%s"), PrintAndLogEx(INFO, "%s| %3d | " _YELLOW_("%s") _MAGENTA_("%s") "%02X " _YELLOW_("%s") "| " _YELLOW_("%s"),
secstr, secstr,
blockno, blockno,
keya, keya,
acl, acl,
d[9], d[9],
keyb, keyb,
ascii ascii
); );
} else { } else {
int32_t value = 0; int32_t value = 0;
if (verbose && mfc_value(d, &value)) { if (verbose && mfc_value(d, &value)) {

View file

@ -332,8 +332,7 @@
"data diff -a fileA -b fileB", "data diff -a fileA -b fileB",
"data diff -a fileA --eb", "data diff -a fileA --eb",
"data diff --fa fileA -b fileB", "data diff --fa fileA -b fileB",
"data diff --fa fileA --fb fileB", "data diff --fa fileA --fb fileB"
"data diff --ea --cb"
], ],
"offline": true, "offline": true,
"options": [ "options": [
@ -12095,6 +12094,6 @@
"metadata": { "metadata": {
"commands_extracted": 759, "commands_extracted": 759,
"extracted_by": "PM3Help2JSON v1.00", "extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2023-06-24T15:16:04" "extracted_on": "2023-06-25T20:30:44"
} }
} }