Skip to content

Commit

Permalink
Print new magic tag values
Browse files Browse the repository at this point in the history
Rename tags.
Tell apart UMC 03a0 (old) and 06a0 (new).
Add new tags (TID, SID, furui supercard)
No longer call QL88 magic. There are ripoff EV1s in China which go by the name of "SAK88-IC".

Signed-off-by: team-orangeBlue <[email protected]>
  • Loading branch information
team-orangeBlue authored Nov 14, 2023
1 parent fafb36d commit 6da950e
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions client/src/mifare/mifarehost.c
Original file line number Diff line number Diff line change
Expand Up @@ -1361,37 +1361,50 @@ int detect_mf_magic(bool is_mfc) {

switch (isGeneration) {
case MAGIC_GEN_1A:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("Gen 1a"));
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Gen 1a"));
break;
case MAGIC_GEN_1B:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("Gen 1b"));
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Gen 1b"));
break;
case MAGIC_GEN_2:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("Gen 2 / CUID"));
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Gen 2 / CUID"));
break;
case MAGIC_GEN_3:
PrintAndLogEx(SUCCESS, "Magic capabilities : possibly " _GREEN_("Gen 3 / APDU"));
PrintAndLogEx(SUCCESS, "Magic capabilities: possibly " _GREEN_("Gen 3 / APDU"));
break;
case MAGIC_GEN_4GTU:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("Gen 4 GTU"));
case MAGIC_GEN_4UMC3:
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Ultimate Magic (old)"));
break;
case MAGIC_GEN_4GDM:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("Gen 4 GDM"));
case MAGIC_GEN_4UMC6:
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Ultimate Magic (new)"));
break;
case MAGIC_GEN_4USC:
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("USCUID"));
break;
case MAGIC_GEN_UNFUSED:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("Write Once / FUID"));
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Write Once / FUID"));
break;
case MAGIC_SUPER_GEN1:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("Super card (") _CYAN_("Gen 1") _GREEN_(")"));
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Super card (") _CYAN_("Gen 1") _GREEN_(")"));
break;
case MAGIC_SUPER_GEN2:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("Super card (") _CYAN_("Gen 2") _GREEN_(")"));
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Super card (") _CYAN_("Gen 2") _GREEN_(")"));
break;
case MAGIC_SUPER_FURUI:
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("Super card (") _CYAN_("Furui") _GREEN_(")"));
break;
case MAGIC_NTAG21X:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("NTAG21x"));
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("NTAG21x"));
break;
case MAGIC_QL88:
PrintAndLogEx(SUCCESS, "Magic capabilities : " _GREEN_("QL88"));
PrintAndLogEx(SUCCESS, "Potentially " _GREEN_("SAK88-IC"));
break;
case MAGIC_TID:
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("TID"));
break;
case MAGIC_SID:
PrintAndLogEx(SUCCESS, "Magic capabilities: " _GREEN_("SID"));
break;
default:
break;
}
Expand Down Expand Up @@ -1558,10 +1571,10 @@ int vigik_verify(mfc_vigik_t *d) {

/*
if v is even and
if J* mod 8 = 1, then f* = n–J*.
if J* mod 8 = 4, then f* = J*,
if J* mod 8 = 6, then f* = 2J*,
if J* mod 8 = 7, then f* = 2(n–J*),
⎯ if J* mod 8 = 1, then f* = n–J*.
вЋЇ if J* mod 8 = 4, then f* = J*,
вЋЇ if J* mod 8 = 6, then f* = 2J*,
⎯ if J* mod 8 = 7, then f* = 2(n–J*),
*/
uint8_t b2 = mbedtls_mpi_get_bit(&sqr, 2);
uint8_t b1 = mbedtls_mpi_get_bit(&sqr, 1);
Expand Down

0 comments on commit 6da950e

Please sign in to comment.