mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
chg: ntag215/amiibo, empty header, use hardcoded values
This commit is contained in:
parent
e0eaff453f
commit
88a42c6108
1 changed files with 15 additions and 3 deletions
|
@ -980,14 +980,26 @@ bool SimulateIso14443aInit(int tagType, int flags, uint8_t *data, tag_response_i
|
||||||
// some first pages of UL/NTAG dump is special data
|
// some first pages of UL/NTAG dump is special data
|
||||||
mfu_dump_t *mfu_header = (mfu_dump_t *) BigBuf_get_EM_addr();
|
mfu_dump_t *mfu_header = (mfu_dump_t *) BigBuf_get_EM_addr();
|
||||||
*pages = MAX(mfu_header->pages, 19);
|
*pages = MAX(mfu_header->pages, 19);
|
||||||
|
|
||||||
// counters and tearing flags
|
// counters and tearing flags
|
||||||
for (int i = 0; i < 3; i++) {
|
// for old dumps with all zero headers, we need to set default values.
|
||||||
|
for (uint8_t i = 0; i < 3; i++) {
|
||||||
|
|
||||||
counters[i] = le24toh(mfu_header->counter_tearing[i]);
|
counters[i] = le24toh(mfu_header->counter_tearing[i]);
|
||||||
|
|
||||||
|
if (mfu_header->counter_tearing[i][3] != 0x00) {
|
||||||
tearings[i] = mfu_header->counter_tearing[i][3];
|
tearings[i] = mfu_header->counter_tearing[i][3];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// GET_VERSION
|
// GET_VERSION
|
||||||
|
if (memcmp(mfu_header->version, "\x00\x00\x00\x00\x00\x00\x00\x00", 8) == 0) {
|
||||||
|
memcpy(rVERSION, "\x00\x04\x04\x02\x01\x00\x11\x03", 8);
|
||||||
|
} else {
|
||||||
memcpy(rVERSION, mfu_header->version, 8);
|
memcpy(rVERSION, mfu_header->version, 8);
|
||||||
|
}
|
||||||
AddCrc14A(rVERSION, sizeof(rVERSION) - 2);
|
AddCrc14A(rVERSION, sizeof(rVERSION) - 2);
|
||||||
|
|
||||||
// READ_SIG
|
// READ_SIG
|
||||||
memcpy(rSIGN, mfu_header->signature, 32);
|
memcpy(rSIGN, mfu_header->signature, 32);
|
||||||
AddCrc14A(rSIGN, sizeof(rSIGN) - 2);
|
AddCrc14A(rSIGN, sizeof(rSIGN) - 2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue