|
@@ -150,6 +150,7 @@ typedef struct {
|
|
|
bool resume;
|
|
bool resume;
|
|
|
bool advertising;
|
|
bool advertising;
|
|
|
uint8_t delay;
|
|
uint8_t delay;
|
|
|
|
|
+ uint8_t mac[GAP_MAC_ADDR_SIZE];
|
|
|
FuriThread* thread;
|
|
FuriThread* thread;
|
|
|
int8_t index;
|
|
int8_t index;
|
|
|
bool ignore_bruteforce;
|
|
bool ignore_bruteforce;
|
|
@@ -189,10 +190,9 @@ static int32_t adv_thread(void* _ctx) {
|
|
|
uint8_t size;
|
|
uint8_t size;
|
|
|
uint16_t delay;
|
|
uint16_t delay;
|
|
|
uint8_t* packet;
|
|
uint8_t* packet;
|
|
|
- uint8_t mac[GAP_MAC_ADDR_SIZE];
|
|
|
|
|
Payload* payload = &attacks[state->index].payload;
|
|
Payload* payload = &attacks[state->index].payload;
|
|
|
const Protocol* protocol = attacks[state->index].protocol;
|
|
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);
|
|
if(state->ctx.led_indicator) start_blink(state);
|
|
|
|
|
|
|
|
while(state->advertising) {
|
|
while(state->advertising) {
|
|
@@ -209,9 +209,9 @@ static int32_t adv_thread(void* _ctx) {
|
|
|
furi_hal_bt_custom_adv_set(packet, size);
|
|
furi_hal_bt_custom_adv_set(packet, size);
|
|
|
free(packet);
|
|
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];
|
|
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_thread_flags_wait(true, FuriFlagWaitAny, delay);
|
|
|
furi_hal_bt_custom_adv_stop();
|
|
furi_hal_bt_custom_adv_stop();
|
|
|
}
|
|
}
|
|
@@ -545,10 +545,10 @@ static bool input_callback(InputEvent* input, void* _ctx) {
|
|
|
furi_hal_bt_custom_adv_set(packet, size);
|
|
furi_hal_bt_custom_adv_set(packet, size);
|
|
|
free(packet);
|
|
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];
|
|
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)
|
|
if(state->ctx.led_indicator)
|
|
|
notification_message(state->ctx.notification, &solid_message);
|
|
notification_message(state->ctx.notification, &solid_message);
|
|
|
furi_delay_ms(10);
|
|
furi_delay_ms(10);
|