mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-25 01:38:11 -07:00
RFID and iButton fuzzer fixes
Attempt to fix crash when exiting from uids from file attack
This commit is contained in:
@@ -82,6 +82,7 @@ typedef struct {
|
||||
ProtocolDict* dict;
|
||||
ProtocolId protocol;
|
||||
bool workr_rund;
|
||||
bool attack_stop_called;
|
||||
|
||||
uint8_t time_between_cards;
|
||||
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -81,6 +81,7 @@ typedef struct {
|
||||
iButtonKeyType keytype;
|
||||
bool workr_rund;
|
||||
bool enter_rerun;
|
||||
bool attack_stop_called;
|
||||
|
||||
uint8_t time_between_cards;
|
||||
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user