fix: LED is used as a flag, 1,2,4,8 not 1,2,3,4..

This commit is contained in:
iceman1001 2019-09-12 09:58:05 +02:00
commit 3587aeff2a
4 changed files with 30 additions and 27 deletions

View file

@ -229,7 +229,7 @@ void RAMFUNC SniffAndStore(uint8_t param) {
if (DBGLEVEL > 1) if (DBGLEVEL > 1)
Dbprintf("[!] Wrote %u Authentification attempts into logfile", auth_attempts); Dbprintf("[!] Wrote %u Authentification attempts into logfile", auth_attempts);
SpinErr(0, 200, 5); // blink led A SpinErr(LED_A, 200, 5);
SpinDelay(100); SpinDelay(100);
} }

View file

@ -518,7 +518,7 @@ failtag:
if (cjcuid == 0) { if (cjcuid == 0) {
cjSetCursLeft(); cjSetCursLeft();
DbprintfEx(FLAG_NEWLINE, "%s>>%s BUG: 0000_CJCUID! Retrying...", _XRED_, _XWHITE_); DbprintfEx(FLAG_NEWLINE, "%s>>%s BUG: 0000_CJCUID! Retrying...", _XRED_, _XWHITE_);
SpinErr(0, 100, 8); SpinErr(LED_A, 100, 8);
goto failtag; goto failtag;
} }
@ -636,7 +636,7 @@ failtag:
cjTabulize(); cjTabulize();
DbprintfEx(FLAG_NEWLINE, "%s[ FAIL ]%s\r\n->did not found all the keys :'(", _XRED_, _XWHITE_); DbprintfEx(FLAG_NEWLINE, "%s[ FAIL ]%s\r\n->did not found all the keys :'(", _XRED_, _XWHITE_);
cjSetCursLeft(); cjSetCursLeft();
SpinErr(1, 100, 8); SpinErr(LEB_B, 100, 8);
SpinOff(100); SpinOff(100);
return; return;
} }
@ -672,7 +672,7 @@ failtag:
cjSetCursLeft(); cjSetCursLeft();
DbprintfEx(FLAG_NEWLINE, "FATAL:EML_FALLBACKFILL_B"); DbprintfEx(FLAG_NEWLINE, "FATAL:EML_FALLBACKFILL_B");
SpinErr(2, 100, 8); SpinErr(LED_C, 100, 8);
SpinOff(100); SpinOff(100);
return; return;
} }
@ -778,7 +778,7 @@ readysim:
DbprintfEx(FLAG_NEWLINE, "- [ LA FIN ] -\r\n%s`-> You can take shell back :) ...", _XWHITE_); DbprintfEx(FLAG_NEWLINE, "- [ LA FIN ] -\r\n%s`-> You can take shell back :) ...", _XWHITE_);
cjSetCursLeft(); cjSetCursLeft();
vtsend_set_attribute(NULL, 0); vtsend_set_attribute(NULL, 0);
SpinErr(3, 100, 16); SpinErr(LED_D, 100, 16);
SpinDown(75); SpinDown(75);
SpinOff(100); SpinOff(100);
return; return;

View file

@ -447,15 +447,12 @@ void SendCapabilities(void) {
// Show some leds in a pattern to identify StandAlone mod is running // Show some leds in a pattern to identify StandAlone mod is running
void StandAloneMode(void) { void StandAloneMode(void) {
DbpString("Stand-alone mode, no computer necessary");
DbpString("Stand-alone mode! No PC necessary.");
SpinDown(50); SpinDown(50);
SpinOff(50); SpinDelay(50);
SpinUp(50); SpinUp(50);
SpinOff(50); SpinDelay(50);
SpinDown(50); SpinDown(50);
SpinDelay(500);
} }
/* /*
@ -1215,7 +1212,11 @@ static void PacketReceived(PacketCommandNG *packet) {
break; break;
} }
case CMD_HF_ICLASS_READER: { case CMD_HF_ICLASS_READER: {
ReaderIClass(packet->oldarg[0]); struct p {
uint8_t flags;
} PACKED;
struct p *payload = (struct p *)packet->data.asBytes;
ReaderIClass(payload->flags);
break; break;
} }
case CMD_HF_ICLASS_REPLAY: { case CMD_HF_ICLASS_REPLAY: {

View file

@ -90,6 +90,7 @@ void LEDsoff() {
LED_D_OFF(); LED_D_OFF();
} }
//ICEMAN: LED went from 1,2,3,4 -> 1,2,4,8
void LED(int led, int ms) { void LED(int led, int ms) {
if (led & LED_A) // Proxmark3 historical mapping: LED_ORANGE if (led & LED_A) // Proxmark3 historical mapping: LED_ORANGE
LED_A_ON(); LED_A_ON();
@ -123,26 +124,27 @@ void SpinOff(uint32_t pause) {
SpinDelay(pause); SpinDelay(pause);
} }
// 0=A, 1=B, 2=C, 3=D // Blinks..
// A = 1, B = 2, C = 4, D = 8
void SpinErr(uint8_t led, uint32_t speed, uint8_t times) { void SpinErr(uint8_t led, uint32_t speed, uint8_t times) {
SpinOff(speed); SpinOff(speed);
NTIME(times) { NTIME(times) {
switch (led) {
case 0: if (led & LED_A) // Proxmark3 historical mapping: LED_ORANGE
LED_A_INV(); LED_A_INV();
break; if (led & LED_B) // Proxmark3 historical mapping: LED_GREEN
case 1: LED_B_INV();
LED_B_INV(); if (led & LED_C) // Proxmark3 historical mapping: LED_RED
break; LED_C_INV();
case 2: if (led & LED_D) // Proxmark3 historical mapping: LED_RED2
LED_C_INV(); LED_D_INV();
break;
case 3:
LED_D_INV();
break;
}
SpinDelay(speed); SpinDelay(speed);
} }
LED_A_OFF();
LED_B_OFF();
LED_C_OFF();
LED_D_OFF();
} }
void SpinDown(uint32_t speed) { void SpinDown(uint32_t speed) {