Skip to content

Commit

Permalink
update blespam
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Dec 10, 2023
1 parent 3ee5280 commit 8a35240
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 29 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 @@ -3,7 +3,7 @@ App(
name="BLE Spam",
apptype=FlipperAppType.EXTERNAL,
entry_point="ble_spam",
stack_size=6 * 1024,
stack_size=2 * 1024,
fap_icon="ble_spam_10px.png",
fap_category="Bluetooth",
fap_author="@Willy-JL @ECTO-1A @Spooks4576",
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 @@ -620,7 +620,7 @@ int32_t ble_spam(void* p) {
state->thread = furi_thread_alloc();
furi_thread_set_callback(state->thread, adv_thread);
furi_thread_set_context(state->thread, state);
furi_thread_set_stack_size(state->thread, 4096);
furi_thread_set_stack_size(state->thread, 2048);
state->ctx.led_indicator = true;
state->lock_timer = furi_timer_alloc(lock_timer_callback, FuriTimerTypeOnce, state);

Expand Down
34 changes: 22 additions & 12 deletions base_pack/ble_spam/protocols/continuity.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,6 @@ void scene_continuity_pp_model_on_enter(void* _ctx) {
ContinuityCfg* cfg = &payload->cfg.continuity;
Submenu* submenu = ctx->submenu;
uint32_t selected = 0;
submenu_reset(submenu);
bool value = payload->mode == PayloadModeValue ||
(payload->mode == PayloadModeBruteforce &&
cfg->data.proximity_pair.bruteforce_mode != ContinuityPpBruteforceModel);
Expand Down Expand Up @@ -882,7 +881,8 @@ bool scene_continuity_pp_model_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_continuity_pp_model_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
submenu_reset(ctx->submenu);
}

static void pp_model_custom_callback(void* _ctx) {
Expand Down Expand Up @@ -918,7 +918,9 @@ bool scene_continuity_pp_model_custom_on_event(void* _ctx, SceneManagerEvent eve
return false;
}
void scene_continuity_pp_model_custom_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(ctx->byte_input, "");
}

static void pp_color_callback(void* _ctx, uint32_t index) {
Expand Down Expand Up @@ -960,7 +962,6 @@ void scene_continuity_pp_color_on_enter(void* _ctx) {
ContinuityCfg* cfg = &payload->cfg.continuity;
Submenu* submenu = ctx->submenu;
uint32_t selected = 0;
submenu_reset(submenu);
bool value = payload->mode == PayloadModeValue ||
(payload->mode == PayloadModeBruteforce &&
cfg->data.proximity_pair.bruteforce_mode != ContinuityPpBruteforceColor);
Expand Down Expand Up @@ -1006,7 +1007,8 @@ bool scene_continuity_pp_color_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_continuity_pp_color_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
submenu_reset(ctx->submenu);
}

static void pp_color_custom_callback(void* _ctx) {
Expand Down Expand Up @@ -1041,7 +1043,9 @@ bool scene_continuity_pp_color_custom_on_event(void* _ctx, SceneManagerEvent eve
return false;
}
void scene_continuity_pp_color_custom_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(ctx->byte_input, "");
}

static void pp_prefix_callback(void* _ctx, uint32_t index) {
Expand Down Expand Up @@ -1069,7 +1073,6 @@ void scene_continuity_pp_prefix_on_enter(void* _ctx) {
Submenu* submenu = ctx->submenu;
uint32_t selected = 0;
bool found = false;
submenu_reset(submenu);

submenu_add_item(submenu, "Automatic", 0, pp_prefix_callback, ctx);
if(cfg->data.proximity_pair.prefix == 0x00) {
Expand Down Expand Up @@ -1099,7 +1102,8 @@ bool scene_continuity_pp_prefix_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_continuity_pp_prefix_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
submenu_reset(ctx->submenu);
}

static void pp_prefix_custom_callback(void* _ctx) {
Expand Down Expand Up @@ -1131,7 +1135,9 @@ bool scene_continuity_pp_prefix_custom_on_event(void* _ctx, SceneManagerEvent ev
return false;
}
void scene_continuity_pp_prefix_custom_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(ctx->byte_input, "");
}

static void na_action_callback(void* _ctx, uint32_t index) {
Expand Down Expand Up @@ -1166,7 +1172,6 @@ void scene_continuity_na_action_on_enter(void* _ctx) {
ContinuityCfg* cfg = &payload->cfg.continuity;
Submenu* submenu = ctx->submenu;
uint32_t selected = 0;
submenu_reset(submenu);

submenu_add_item(submenu, "Random", 0, na_action_callback, ctx);
if(payload->mode == PayloadModeRandom) {
Expand Down Expand Up @@ -1202,7 +1207,8 @@ bool scene_continuity_na_action_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_continuity_na_action_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
submenu_reset(ctx->submenu);
}

static void na_action_custom_callback(void* _ctx) {
Expand Down Expand Up @@ -1235,7 +1241,9 @@ bool scene_continuity_na_action_custom_on_event(void* _ctx, SceneManagerEvent ev
return false;
}
void scene_continuity_na_action_custom_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(ctx->byte_input, "");
}

static void na_flags_callback(void* _ctx) {
Expand Down Expand Up @@ -1269,4 +1277,6 @@ void scene_continuity_na_flags_on_exit(void* _ctx) {
Payload* payload = &ctx->attack->payload;
ContinuityCfg* cfg = &payload->cfg.continuity;
cfg->data.nearby_action.flags = (ctx->byte_store[0] << 0x00);
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(ctx->byte_input, "");
}
12 changes: 7 additions & 5 deletions base_pack/ble_spam/protocols/easysetup.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ void scene_easysetup_buds_model_on_enter(void* _ctx) {
EasysetupCfg* cfg = &payload->cfg.easysetup;
Submenu* submenu = ctx->submenu;
uint32_t selected = 0;
submenu_reset(submenu);

submenu_add_item(submenu, "Random", 0, buds_model_callback, ctx);
if(payload->mode == PayloadModeRandom) {
Expand Down Expand Up @@ -434,7 +433,8 @@ bool scene_easysetup_buds_model_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_easysetup_buds_model_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
submenu_reset(ctx->submenu);
}

static void buds_model_custom_callback(void* _ctx) {
Expand Down Expand Up @@ -470,7 +470,9 @@ bool scene_easysetup_buds_model_custom_on_event(void* _ctx, SceneManagerEvent ev
return false;
}
void scene_easysetup_buds_model_custom_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(ctx->byte_input, "");
}

static void watch_model_callback(void* _ctx, uint32_t index) {
Expand Down Expand Up @@ -505,7 +507,6 @@ void scene_easysetup_watch_model_on_enter(void* _ctx) {
EasysetupCfg* cfg = &payload->cfg.easysetup;
Submenu* submenu = ctx->submenu;
uint32_t selected = 0;
submenu_reset(submenu);

submenu_add_item(submenu, "Random", 0, watch_model_callback, ctx);
if(payload->mode == PayloadModeRandom) {
Expand Down Expand Up @@ -541,7 +542,8 @@ bool scene_easysetup_watch_model_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_easysetup_watch_model_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
submenu_reset(ctx->submenu);
}

static void watch_model_custom_callback(void* _ctx) {
Expand Down
8 changes: 5 additions & 3 deletions base_pack/ble_spam/protocols/fastpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@ void scene_fastpair_model_on_enter(void* _ctx) {
FastpairCfg* cfg = &payload->cfg.fastpair;
Submenu* submenu = ctx->submenu;
uint32_t selected = 0;
submenu_reset(submenu);

submenu_add_item(submenu, "Random", 0, model_callback, ctx);
if(payload->mode == PayloadModeRandom) {
Expand Down Expand Up @@ -781,7 +780,8 @@ bool scene_fastpair_model_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_fastpair_model_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
submenu_reset(ctx->submenu);
}

static void model_custom_callback(void* _ctx) {
Expand Down Expand Up @@ -817,5 +817,7 @@ bool scene_fastpair_model_custom_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_fastpair_model_custom_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(ctx->byte_input, "");
}
8 changes: 5 additions & 3 deletions base_pack/ble_spam/protocols/lovespouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ void scene_lovespouse_mode_on_enter(void* _ctx) {
LovespouseCfg* cfg = &payload->cfg.lovespouse;
Submenu* submenu = ctx->submenu;
uint32_t selected = 0;
submenu_reset(submenu);

submenu_add_item(submenu, "Random", 0, mode_callback, ctx);
if(payload->mode == PayloadModeRandom) {
Expand Down Expand Up @@ -252,7 +251,8 @@ bool scene_lovespouse_mode_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_lovespouse_mode_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
submenu_reset(ctx->submenu);
}

static void mode_custom_callback(void* _ctx) {
Expand Down Expand Up @@ -288,5 +288,7 @@ bool scene_lovespouse_mode_custom_on_event(void* _ctx, SceneManagerEvent event)
return false;
}
void scene_lovespouse_mode_custom_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
byte_input_set_result_callback(ctx->byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(ctx->byte_input, "");
}
4 changes: 2 additions & 2 deletions base_pack/ble_spam/protocols/swiftpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ void scene_swiftpair_name_on_enter(void* _ctx) {
Payload* payload = &ctx->attack->payload;
SwiftpairCfg* cfg = &payload->cfg.swiftpair;
TextInput* text_input = ctx->text_input;
text_input_reset(text_input);

text_input_set_header_text(text_input, "Press back for random");

Expand All @@ -131,5 +130,6 @@ bool scene_swiftpair_name_on_event(void* _ctx, SceneManagerEvent event) {
return false;
}
void scene_swiftpair_name_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
text_input_reset(ctx->text_input);
}
4 changes: 2 additions & 2 deletions base_pack/ble_spam/scenes/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ static void config_callback(void* _ctx, uint32_t index) {
void scene_config_on_enter(void* _ctx) {
Ctx* ctx = _ctx;
VariableItemList* list = ctx->variable_item_list;
variable_item_list_reset(list);

// Add item to be used as attack name header
//variable_item_list_add(list, ctx->attack->title, 0, NULL, NULL);
Expand Down Expand Up @@ -73,5 +72,6 @@ bool scene_config_on_event(void* _ctx, SceneManagerEvent event) {
}

void scene_config_on_exit(void* _ctx) {
UNUSED(_ctx);
Ctx* ctx = _ctx;
variable_item_list_reset(ctx->variable_item_list);
}

0 comments on commit 8a35240

Please sign in to comment.