Skip to content

Commit

Permalink
upd blespam
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Dec 1, 2023
1 parent efeac36 commit c5f4426
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 9 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.3",
fap_version="4.4",
fap_description="Flood BLE advertisements to cause spammy and annoying popups/notifications",
fap_icon_assets="icons",
fap_icon_assets_symbol="ble_spam",
Expand Down
2 changes: 1 addition & 1 deletion base_pack/ble_spam/ble_spam.c
Original file line number Diff line number Diff line change
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.3\e#",
" Version \e#4.4\e#",
false);
break;
default: {
Expand Down
53 changes: 47 additions & 6 deletions base_pack/ble_spam/protocols/continuity.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ static const ContinuityColor colors_powerbeats_3[] = {
};
static const ContinuityColor colors_powerbeats_pro[] = {
{0x00, "White"},
{0x01, "Black"},
{0x02, "Yellowish Green"},
{0x03, "Blue"},
{0x04, "Black"},
{0x05, "Pink"},
{0x06, "Red"},
{0x0B, "Gray ?"},
{0x0D, "Sky Blue"},
};
static const ContinuityColor colors_beats_solo_pro[] = {
{0x00, "White"},
Expand All @@ -45,8 +51,16 @@ static const ContinuityColor colors_beats_x[] = {
static const ContinuityColor colors_beats_studio_3[] = {
{0x00, "White"},
{0x01, "Black"},
{0x03, "Red"},
{0x43, "White marble"},
{0x02, "Red"},
{0x03, "Blue"},
{0x18, "Shadow Gray"},
{0x19, "Desert Sand"},
{0x25, "Black / Red"},
{0x26, "Midnight Black"},
{0x27, "Desert Sand 2"},
{0x28, "Clear blue/ gold"},
{0x42, "Green Forest camo"},
{0x43, "White Camo"},
};
static const ContinuityColor colors_beats_studio_pro[] = {
{0x00, "White"},
Expand Down Expand Up @@ -438,20 +452,47 @@ static void pp_model_changed(VariableItem* item) {
Payload* payload = &ctx->attack->payload;
ContinuityCfg* cfg = &payload->cfg.continuity;
uint8_t index = variable_item_get_current_value_index(item);
const char* color_name = NULL;
char color_name_buf[3];
uint8_t colors_count;
uint8_t value_index_color;
if(index) {
index--;
if(payload->mode != PayloadModeBruteforce ||
cfg->data.proximity_pair.bruteforce_mode == ContinuityPpBruteforceModel)
payload->mode = PayloadModeValue;
cfg->data.proximity_pair.model = pp_models[index].value;
variable_item_set_current_value_text(item, pp_models[index].name);
colors_count = pp_models[index].colors_count;
if(payload->mode == PayloadModeValue) {
for(uint8_t j = 0; j < colors_count; j++) {
if(cfg->data.proximity_pair.color == pp_models[index].colors[j].value) {
color_name = pp_models[index].colors[j].name;
value_index_color = j;
break;
}
}
if(!color_name) {
snprintf(
color_name_buf, sizeof(color_name_buf), "%02X", cfg->data.proximity_pair.color);
color_name = color_name_buf;
value_index_color = colors_count;
}
} else {
color_name = "Bruteforce";
value_index_color = colors_count;
}
} else {
payload->mode = PayloadModeRandom;
variable_item_set_current_value_text(item, "Random");
color_name = "Random";
colors_count = 1;
value_index_color = 0;
}
scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, ConfigPpModel);
scene_manager_previous_scene(ctx->scene_manager);
scene_manager_next_scene(ctx->scene_manager, SceneConfig);
item = variable_item_list_get(ctx->variable_item_list, ConfigPpColor);
variable_item_set_values_count(item, colors_count);
variable_item_set_current_value_index(item, value_index_color);
variable_item_set_current_value_text(item, color_name);
}
static void pp_color_changed(VariableItem* item) {
Payload* payload = variable_item_get_context(item);
Expand Down
50 changes: 49 additions & 1 deletion base_pack/ble_spam/protocols/fastpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,36 +616,84 @@ static void config_callback(void* _ctx, uint32_t index) {
break;
}
}
static void model_changed(VariableItem* item) {
Payload* payload = variable_item_get_context(item);
FastpairCfg* cfg = &payload->cfg.fastpair;
uint16_t index = variable_item_get_current_value_index(item);
switch(index) {
case 0:
cfg->_model_index--;
break;
case 1:
if(cfg->_model_index == 0) {
cfg->_model_index++;
} else {
cfg->_model_index--;
}
break;
case 2:
if(cfg->_model_index > models_count) {
cfg->_model_index--;
} else {
cfg->_model_index++;
}
break;
}
index = cfg->_model_index;
if(index) {
index--;
payload->mode = PayloadModeValue;
cfg->model = models[index].value;
variable_item_set_current_value_index(item, index == (models_count - 1) ? 2 : 1);
variable_item_set_current_value_text(item, models[index].name);
} else {
payload->mode = PayloadModeRandom;
variable_item_set_current_value_index(item, 0);
variable_item_set_current_value_text(item, "Random");
}
}
static void extra_config(Ctx* ctx) {
Payload* payload = &ctx->attack->payload;
FastpairCfg* cfg = &payload->cfg.fastpair;
VariableItemList* list = ctx->variable_item_list;
VariableItem* item;
uint8_t value_index;
uint16_t model_index;

item = variable_item_list_add(list, "Model Code", 0, NULL, NULL);
item = variable_item_list_add(list, "Model Code", 3, model_changed, payload);
const char* model_name = NULL;
char model_name_buf[9];
switch(payload->mode) {
case PayloadModeRandom:
default:
model_name = "Random";
value_index = 0;
model_index = 0;
break;
case PayloadModeValue:
for(uint16_t i = 0; i < models_count; i++) {
if(cfg->model == models[i].value) {
model_name = models[i].name;
value_index = i == (models_count - 1) ? 2 : 1;
model_index = i + 1;
break;
}
}
if(!model_name) {
snprintf(model_name_buf, sizeof(model_name_buf), "%06lX", cfg->model);
model_name = model_name_buf;
value_index = 3;
model_index = models_count + 1;
}
break;
case PayloadModeBruteforce:
model_name = "Bruteforce";
value_index = 3;
model_index = models_count + 1;
break;
}
cfg->_model_index = model_index;
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, model_name);

variable_item_list_add(list, "Requires Google services", 0, NULL, NULL);
Expand Down
1 change: 1 addition & 0 deletions base_pack/ble_spam/protocols/fastpair.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

typedef struct {
uint32_t model;
uint16_t _model_index;
} FastpairCfg;

extern const Protocol protocol_fastpair;

0 comments on commit c5f4426

Please sign in to comment.