From aface38b421651f9a4247bcc5145d826c8f67b38 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 13 Nov 2022 02:56:32 +0300 Subject: [PATCH] RFID Fuzzer fixes --- CHANGELOG.md | 1 + applications/plugins/flipfrid/flipfrid.h | 1 + .../flipfrid/scene/flipfrid_scene_run_attack.c | 15 +++++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b76d915..006b1a27f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * SubGHz Remote: Cleanup code in unirf, fix issue #153 * Plugins: Remove `srand` calls * Plugins: Fix DHT Monitor icon +* Plugins: RFID Fuzzer - Fix random crashes and improve stability * Plugins: RFID Fuzzer - allow holding left right to change delay faster (hold TD button to add +10 or -10 to time delay) * Plugins: Morse code cleanup text by pressing back * Plugins: TOTP Update - "BadUSB" type key into pc mode [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator) diff --git a/applications/plugins/flipfrid/flipfrid.h b/applications/plugins/flipfrid/flipfrid.h index 4e3e7a37b..8ce2cca79 100644 --- a/applications/plugins/flipfrid/flipfrid.h +++ b/applications/plugins/flipfrid/flipfrid.h @@ -81,6 +81,7 @@ typedef struct { LFRFIDWorker* worker; ProtocolDict* dict; ProtocolId protocol; + bool workr_rund; uint8_t time_between_cards; diff --git a/applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c b/applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c index 983a6e7eb..890b5f384 100644 --- a/applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c +++ b/applications/plugins/flipfrid/scene/flipfrid_scene_run_attack.c @@ -94,8 +94,11 @@ void flipfrid_scene_run_attack_on_enter(FlipFridState* context) { } void flipfrid_scene_run_attack_on_exit(FlipFridState* context) { - lfrfid_worker_stop(context->worker); - lfrfid_worker_stop_thread(context->worker); + if(context->workr_rund) { + lfrfid_worker_stop(context->worker); + lfrfid_worker_stop_thread(context->worker); + context->workr_rund = false; + } lfrfid_worker_free(context->worker); protocol_dict_free(context->dict); notification_message(context->notify, &sequence_blink_stop); @@ -109,9 +112,13 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) { context->worker = lfrfid_worker_alloc(context->dict); lfrfid_worker_start_thread(context->worker); lfrfid_worker_emulate_start(context->worker, context->protocol); + context->workr_rund = true; } else if(0 == counter) { - lfrfid_worker_stop(context->worker); - lfrfid_worker_stop_thread(context->worker); + if(context->workr_rund) { + lfrfid_worker_stop(context->worker); + lfrfid_worker_stop_thread(context->worker); + context->workr_rund = false; + } switch(context->attack) { case FlipFridAttackDefaultValues: if(context->proto == EM4100) {