mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
FIX: cleanup code, sync of output texts.
This commit is contained in:
parent
4c37126baf
commit
4c72acaf63
3 changed files with 66 additions and 61 deletions
|
@ -47,7 +47,7 @@ void RunMod() {
|
|||
|
||||
// Was our button held down or pressed?
|
||||
int button_pressed = BUTTON_HELD(1000);
|
||||
//SpinDelay(300);
|
||||
SpinDelay(300);
|
||||
|
||||
// Button was held for a second, begin recording
|
||||
if (button_pressed > 0 && cardRead == 0) {
|
||||
|
@ -56,7 +56,7 @@ void RunMod() {
|
|||
LED(LED_RED2, 0);
|
||||
|
||||
// record
|
||||
DbpString("[+] starting recording");
|
||||
DbpString("[=] starting recording");
|
||||
|
||||
// wait for button to be released
|
||||
while(BUTTON_PRESS())
|
||||
|
@ -66,7 +66,7 @@ void RunMod() {
|
|||
SpinDelay(500);
|
||||
|
||||
CmdHIDdemodFSK(1, &high[selected], &low[selected], 0);
|
||||
Dbprintf("[+] recorded %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] recorded %x %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
LEDsoff();
|
||||
LED(selected + 1, 0);
|
||||
|
@ -82,7 +82,7 @@ void RunMod() {
|
|||
LED(LED_ORANGE, 0);
|
||||
|
||||
// record
|
||||
Dbprintf("[+] cloning %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] cloning %x %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
// wait for button to be released
|
||||
while(BUTTON_PRESS())
|
||||
|
@ -92,7 +92,7 @@ void RunMod() {
|
|||
SpinDelay(500);
|
||||
|
||||
CopyHIDtoT55x7(0, high[selected], low[selected], 0);
|
||||
Dbprintf("[+] cloned %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] cloned %x %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
LEDsoff();
|
||||
LED(selected + 1, 0);
|
||||
|
@ -109,6 +109,7 @@ void RunMod() {
|
|||
// Next option if we were previously playing
|
||||
if (playing)
|
||||
selected = (selected + 1) % OPTS;
|
||||
|
||||
playing = !playing;
|
||||
|
||||
LEDsoff();
|
||||
|
@ -118,21 +119,18 @@ void RunMod() {
|
|||
if (playing && selected != 2) {
|
||||
|
||||
LED(LED_GREEN, 0);
|
||||
DbpString("[+] playing");
|
||||
DbpString("[=] playing");
|
||||
|
||||
// wait for button to be released
|
||||
while (BUTTON_PRESS())
|
||||
WDT_HIT();
|
||||
|
||||
Dbprintf("[+] %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] %x %x %08x", selected, high[selected], low[selected]);
|
||||
CmdHIDsimTAG(high[selected], low[selected], 0);
|
||||
DbpString("[+] done playing");
|
||||
DbpString("[=] done playing");
|
||||
|
||||
if (BUTTON_HELD(1000) > 0) {
|
||||
DbpString("[+] exiting");
|
||||
LEDsoff();
|
||||
return;
|
||||
}
|
||||
if (BUTTON_HELD(1000) > 0)
|
||||
goto out;
|
||||
|
||||
/* We pressed a button so ignore it here with a delay */
|
||||
SpinDelay(300);
|
||||
|
@ -166,18 +164,18 @@ void RunMod() {
|
|||
uint32_t fc = ((high[selected] & 1 ) << 11 ) | (low[selected] >> 21);
|
||||
uint32_t original_cardnum = cardnum;
|
||||
|
||||
Dbprintf("[+] Proxbrute - starting decrementing card number");
|
||||
Dbprintf("[=] Proxbrute - starting decrementing card number");
|
||||
|
||||
while (cardnum >= 0) {
|
||||
|
||||
// Needed for exiting from proxbrute when button is pressed
|
||||
if (BUTTON_PRESS()) {
|
||||
if (BUTTON_HELD(1000) > 0) {
|
||||
DbpString("[+] exiting");
|
||||
LEDsoff();
|
||||
return;
|
||||
goto out;
|
||||
} else {
|
||||
while (BUTTON_PRESS()) { WDT_HIT(); }
|
||||
while (BUTTON_PRESS()) {
|
||||
WDT_HIT();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -189,23 +187,21 @@ void RunMod() {
|
|||
hid_corporate_1000_calculate_checksum_and_set(&high[selected], &low[selected], cardnum, fc);
|
||||
|
||||
// Print actual code to brute
|
||||
Dbprintf("[+] TAG ID: %x%08x (%d) - FC: %u - Card: %u", high[selected], low[selected], (low[selected] >> 1) & 0xFFFF, fc, cardnum);
|
||||
Dbprintf("[=] TAG ID: %x%08x (%d) - FC: %u - Card: %u", high[selected], low[selected], (low[selected] >> 1) & 0xFFFF, fc, cardnum);
|
||||
|
||||
CmdHIDsimTAGEx(high[selected], low[selected], 1, 50000);
|
||||
}
|
||||
|
||||
cardnum = original_cardnum;
|
||||
|
||||
Dbprintf("[+] Proxbrute - starting incrementing card number");
|
||||
Dbprintf("[=] Proxbrute - starting incrementing card number");
|
||||
|
||||
while (cardnum <= 0xFFFFF) {
|
||||
|
||||
// Needed for exiting from proxbrute when button is pressed
|
||||
if (BUTTON_PRESS()) {
|
||||
if (BUTTON_HELD(1000) > 0) {
|
||||
DbpString("[+] exiting");
|
||||
LEDsoff();
|
||||
return;
|
||||
goto out;
|
||||
} else {
|
||||
while (BUTTON_PRESS()) { WDT_HIT(); }
|
||||
break;
|
||||
|
@ -219,17 +215,14 @@ void RunMod() {
|
|||
hid_corporate_1000_calculate_checksum_and_set(&high[selected], &low[selected], cardnum, fc);
|
||||
|
||||
// Print actual code to brute
|
||||
Dbprintf("[+] TAG ID: %x%08x (%d) - FC: %u - Card: %u", high[selected], low[selected], (low[selected] >> 1) & 0xFFFF, fc, cardnum);
|
||||
Dbprintf("[=] TAG ID: %x%08x (%d) - FC: %u - Card: %u", high[selected], low[selected], (low[selected] >> 1) & 0xFFFF, fc, cardnum);
|
||||
|
||||
CmdHIDsimTAGEx(high[selected], low[selected], 1, 50000);
|
||||
}
|
||||
|
||||
DbpString("[+] done bruteforcing");
|
||||
if (BUTTON_HELD(1000) > 0) {
|
||||
DbpString("Exiting");
|
||||
LEDsoff();
|
||||
return;
|
||||
}
|
||||
DbpString("[=] done bruteforcing");
|
||||
if (BUTTON_HELD(1000) > 0)
|
||||
goto out;
|
||||
|
||||
/* We pressed a button so ignore it here with a delay */
|
||||
SpinDelay(300);
|
||||
|
@ -246,6 +239,10 @@ void RunMod() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
DbpString("[=] exiting");
|
||||
LEDsoff();
|
||||
}
|
||||
|
||||
// Function that calculate next value for the brutforce of HID corporate 1000
|
||||
|
|
|
@ -32,7 +32,7 @@ void RunMod() {
|
|||
|
||||
// Was our button held down or pressed?
|
||||
int button_pressed = BUTTON_HELD(1000);
|
||||
//SpinDelay(300);
|
||||
SpinDelay(300);
|
||||
|
||||
// Button was held for a second, begin recording
|
||||
if (button_pressed > 0 && cardRead == 0) {
|
||||
|
@ -41,7 +41,7 @@ void RunMod() {
|
|||
LED(LED_RED2, 0);
|
||||
|
||||
// record
|
||||
DbpString("[+] starting recording");
|
||||
DbpString("[=] starting recording");
|
||||
|
||||
// wait for button to be released
|
||||
while (BUTTON_PRESS())
|
||||
|
@ -51,7 +51,7 @@ void RunMod() {
|
|||
SpinDelay(500);
|
||||
|
||||
CmdHIDdemodFSK(1, &high[selected], &low[selected], 0);
|
||||
Dbprintf("[+] recorded %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] recorded %x %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
LEDsoff();
|
||||
LED(selected + 1, 0);
|
||||
|
@ -67,7 +67,7 @@ void RunMod() {
|
|||
LED(LED_ORANGE, 0);
|
||||
|
||||
// record
|
||||
Dbprintf("[+] cloning %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] cloning %x %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
// wait for button to be released
|
||||
while (BUTTON_PRESS())
|
||||
|
@ -77,7 +77,7 @@ void RunMod() {
|
|||
SpinDelay(500);
|
||||
|
||||
CopyHIDtoT55x7(0, high[selected], low[selected], 0);
|
||||
Dbprintf("[+] cloned %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] cloned %x %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
LEDsoff();
|
||||
LED(selected + 1, 0);
|
||||
|
@ -102,7 +102,7 @@ void RunMod() {
|
|||
// Begin transmitting
|
||||
if (playing) {
|
||||
LED(LED_GREEN, 0);
|
||||
DbpString("[+] playing");
|
||||
DbpString("[=] playing");
|
||||
// wait for button to be released
|
||||
while (BUTTON_PRESS())
|
||||
WDT_HIT();
|
||||
|
@ -120,7 +120,7 @@ void RunMod() {
|
|||
*/
|
||||
if ( selected == 1 ) {
|
||||
DbpString("[=] entering ProxBrute Mode");
|
||||
Dbprintf("[+] current Tag: Selected = %x Facility = %08x ID = %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] current Tag: Selected = %x Facility = %08x ID = %08x", selected, high[selected], low[selected]);
|
||||
LED(LED_ORANGE, 0);
|
||||
LED(LED_RED, 0);
|
||||
for (uint16_t i = low[selected]-1; i > 0; i--) {
|
||||
|
@ -135,20 +135,17 @@ void RunMod() {
|
|||
}
|
||||
|
||||
} else {
|
||||
DbpString("[+] RED is lit, not entering ProxBrute Mode");
|
||||
Dbprintf("[+] %x %x %x", selected, high[selected], low[selected]);
|
||||
DbpString("[=] RED is lit, not entering ProxBrute Mode");
|
||||
Dbprintf("[=] %x %x %x", selected, high[selected], low[selected]);
|
||||
CmdHIDsimTAGEx(high[selected], low[selected], 0, 20000);
|
||||
DbpString("[+] done playing");
|
||||
DbpString("[=] done playing");
|
||||
}
|
||||
|
||||
/* END PROXBRUTE */
|
||||
|
||||
|
||||
if (BUTTON_HELD(1000) > 0) {
|
||||
DbpString("[+] exiting");
|
||||
LEDsoff();
|
||||
return;
|
||||
}
|
||||
if (BUTTON_HELD(1000) > 0)
|
||||
goto out;
|
||||
|
||||
/* We pressed a button so ignore it here with a delay */
|
||||
SpinDelay(300);
|
||||
|
@ -165,4 +162,7 @@ void RunMod() {
|
|||
}
|
||||
}
|
||||
}
|
||||
out:
|
||||
DbpString("[=] exiting");
|
||||
LEDsoff();
|
||||
}
|
|
@ -19,7 +19,7 @@ void RunMod() {
|
|||
int selected = 0;
|
||||
int playing = 0;
|
||||
int cardRead = 0;
|
||||
|
||||
bool gotCard;
|
||||
// Turn on selected LED
|
||||
LED(selected + 1, 0);
|
||||
|
||||
|
@ -31,7 +31,9 @@ void RunMod() {
|
|||
|
||||
// Was our button held down or pressed?
|
||||
int button_pressed = BUTTON_HELD(1000);
|
||||
//SpinDelay(300);
|
||||
|
||||
Dbprintf("button %d", button_pressed);
|
||||
SpinDelay(300);
|
||||
|
||||
// Button was held for a second, begin recording
|
||||
if (button_pressed > 0 && cardRead == 0) {
|
||||
|
@ -40,7 +42,7 @@ void RunMod() {
|
|||
LED(LED_RED2, 0);
|
||||
|
||||
// record
|
||||
DbpString("[+] starting recording");
|
||||
DbpString("[=] starting recording");
|
||||
|
||||
// wait for button to be released
|
||||
while (BUTTON_PRESS())
|
||||
|
@ -50,7 +52,7 @@ void RunMod() {
|
|||
SpinDelay(500);
|
||||
|
||||
CmdHIDdemodFSK(1, &high[selected], &low[selected], 0);
|
||||
Dbprintf("[+] recorded %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] recorded bank %x | %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
LEDsoff();
|
||||
LED(selected + 1, 0);
|
||||
|
@ -58,7 +60,9 @@ void RunMod() {
|
|||
// If we were previously playing, set playing off
|
||||
// so next button push begins playing what we recorded
|
||||
playing = 0;
|
||||
cardRead = 1;
|
||||
cardRead = 1;
|
||||
|
||||
gotCard = true;
|
||||
}
|
||||
else if (button_pressed > 0 && cardRead == 1) {
|
||||
LEDsoff();
|
||||
|
@ -66,7 +70,7 @@ void RunMod() {
|
|||
LED(LED_ORANGE, 0);
|
||||
|
||||
// record
|
||||
Dbprintf("[+] cloning %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] cloning %x %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
// wait for button to be released
|
||||
while (BUTTON_PRESS())
|
||||
|
@ -76,7 +80,7 @@ void RunMod() {
|
|||
SpinDelay(500);
|
||||
|
||||
CopyHIDtoT55x7(0, high[selected], low[selected], 0);
|
||||
Dbprintf("[+] cloned %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] cloned %x %x %08x", selected, high[selected], low[selected]);
|
||||
|
||||
LEDsoff();
|
||||
LED(selected + 1, 0);
|
||||
|
@ -89,10 +93,11 @@ void RunMod() {
|
|||
}
|
||||
|
||||
// Change where to record (or begin playing)
|
||||
else if (button_pressed) {
|
||||
else if (button_pressed && gotCard) {
|
||||
// Next option if we were previously playing
|
||||
if (playing)
|
||||
selected = (selected + 1) % OPTS;
|
||||
|
||||
playing = !playing;
|
||||
|
||||
LEDsoff();
|
||||
|
@ -100,21 +105,20 @@ void RunMod() {
|
|||
|
||||
// Begin transmitting
|
||||
if (playing) {
|
||||
|
||||
LED(LED_GREEN, 0);
|
||||
DbpString("[+] playing");
|
||||
DbpString("[=] playing");
|
||||
|
||||
// wait for button to be released
|
||||
while (BUTTON_PRESS())
|
||||
WDT_HIT();
|
||||
|
||||
Dbprintf("[+] %x %x %08x", selected, high[selected], low[selected]);
|
||||
Dbprintf("[=] %x %x %08x", selected, high[selected], low[selected]);
|
||||
CmdHIDsimTAG(high[selected], low[selected], false);
|
||||
DbpString("[+] done playing");
|
||||
DbpString("[=] done playing");
|
||||
|
||||
if (BUTTON_HELD(1000) > 0) {
|
||||
DbpString("[+] exiting");
|
||||
LEDsoff();
|
||||
return;
|
||||
}
|
||||
if (BUTTON_HELD(1000) > 0)
|
||||
goto out;
|
||||
|
||||
/* We pressed a button so ignore it here with a delay */
|
||||
SpinDelay(300);
|
||||
|
@ -131,4 +135,8 @@ void RunMod() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
DbpString("[=] exiting");
|
||||
LEDsoff();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue