mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 13:23:25 -07:00
fix 'hf iclass replay' (#888)
* implement option -n for authentication with replayed NR/MAC pairs in 'dump' and 'readbl' * delete 'hf iclass replay'
This commit is contained in:
parent
00848e096b
commit
28ae37b746
7 changed files with 107 additions and 262 deletions
|
@ -70,7 +70,7 @@ char* Iso15693sprintUID(char *target, uint8_t *uid) {
|
|||
}
|
||||
|
||||
|
||||
uint16_t iclass_crc16(char *data_p, unsigned short length) {
|
||||
uint16_t iclass_crc16(uint8_t *data_p, unsigned short length) {
|
||||
unsigned char i;
|
||||
unsigned int data;
|
||||
uint16_t crc = ISO15693_CRC_PRESET;
|
||||
|
@ -79,7 +79,7 @@ uint16_t iclass_crc16(char *data_p, unsigned short length) {
|
|||
return (~crc);
|
||||
|
||||
do {
|
||||
for (i = 0, data = (unsigned int)0xff & *data_p++; i < 8; i++, data >>= 1) {
|
||||
for (i = 0, data = 0xff & *data_p++; i < 8; i++, data >>= 1) {
|
||||
if ((crc & 0x0001) ^ (data & 0x0001))
|
||||
crc = (crc >> 1) ^ ISO15693_CRC_POLY;
|
||||
else crc >>= 1;
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
uint16_t Iso15693Crc(uint8_t *v, int n);
|
||||
int Iso15693AddCrc(uint8_t *req, int n);
|
||||
char* Iso15693sprintUID(char *target, uint8_t *uid);
|
||||
unsigned short iclass_crc16(char *data_p, unsigned short length);
|
||||
unsigned short iclass_crc16(uint8_t *data_p, unsigned short length);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue