RFID and iButton fuzzer fixes

Attempt to fix crash when exiting from uids from file attack
This commit is contained in:
MX 2022-12-10 04:36:44 +03:00
parent 9df393c301
commit e756c680e5
No known key found for this signature in database
GPG key ID: 6C4C311DFD4B4AB5
7 changed files with 33 additions and 19 deletions

View file

@ -5,6 +5,7 @@
* Plugins: Weather Station -> Improved signal info dashboard, added signal age counter. (PR by @LY2NEO | #197) (Modified and improved by @xMasterX, new icons and UI changes recommendations by @Karator in OFW PR 2087)
* Plugins: Weather Station -> Oregon2 - add support for RTHN129
* Plugins: iButton Fuzzer -> change minimal delay (after @Tobirg successfully verified stability with lower delay)
* Plugins: iButton Fuzzer + RFID Fuzzer -> Attempt to fix crash when exiting from uids from file attack
* OFW: NFC bug fixes **(breaking change, affects API version)**
* OFW: UART echo: fix race conditions causing null pointer dereference
* OFW: File browser base folder **(breaking change, affects API version)**

View file

@ -82,6 +82,7 @@ typedef struct {
ProtocolDict* dict;
ProtocolId protocol;
bool workr_rund;
bool attack_stop_called;
uint8_t time_between_cards;

View file

@ -71,7 +71,7 @@ void flipfrid_scene_entrypoint_on_enter(FlipFridState* context) {
main_menu_items[0] = furi_string_alloc_set("Default Values");
main_menu_items[1] = furi_string_alloc_set("BF Customer ID");
main_menu_items[2] = furi_string_alloc_set("Load File");
main_menu_items[3] = furi_string_alloc_set("Load uids from file");
main_menu_items[3] = furi_string_alloc_set("Load UIDs from file");
context->menu_proto_index = 0;
/*for(uint32_t i = 0; i < 4; i++) {

View file

@ -80,6 +80,7 @@ uint8_t id_list_h[14][3] = {
void flipfrid_scene_run_attack_on_enter(FlipFridState* context) {
context->time_between_cards = 10;
context->attack_step = 0;
context->attack_stop_called = false;
context->dict = protocol_dict_alloc(lfrfid_protocols, LFRFIDProtocolMax);
context->worker = lfrfid_worker_alloc(context->dict);
if(context->proto == HIDProx) {
@ -497,7 +498,6 @@ void flipfrid_scene_run_attack_on_tick(FlipFridState* context) {
}
}
}
if(counter > context->time_between_cards) {
counter = 0;
} else {
@ -541,18 +541,23 @@ void flipfrid_scene_run_attack_on_event(FlipFridEvent event, FlipFridState* cont
break;
case InputKeyBack:
context->is_attacking = false;
context->attack_step = 0;
counter = 0;
if(context->attack == FlipFridAttackLoadFileCustomUids) {
furi_string_reset(context->data_str);
stream_rewind(context->uids_stream);
buffered_file_stream_close(context->uids_stream);
notification_message(context->notify, &sequence_blink_stop);
if(context->attack_stop_called) {
context->attack_stop_called = false;
context->attack_step = 0;
if(context->attack == FlipFridAttackLoadFileCustomUids) {
furi_string_reset(context->data_str);
stream_rewind(context->uids_stream);
buffered_file_stream_close(context->uids_stream);
}
furi_string_reset(context->notification_msg);
context->current_scene = SceneEntryPoint;
}
furi_string_reset(context->notification_msg);
notification_message(context->notify, &sequence_blink_stop);
context->current_scene = SceneEntryPoint;
context->attack_stop_called = true;
break;
default:
break;

View file

@ -81,6 +81,7 @@ typedef struct {
iButtonKeyType keytype;
bool workr_rund;
bool enter_rerun;
bool attack_stop_called;
uint8_t time_between_cards;

View file

@ -63,7 +63,7 @@ void ibtnfuzzer_scene_entrypoint_on_enter(iBtnFuzzerState* context) {
main_menu_items[0] = furi_string_alloc_set("Default Values");
main_menu_items[1] = furi_string_alloc_set("Load File");
main_menu_items[2] = furi_string_alloc_set("Load uids from file");
main_menu_items[2] = furi_string_alloc_set("Load UIDs from file");
context->menu_proto_index = 0;
/*for(uint32_t i = 0; i < 4; i++) {

View file

@ -71,6 +71,7 @@ uint8_t id_list_cyfral[14][2] = {
void ibtnfuzzer_scene_run_attack_on_enter(iBtnFuzzerState* context) {
context->time_between_cards = 8;
context->attack_step = 0;
context->attack_stop_called = false;
context->key = ibutton_key_alloc();
context->worker = ibutton_worker_alloc();
if(context->proto == Metakom) {
@ -387,18 +388,23 @@ void ibtnfuzzer_scene_run_attack_on_event(iBtnFuzzerEvent event, iBtnFuzzerState
break;
case InputKeyBack:
context->is_attacking = false;
context->attack_step = 0;
counter = 0;
if(context->attack == iBtnFuzzerAttackLoadFileCustomUids) {
furi_string_reset(context->data_str);
stream_rewind(context->uids_stream);
buffered_file_stream_close(context->uids_stream);
notification_message(context->notify, &sequence_blink_stop);
if(context->attack_stop_called) {
context->attack_stop_called = false;
context->attack_step = 0;
if(context->attack == iBtnFuzzerAttackLoadFileCustomUids) {
furi_string_reset(context->data_str);
stream_rewind(context->uids_stream);
buffered_file_stream_close(context->uids_stream);
}
furi_string_reset(context->notification_msg);
context->current_scene = SceneEntryPoint;
}
furi_string_reset(context->notification_msg);
notification_message(context->notify, &sequence_blink_stop);
context->current_scene = SceneEntryPoint;
context->attack_stop_called = true;
break;
default:
break;