2023-06-02 13:42:58 +00:00
|
|
|
#include "../fuzzer_i.h"
|
|
|
|
#include "../helpers/fuzzer_custom_event.h"
|
|
|
|
|
2023-06-02 21:32:32 +00:00
|
|
|
#include "../helpers/protocol.h"
|
|
|
|
#include "../helpers/gui_const.h"
|
|
|
|
|
2023-06-02 13:42:58 +00:00
|
|
|
void fuzzer_scene_main_callback(FuzzerCustomEvent event, void* context) {
|
|
|
|
furi_assert(context);
|
|
|
|
PacsFuzzerApp* app = context;
|
|
|
|
view_dispatcher_send_custom_event(app->view_dispatcher, event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void fuzzer_scene_main_on_enter(void* context) {
|
|
|
|
furi_assert(context);
|
|
|
|
PacsFuzzerApp* app = context;
|
|
|
|
|
|
|
|
fuzzer_view_main_set_callback(app->main_view, fuzzer_scene_main_callback, app);
|
|
|
|
|
2023-06-02 17:33:28 +00:00
|
|
|
fuzzer_view_main_update_data(app->main_view, app->fuzzer_state);
|
|
|
|
|
2023-06-02 13:42:58 +00:00
|
|
|
view_dispatcher_switch_to_view(app->view_dispatcher, FuzzerViewIDMain);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool fuzzer_scene_main_on_event(void* context, SceneManagerEvent event) {
|
|
|
|
furi_assert(context);
|
|
|
|
PacsFuzzerApp* app = context;
|
|
|
|
bool consumed = false;
|
|
|
|
|
|
|
|
if(event.type == SceneManagerEventTypeCustom) {
|
|
|
|
if(event.event == FuzzerCustomEventViewMainBack) {
|
|
|
|
if(!scene_manager_previous_scene(app->scene_manager)) {
|
|
|
|
scene_manager_stop(app->scene_manager);
|
|
|
|
view_dispatcher_stop(app->view_dispatcher);
|
|
|
|
}
|
|
|
|
consumed = true;
|
2023-06-02 17:33:28 +00:00
|
|
|
} else if(event.event == FuzzerCustomEventViewMainOk) {
|
|
|
|
fuzzer_view_main_get_state(app->main_view, &app->fuzzer_state);
|
2023-06-02 21:32:32 +00:00
|
|
|
|
|
|
|
switch(app->fuzzer_state.menu_index) {
|
|
|
|
case FuzzerMainMenuIndexDefaultValues:
|
|
|
|
fuzzer_worker_attack_dict(app->worker, app->fuzzer_state.proto_index);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-06-02 17:33:28 +00:00
|
|
|
scene_manager_next_scene(app->scene_manager, FuzzerSceneAttack);
|
|
|
|
consumed = true;
|
2023-06-02 13:42:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return consumed;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fuzzer_scene_main_on_exit(void* context) {
|
|
|
|
// furi_assert(context);
|
|
|
|
// PacsFuzzerApp* app = context;
|
|
|
|
UNUSED(context);
|
|
|
|
}
|