the 14a sim had a wrong size check of the irats pointer instead of actual size. Only way around it was to add the length at function call

This commit is contained in:
iceman1001 2024-11-15 13:27:39 +01:00
commit d398576fc7
7 changed files with 57 additions and 28 deletions

View file

@ -89,22 +89,22 @@ void RunMod(void) {
Dbprintf("Starting simulation, press " _GREEN_("pm3 button") " to stop and go back to search state.");
if (card.sak == 0x08 && card.atqa[0] == 0x04 && card.atqa[1] == 0) {
DbpString("Mifare Classic 1k");
SimulateIso14443aTag(1, flags, card.uid, 0, NULL);
SimulateIso14443aTag(1, flags, card.uid, 0, NULL, 0);
} else if (card.sak == 0x08 && card.atqa[0] == 0x44 && card.atqa[1] == 0) {
DbpString("Mifare Classic 4k ");
SimulateIso14443aTag(8, flags, card.uid, 0, NULL);
SimulateIso14443aTag(8, flags, card.uid, 0, NULL, 0);
} else if (card.sak == 0x00 && card.atqa[0] == 0x44 && card.atqa[1] == 0) {
DbpString("Mifare Ultralight");
SimulateIso14443aTag(2, flags, card.uid, 0, NULL);
SimulateIso14443aTag(2, flags, card.uid, 0, NULL, 0);
} else if (card.sak == 0x20 && card.atqa[0] == 0x04 && card.atqa[1] == 0x03) {
DbpString("Mifare DESFire");
SimulateIso14443aTag(3, flags, card.uid, 0, NULL);
SimulateIso14443aTag(3, flags, card.uid, 0, NULL, 0);
} else if (card.sak == 0x20 && card.atqa[0] == 0x44 && card.atqa[1] == 0x03) {
DbpString("Mifare DESFire Ev1/Plus/JCOP");
SimulateIso14443aTag(3, flags, card.uid, 0, NULL);
SimulateIso14443aTag(3, flags, card.uid, 0, NULL, 0);
} else {
Dbprintf("Unrecognized tag type -- defaulting to Mifare Classic emulation");
SimulateIso14443aTag(1, flags, card.uid, 0, NULL);
SimulateIso14443aTag(1, flags, card.uid, 0, NULL, 0);
}
// Go back to search state if user presses pm3-button