Skip to content

Commit

Permalink
upd blespam
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Nov 29, 2023
1 parent ddf2f1c commit 42e9c7f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion base_pack/ble_spam/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions base_pack/ble_spam/ble_spam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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();
}
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions base_pack/ble_spam/protocols/continuity.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 42e9c7f

Please sign in to comment.