Skip to content

Commit a8b4877

Browse files
committed
rfid fuzzer, ability to change time delay
1 parent 1424878 commit a8b4877

File tree

3 files changed

+33
-31
lines changed

3 files changed

+33
-31
lines changed

CHANGELOG.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
### New changes
2-
* PR: New notification sequence for Frequency Analyzer (PR #86 by @BastienB3)
3-
* Infrared: Update assets (by @Amec0e)
4-
* OFW PR: Signal Generator app: UI update (OFW PR 1829 by nminaylov)
5-
* OFW PR: RFID: write fix for some protocols (OFW PR 1828 by nminaylov)
2+
* Plugins: RFID Fuzzer - ability to change time delay (between cards), useful for slow readers, you can adjust it on the go
63

74
#### [🎲 Download extra apps pack](https://download-directory.github.io/?url=https://github.com/UberGuidoZ/Flipper/tree/main/Applications/Unleashed)
85

applications/plugins/flipfrid/flipfrid.h

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ typedef struct {
8181
ProtocolDict* dict;
8282
ProtocolId protocol;
8383

84+
uint8_t time_between_cards;
85+
8486
// Used for custom dictionnary
8587
Stream* uids_stream;
8688
} FlipFridState;

applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c

+30-27
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <gui/elements.h>
33

44
uint8_t counter = 0;
5-
#define TIME_BETWEEN_CARDS 6
5+
66
uint8_t id_list[17][5] = {
77
{0x00, 0x00, 0x00, 0x00, 0x00}, // Null bytes
88
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, // Only FF
@@ -78,6 +78,7 @@ uint8_t id_list_h[14][3] = {
7878
};
7979

8080
void flipfrid_scene_run_attack_on_enter(FlipFridState* context) {
81+
context->time_between_cards = 10;
8182
context->attack_step = 0;
8283
context->dict = protocol_dict_alloc(lfrfid_protocols, LFRFIDProtocolMax);
8384
context->worker = lfrfid_worker_alloc(context->dict);
@@ -488,30 +489,11 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
488489
}
489490
}
490491
}
491-
if(context->proto == PAC) {
492-
if(counter > 10) {
493-
counter = 0;
494-
} else {
495-
counter++;
496-
}
497-
} else if(context->proto == HIDProx) {
498-
if(counter > 10) {
499-
counter = 0;
500-
} else {
501-
counter++;
502-
}
503-
} else if(context->proto == H10301) {
504-
if(counter > 10) {
505-
counter = 0;
506-
} else {
507-
counter++;
508-
}
492+
493+
if(counter > context->time_between_cards) {
494+
counter = 0;
509495
} else {
510-
if(counter > TIME_BETWEEN_CARDS) {
511-
counter = 0;
512-
} else {
513-
counter++;
514-
}
496+
counter++;
515497
}
516498
}
517499
}
@@ -521,9 +503,22 @@ void flipfrid_scene_run_attack_on_event(FlipFridEvent event, FlipFridState* cont
521503
if(event.input_type == InputTypeShort) {
522504
switch(event.key) {
523505
case InputKeyDown:
506+
break;
524507
case InputKeyUp:
508+
break;
525509
case InputKeyLeft:
510+
if(!context->is_attacking) {
511+
if(context->time_between_cards > 0) {
512+
context->time_between_cards--;
513+
}
514+
}
515+
break;
526516
case InputKeyRight:
517+
if(!context->is_attacking) {
518+
if(context->time_between_cards < 60) {
519+
context->time_between_cards++;
520+
}
521+
}
527522
break;
528523
case InputKeyOk:
529524
counter = 0;
@@ -562,9 +557,10 @@ void flipfrid_scene_run_attack_on_draw(Canvas* canvas, FlipFridState* context) {
562557
// Title
563558
canvas_set_font(canvas, FontPrimary);
564559
canvas_draw_str_aligned(
565-
canvas, 64, 8, AlignCenter, AlignTop, string_get_cstr(context->attack_name));
560+
canvas, 64, 2, AlignCenter, AlignTop, string_get_cstr(context->attack_name));
566561

567562
char uid[18];
563+
char speed[16];
568564
if(context->proto == HIDProx) {
569565
snprintf(
570566
uid,
@@ -605,18 +601,25 @@ void flipfrid_scene_run_attack_on_draw(Canvas* canvas, FlipFridState* context) {
605601
context->payload[4]);
606602
}
607603

608-
canvas_draw_str_aligned(canvas, 64, 36, AlignCenter, AlignTop, uid);
604+
canvas_draw_str_aligned(canvas, 64, 38, AlignCenter, AlignTop, uid);
609605

610606
canvas_set_font(canvas, FontSecondary);
611607

612608
canvas_draw_str_aligned(
613-
canvas, 64, 22, AlignCenter, AlignTop, string_get_cstr(context->proto_name));
609+
canvas, 64, 26, AlignCenter, AlignTop, string_get_cstr(context->proto_name));
610+
611+
snprintf(speed, sizeof(speed), "Time delay: %d", context->time_between_cards);
612+
613+
//canvas_draw_str_aligned(canvas, 0, 22, AlignLeft, AlignTop, "Speed:");
614+
canvas_draw_str_aligned(canvas, 64, 14, AlignCenter, AlignTop, speed);
614615
//char start_stop_msg[20];
615616
if(context->is_attacking) {
616617
elements_button_center(canvas, "Stop");
617618
//snprintf(start_stop_msg, sizeof(start_stop_msg), " Press OK to stop ");
618619
} else {
619620
elements_button_center(canvas, "Start");
621+
elements_button_left(canvas, "TD -");
622+
elements_button_right(canvas, "+ TD");
620623
}
621624
//canvas_draw_str_aligned(canvas, 64, 44, AlignCenter, AlignTop, start_stop_msg);
622625
}

0 commit comments

Comments
 (0)