Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISO15693 NXP SLIX-L features #930

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 109 additions & 1 deletion armsrc/appmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ void SendStatus(void) {
LED_A_OFF();
}

#if defined(WITH_ISO14443a_StandAlone) || defined(WITH_LF_StandAlone)
#if defined(WITH_ISO14443a_StandAlone) || defined(WITH_ISO15693_StandAlone) || defined(WITH_LF_StandAlone)

#define OPTS 2

Expand Down Expand Up @@ -778,6 +778,106 @@ void SamyRun() {
}
}

#elif WITH_ISO15693_StandAlone

void StandAloneMode15() {
StandAloneMode();
FpgaDownloadAndGo(FPGA_BITSTREAM_HF);

int mode = 0;
bool done = false;
const char *modes[] = { "Set password", "Reveal tag", "Lock password", "Stresstest", "Bruteforce", "Quit standalone" };

Dbprintf("Starting standalone mode: Menu");
LED(0x0F, 0);

/* wait for button being released before preoceeding evaluation */
while(BUTTON_PRESS()) {
WDT_HIT();
}

while(!done) {
if(usb_poll_validate_length()) {
done = true;
continue;
}

SpinDelay(50);
usb_poll();
WDT_HIT();

LEDsoff();
switch(mode) {
case 0:
LED_A_ON();
break;
case 1:
LED_B_ON();
break;
case 2:
LED_C_ON();
break;
case 3:
LED_D_ON();
break;
case 4:
LED_D_ON();
LED_A_ON();
break;
case 5:
LED_A_ON();
LED_B_ON();
LED_C_ON();
LED_D_ON();
break;
}

switch(BUTTON_HELD(1000)) {
case BUTTON_SINGLE_CLICK:
mode++;
mode %= 6;
Dbprintf(" Menu #%d: %s", mode, modes[mode]);
break;
case BUTTON_HOLD:
Dbprintf(" Execute #%d", mode);
LEDsoff();
while(BUTTON_PRESS()) {
WDT_HIT();
}

switch(mode) {
case 0:
ChangePassSlixLIso15693(4, 0, 0x7FFD6E5B);
break;
case 1:
DisablePrivacySlixLIso15693(0x7FFD6E5B);
DisablePrivacySlixLIso15693(0x0F0F0F0F);
break;
case 2:
LockPassSlixLIso15693(4, 0x7FFD6E5B);
break;
case 3:
StressSlixLIso15693(0x0F0F0F0F, 7);
break;
case 4:
BruteforceIso15693(0x40, 0xFF);
break;
case 5:
done = true;
break;
}
LEDsoff();
while(BUTTON_PRESS()) {
WDT_HIT();
}
break;
default:
SpinDelay(50);
continue;
}
}
}

#endif

/*
Expand Down Expand Up @@ -1095,6 +1195,10 @@ void UsbPacketReceived(UsbCommand *c) {
DirectTag15693Command(c->arg[0],c->arg[1],c->arg[2],c->d.asBytes);
break;

case CMD_ISO_15693_SLIX_L_DISABLE_PRIVACY:
DisablePrivacySlixLIso15693(c->arg[0]);
break;

case CMD_ISO_15693_FIND_AFI:
BruteforceIso15693Afi(c->arg[0]);
break;
Expand Down Expand Up @@ -1494,6 +1598,10 @@ void __attribute__((noreturn)) AppMain(void) {
#if defined(WITH_ISO14443a) && defined(WITH_ISO14443a_StandAlone)
if (BUTTON_HELD(1000) > 0)
StandAloneMode14a();
#endif
#if defined(WITH_ISO15693) && defined(WITH_ISO15693_StandAlone)
if (BUTTON_HELD(1000) > 0)
StandAloneMode15();
#endif
}
}
Expand Down
Loading