mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix: using the right sized param, helps..
This commit is contained in:
parent
a4ce672d12
commit
945bbe6311
1 changed files with 15 additions and 11 deletions
|
@ -170,22 +170,26 @@ static int usage_legic_wipe(void) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool legic_xor(uint8_t *data, uint8_t cardsize) {
|
static bool legic_xor(uint8_t *data, uint16_t cardsize) {
|
||||||
bool ret = true;
|
|
||||||
|
if (cardsize <= 22) {
|
||||||
|
PrintAndLogEx(INFO, "No obsfuscation such small dump");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t crc = data[4];
|
uint8_t crc = data[4];
|
||||||
uint32_t calc_crc = CRC8Legic(data, 4);
|
uint32_t calc_crc = CRC8Legic(data, 4);
|
||||||
if (crc != calc_crc) {
|
if (crc != calc_crc) {
|
||||||
PrintAndLogEx(INFO, "Crc mismatch, obsfuscation not possible");
|
PrintAndLogEx(INFO, "Crc mismatch, obsfuscation not possible");
|
||||||
ret = false;
|
return false;
|
||||||
} else if (cardsize <= 22) {
|
}
|
||||||
PrintAndLogEx(INFO, "No obsfuscation such small dump");
|
|
||||||
} else {
|
|
||||||
for(uint16_t i = 22; i < cardsize - 22; i++) {
|
for(uint16_t i = 22; i < cardsize - 22; i++) {
|
||||||
data[i] ^= crc;
|
data[i] ^= crc;
|
||||||
}
|
|
||||||
PrintAndLogEx(SUCCESS, "Obsfuscation done");
|
|
||||||
}
|
}
|
||||||
return ret;
|
PrintAndLogEx(SUCCESS, "Obsfuscation done");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue