mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-07-16 10:03:04 -07:00
text
This commit is contained in:
parent
6eaff873ba
commit
c27264e4c4
15 changed files with 68 additions and 51 deletions
|
@ -2103,7 +2103,7 @@ static int CmdHF15CSetUID(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memcmp(revuid, payload.uid, 8) != 0) {
|
if (memcmp(revuid, payload.uid, 8) != 0) {
|
||||||
PrintAndLogEx(FAILED, "setting new UID (" _RED_("failed") ")");
|
PrintAndLogEx(FAILED, "setting new UID ( " _RED_("fail") " )");
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(SUCCESS, "setting new UID ( " _GREEN_("ok") " )");
|
PrintAndLogEx(SUCCESS, "setting new UID ( " _GREEN_("ok") " )");
|
||||||
|
|
|
@ -5150,7 +5150,7 @@ static int CmdHf14AMfSetMod(const char *Cmd) {
|
||||||
if (resp.status == PM3_SUCCESS)
|
if (resp.status == PM3_SUCCESS)
|
||||||
PrintAndLogEx(SUCCESS, "Change ( " _GREEN_("ok") " )");
|
PrintAndLogEx(SUCCESS, "Change ( " _GREEN_("ok") " )");
|
||||||
else
|
else
|
||||||
PrintAndLogEx(FAILED, "Change (" _GREEN_("fail") " )");
|
PrintAndLogEx(FAILED, "Change ( " _RED_("fail") " )");
|
||||||
|
|
||||||
return resp.status;
|
return resp.status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -513,8 +513,8 @@ static int CmdHFMFPWritePerso(const char *Cmd) {
|
||||||
PrintAndLogEx(ERR, "Command error: %02x %s", data[0], mfpGetErrorDescription(data[0]));
|
PrintAndLogEx(ERR, "Command error: %02x %s", data[0], mfpGetErrorDescription(data[0]));
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
PrintAndLogEx(INFO, "Write (" _GREEN_("ok") " )");
|
|
||||||
|
|
||||||
|
PrintAndLogEx(INFO, "Write ( " _GREEN_("ok") " )");
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -939,7 +939,7 @@ int CmdEM4x50WritePwd(const char *Cmd) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
|
|
||||||
if (resp.status != PM3_SUCCESS) {
|
if (resp.status != PM3_SUCCESS) {
|
||||||
PrintAndLogEx(FAILED, "Writing password (" _RED_("failed") ")");
|
PrintAndLogEx(FAILED, "Writing password ( " _RED_("fail") " )");
|
||||||
return PM3_EFAILED;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ int testMAC(void) {
|
||||||
if (memcmp(calculated_mac, correct_MAC, 4) == 0) {
|
if (memcmp(calculated_mac, correct_MAC, 4) == 0) {
|
||||||
PrintAndLogEx(SUCCESS, " MAC calculation ( %s )", _GREEN_("ok"));
|
PrintAndLogEx(SUCCESS, " MAC calculation ( %s )", _GREEN_("ok"));
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(FAILED, " MAC calculation (%s)", _RED_("failed"));
|
PrintAndLogEx(FAILED, " MAC calculation ( %s )", _RED_("fail"));
|
||||||
printarr(" Calculated_MAC", calculated_mac, 4);
|
printarr(" Calculated_MAC", calculated_mac, 4);
|
||||||
printarr(" Correct_MAC ", correct_MAC, 4);
|
printarr(" Correct_MAC ", correct_MAC, 4);
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
|
|
|
@ -200,7 +200,7 @@ static int testBitStream(void) {
|
||||||
if (memcmp(input, output, sizeof(input)) == 0) {
|
if (memcmp(input, output, sizeof(input)) == 0) {
|
||||||
PrintAndLogEx(SUCCESS, " Bitstream test 1 ( %s )", _GREEN_("ok"));
|
PrintAndLogEx(SUCCESS, " Bitstream test 1 ( %s )", _GREEN_("ok"));
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(FAILED, " Bitstream test 1 (%s)", _RED_("failed"));
|
PrintAndLogEx(FAILED, " Bitstream test 1 ( %s )", _RED_("fail"));
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
for (i = 0 ; i < ARRAYLEN(input) ; i++) {
|
for (i = 0 ; i < ARRAYLEN(input) ; i++) {
|
||||||
PrintAndLogEx(NORMAL, " IN %02x, OUT %02x", input[i], output[i]);
|
PrintAndLogEx(NORMAL, " IN %02x, OUT %02x", input[i], output[i]);
|
||||||
|
@ -230,7 +230,7 @@ static int testReversedBitstream(void) {
|
||||||
if (memcmp(input, output, sizeof(input)) == 0) {
|
if (memcmp(input, output, sizeof(input)) == 0) {
|
||||||
PrintAndLogEx(SUCCESS, " Bitstream test 2 ( %s )", _GREEN_("ok"));
|
PrintAndLogEx(SUCCESS, " Bitstream test 2 ( %s )", _GREEN_("ok"));
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(FAILED, " Bitstream test 2 (%s)", _RED_("failed"));
|
PrintAndLogEx(FAILED, " Bitstream test 2 ( %s )", _RED_("fail"));
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
for (i = 0 ; i < ARRAYLEN(input) ; i++) {
|
for (i = 0 ; i < ARRAYLEN(input) ; i++) {
|
||||||
PrintAndLogEx(NORMAL, " IN %02x, MIDDLE: %02x, OUT %02x", input[i], reverse[i], output[i]);
|
PrintAndLogEx(NORMAL, " IN %02x, MIDDLE: %02x, OUT %02x", input[i], reverse[i], output[i]);
|
||||||
|
|
|
@ -758,7 +758,7 @@ int bruteforceDump(uint8_t dump[], size_t dumpsize, uint16_t keytable[]) {
|
||||||
first16bytes[i] = keytable[i] & 0xFF;
|
first16bytes[i] = keytable[i] & 0xFF;
|
||||||
|
|
||||||
if ((keytable[i] & LOCLASS_CRACKED) != LOCLASS_CRACKED) {
|
if ((keytable[i] & LOCLASS_CRACKED) != LOCLASS_CRACKED) {
|
||||||
PrintAndLogEx(WARNING, "Warning: we are missing byte %d, custom key calculation will fail...", i);
|
PrintAndLogEx(WARNING, "Warning: we are missing byte " _RED_("%d") " , custom key calculation will fail...", i);
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,8 +141,25 @@ static uint8_t get_length_from_header(wiegand_message_t *data) {
|
||||||
hfmt = data->Top & 0x000FFFFF;
|
hfmt = data->Top & 0x000FFFFF;
|
||||||
len = 64;
|
len = 64;
|
||||||
} else if (data->Mid > 0) { // < 63-32 bits
|
} else if (data->Mid > 0) { // < 63-32 bits
|
||||||
|
|
||||||
|
// detect HID format b38 set
|
||||||
|
if (data->Mid & 0xFFFFFFC0) {
|
||||||
hfmt = data->Mid;
|
hfmt = data->Mid;
|
||||||
len = 32;
|
len = 32;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
printf("hid preamble detected\n");
|
||||||
|
len = 32;
|
||||||
|
|
||||||
|
if ((data->Mid ^ 0x20) == 0) { hfmt = data->Bot; len = 0; }
|
||||||
|
else if ((data->Mid & 0x10) == 0) { hfmt = data->Mid & 0x1F; }
|
||||||
|
else if ((data->Mid & 0x08) == 0) { hfmt = data->Mid & 0x0F; }
|
||||||
|
else if ((data->Mid & 0x04) == 0) { hfmt = data->Mid & 0x07; }
|
||||||
|
else if ((data->Mid & 0x02) == 0) { hfmt = data->Mid & 0x03; }
|
||||||
|
else if ((data->Mid & 0x01) == 0) { hfmt = data->Mid & 0x01; }
|
||||||
|
else { hfmt = data->Mid & 0x3F;}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
hfmt = data->Bot;
|
hfmt = data->Bot;
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue