|
@@ -1,7 +1,5 @@
|
|
|
#include "../wifi_marauder_app_i.h"
|
|
#include "../wifi_marauder_app_i.h"
|
|
|
|
|
|
|
|
-#define NUM_MENU_ITEMS (14)
|
|
|
|
|
-
|
|
|
|
|
// For each command, define whether additional arguments are needed
|
|
// For each command, define whether additional arguments are needed
|
|
|
// (enabling text input to fill them out), and whether the console
|
|
// (enabling text input to fill them out), and whether the console
|
|
|
// text box should focus at the start of the output or the end
|
|
// text box should focus at the start of the output or the end
|
|
@@ -18,7 +16,9 @@ struct WifiMarauderItem {
|
|
|
bool focus_console_start;
|
|
bool focus_console_start;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const struct WifiMarauderItem items[NUM_MENU_ITEMS] = {
|
|
|
|
|
|
|
+typedef struct WifiMarauderItem WifiMarauderItem;
|
|
|
|
|
+
|
|
|
|
|
+const WifiMarauderItem items[NUM_MENU_ITEMS] = {
|
|
|
{ "View Log from", {"start", "end"}, 2, {}, NO_ARGS, FOCUS_CONSOLE_START },
|
|
{ "View Log from", {"start", "end"}, 2, {}, NO_ARGS, FOCUS_CONSOLE_START },
|
|
|
{ "Scan", {""}, 1, {"scanap"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
{ "Scan", {""}, 1, {"scanap"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
|
{ "List", {"ap", "ssid"}, 2, {"list -a", "list -s"}, NO_ARGS, FOCUS_CONSOLE_START },
|
|
{ "List", {"ap", "ssid"}, 2, {"list -a", "list -s"}, NO_ARGS, FOCUS_CONSOLE_START },
|
|
@@ -29,22 +29,27 @@ const struct WifiMarauderItem items[NUM_MENU_ITEMS] = {
|
|
|
{ "Beacon Spam", {"list", "random", "ap"}, 3, {"attack -t beacon -l", "attack -t beacon -r", "attack -t beacon -a"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
{ "Beacon Spam", {"list", "random", "ap"}, 3, {"attack -t beacon -l", "attack -t beacon -r", "attack -t beacon -a"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
|
{ "Sniff", {"beacon", "deauth", "esp", "pmkid", "pwn"}, 5, {"sniffbeacon", "sniffdeauth", "sniffesp", "sniffpmkid", "sniffpwn"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
{ "Sniff", {"beacon", "deauth", "esp", "pmkid", "pwn"}, 5, {"sniffbeacon", "sniffdeauth", "sniffesp", "sniffpmkid", "sniffpwn"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
|
{ "Sniff PMKID on channel", {""}, 1, {"sniffpmkid -c"}, INPUT_ARGS, FOCUS_CONSOLE_END },
|
|
{ "Sniff PMKID on channel", {""}, 1, {"sniffpmkid -c"}, INPUT_ARGS, FOCUS_CONSOLE_END },
|
|
|
- { "Channel", {"get", "set"}, 2, {"channel", "channel -s"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
|
|
|
|
|
+ { "Channel", {""}, 1, {"channel -s"}, INPUT_ARGS, FOCUS_CONSOLE_END },
|
|
|
{ "Update", {""}, 1, {"update -w"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
{ "Update", {""}, 1, {"update -w"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
|
{ "Reboot", {""}, 1, {"reboot"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
{ "Reboot", {""}, 1, {"reboot"}, NO_ARGS, FOCUS_CONSOLE_END },
|
|
|
{ "Help", {""}, 1, {"help"}, NO_ARGS, FOCUS_CONSOLE_START },
|
|
{ "Help", {""}, 1, {"help"}, NO_ARGS, FOCUS_CONSOLE_START },
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-typedef struct WifiMarauderItem WifiMarauderItem;
|
|
|
|
|
|
|
|
|
|
static void wifi_marauder_scene_start_var_list_enter_callback(void* context, uint32_t index) {
|
|
static void wifi_marauder_scene_start_var_list_enter_callback(void* context, uint32_t index) {
|
|
|
furi_assert(context);
|
|
furi_assert(context);
|
|
|
WifiMarauderApp* app = context;
|
|
WifiMarauderApp* app = context;
|
|
|
- app->selected_tx_string = items[index].item_string;
|
|
|
|
|
|
|
+ if (app->selected_option_index[index] < items[index].num_options_menu) {
|
|
|
|
|
+ app->selected_tx_string = items[index].actual_commands[app->selected_option_index[index]];
|
|
|
|
|
+ }
|
|
|
app->is_command = (1 <= index);
|
|
app->is_command = (1 <= index);
|
|
|
app->is_custom_tx_string = false;
|
|
app->is_custom_tx_string = false;
|
|
|
app->selected_menu_index = index;
|
|
app->selected_menu_index = index;
|
|
|
app->focus_console_start = items[index].focus_console_start;
|
|
app->focus_console_start = items[index].focus_console_start;
|
|
|
|
|
+ if (!(app->is_command) && (app->selected_option_index[index] == 1)) { // special case: View Log from end
|
|
|
|
|
+ app->focus_console_start = FOCUS_CONSOLE_END;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (items[index].needs_keyboard) {
|
|
if (items[index].needs_keyboard) {
|
|
|
view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventStartKeyboard);
|
|
view_dispatcher_send_custom_event(app->view_dispatcher, WifiMarauderEventStartKeyboard);
|
|
|
} else {
|
|
} else {
|
|
@@ -53,11 +58,16 @@ static void wifi_marauder_scene_start_var_list_enter_callback(void* context, uin
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void wifi_marauder_scene_start_var_list_change_callback(VariableItem* item) {
|
|
static void wifi_marauder_scene_start_var_list_change_callback(VariableItem* item) {
|
|
|
- WifiMarauderItem* menu_item = variable_item_get_context(item);
|
|
|
|
|
- furi_assert(menu_item);
|
|
|
|
|
|
|
+ furi_assert(item);
|
|
|
|
|
+
|
|
|
|
|
+ WifiMarauderApp* app = variable_item_get_context(item);
|
|
|
|
|
+ furi_assert(app);
|
|
|
|
|
+
|
|
|
|
|
+ const WifiMarauderItem* menu_item = &items[app->selected_menu_index];
|
|
|
uint8_t item_index = variable_item_get_current_value_index(item);
|
|
uint8_t item_index = variable_item_get_current_value_index(item);
|
|
|
furi_assert(item_index < menu_item->num_options_menu);
|
|
furi_assert(item_index < menu_item->num_options_menu);
|
|
|
variable_item_set_current_value_text(item, menu_item->options_menu[item_index]);
|
|
variable_item_set_current_value_text(item, menu_item->options_menu[item_index]);
|
|
|
|
|
+ app->selected_option_index[app->selected_menu_index] = item_index;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void wifi_marauder_scene_start_on_enter(void* context) {
|
|
void wifi_marauder_scene_start_on_enter(void* context) {
|
|
@@ -69,7 +79,8 @@ void wifi_marauder_scene_start_on_enter(void* context) {
|
|
|
|
|
|
|
|
VariableItem* item;
|
|
VariableItem* item;
|
|
|
for (int i = 0; i < NUM_MENU_ITEMS; ++i) {
|
|
for (int i = 0; i < NUM_MENU_ITEMS; ++i) {
|
|
|
- item = variable_item_list_add(var_item_list, items[i].item_string, items[i].num_options_menu, wifi_marauder_scene_start_var_list_change_callback, (WifiMarauderItem*)&items[i]);
|
|
|
|
|
|
|
+ app->selected_option_index[i] = 0;
|
|
|
|
|
+ item = variable_item_list_add(var_item_list, items[i].item_string, items[i].num_options_menu, wifi_marauder_scene_start_var_list_change_callback, app);
|
|
|
if (items[i].num_options_menu) {
|
|
if (items[i].num_options_menu) {
|
|
|
variable_item_set_current_value_index(item, 0);
|
|
variable_item_set_current_value_index(item, 0);
|
|
|
variable_item_set_current_value_text(item, items[i].options_menu[0]);
|
|
variable_item_set_current_value_text(item, items[i].options_menu[0]);
|
|
@@ -97,6 +108,11 @@ bool wifi_marauder_scene_start_on_event(void* context, SceneManagerEvent event)
|
|
|
}
|
|
}
|
|
|
consumed = true;
|
|
consumed = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ app->selected_menu_index = variable_item_list_get_selected_item_index(app->var_item_list);
|
|
|
|
|
+ consumed = true;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return consumed;
|
|
return consumed;
|
|
|
}
|
|
}
|