mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix: VIGIKPWN - use 10/7/4 uid (@McEloff)
This commit is contained in:
parent
bb45aad212
commit
cd9092c58a
1 changed files with 19 additions and 5 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
uint8_t cjuid[10];
|
uint8_t cjuid[10];
|
||||||
uint32_t cjcuid;
|
uint32_t cjcuid;
|
||||||
|
iso14a_card_select_t p_card;
|
||||||
int currline;
|
int currline;
|
||||||
int currfline;
|
int currfline;
|
||||||
int curlline;
|
int curlline;
|
||||||
|
@ -350,7 +351,7 @@ failtag:
|
||||||
LED_A_ON();
|
LED_A_ON();
|
||||||
uint8_t ticker = 0;
|
uint8_t ticker = 0;
|
||||||
//while (!BUTTON_PRESS() && !iso14443a_select_card(cjuid, NULL, &cjcuid, true, 0, true))
|
//while (!BUTTON_PRESS() && !iso14443a_select_card(cjuid, NULL, &cjcuid, true, 0, true))
|
||||||
while (!iso14443a_select_card(cjuid, NULL, &cjcuid, true, 0, true)) {
|
while (!iso14443a_select_card(cjuid, &p_card, &cjcuid, true, 0, true)) {
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
|
||||||
ticker++;
|
ticker++;
|
||||||
|
@ -773,7 +774,20 @@ readysim:
|
||||||
|
|
||||||
SpinOff(100);
|
SpinOff(100);
|
||||||
LED_C_ON();
|
LED_C_ON();
|
||||||
Mifare1ksim(FLAG_4B_UID_IN_DATA | FLAG_UID_IN_EMUL, 0, cjuid);
|
|
||||||
|
uint16_t flags;
|
||||||
|
switch (p_card.uidlen){
|
||||||
|
case 10:
|
||||||
|
flags = FLAG_10B_UID_IN_DATA;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
flags = FLAG_7B_UID_IN_DATA;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
flags = FLAG_4B_UID_IN_DATA;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Mifare1ksim(flags | FLAG_MF_1K, 0, cjuid);
|
||||||
LED_C_OFF();
|
LED_C_OFF();
|
||||||
SpinOff(50);
|
SpinOff(50);
|
||||||
vtsend_cursor_position_restore(NULL);
|
vtsend_cursor_position_restore(NULL);
|
||||||
|
@ -832,7 +846,7 @@ int e_MifareECardLoad(uint32_t numofsectors, uint8_t keytype) {
|
||||||
|
|
||||||
bool isOK = true;
|
bool isOK = true;
|
||||||
|
|
||||||
if (!iso14443a_select_card(cjuid, NULL, &cjcuid, true, 0, true)) {
|
if (!iso14443a_select_card(cjuid, &p_card, &cjcuid, true, 0, true)) {
|
||||||
isOK = false;
|
isOK = false;
|
||||||
if (MF_DBGLEVEL >= 1)
|
if (MF_DBGLEVEL >= 1)
|
||||||
DbprintfEx(FLAG_RAWPRINT, "Can't select card");
|
DbprintfEx(FLAG_RAWPRINT, "Can't select card");
|
||||||
|
@ -903,7 +917,7 @@ int cjat91_saMifareChkKeys(uint8_t blockNo, uint8_t keyType, bool clearTrace, ui
|
||||||
|
|
||||||
/* no need for anticollision. just verify tag is still here */
|
/* no need for anticollision. just verify tag is still here */
|
||||||
// if (!iso14443a_fast_select_card(cjuid, 0)) {
|
// if (!iso14443a_fast_select_card(cjuid, 0)) {
|
||||||
if (!iso14443a_select_card(cjuid, NULL, &cjcuid, true, 0, true)) {
|
if (!iso14443a_select_card(cjuid, &p_card, &cjcuid, true, 0, true)) {
|
||||||
cjSetCursLeft();
|
cjSetCursLeft();
|
||||||
DbprintfEx(FLAG_NEWLINE, "%sFATAL%s : E_MF_LOSTTAG", _XRED_, _XWHITE_);
|
DbprintfEx(FLAG_NEWLINE, "%sFATAL%s : E_MF_LOSTTAG", _XRED_, _XWHITE_);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1034,7 +1048,7 @@ int saMifareCSetBlock(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *data
|
||||||
|
|
||||||
// get UID from chip
|
// get UID from chip
|
||||||
if (workFlags & 0x01) {
|
if (workFlags & 0x01) {
|
||||||
if (!iso14443a_select_card(cjuid, NULL, &cjcuid, true, 0, true)) {
|
if (!iso14443a_select_card(cjuid, &p_card, &cjcuid, true, 0, true)) {
|
||||||
DbprintfEx(FLAG_NEWLINE, "Can't select card");
|
DbprintfEx(FLAG_NEWLINE, "Can't select card");
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue