mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-25 22:49:41 +08:00
Refactor emulator accessor helpers for ISO15693.
This commit is contained in:
parent
41f36199aa
commit
c062c44230
2 changed files with 12 additions and 6 deletions
armsrc
|
@ -2111,6 +2111,11 @@ void EmlSetMemIso15693(uint8_t count, uint8_t *data, uint32_t offset) {
|
||||||
memcpy(emCARD + offset, data, count);
|
memcpy(emCARD + offset, data, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EmlGetMemIso15693(uint8_t count, uint8_t *output, uint32_t offset) {
|
||||||
|
uint8_t *emCARD = BigBuf_get_EM_addr();
|
||||||
|
memcpy(output, emCARD + offset, count);
|
||||||
|
}
|
||||||
|
|
||||||
// Simulate an ISO15693 TAG, perform anti-collision and then print any reader commands
|
// Simulate an ISO15693 TAG, perform anti-collision and then print any reader commands
|
||||||
// all demodulation performed in arm rather than host. - greg
|
// all demodulation performed in arm rather than host. - greg
|
||||||
void SimTagIso15693(uint8_t *uid, uint8_t block_size) {
|
void SimTagIso15693(uint8_t *uid, uint8_t block_size) {
|
||||||
|
@ -2272,7 +2277,6 @@ void SimTagIso15693(uint8_t *uid, uint8_t block_size) {
|
||||||
resp_readblock[i] = 0;
|
resp_readblock[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *emCARD = BigBuf_get_EM_addr();
|
|
||||||
resp_readblock[0] = 0; // Response flags
|
resp_readblock[0] = 0; // Response flags
|
||||||
for (int j = 0; j < block_count; j++) {
|
for (int j = 0; j < block_count; j++) {
|
||||||
// where to put the data of the current block
|
// where to put the data of the current block
|
||||||
|
@ -2280,11 +2284,12 @@ void SimTagIso15693(uint8_t *uid, uint8_t block_size) {
|
||||||
if (option) {
|
if (option) {
|
||||||
resp_readblock[work_offset] = 0; // Security status
|
resp_readblock[work_offset] = 0; // Security status
|
||||||
}
|
}
|
||||||
for (int i = 0; i < block_size; i++) {
|
// Block data
|
||||||
// Block data
|
if (block_size * (block_idx + j + 1) <= CARD_MEMORY_SIZE) {
|
||||||
if (block_size * (block_idx + j + 1) <= CARD_MEMORY_SIZE) {
|
EmlGetMemIso15693(block_size, resp_readblock + (work_offset + security_offset),
|
||||||
resp_readblock[work_offset + security_offset + i] = emCARD[block_size * (block_idx + j) + i];
|
block_size * (block_idx + j));
|
||||||
} else {
|
} else {
|
||||||
|
for (int i = 0; i < block_size; i++) {
|
||||||
resp_readblock[work_offset + security_offset + i] = 0;
|
resp_readblock[work_offset + security_offset + i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ void AcquireRawAdcSamplesIso15693(void);
|
||||||
void ReaderIso15693(iso15_card_select_t *p_card); // ISO15693 reader
|
void ReaderIso15693(iso15_card_select_t *p_card); // ISO15693 reader
|
||||||
void EmlClearIso15693(void);
|
void EmlClearIso15693(void);
|
||||||
void EmlSetMemIso15693(uint8_t count, uint8_t *data, uint32_t offset);
|
void EmlSetMemIso15693(uint8_t count, uint8_t *data, uint32_t offset);
|
||||||
|
void EmlGetMemIso15693(uint8_t count, uint8_t *output, uint32_t offset);
|
||||||
void SimTagIso15693(uint8_t *uid, uint8_t block_size); // simulate an ISO15693 tag
|
void SimTagIso15693(uint8_t *uid, uint8_t block_size); // simulate an ISO15693 tag
|
||||||
void BruteforceIso15693Afi(uint32_t speed); // find an AFI of a tag
|
void BruteforceIso15693Afi(uint32_t speed); // find an AFI of a tag
|
||||||
void DirectTag15693Command(uint32_t datalen, uint32_t speed, uint32_t recv, uint8_t *data); // send arbitrary commands from CLI
|
void DirectTag15693Command(uint32_t datalen, uint32_t speed, uint32_t recv, uint8_t *data); // send arbitrary commands from CLI
|
||||||
|
|
Loading…
Add table
Reference in a new issue