mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 04:50:12 -07:00
rem: 'hf iclass' blocknum LUT is gone. Removed also functionality for it.
This commit is contained in:
parent
5c380767e8
commit
50743b7e88
3 changed files with 4 additions and 28 deletions
|
@ -1825,6 +1825,8 @@ void setupIclassReader() {
|
|||
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_ISO14443A | FPGA_HF_ISO14443A_READER_MOD);
|
||||
SpinDelay(300);
|
||||
|
||||
init_table(CRC_15_ICLASS);
|
||||
|
||||
// Start the timer
|
||||
StartCountSspClk();
|
||||
|
||||
|
@ -2291,7 +2293,7 @@ out:
|
|||
|
||||
bool iClass_ReadBlock(uint8_t blockNo, uint8_t *readdata) {
|
||||
uint8_t readcmd[] = {ICLASS_CMD_READ_OR_IDENTIFY, blockNo, 0x00, 0x00}; //0x88, 0x00 // can i use 0C?
|
||||
uint16_t crc = iclass_crc16(readcmd+1, 1);
|
||||
uint16_t crc = crc16_iclass(readcmd+1, 1);
|
||||
readcmd[2] = crc >> 8;
|
||||
readcmd[3] = crc & 0xff;
|
||||
uint8_t resp[] = {0,0,0,0,0,0,0,0,0,0};
|
||||
|
@ -2348,7 +2350,7 @@ void iClass_Dump(uint8_t blockno, uint8_t numblks) {
|
|||
bool iClass_WriteBlock_ext(uint8_t blockNo, uint8_t *data) {
|
||||
uint8_t write[] = { ICLASS_CMD_UPDATE, blockNo, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
memcpy(write+2, data, 12); // data + mac
|
||||
uint16_t crc = iclass_crc16(write+1, 13);
|
||||
uint16_t crc = crc16_iclass(write+1, 13);
|
||||
write[14] = crc >> 8;
|
||||
write[15] = crc & 0xff;
|
||||
uint8_t resp[] = {0,0,0,0,0,0,0,0,0,0};
|
||||
|
|
|
@ -51,28 +51,3 @@ char* Iso15693sprintUID(char *target, uint8_t *uid) {
|
|||
);
|
||||
return target;
|
||||
}
|
||||
|
||||
uint16_t iclass_crc16(uint8_t *d, uint16_t n) {
|
||||
|
||||
unsigned int data;
|
||||
uint16_t crc = 0xffff;
|
||||
|
||||
|
||||
if (n == 0)
|
||||
return (~crc);
|
||||
|
||||
do {
|
||||
for (uint8_t i=0, data = *d++; i < 8; i++, data >>= 1) {
|
||||
if ((crc & 0x0001) ^ (data & 0x0001))
|
||||
crc = (crc >> 1) ^ ISO15_CRC_POLY;
|
||||
else
|
||||
crc >>= 1;
|
||||
}
|
||||
} while (--n);
|
||||
|
||||
crc = ~crc;
|
||||
data = crc;
|
||||
crc = (crc << 8) | (data >> 8 & 0xff);
|
||||
crc = crc ^ 0xBC3;
|
||||
return crc;
|
||||
}
|
|
@ -77,7 +77,6 @@ int Iso15693AddCrc(uint8_t *d, size_t n);
|
|||
bool Iso15693CheckCrc(uint8_t *d, size_t n);
|
||||
char* Iso15693sprintUID(char *target, uint8_t *uid);
|
||||
|
||||
uint16_t iclass_crc16(uint8_t *d, uint16_t n);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Map a sequence of octets (~layer 2 command) into the set of bits to feed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue