Skip to content

Commit c5f4426

Browse files
committed
upd blespam
1 parent efeac36 commit c5f4426

File tree

5 files changed

+99
-9
lines changed

5 files changed

+99
-9
lines changed

base_pack/ble_spam/application.fam

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ App(
88
fap_category="Bluetooth",
99
fap_author="@Willy-JL @ECTO-1A @Spooks4576",
1010
fap_weburl="https://github.com/Flipper-XFW/Xtreme-Apps/tree/dev/ble_spam",
11-
fap_version="4.3",
11+
fap_version="4.4",
1212
fap_description="Flood BLE advertisements to cause spammy and annoying popups/notifications",
1313
fap_icon_assets="icons",
1414
fap_icon_assets_symbol="ble_spam",

base_pack/ble_spam/ble_spam.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static void draw_callback(Canvas* canvas, void* _ctx) {
375375
"App+Spam: \e#WillyJL\e# XFW\n"
376376
"Apple+Crash: \e#ECTO-1A\e#\n"
377377
"Android+Win: \e#Spooks4576\e#\n"
378-
" Version \e#4.3\e#",
378+
" Version \e#4.4\e#",
379379
false);
380380
break;
381381
default: {

base_pack/ble_spam/protocols/continuity.c

+47-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ static const ContinuityColor colors_powerbeats_3[] = {
2828
};
2929
static const ContinuityColor colors_powerbeats_pro[] = {
3030
{0x00, "White"},
31-
{0x01, "Black"},
31+
{0x02, "Yellowish Green"},
32+
{0x03, "Blue"},
33+
{0x04, "Black"},
34+
{0x05, "Pink"},
35+
{0x06, "Red"},
36+
{0x0B, "Gray ?"},
37+
{0x0D, "Sky Blue"},
3238
};
3339
static const ContinuityColor colors_beats_solo_pro[] = {
3440
{0x00, "White"},
@@ -45,8 +51,16 @@ static const ContinuityColor colors_beats_x[] = {
4551
static const ContinuityColor colors_beats_studio_3[] = {
4652
{0x00, "White"},
4753
{0x01, "Black"},
48-
{0x03, "Red"},
49-
{0x43, "White marble"},
54+
{0x02, "Red"},
55+
{0x03, "Blue"},
56+
{0x18, "Shadow Gray"},
57+
{0x19, "Desert Sand"},
58+
{0x25, "Black / Red"},
59+
{0x26, "Midnight Black"},
60+
{0x27, "Desert Sand 2"},
61+
{0x28, "Clear blue/ gold"},
62+
{0x42, "Green Forest camo"},
63+
{0x43, "White Camo"},
5064
};
5165
static const ContinuityColor colors_beats_studio_pro[] = {
5266
{0x00, "White"},
@@ -438,20 +452,47 @@ static void pp_model_changed(VariableItem* item) {
438452
Payload* payload = &ctx->attack->payload;
439453
ContinuityCfg* cfg = &payload->cfg.continuity;
440454
uint8_t index = variable_item_get_current_value_index(item);
455+
const char* color_name = NULL;
456+
char color_name_buf[3];
457+
uint8_t colors_count;
458+
uint8_t value_index_color;
441459
if(index) {
442460
index--;
443461
if(payload->mode != PayloadModeBruteforce ||
444462
cfg->data.proximity_pair.bruteforce_mode == ContinuityPpBruteforceModel)
445463
payload->mode = PayloadModeValue;
446464
cfg->data.proximity_pair.model = pp_models[index].value;
447465
variable_item_set_current_value_text(item, pp_models[index].name);
466+
colors_count = pp_models[index].colors_count;
467+
if(payload->mode == PayloadModeValue) {
468+
for(uint8_t j = 0; j < colors_count; j++) {
469+
if(cfg->data.proximity_pair.color == pp_models[index].colors[j].value) {
470+
color_name = pp_models[index].colors[j].name;
471+
value_index_color = j;
472+
break;
473+
}
474+
}
475+
if(!color_name) {
476+
snprintf(
477+
color_name_buf, sizeof(color_name_buf), "%02X", cfg->data.proximity_pair.color);
478+
color_name = color_name_buf;
479+
value_index_color = colors_count;
480+
}
481+
} else {
482+
color_name = "Bruteforce";
483+
value_index_color = colors_count;
484+
}
448485
} else {
449486
payload->mode = PayloadModeRandom;
450487
variable_item_set_current_value_text(item, "Random");
488+
color_name = "Random";
489+
colors_count = 1;
490+
value_index_color = 0;
451491
}
452-
scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, ConfigPpModel);
453-
scene_manager_previous_scene(ctx->scene_manager);
454-
scene_manager_next_scene(ctx->scene_manager, SceneConfig);
492+
item = variable_item_list_get(ctx->variable_item_list, ConfigPpColor);
493+
variable_item_set_values_count(item, colors_count);
494+
variable_item_set_current_value_index(item, value_index_color);
495+
variable_item_set_current_value_text(item, color_name);
455496
}
456497
static void pp_color_changed(VariableItem* item) {
457498
Payload* payload = variable_item_get_context(item);

base_pack/ble_spam/protocols/fastpair.c

+49-1
Original file line numberDiff line numberDiff line change
@@ -616,36 +616,84 @@ static void config_callback(void* _ctx, uint32_t index) {
616616
break;
617617
}
618618
}
619+
static void model_changed(VariableItem* item) {
620+
Payload* payload = variable_item_get_context(item);
621+
FastpairCfg* cfg = &payload->cfg.fastpair;
622+
uint16_t index = variable_item_get_current_value_index(item);
623+
switch(index) {
624+
case 0:
625+
cfg->_model_index--;
626+
break;
627+
case 1:
628+
if(cfg->_model_index == 0) {
629+
cfg->_model_index++;
630+
} else {
631+
cfg->_model_index--;
632+
}
633+
break;
634+
case 2:
635+
if(cfg->_model_index > models_count) {
636+
cfg->_model_index--;
637+
} else {
638+
cfg->_model_index++;
639+
}
640+
break;
641+
}
642+
index = cfg->_model_index;
643+
if(index) {
644+
index--;
645+
payload->mode = PayloadModeValue;
646+
cfg->model = models[index].value;
647+
variable_item_set_current_value_index(item, index == (models_count - 1) ? 2 : 1);
648+
variable_item_set_current_value_text(item, models[index].name);
649+
} else {
650+
payload->mode = PayloadModeRandom;
651+
variable_item_set_current_value_index(item, 0);
652+
variable_item_set_current_value_text(item, "Random");
653+
}
654+
}
619655
static void extra_config(Ctx* ctx) {
620656
Payload* payload = &ctx->attack->payload;
621657
FastpairCfg* cfg = &payload->cfg.fastpair;
622658
VariableItemList* list = ctx->variable_item_list;
623659
VariableItem* item;
660+
uint8_t value_index;
661+
uint16_t model_index;
624662

625-
item = variable_item_list_add(list, "Model Code", 0, NULL, NULL);
663+
item = variable_item_list_add(list, "Model Code", 3, model_changed, payload);
626664
const char* model_name = NULL;
627665
char model_name_buf[9];
628666
switch(payload->mode) {
629667
case PayloadModeRandom:
630668
default:
631669
model_name = "Random";
670+
value_index = 0;
671+
model_index = 0;
632672
break;
633673
case PayloadModeValue:
634674
for(uint16_t i = 0; i < models_count; i++) {
635675
if(cfg->model == models[i].value) {
636676
model_name = models[i].name;
677+
value_index = i == (models_count - 1) ? 2 : 1;
678+
model_index = i + 1;
637679
break;
638680
}
639681
}
640682
if(!model_name) {
641683
snprintf(model_name_buf, sizeof(model_name_buf), "%06lX", cfg->model);
642684
model_name = model_name_buf;
685+
value_index = 3;
686+
model_index = models_count + 1;
643687
}
644688
break;
645689
case PayloadModeBruteforce:
646690
model_name = "Bruteforce";
691+
value_index = 3;
692+
model_index = models_count + 1;
647693
break;
648694
}
695+
cfg->_model_index = model_index;
696+
variable_item_set_current_value_index(item, value_index);
649697
variable_item_set_current_value_text(item, model_name);
650698

651699
variable_item_list_add(list, "Requires Google services", 0, NULL, NULL);

base_pack/ble_spam/protocols/fastpair.h

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
typedef struct {
88
uint32_t model;
9+
uint16_t _model_index;
910
} FastpairCfg;
1011

1112
extern const Protocol protocol_fastpair;

0 commit comments

Comments
 (0)