Skip to content

Commit f20d8f3

Browse files
committed
ulaes sim: add getversion support
1 parent 716d5c6 commit f20d8f3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

armsrc/iso14443a.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,14 @@ bool SimulateIso14443aInit(uint8_t tagType, uint16_t flags, uint8_t *data,
14031403
mfu_dump_t *mfu_header = (mfu_dump_t *) BigBuf_get_EM_addr();
14041404
*pages = MAX(mfu_header->pages, 47);
14051405

1406+
// GET_VERSION
1407+
if (memcmp(mfu_header->version, "\x00\x00\x00\x00\x00\x00\x00\x00", 8) == 0) {
1408+
memcpy(rVERSION, "\x00\x04\x03\x01\x04\x00\x0F\x03", 8);
1409+
} else {
1410+
memcpy(rVERSION, mfu_header->version, 8);
1411+
}
1412+
AddCrc14A(rVERSION, sizeof(rVERSION) - 2);
1413+
14061414
Simulate_read_ulaes_key0(ulc_key);
14071415

14081416
/*
@@ -2013,7 +2021,7 @@ void SimulateIso14443aTag(uint8_t tagType, uint16_t flags, uint8_t *useruid, uin
20132021
LogTrace(receivedCmd, Uart.len, Uart.startTime * 16 - DELAY_AIR2ARM_AS_TAG, Uart.endTime * 16 - DELAY_AIR2ARM_AS_TAG, Uart.parity, true);
20142022
p_response = NULL;
20152023
order = ORDER_HALTED;
2016-
} else if (receivedCmd[0] == MIFARE_ULEV1_VERSION && len == 3 && (tagType == 2 || tagType == 7)) {
2024+
} else if (receivedCmd[0] == MIFARE_ULEV1_VERSION && len == 3 && (tagType == 2 || tagType == 7 || tagType == 14)) {
20172025
p_response = &responses[RESP_INDEX_VERSION];
20182026
} else if (receivedCmd[0] == MFDES_GET_VERSION && len == 4 && (tagType == 3)) {
20192027
p_response = &responses[RESP_INDEX_VERSION];

0 commit comments

Comments
 (0)