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

View file

@ -3082,14 +3082,14 @@ static int CmdDiff(const char *Cmd) {
if (inB == NULL)
PrintAndLogEx(INFO, "inB null");
int hdr_sln = (width * 4) + 2;
int hdr_sln = (width * 4) + 2;
char hdr0[300] = {0};
int max_fn_space = (width * 5);
if (fnlenA && fnlenB && (max_fn_space > fnlenA) && (max_fn_space > fnlenB)) {
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);
} else {
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};
ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1);
PrintAndLogEx(INFO, "%3d | " _RED_("%s") "| " _RED_("%s"),
blockno,
sprint_hex(d, MFBLOCK_SIZE),
ascii
);
blockno,
sprint_hex(d, MFBLOCK_SIZE),
ascii
);
} else if (mfIsSectorTrailer(blockno)) {
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);
PrintAndLogEx(INFO, "%3d | " _YELLOW_("%s") _MAGENTA_("%s") "%02X " _YELLOW_("%s") "| " _YELLOW_("%s"),
blockno,
keya,
acl,
d[9],
keyb,
ascii
);
blockno,
keya,
acl,
d[9],
keyb,
ascii
);
} else {
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};
ascii_to_buffer((uint8_t *)ascii, d, MFBLOCK_SIZE, sizeof(ascii) - 1, 1);
PrintAndLogEx(INFO, "%s| %3d | " _RED_("%s") "| " _RED_("%s"),
secstr,
blockno,
sprint_hex(d, MFBLOCK_SIZE),
ascii
);
secstr,
blockno,
sprint_hex(d, MFBLOCK_SIZE),
ascii
);
} 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);
PrintAndLogEx(INFO, "%s| %3d | " _YELLOW_("%s") _MAGENTA_("%s") "%02X " _YELLOW_("%s") "| " _YELLOW_("%s"),
secstr,
blockno,
keya,
acl,
d[9],
keyb,
ascii
);
secstr,
blockno,
keya,
acl,
d[9],
keyb,
ascii
);
} else {
int32_t value = 0;
if (verbose && mfc_value(d, &value)) {

View file

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