wifi_marauder_app_i.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. //** Includes sniffbt and sniffskim for compatible ESP32-WROOM hardware.
  2. // wifi_marauder_scene_start.c also changed **//
  3. #pragma once
  4. #include "wifi_marauder_app.h"
  5. #include "scenes/wifi_marauder_scene.h"
  6. #include "wifi_marauder_custom_event.h"
  7. #include "wifi_marauder_uart.h"
  8. #include "file/sequential_file.h"
  9. #include "script/wifi_marauder_script.h"
  10. #include "script/wifi_marauder_script_worker.h"
  11. #include "script/wifi_marauder_script_executor.h"
  12. #include "script/menu/wifi_marauder_script_stage_menu.h"
  13. #include <gui/gui.h>
  14. #include <gui/view_dispatcher.h>
  15. #include <gui/scene_manager.h>
  16. #include <gui/modules/text_box.h>
  17. #include <gui/modules/submenu.h>
  18. #include <gui/modules/variable_item_list.h>
  19. #include <gui/modules/widget.h>
  20. #include "wifi_marauder_text_input.h"
  21. #include <esp32_wifi_marauder_icons.h>
  22. #include <storage/storage.h>
  23. #include <lib/toolbox/path.h>
  24. #include <dialogs/dialogs.h>
  25. #define NUM_MENU_ITEMS (19)
  26. #define WIFI_MARAUDER_TEXT_BOX_STORE_SIZE (4096)
  27. #define WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE (512)
  28. #define MARAUDER_APP_FOLDER_USER "apps_data/marauder"
  29. #define MARAUDER_APP_FOLDER EXT_PATH(MARAUDER_APP_FOLDER_USER)
  30. #define MARAUDER_APP_FOLDER_PCAPS MARAUDER_APP_FOLDER "/pcaps"
  31. #define MARAUDER_APP_FOLDER_LOGS MARAUDER_APP_FOLDER "/logs"
  32. #define MARAUDER_APP_FOLDER_USER_PCAPS MARAUDER_APP_FOLDER_USER "/pcaps"
  33. #define MARAUDER_APP_FOLDER_USER_LOGS MARAUDER_APP_FOLDER_USER "/logs"
  34. #define MARAUDER_APP_FOLDER_SCRIPTS MARAUDER_APP_FOLDER "/scripts"
  35. #define MARAUDER_APP_SCRIPT_PATH(file_name) MARAUDER_APP_FOLDER_SCRIPTS "/" file_name ".json"
  36. #define SAVE_PCAP_SETTING_FILEPATH MARAUDER_APP_FOLDER "/save_pcaps_here.setting"
  37. #define SAVE_LOGS_SETTING_FILEPATH MARAUDER_APP_FOLDER "/save_logs_here.setting"
  38. typedef enum WifiMarauderUserInputType {
  39. WifiMarauderUserInputTypeString,
  40. WifiMarauderUserInputTypeNumber,
  41. WifiMarauderUserInputTypeFileName
  42. } WifiMarauderUserInputType;
  43. typedef enum SelectedFlashOptions {
  44. SelectedFlashS3Mode,
  45. SelectedFlashBoot,
  46. SelectedFlashPart,
  47. SelectedFlashNvs,
  48. SelectedFlashBootApp0,
  49. SelectedFlashApp,
  50. SelectedFlashCustom,
  51. NUM_FLASH_OPTIONS
  52. } SelectedFlashOptions;
  53. struct WifiMarauderApp {
  54. Gui* gui;
  55. ViewDispatcher* view_dispatcher;
  56. SceneManager* scene_manager;
  57. char text_input_store[WIFI_MARAUDER_TEXT_INPUT_STORE_SIZE + 1];
  58. FuriString* text_box_store;
  59. size_t text_box_store_strlen;
  60. TextBox* text_box;
  61. WIFI_TextInput* text_input;
  62. Storage* storage;
  63. File* capture_file;
  64. File* log_file;
  65. char log_file_path[100];
  66. File* save_pcap_setting_file;
  67. File* save_logs_setting_file;
  68. bool need_to_prompt_settings_init;
  69. int which_prompt;
  70. bool ok_to_save_pcaps;
  71. bool ok_to_save_logs;
  72. bool has_saved_logs_this_session;
  73. DialogsApp* dialogs;
  74. VariableItemList* var_item_list;
  75. Widget* widget;
  76. Submenu* submenu;
  77. int open_log_file_page;
  78. int open_log_file_num_pages;
  79. WifiMarauderUart* uart;
  80. WifiMarauderUart* lp_uart;
  81. int selected_menu_index;
  82. int selected_option_index[NUM_MENU_ITEMS];
  83. const char* selected_tx_string;
  84. bool is_command;
  85. bool is_custom_tx_string;
  86. bool focus_console_start;
  87. bool show_stopscan_tip;
  88. bool is_writing_pcap;
  89. bool is_writing_log;
  90. // User input
  91. WifiMarauderUserInputType user_input_type;
  92. char** user_input_string_reference;
  93. int* user_input_number_reference;
  94. char* user_input_file_dir;
  95. char* user_input_file_extension;
  96. // Automation script
  97. WifiMarauderScript* script;
  98. WifiMarauderScriptWorker* script_worker;
  99. FuriString** script_list;
  100. int script_list_count;
  101. WifiMarauderScriptStage* script_edit_selected_stage;
  102. WifiMarauderScriptStageMenu* script_stage_menu;
  103. WifiMarauderScriptStageListItem* script_stage_edit_first_item;
  104. char*** script_stage_edit_strings_reference;
  105. int* script_stage_edit_string_count_reference;
  106. int** script_stage_edit_numbers_reference;
  107. int* script_stage_edit_number_count_reference;
  108. // For input source and destination MAC in targeted deauth attack
  109. int special_case_input_step;
  110. char special_case_input_src_addr[20];
  111. char special_case_input_dst_addr[20];
  112. // For flashing - TODO: put into its own struct?
  113. bool selected_flash_options[NUM_FLASH_OPTIONS];
  114. int num_selected_flash_options;
  115. char bin_file_path_boot[100];
  116. char bin_file_path_part[100];
  117. char bin_file_path_nvs[100];
  118. char bin_file_path_boot_app0[100];
  119. char bin_file_path_app[100];
  120. char bin_file_path_custom[100];
  121. FuriThread* flash_worker;
  122. bool flash_worker_busy;
  123. bool flash_mode;
  124. };
  125. // Supported commands:
  126. // https://github.com/justcallmekoko/ESP32Marauder/wiki/cli
  127. // Scan
  128. // -> If list is empty, then start a new scanap. (Tap any button to stop.)
  129. // -> If there's a list, provide option to rescan and dump list of targets to select.
  130. // -> Press BACK to go back to top-level.
  131. // Attack
  132. // -> Beacon
  133. // -> Deauth
  134. // -> Probe
  135. // -> Rickroll
  136. // Sniff
  137. // -> Beacon
  138. // -> Deauth
  139. // -> ESP
  140. // -> PMKID
  141. // -> Pwnagotchi
  142. // Channel
  143. // Update
  144. // Reboot
  145. typedef enum {
  146. WifiMarauderAppViewVarItemList,
  147. WifiMarauderAppViewConsoleOutput,
  148. WifiMarauderAppViewTextInput,
  149. WifiMarauderAppViewWidget,
  150. WifiMarauderAppViewSubmenu,
  151. } WifiMarauderAppView;