Deauther Upd

This commit is contained in:
RogueMaster
2022-10-26 16:51:15 -04:00
parent 70ce70bd9e
commit f8f9993a41
4 changed files with 17 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
App( App(
appid="ESP8266_Wifi_Deauther", appid="ESP8266_Wifi_Deauther_V2",
name="[ESP8266] WiFi (Deauther)", name="[ESP8266] WiFi (Deauther) V2",
apptype=FlipperAppType.EXTERNAL, apptype=FlipperAppType.EXTERNAL,
entry_point="wifi_deauther_app", entry_point="wifi_deauther_app",
cdefines=["APP_WIFI_deauther"], cdefines=["APP_WIFI_deauther"],

View File

@@ -7,13 +7,13 @@ void wifi_deauther_console_output_handle_rx_data_cb(uint8_t* buf, size_t len, vo
// If text box store gets too big, then truncate it // If text box store gets too big, then truncate it
app->text_box_store_strlen += len; app->text_box_store_strlen += len;
if(app->text_box_store_strlen >= WIFI_deauther_TEXT_BOX_STORE_SIZE - 1) { if(app->text_box_store_strlen >= WIFI_deauther_TEXT_BOX_STORE_SIZE - 1) {
furi_string_right(app->text_box_store, app->text_box_store_strlen / 2); string_right(app->text_box_store, app->text_box_store_strlen / 2);
app->text_box_store_strlen = furi_string_size(app->text_box_store); app->text_box_store_strlen = string_size(app->text_box_store);
} }
// Null-terminate buf and append to text box store // Null-terminate buf and append to text box store
buf[len] = '\0'; buf[len] = '\0';
furi_string_cat_printf(app->text_box_store, "%s", buf); string_cat_printf(app->text_box_store, "%s", buf);
view_dispatcher_send_custom_event(app->view_dispatcher, WifideautherEventRefreshConsoleOutput); view_dispatcher_send_custom_event(app->view_dispatcher, WifideautherEventRefreshConsoleOutput);
} }
@@ -30,22 +30,22 @@ void wifi_deauther_scene_console_output_on_enter(void* context) {
text_box_set_focus(text_box, TextBoxFocusEnd); text_box_set_focus(text_box, TextBoxFocusEnd);
} }
if(app->is_command) { if(app->is_command) {
furi_string_reset(app->text_box_store); string_reset(app->text_box_store);
app->text_box_store_strlen = 0; app->text_box_store_strlen = 0;
if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) { if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) {
const char* help_msg = const char* help_msg =
"For app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n"; "For app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)/B4 was here\n";
furi_string_cat_str(app->text_box_store, help_msg); string_cat_str(app->text_box_store, help_msg);
app->text_box_store_strlen += strlen(help_msg); app->text_box_store_strlen += strlen(help_msg);
} }
if(app->show_stopscan_tip) { if(app->show_stopscan_tip) {
const char* help_msg = "Press BACK to send stopscan\n"; const char* help_msg = "Press BACK button to stop your scan\n";
furi_string_cat_str(app->text_box_store, help_msg); string_cat_str(app->text_box_store, help_msg);
app->text_box_store_strlen += strlen(help_msg); app->text_box_store_strlen += strlen(help_msg);
} }
} else { // "View Log" menu action } else { // "View Log" menu action
text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store)); text_box_set_text(app->text_box, string_get_cstr(app->text_box_store));
} }
scene_manager_set_scene_state(app->scene_manager, WifideautherSceneConsoleOutput, 0); scene_manager_set_scene_state(app->scene_manager, WifideautherSceneConsoleOutput, 0);
@@ -69,7 +69,7 @@ bool wifi_deauther_scene_console_output_on_event(void* context, SceneManagerEven
bool consumed = false; bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
text_box_set_text(app->text_box, furi_string_get_cstr(app->text_box_store)); text_box_set_text(app->text_box, string_get_cstr(app->text_box_store));
consumed = true; consumed = true;
} else if(event.type == SceneManagerEventTypeTick) { } else if(event.type == SceneManagerEventTypeTick) {
consumed = true; consumed = true;

View File

@@ -54,8 +54,8 @@ WifideautherApp* wifi_deauther_app_alloc() {
app->text_box = text_box_alloc(); app->text_box = text_box_alloc();
view_dispatcher_add_view( view_dispatcher_add_view(
app->view_dispatcher, WifideautherAppViewConsoleOutput, text_box_get_view(app->text_box)); app->view_dispatcher, WifideautherAppViewConsoleOutput, text_box_get_view(app->text_box));
app->text_box_store = furi_string_alloc(); string_init(app->text_box_store);
furi_string_reserve(app->text_box_store, WIFI_deauther_TEXT_BOX_STORE_SIZE); string_reserve(app->text_box_store, WIFI_deauther_TEXT_BOX_STORE_SIZE);
app->text_input = text_input_alloc(); app->text_input = text_input_alloc();
view_dispatcher_add_view( view_dispatcher_add_view(
@@ -74,7 +74,7 @@ void wifi_deauther_app_free(WifideautherApp* app) {
view_dispatcher_remove_view(app->view_dispatcher, WifideautherAppViewConsoleOutput); view_dispatcher_remove_view(app->view_dispatcher, WifideautherAppViewConsoleOutput);
view_dispatcher_remove_view(app->view_dispatcher, WifideautherAppViewTextInput); view_dispatcher_remove_view(app->view_dispatcher, WifideautherAppViewTextInput);
text_box_free(app->text_box); text_box_free(app->text_box);
furi_string_free(app->text_box_store); string_clear(app->text_box_store);
text_input_free(app->text_input); text_input_free(app->text_input);
// View dispatcher // View dispatcher
@@ -84,7 +84,7 @@ void wifi_deauther_app_free(WifideautherApp* app) {
wifi_deauther_uart_free(app->uart); wifi_deauther_uart_free(app->uart);
// Close records // Close records
furi_record_close(RECORD_GUI); furi_record_close(RECORD_GUI); // GET PWNED
free(app); free(app);
} }

View File

@@ -23,7 +23,7 @@ struct WifideautherApp {
SceneManager* scene_manager; SceneManager* scene_manager;
char text_input_store[WIFI_deauther_TEXT_INPUT_STORE_SIZE + 1]; char text_input_store[WIFI_deauther_TEXT_INPUT_STORE_SIZE + 1];
FuriString* text_box_store; string_t text_box_store;
size_t text_box_store_strlen; size_t text_box_store_strlen;
TextBox* text_box; TextBox* text_box;
TextInput* text_input; TextInput* text_input;