MX 2 лет назад
Родитель
Сommit
af316b799d

+ 33 - 32
base_pack/ble_spam/ble_spam.c

@@ -30,7 +30,7 @@ static Attack attacks[] = {
         .payload =
         .payload =
             {
             {
                 .random_mac = false,
                 .random_mac = false,
-                .cfg.specific.continuity =
+                .cfg.continuity =
                     {
                     {
                         .type = ContinuityTypeCustomCrash,
                         .type = ContinuityTypeCustomCrash,
                         .data = {},
                         .data = {},
@@ -44,7 +44,7 @@ static Attack attacks[] = {
         .payload =
         .payload =
             {
             {
                 .random_mac = false,
                 .random_mac = false,
-                .cfg.specific.continuity =
+                .cfg.continuity =
                     {
                     {
                         .type = ContinuityTypeNearbyAction,
                         .type = ContinuityTypeNearbyAction,
                         .data = {},
                         .data = {},
@@ -58,7 +58,7 @@ static Attack attacks[] = {
         .payload =
         .payload =
             {
             {
                 .random_mac = false,
                 .random_mac = false,
-                .cfg.specific.continuity =
+                .cfg.continuity =
                     {
                     {
                         .type = ContinuityTypeProximityPair,
                         .type = ContinuityTypeProximityPair,
                         .data = {},
                         .data = {},
@@ -72,7 +72,7 @@ static Attack attacks[] = {
         .payload =
         .payload =
             {
             {
                 .random_mac = true,
                 .random_mac = true,
-                .cfg.specific.fastpair = {},
+                .cfg.fastpair = {},
             },
             },
     },
     },
     {
     {
@@ -82,7 +82,7 @@ static Attack attacks[] = {
         .payload =
         .payload =
             {
             {
                 .random_mac = true,
                 .random_mac = true,
-                .cfg.specific.easysetup =
+                .cfg.easysetup =
                     {
                     {
                         .type = EasysetupTypeBuds,
                         .type = EasysetupTypeBuds,
                         .data = {},
                         .data = {},
@@ -96,7 +96,7 @@ static Attack attacks[] = {
         .payload =
         .payload =
             {
             {
                 .random_mac = true,
                 .random_mac = true,
-                .cfg.specific.easysetup =
+                .cfg.easysetup =
                     {
                     {
                         .type = EasysetupTypeWatch,
                         .type = EasysetupTypeWatch,
                         .data = {},
                         .data = {},
@@ -110,7 +110,7 @@ static Attack attacks[] = {
         .payload =
         .payload =
             {
             {
                 .random_mac = true,
                 .random_mac = true,
-                .cfg.specific.swiftpair = {},
+                .cfg.swiftpair = {},
             },
             },
     },
     },
 };
 };
@@ -171,18 +171,17 @@ static int32_t adv_thread(void* _ctx) {
     uint8_t mac[GAP_MAC_ADDR_SIZE];
     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;
-    ProtocolCfg* _cfg = &payload->cfg;
     if(!payload->random_mac) furi_hal_random_fill_buf(mac, sizeof(mac));
     if(!payload->random_mac) furi_hal_random_fill_buf(mac, sizeof(mac));
     if(state->ctx.led_indicator) start_blink(state);
     if(state->ctx.led_indicator) start_blink(state);
 
 
     while(state->advertising) {
     while(state->advertising) {
         if(protocol) {
         if(protocol) {
-            if(_cfg->mode == ProtocolModeBruteforce && _cfg->bruteforce.counter++ >= 10) {
-                _cfg->bruteforce.counter = 0;
-                _cfg->bruteforce.value =
-                    (_cfg->bruteforce.value + 1) % (1 << (_cfg->bruteforce.size * 8));
+            if(payload->mode == PayloadModeBruteforce && payload->bruteforce.counter++ >= 10) {
+                payload->bruteforce.counter = 0;
+                payload->bruteforce.value =
+                    (payload->bruteforce.value + 1) % (1 << (payload->bruteforce.size * 8));
             }
             }
-            protocol->make_packet(&size, &packet, &payload->cfg);
+            protocol->make_packet(&size, &packet, payload);
         } else {
         } else {
             protocols[rand() % protocols_count]->make_packet(&size, &packet, NULL);
             protocols[rand() % protocols_count]->make_packet(&size, &packet, NULL);
         }
         }
@@ -367,13 +366,13 @@ static void draw_callback(Canvas* canvas, void* _ctx) {
         char str[32];
         char str[32];
 
 
         canvas_set_font(canvas, FontBatteryPercent);
         canvas_set_font(canvas, FontBatteryPercent);
-        if(payload->cfg.mode == ProtocolModeBruteforce) {
+        if(payload->mode == PayloadModeBruteforce) {
             snprintf(
             snprintf(
                 str,
                 str,
                 sizeof(str),
                 sizeof(str),
                 "0x%0*lX",
                 "0x%0*lX",
-                payload->cfg.bruteforce.size * 2,
-                payload->cfg.bruteforce.value);
+                payload->bruteforce.size * 2,
+                payload->bruteforce.value);
         } else {
         } else {
             snprintf(str, sizeof(str), "%ims", delays[state->delay]);
             snprintf(str, sizeof(str), "%ims", delays[state->delay]);
         }
         }
@@ -382,7 +381,7 @@ static void draw_callback(Canvas* canvas, void* _ctx) {
         canvas_draw_icon(canvas, 119, 10, &I_SmallArrowDown_3x5);
         canvas_draw_icon(canvas, 119, 10, &I_SmallArrowDown_3x5);
 
 
         canvas_set_font(canvas, FontBatteryPercent);
         canvas_set_font(canvas, FontBatteryPercent);
-        if(payload->cfg.mode == ProtocolModeBruteforce) {
+        if(payload->mode == PayloadModeBruteforce) {
             canvas_draw_str_aligned(canvas, 64, 22, AlignCenter, AlignBottom, "Bruteforce");
             canvas_draw_str_aligned(canvas, 64, 22, AlignCenter, AlignBottom, "Bruteforce");
             if(delays[state->delay] < 100) {
             if(delays[state->delay] < 100) {
                 snprintf(str, sizeof(str), "%ims>", delays[state->delay]);
                 snprintf(str, sizeof(str), "%ims>", delays[state->delay]);
@@ -403,7 +402,7 @@ static void draw_callback(Canvas* canvas, void* _ctx) {
                 "%02i/%02i: %s",
                 "%02i/%02i: %s",
                 state->index + 1,
                 state->index + 1,
                 ATTACKS_COUNT,
                 ATTACKS_COUNT,
-                protocol ? protocol->get_name(&payload->cfg) : "Everything AND");
+                protocol ? protocol->get_name(payload) : "Everything AND");
             canvas_draw_str(canvas, 4 - (state->index < 19 ? 1 : 0), 22, str);
             canvas_draw_str(canvas, 4 - (state->index < 19 ? 1 : 0), 22, str);
         }
         }
 
 
@@ -461,7 +460,7 @@ static bool input_callback(InputEvent* input, void* _ctx) {
         consumed = true;
         consumed = true;
 
 
         bool is_attack = state->index >= 0 && state->index <= ATTACKS_COUNT - 1;
         bool is_attack = state->index >= 0 && state->index <= ATTACKS_COUNT - 1;
-        ProtocolCfg* _cfg = is_attack ? &attacks[state->index].payload.cfg : NULL;
+        Payload* payload = is_attack ? &attacks[state->index].payload : NULL;
         bool advertising = state->advertising;
         bool advertising = state->advertising;
 
 
         switch(input->key) {
         switch(input->key) {
@@ -479,10 +478,10 @@ static bool input_callback(InputEvent* input, void* _ctx) {
             break;
             break;
         case InputKeyUp:
         case InputKeyUp:
             if(is_attack) {
             if(is_attack) {
-                if(_cfg->mode == ProtocolModeBruteforce) {
-                    _cfg->bruteforce.counter = 0;
-                    _cfg->bruteforce.value =
-                        (_cfg->bruteforce.value + 1) % (1 << (_cfg->bruteforce.size * 8));
+                if(payload->mode == PayloadModeBruteforce) {
+                    payload->bruteforce.counter = 0;
+                    payload->bruteforce.value =
+                        (payload->bruteforce.value + 1) % (1 << (payload->bruteforce.size * 8));
                 } else if(state->delay < COUNT_OF(delays) - 1) {
                 } else if(state->delay < COUNT_OF(delays) - 1) {
                     state->delay++;
                     state->delay++;
                     if(advertising) start_blink(state);
                     if(advertising) start_blink(state);
@@ -491,10 +490,10 @@ static bool input_callback(InputEvent* input, void* _ctx) {
             break;
             break;
         case InputKeyDown:
         case InputKeyDown:
             if(is_attack) {
             if(is_attack) {
-                if(_cfg->mode == ProtocolModeBruteforce) {
-                    _cfg->bruteforce.counter = 0;
-                    _cfg->bruteforce.value =
-                        (_cfg->bruteforce.value - 1) % (1 << (_cfg->bruteforce.size * 8));
+                if(payload->mode == PayloadModeBruteforce) {
+                    payload->bruteforce.counter = 0;
+                    payload->bruteforce.value =
+                        (payload->bruteforce.value - 1) % (1 << (payload->bruteforce.size * 8));
                 } else if(state->delay > 0) {
                 } else if(state->delay > 0) {
                     state->delay--;
                     state->delay--;
                     if(advertising) start_blink(state);
                     if(advertising) start_blink(state);
@@ -503,10 +502,11 @@ static bool input_callback(InputEvent* input, void* _ctx) {
             break;
             break;
         case InputKeyLeft:
         case InputKeyLeft:
             if(input->type == InputTypeLong) {
             if(input->type == InputTypeLong) {
-                state->ignore_bruteforce = _cfg ? (_cfg->mode != ProtocolModeBruteforce) : true;
+                state->ignore_bruteforce = payload ? (payload->mode != PayloadModeBruteforce) :
+                                                     true;
             }
             }
             if(input->type == InputTypeShort || !is_attack || state->ignore_bruteforce ||
             if(input->type == InputTypeShort || !is_attack || state->ignore_bruteforce ||
-               _cfg->mode != ProtocolModeBruteforce) {
+               payload->mode != PayloadModeBruteforce) {
                 if(state->index > PAGE_MIN) {
                 if(state->index > PAGE_MIN) {
                     if(advertising) toggle_adv(state);
                     if(advertising) toggle_adv(state);
                     state->index--;
                     state->index--;
@@ -520,7 +520,7 @@ static bool input_callback(InputEvent* input, void* _ctx) {
 
 
                     uint8_t size;
                     uint8_t size;
                     uint8_t* packet;
                     uint8_t* packet;
-                    protocol->make_packet(&size, &packet, &payload->cfg);
+                    protocol->make_packet(&size, &packet, payload);
                     furi_hal_bt_custom_adv_set(packet, size);
                     furi_hal_bt_custom_adv_set(packet, size);
                     free(packet);
                     free(packet);
 
 
@@ -541,10 +541,11 @@ static bool input_callback(InputEvent* input, void* _ctx) {
             break;
             break;
         case InputKeyRight:
         case InputKeyRight:
             if(input->type == InputTypeLong) {
             if(input->type == InputTypeLong) {
-                state->ignore_bruteforce = _cfg ? (_cfg->mode != ProtocolModeBruteforce) : true;
+                state->ignore_bruteforce = payload ? (payload->mode != PayloadModeBruteforce) :
+                                                     true;
             }
             }
             if(input->type == InputTypeShort || !is_attack || state->ignore_bruteforce ||
             if(input->type == InputTypeShort || !is_attack || state->ignore_bruteforce ||
-               _cfg->mode != ProtocolModeBruteforce) {
+               payload->mode != PayloadModeBruteforce) {
                 if(state->index < PAGE_MAX) {
                 if(state->index < PAGE_MAX) {
                     if(advertising) toggle_adv(state);
                     if(advertising) toggle_adv(state);
                     state->index++;
                     state->index++;

+ 4 - 4
base_pack/ble_spam/protocols/_base.h

@@ -9,12 +9,12 @@
 #include <core/core_defines.h>
 #include <core/core_defines.h>
 #include "../ble_spam.h"
 #include "../ble_spam.h"
 
 
-typedef struct ProtocolCfg ProtocolCfg;
+typedef struct Payload Payload;
 
 
 typedef struct {
 typedef struct {
     const Icon* icon;
     const Icon* icon;
-    const char* (*get_name)(const ProtocolCfg* _cfg);
-    void (*make_packet)(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg);
+    const char* (*get_name)(const Payload* payload);
+    void (*make_packet)(uint8_t* _size, uint8_t** _packet, Payload* payload);
     void (*extra_config)(Ctx* ctx);
     void (*extra_config)(Ctx* ctx);
-    uint8_t (*config_count)(const ProtocolCfg* _cfg);
+    uint8_t (*config_count)(const Payload* payload);
 } Protocol;
 } Protocol;

+ 8 - 12
base_pack/ble_spam/protocols/_protocols.h

@@ -6,13 +6,14 @@
 #include "swiftpair.h"
 #include "swiftpair.h"
 
 
 typedef enum {
 typedef enum {
-    ProtocolModeRandom,
-    ProtocolModeValue,
-    ProtocolModeBruteforce,
-} ProtocolMode;
+    PayloadModeRandom,
+    PayloadModeValue,
+    PayloadModeBruteforce,
+} PayloadMode;
 
 
-struct ProtocolCfg {
-    ProtocolMode mode;
+struct Payload {
+    bool random_mac;
+    PayloadMode mode;
     struct {
     struct {
         uint8_t counter;
         uint8_t counter;
         uint32_t value;
         uint32_t value;
@@ -23,18 +24,13 @@ struct ProtocolCfg {
         FastpairCfg fastpair;
         FastpairCfg fastpair;
         EasysetupCfg easysetup;
         EasysetupCfg easysetup;
         SwiftpairCfg swiftpair;
         SwiftpairCfg swiftpair;
-    } specific;
+    } cfg;
 };
 };
 
 
 extern const Protocol* protocols[];
 extern const Protocol* protocols[];
 
 
 extern const size_t protocols_count;
 extern const size_t protocols_count;
 
 
-typedef struct {
-    bool random_mac;
-    ProtocolCfg cfg;
-} Payload;
-
 struct Attack {
 struct Attack {
     const char* title;
     const char* title;
     const char* text;
     const char* text;

+ 92 - 92
base_pack/ble_spam/protocols/continuity.c

@@ -71,8 +71,8 @@ static const char* type_names[ContinuityTypeCOUNT] = {
     [ContinuityTypeNearbyInfo] = "Nearby Info",
     [ContinuityTypeNearbyInfo] = "Nearby Info",
     [ContinuityTypeCustomCrash] = "Continuity Custom",
     [ContinuityTypeCustomCrash] = "Continuity Custom",
 };
 };
-static const char* get_name(const ProtocolCfg* _cfg) {
-    const ContinuityCfg* cfg = &_cfg->specific.continuity;
+static const char* get_name(const Payload* payload) {
+    const ContinuityCfg* cfg = &payload->cfg.continuity;
     return type_names[cfg->type];
     return type_names[cfg->type];
 }
 }
 
 
@@ -87,8 +87,8 @@ static uint8_t packet_sizes[ContinuityTypeCOUNT] = {
     [ContinuityTypeNearbyInfo] = HEADER_LEN + 5,
     [ContinuityTypeNearbyInfo] = HEADER_LEN + 5,
     [ContinuityTypeCustomCrash] = HEADER_LEN + 11,
     [ContinuityTypeCustomCrash] = HEADER_LEN + 11,
 };
 };
-static void make_packet(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg) {
-    ContinuityCfg* cfg = _cfg ? &_cfg->specific.continuity : NULL;
+static void make_packet(uint8_t* _size, uint8_t** _packet, Payload* payload) {
+    ContinuityCfg* cfg = payload ? &payload->cfg.continuity : NULL;
 
 
     ContinuityType type;
     ContinuityType type;
     if(cfg && cfg->type != 0x00) {
     if(cfg && cfg->type != 0x00) {
@@ -139,16 +139,16 @@ static void make_packet(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg) {
 
 
     case ContinuityTypeProximityPair: {
     case ContinuityTypeProximityPair: {
         uint16_t model;
         uint16_t model;
-        switch(cfg ? _cfg->mode : ProtocolModeRandom) {
-        case ProtocolModeRandom:
+        switch(payload ? payload->mode : PayloadModeRandom) {
+        case PayloadModeRandom:
         default:
         default:
             model = pp_models[rand() % pp_models_count].value;
             model = pp_models[rand() % pp_models_count].value;
             break;
             break;
-        case ProtocolModeValue:
+        case PayloadModeValue:
             model = cfg->data.proximity_pair.model;
             model = cfg->data.proximity_pair.model;
             break;
             break;
-        case ProtocolModeBruteforce:
-            model = cfg->data.proximity_pair.model = _cfg->bruteforce.value;
+        case PayloadModeBruteforce:
+            model = cfg->data.proximity_pair.model = payload->bruteforce.value;
             break;
             break;
         }
         }
 
 
@@ -216,16 +216,16 @@ static void make_packet(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg) {
 
 
     case ContinuityTypeNearbyAction: {
     case ContinuityTypeNearbyAction: {
         uint8_t action;
         uint8_t action;
-        switch(cfg ? _cfg->mode : ProtocolModeRandom) {
-        case ProtocolModeRandom:
+        switch(payload ? payload->mode : PayloadModeRandom) {
+        case PayloadModeRandom:
         default:
         default:
             action = na_actions[rand() % na_actions_count].value;
             action = na_actions[rand() % na_actions_count].value;
             break;
             break;
-        case ProtocolModeValue:
+        case PayloadModeValue:
             action = cfg->data.nearby_action.action;
             action = cfg->data.nearby_action.action;
             break;
             break;
-        case ProtocolModeBruteforce:
-            action = cfg->data.nearby_action.action = _cfg->bruteforce.value;
+        case PayloadModeBruteforce:
+            action = cfg->data.nearby_action.action = payload->bruteforce.value;
             break;
             break;
         }
         }
 
 
@@ -307,8 +307,8 @@ enum {
 };
 };
 static void config_callback(void* _ctx, uint32_t index) {
 static void config_callback(void* _ctx, uint32_t index) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, index);
     scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, index);
     switch(cfg->type) {
     switch(cfg->type) {
     case ContinuityTypeProximityPair: {
     case ContinuityTypeProximityPair: {
@@ -356,22 +356,22 @@ static void config_callback(void* _ctx, uint32_t index) {
     }
     }
 }
 }
 static void pp_model_changed(VariableItem* item) {
 static void pp_model_changed(VariableItem* item) {
-    ProtocolCfg* _cfg = variable_item_get_context(item);
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = variable_item_get_context(item);
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     uint8_t index = variable_item_get_current_value_index(item);
     uint8_t index = variable_item_get_current_value_index(item);
     if(index) {
     if(index) {
         index--;
         index--;
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->data.proximity_pair.model = pp_models[index].value;
         cfg->data.proximity_pair.model = pp_models[index].value;
         variable_item_set_current_value_text(item, pp_models[index].name);
         variable_item_set_current_value_text(item, pp_models[index].name);
     } else {
     } else {
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         variable_item_set_current_value_text(item, "Random");
         variable_item_set_current_value_text(item, "Random");
     }
     }
 }
 }
 static void pp_prefix_changed(VariableItem* item) {
 static void pp_prefix_changed(VariableItem* item) {
-    ProtocolCfg* _cfg = variable_item_get_context(item);
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = variable_item_get_context(item);
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     uint8_t index = variable_item_get_current_value_index(item);
     uint8_t index = variable_item_get_current_value_index(item);
     if(index) {
     if(index) {
         index--;
         index--;
@@ -383,22 +383,22 @@ static void pp_prefix_changed(VariableItem* item) {
     }
     }
 }
 }
 static void na_action_changed(VariableItem* item) {
 static void na_action_changed(VariableItem* item) {
-    ProtocolCfg* _cfg = variable_item_get_context(item);
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = variable_item_get_context(item);
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     uint8_t index = variable_item_get_current_value_index(item);
     uint8_t index = variable_item_get_current_value_index(item);
     if(index) {
     if(index) {
         index--;
         index--;
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->data.nearby_action.action = na_actions[index].value;
         cfg->data.nearby_action.action = na_actions[index].value;
         variable_item_set_current_value_text(item, na_actions[index].name);
         variable_item_set_current_value_text(item, na_actions[index].name);
     } else {
     } else {
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         variable_item_set_current_value_text(item, "Random");
         variable_item_set_current_value_text(item, "Random");
     }
     }
 }
 }
 static void extra_config(Ctx* ctx) {
 static void extra_config(Ctx* ctx) {
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     VariableItemList* list = ctx->variable_item_list;
     VariableItemList* list = ctx->variable_item_list;
     VariableItem* item;
     VariableItem* item;
     size_t value_index;
     size_t value_index;
@@ -406,16 +406,16 @@ static void extra_config(Ctx* ctx) {
     switch(cfg->type) {
     switch(cfg->type) {
     case ContinuityTypeProximityPair: {
     case ContinuityTypeProximityPair: {
         item = variable_item_list_add(
         item = variable_item_list_add(
-            list, "Model Code", pp_models_count + 1, pp_model_changed, _cfg);
+            list, "Model Code", pp_models_count + 1, pp_model_changed, payload);
         const char* model_name = NULL;
         const char* model_name = NULL;
         char model_name_buf[5];
         char model_name_buf[5];
-        switch(_cfg->mode) {
-        case ProtocolModeRandom:
+        switch(payload->mode) {
+        case PayloadModeRandom:
         default:
         default:
             model_name = "Random";
             model_name = "Random";
             value_index = 0;
             value_index = 0;
             break;
             break;
-        case ProtocolModeValue:
+        case PayloadModeValue:
             for(uint8_t i = 0; i < pp_models_count; i++) {
             for(uint8_t i = 0; i < pp_models_count; i++) {
                 if(cfg->data.proximity_pair.model == pp_models[i].value) {
                 if(cfg->data.proximity_pair.model == pp_models[i].value) {
                     model_name = pp_models[i].name;
                     model_name = pp_models[i].name;
@@ -430,7 +430,7 @@ static void extra_config(Ctx* ctx) {
                 value_index = pp_models_count + 1;
                 value_index = pp_models_count + 1;
             }
             }
             break;
             break;
-        case ProtocolModeBruteforce:
+        case PayloadModeBruteforce:
             model_name = "Bruteforce";
             model_name = "Bruteforce";
             value_index = pp_models_count + 1;
             value_index = pp_models_count + 1;
             break;
             break;
@@ -438,8 +438,8 @@ static void extra_config(Ctx* ctx) {
         variable_item_set_current_value_index(item, value_index);
         variable_item_set_current_value_index(item, value_index);
         variable_item_set_current_value_text(item, model_name);
         variable_item_set_current_value_text(item, model_name);
 
 
-        item =
-            variable_item_list_add(list, "Prefix", pp_prefixes_count + 1, pp_prefix_changed, _cfg);
+        item = variable_item_list_add(
+            list, "Prefix", pp_prefixes_count + 1, pp_prefix_changed, payload);
         const char* prefix_name = NULL;
         const char* prefix_name = NULL;
         char prefix_name_buf[3];
         char prefix_name_buf[3];
         if(cfg->data.proximity_pair.prefix == 0x00) {
         if(cfg->data.proximity_pair.prefix == 0x00) {
@@ -469,16 +469,16 @@ static void extra_config(Ctx* ctx) {
     }
     }
     case ContinuityTypeNearbyAction: {
     case ContinuityTypeNearbyAction: {
         item = variable_item_list_add(
         item = variable_item_list_add(
-            list, "Action Type", na_actions_count + 1, na_action_changed, _cfg);
+            list, "Action Type", na_actions_count + 1, na_action_changed, payload);
         const char* action_name = NULL;
         const char* action_name = NULL;
         char action_name_buf[3];
         char action_name_buf[3];
-        switch(_cfg->mode) {
-        case ProtocolModeRandom:
+        switch(payload->mode) {
+        case PayloadModeRandom:
         default:
         default:
             action_name = "Random";
             action_name = "Random";
             value_index = 0;
             value_index = 0;
             break;
             break;
-        case ProtocolModeValue:
+        case PayloadModeValue:
             for(uint8_t i = 0; i < na_actions_count; i++) {
             for(uint8_t i = 0; i < na_actions_count; i++) {
                 if(cfg->data.nearby_action.action == na_actions[i].value) {
                 if(cfg->data.nearby_action.action == na_actions[i].value) {
                     action_name = na_actions[i].name;
                     action_name = na_actions[i].name;
@@ -496,7 +496,7 @@ static void extra_config(Ctx* ctx) {
                 value_index = na_actions_count + 1;
                 value_index = na_actions_count + 1;
             }
             }
             break;
             break;
-        case ProtocolModeBruteforce:
+        case PayloadModeBruteforce:
             action_name = "Bruteforce";
             action_name = "Bruteforce";
             value_index = na_actions_count + 1;
             value_index = na_actions_count + 1;
             break;
             break;
@@ -539,8 +539,8 @@ static uint8_t config_counts[ContinuityTypeCOUNT] = {
     [ContinuityTypeNearbyInfo] = 0,
     [ContinuityTypeNearbyInfo] = 0,
     [ContinuityTypeCustomCrash] = ConfigCcCOUNT - ConfigExtraStart - 1,
     [ContinuityTypeCustomCrash] = ConfigCcCOUNT - ConfigExtraStart - 1,
 };
 };
-static uint8_t config_count(const ProtocolCfg* _cfg) {
-    const ContinuityCfg* cfg = &_cfg->specific.continuity;
+static uint8_t config_count(const Payload* payload) {
+    const ContinuityCfg* cfg = &payload->cfg.continuity;
     return config_counts[cfg->type];
     return config_counts[cfg->type];
 }
 }
 
 
@@ -554,25 +554,25 @@ const Protocol protocol_continuity = {
 
 
 static void pp_model_callback(void* _ctx, uint32_t index) {
 static void pp_model_callback(void* _ctx, uint32_t index) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     switch(index) {
     switch(index) {
     case 0:
     case 0:
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     case pp_models_count + 1:
     case pp_models_count + 1:
         scene_manager_next_scene(ctx->scene_manager, SceneContinuityPpModelCustom);
         scene_manager_next_scene(ctx->scene_manager, SceneContinuityPpModelCustom);
         break;
         break;
     case pp_models_count + 2:
     case pp_models_count + 2:
-        _cfg->mode = ProtocolModeBruteforce;
-        _cfg->bruteforce.counter = 0;
-        _cfg->bruteforce.value = cfg->data.proximity_pair.model;
-        _cfg->bruteforce.size = 2;
+        payload->mode = PayloadModeBruteforce;
+        payload->bruteforce.counter = 0;
+        payload->bruteforce.value = cfg->data.proximity_pair.model;
+        payload->bruteforce.size = 2;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     default:
     default:
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->data.proximity_pair.model = pp_models[index - 1].value;
         cfg->data.proximity_pair.model = pp_models[index - 1].value;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
@@ -580,33 +580,33 @@ static void pp_model_callback(void* _ctx, uint32_t index) {
 }
 }
 void scene_continuity_pp_model_on_enter(void* _ctx) {
 void scene_continuity_pp_model_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     Submenu* submenu = ctx->submenu;
     Submenu* submenu = ctx->submenu;
     uint32_t selected = 0;
     uint32_t selected = 0;
     submenu_reset(submenu);
     submenu_reset(submenu);
 
 
     submenu_add_item(submenu, "Random", 0, pp_model_callback, ctx);
     submenu_add_item(submenu, "Random", 0, pp_model_callback, ctx);
-    if(_cfg->mode == ProtocolModeRandom) {
+    if(payload->mode == PayloadModeRandom) {
         selected = 0;
         selected = 0;
     }
     }
 
 
     bool found = false;
     bool found = false;
     for(uint8_t i = 0; i < pp_models_count; i++) {
     for(uint8_t i = 0; i < pp_models_count; i++) {
         submenu_add_item(submenu, pp_models[i].name, i + 1, pp_model_callback, ctx);
         submenu_add_item(submenu, pp_models[i].name, i + 1, pp_model_callback, ctx);
-        if(!found && _cfg->mode == ProtocolModeValue &&
+        if(!found && payload->mode == PayloadModeValue &&
            cfg->data.proximity_pair.model == pp_models[i].value) {
            cfg->data.proximity_pair.model == pp_models[i].value) {
             found = true;
             found = true;
             selected = i + 1;
             selected = i + 1;
         }
         }
     }
     }
     submenu_add_item(submenu, "Custom", pp_models_count + 1, pp_model_callback, ctx);
     submenu_add_item(submenu, "Custom", pp_models_count + 1, pp_model_callback, ctx);
-    if(!found && _cfg->mode == ProtocolModeValue) {
+    if(!found && payload->mode == PayloadModeValue) {
         selected = pp_models_count + 1;
         selected = pp_models_count + 1;
     }
     }
 
 
     submenu_add_item(submenu, "Bruteforce", pp_models_count + 2, pp_model_callback, ctx);
     submenu_add_item(submenu, "Bruteforce", pp_models_count + 2, pp_model_callback, ctx);
-    if(_cfg->mode == ProtocolModeBruteforce) {
+    if(payload->mode == PayloadModeBruteforce) {
         selected = pp_models_count + 2;
         selected = pp_models_count + 2;
     }
     }
 
 
@@ -625,17 +625,17 @@ void scene_continuity_pp_model_on_exit(void* _ctx) {
 
 
 static void pp_model_custom_callback(void* _ctx) {
 static void pp_model_custom_callback(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
-    _cfg->mode = ProtocolModeValue;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
+    payload->mode = PayloadModeValue;
     cfg->data.proximity_pair.model = (ctx->byte_store[0] << 0x08) + (ctx->byte_store[1] << 0x00);
     cfg->data.proximity_pair.model = (ctx->byte_store[0] << 0x08) + (ctx->byte_store[1] << 0x00);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
 }
 }
 void scene_continuity_pp_model_custom_on_enter(void* _ctx) {
 void scene_continuity_pp_model_custom_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     ByteInput* byte_input = ctx->byte_input;
     ByteInput* byte_input = ctx->byte_input;
 
 
     byte_input_set_header_text(byte_input, "Enter custom Model Code");
     byte_input_set_header_text(byte_input, "Enter custom Model Code");
@@ -659,8 +659,8 @@ void scene_continuity_pp_model_custom_on_exit(void* _ctx) {
 
 
 static void pp_prefix_callback(void* _ctx, uint32_t index) {
 static void pp_prefix_callback(void* _ctx, uint32_t index) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     switch(index) {
     switch(index) {
     case 0:
     case 0:
         cfg->data.proximity_pair.prefix = 0x00;
         cfg->data.proximity_pair.prefix = 0x00;
@@ -677,8 +677,8 @@ static void pp_prefix_callback(void* _ctx, uint32_t index) {
 }
 }
 void scene_continuity_pp_prefix_on_enter(void* _ctx) {
 void scene_continuity_pp_prefix_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     Submenu* submenu = ctx->submenu;
     Submenu* submenu = ctx->submenu;
     uint32_t selected = 0;
     uint32_t selected = 0;
     bool found = false;
     bool found = false;
@@ -717,16 +717,16 @@ void scene_continuity_pp_prefix_on_exit(void* _ctx) {
 
 
 static void pp_prefix_custom_callback(void* _ctx) {
 static void pp_prefix_custom_callback(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     cfg->data.proximity_pair.prefix = (ctx->byte_store[0] << 0x00);
     cfg->data.proximity_pair.prefix = (ctx->byte_store[0] << 0x00);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
 }
 }
 void scene_continuity_pp_prefix_custom_on_enter(void* _ctx) {
 void scene_continuity_pp_prefix_custom_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     ByteInput* byte_input = ctx->byte_input;
     ByteInput* byte_input = ctx->byte_input;
 
 
     byte_input_set_header_text(byte_input, "Enter custom Prefix");
     byte_input_set_header_text(byte_input, "Enter custom Prefix");
@@ -749,25 +749,25 @@ void scene_continuity_pp_prefix_custom_on_exit(void* _ctx) {
 
 
 static void na_action_callback(void* _ctx, uint32_t index) {
 static void na_action_callback(void* _ctx, uint32_t index) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     switch(index) {
     switch(index) {
     case 0:
     case 0:
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     case na_actions_count + 1:
     case na_actions_count + 1:
         scene_manager_next_scene(ctx->scene_manager, SceneContinuityNaActionCustom);
         scene_manager_next_scene(ctx->scene_manager, SceneContinuityNaActionCustom);
         break;
         break;
     case na_actions_count + 2:
     case na_actions_count + 2:
-        _cfg->mode = ProtocolModeBruteforce;
-        _cfg->bruteforce.counter = 0;
-        _cfg->bruteforce.value = cfg->data.nearby_action.action;
-        _cfg->bruteforce.size = 1;
+        payload->mode = PayloadModeBruteforce;
+        payload->bruteforce.counter = 0;
+        payload->bruteforce.value = cfg->data.nearby_action.action;
+        payload->bruteforce.size = 1;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     default:
     default:
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->data.nearby_action.action = na_actions[index - 1].value;
         cfg->data.nearby_action.action = na_actions[index - 1].value;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
@@ -775,33 +775,33 @@ static void na_action_callback(void* _ctx, uint32_t index) {
 }
 }
 void scene_continuity_na_action_on_enter(void* _ctx) {
 void scene_continuity_na_action_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     Submenu* submenu = ctx->submenu;
     Submenu* submenu = ctx->submenu;
     uint32_t selected = 0;
     uint32_t selected = 0;
     submenu_reset(submenu);
     submenu_reset(submenu);
 
 
     submenu_add_item(submenu, "Random", 0, na_action_callback, ctx);
     submenu_add_item(submenu, "Random", 0, na_action_callback, ctx);
-    if(_cfg->mode == ProtocolModeRandom) {
+    if(payload->mode == PayloadModeRandom) {
         selected = 0;
         selected = 0;
     }
     }
 
 
     bool found = false;
     bool found = false;
     for(uint8_t i = 0; i < na_actions_count; i++) {
     for(uint8_t i = 0; i < na_actions_count; i++) {
         submenu_add_item(submenu, na_actions[i].name, i + 1, na_action_callback, ctx);
         submenu_add_item(submenu, na_actions[i].name, i + 1, na_action_callback, ctx);
-        if(!found && _cfg->mode == ProtocolModeValue &&
+        if(!found && payload->mode == PayloadModeValue &&
            cfg->data.nearby_action.action == na_actions[i].value) {
            cfg->data.nearby_action.action == na_actions[i].value) {
             found = true;
             found = true;
             selected = i + 1;
             selected = i + 1;
         }
         }
     }
     }
     submenu_add_item(submenu, "Custom", na_actions_count + 1, na_action_callback, ctx);
     submenu_add_item(submenu, "Custom", na_actions_count + 1, na_action_callback, ctx);
-    if(!found && _cfg->mode == ProtocolModeValue) {
+    if(!found && payload->mode == PayloadModeValue) {
         selected = na_actions_count + 1;
         selected = na_actions_count + 1;
     }
     }
 
 
     submenu_add_item(submenu, "Bruteforce", na_actions_count + 2, na_action_callback, ctx);
     submenu_add_item(submenu, "Bruteforce", na_actions_count + 2, na_action_callback, ctx);
-    if(_cfg->mode == ProtocolModeBruteforce) {
+    if(payload->mode == PayloadModeBruteforce) {
         selected = na_actions_count + 2;
         selected = na_actions_count + 2;
     }
     }
 
 
@@ -820,17 +820,17 @@ void scene_continuity_na_action_on_exit(void* _ctx) {
 
 
 static void na_action_custom_callback(void* _ctx) {
 static void na_action_custom_callback(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
-    _cfg->mode = ProtocolModeValue;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
+    payload->mode = PayloadModeValue;
     cfg->data.nearby_action.action = (ctx->byte_store[0] << 0x00);
     cfg->data.nearby_action.action = (ctx->byte_store[0] << 0x00);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
 }
 }
 void scene_continuity_na_action_custom_on_enter(void* _ctx) {
 void scene_continuity_na_action_custom_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     ByteInput* byte_input = ctx->byte_input;
     ByteInput* byte_input = ctx->byte_input;
 
 
     byte_input_set_header_text(byte_input, "Enter custom Action Type");
     byte_input_set_header_text(byte_input, "Enter custom Action Type");
@@ -857,8 +857,8 @@ static void na_flags_callback(void* _ctx) {
 }
 }
 void scene_continuity_na_flags_on_enter(void* _ctx) {
 void scene_continuity_na_flags_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     ByteInput* byte_input = ctx->byte_input;
     ByteInput* byte_input = ctx->byte_input;
 
 
     byte_input_set_header_text(byte_input, "Press back for automatic");
     byte_input_set_header_text(byte_input, "Press back for automatic");
@@ -879,7 +879,7 @@ bool scene_continuity_na_flags_on_event(void* _ctx, SceneManagerEvent event) {
 }
 }
 void scene_continuity_na_flags_on_exit(void* _ctx) {
 void scene_continuity_na_flags_on_exit(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    ContinuityCfg* cfg = &_cfg->specific.continuity;
+    Payload* payload = &ctx->attack->payload;
+    ContinuityCfg* cfg = &payload->cfg.continuity;
     cfg->data.nearby_action.flags = (ctx->byte_store[0] << 0x00);
     cfg->data.nearby_action.flags = (ctx->byte_store[0] << 0x00);
 }
 }

+ 76 - 76
base_pack/ble_spam/protocols/easysetup.c

@@ -68,8 +68,8 @@ static const char* type_names[EasysetupTypeCOUNT] = {
     [EasysetupTypeBuds] = "EasySetup Buds",
     [EasysetupTypeBuds] = "EasySetup Buds",
     [EasysetupTypeWatch] = "EasySetup Watch",
     [EasysetupTypeWatch] = "EasySetup Watch",
 };
 };
-static const char* get_name(const ProtocolCfg* _cfg) {
-    const EasysetupCfg* cfg = &_cfg->specific.easysetup;
+static const char* get_name(const Payload* payload) {
+    const EasysetupCfg* cfg = &payload->cfg.easysetup;
     return type_names[cfg->type];
     return type_names[cfg->type];
 }
 }
 
 
@@ -77,8 +77,8 @@ static uint8_t packet_sizes[EasysetupTypeCOUNT] = {
     [EasysetupTypeBuds] = 31,
     [EasysetupTypeBuds] = 31,
     [EasysetupTypeWatch] = 15,
     [EasysetupTypeWatch] = 15,
 };
 };
-void make_packet(uint8_t* out_size, uint8_t** out_packet, ProtocolCfg* _cfg) {
-    EasysetupCfg* cfg = _cfg ? &_cfg->specific.easysetup : NULL;
+void make_packet(uint8_t* out_size, uint8_t** out_packet, Payload* payload) {
+    EasysetupCfg* cfg = payload ? &payload->cfg.easysetup : NULL;
 
 
     EasysetupType type;
     EasysetupType type;
     if(cfg && cfg->type != 0x00) {
     if(cfg && cfg->type != 0x00) {
@@ -98,16 +98,16 @@ void make_packet(uint8_t* out_size, uint8_t** out_packet, ProtocolCfg* _cfg) {
     switch(type) {
     switch(type) {
     case EasysetupTypeBuds: {
     case EasysetupTypeBuds: {
         uint32_t model;
         uint32_t model;
-        switch(cfg ? _cfg->mode : ProtocolModeRandom) {
-        case ProtocolModeRandom:
+        switch(cfg ? payload->mode : PayloadModeRandom) {
+        case PayloadModeRandom:
         default:
         default:
             model = buds_models[rand() % buds_models_count].value;
             model = buds_models[rand() % buds_models_count].value;
             break;
             break;
-        case ProtocolModeValue:
+        case PayloadModeValue:
             model = cfg->data.buds.model;
             model = cfg->data.buds.model;
             break;
             break;
-        case ProtocolModeBruteforce:
-            model = cfg->data.buds.model = _cfg->bruteforce.value;
+        case PayloadModeBruteforce:
+            model = cfg->data.buds.model = payload->bruteforce.value;
             break;
             break;
         }
         }
 
 
@@ -148,16 +148,16 @@ void make_packet(uint8_t* out_size, uint8_t** out_packet, ProtocolCfg* _cfg) {
     }
     }
     case EasysetupTypeWatch: {
     case EasysetupTypeWatch: {
         uint8_t model;
         uint8_t model;
-        switch(cfg ? _cfg->mode : ProtocolModeRandom) {
-        case ProtocolModeRandom:
+        switch(cfg ? payload->mode : PayloadModeRandom) {
+        case PayloadModeRandom:
         default:
         default:
             model = watch_models[rand() % watch_models_count].value;
             model = watch_models[rand() % watch_models_count].value;
             break;
             break;
-        case ProtocolModeValue:
+        case PayloadModeValue:
             model = cfg->data.watch.model;
             model = cfg->data.watch.model;
             break;
             break;
-        case ProtocolModeBruteforce:
-            model = cfg->data.watch.model = _cfg->bruteforce.value;
+        case PayloadModeBruteforce:
+            model = cfg->data.watch.model = payload->bruteforce.value;
             break;
             break;
         }
         }
 
 
@@ -199,8 +199,8 @@ enum {
 };
 };
 static void config_callback(void* _ctx, uint32_t index) {
 static void config_callback(void* _ctx, uint32_t index) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, index);
     scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, index);
     switch(cfg->type) {
     switch(cfg->type) {
     case EasysetupTypeBuds: {
     case EasysetupTypeBuds: {
@@ -233,36 +233,36 @@ static void config_callback(void* _ctx, uint32_t index) {
     }
     }
 }
 }
 static void buds_model_changed(VariableItem* item) {
 static void buds_model_changed(VariableItem* item) {
-    ProtocolCfg* _cfg = variable_item_get_context(item);
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = variable_item_get_context(item);
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     uint8_t index = variable_item_get_current_value_index(item);
     uint8_t index = variable_item_get_current_value_index(item);
     if(index) {
     if(index) {
         index--;
         index--;
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->data.buds.model = buds_models[index].value;
         cfg->data.buds.model = buds_models[index].value;
         variable_item_set_current_value_text(item, buds_models[index].name);
         variable_item_set_current_value_text(item, buds_models[index].name);
     } else {
     } else {
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         variable_item_set_current_value_text(item, "Random");
         variable_item_set_current_value_text(item, "Random");
     }
     }
 }
 }
 static void watch_model_changed(VariableItem* item) {
 static void watch_model_changed(VariableItem* item) {
-    ProtocolCfg* _cfg = variable_item_get_context(item);
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = variable_item_get_context(item);
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     uint8_t index = variable_item_get_current_value_index(item);
     uint8_t index = variable_item_get_current_value_index(item);
     if(index) {
     if(index) {
         index--;
         index--;
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->data.watch.model = watch_models[index].value;
         cfg->data.watch.model = watch_models[index].value;
         variable_item_set_current_value_text(item, watch_models[index].name);
         variable_item_set_current_value_text(item, watch_models[index].name);
     } else {
     } else {
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         variable_item_set_current_value_text(item, "Random");
         variable_item_set_current_value_text(item, "Random");
     }
     }
 }
 }
 static void extra_config(Ctx* ctx) {
 static void extra_config(Ctx* ctx) {
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     VariableItemList* list = ctx->variable_item_list;
     VariableItemList* list = ctx->variable_item_list;
     VariableItem* item;
     VariableItem* item;
     size_t value_index;
     size_t value_index;
@@ -270,16 +270,16 @@ static void extra_config(Ctx* ctx) {
     switch(cfg->type) {
     switch(cfg->type) {
     case EasysetupTypeBuds: {
     case EasysetupTypeBuds: {
         item = variable_item_list_add(
         item = variable_item_list_add(
-            list, "Model Code", buds_models_count + 1, buds_model_changed, _cfg);
+            list, "Model Code", buds_models_count + 1, buds_model_changed, payload);
         const char* model_name = NULL;
         const char* model_name = NULL;
         char model_name_buf[9];
         char model_name_buf[9];
-        switch(_cfg->mode) {
-        case ProtocolModeRandom:
+        switch(payload->mode) {
+        case PayloadModeRandom:
         default:
         default:
             model_name = "Random";
             model_name = "Random";
             value_index = 0;
             value_index = 0;
             break;
             break;
-        case ProtocolModeValue:
+        case PayloadModeValue:
             for(uint8_t i = 0; i < buds_models_count; i++) {
             for(uint8_t i = 0; i < buds_models_count; i++) {
                 if(cfg->data.buds.model == buds_models[i].value) {
                 if(cfg->data.buds.model == buds_models[i].value) {
                     model_name = buds_models[i].name;
                     model_name = buds_models[i].name;
@@ -293,7 +293,7 @@ static void extra_config(Ctx* ctx) {
                 value_index = buds_models_count + 1;
                 value_index = buds_models_count + 1;
             }
             }
             break;
             break;
-        case ProtocolModeBruteforce:
+        case PayloadModeBruteforce:
             model_name = "Bruteforce";
             model_name = "Bruteforce";
             value_index = buds_models_count + 1;
             value_index = buds_models_count + 1;
             break;
             break;
@@ -306,16 +306,16 @@ static void extra_config(Ctx* ctx) {
     }
     }
     case EasysetupTypeWatch: {
     case EasysetupTypeWatch: {
         item = variable_item_list_add(
         item = variable_item_list_add(
-            list, "Model Code", watch_models_count + 1, watch_model_changed, _cfg);
+            list, "Model Code", watch_models_count + 1, watch_model_changed, payload);
         const char* model_name = NULL;
         const char* model_name = NULL;
         char model_name_buf[3];
         char model_name_buf[3];
-        switch(_cfg->mode) {
-        case ProtocolModeRandom:
+        switch(payload->mode) {
+        case PayloadModeRandom:
         default:
         default:
             model_name = "Random";
             model_name = "Random";
             value_index = 0;
             value_index = 0;
             break;
             break;
-        case ProtocolModeValue:
+        case PayloadModeValue:
             for(uint8_t i = 0; i < watch_models_count; i++) {
             for(uint8_t i = 0; i < watch_models_count; i++) {
                 if(cfg->data.watch.model == watch_models[i].value) {
                 if(cfg->data.watch.model == watch_models[i].value) {
                     model_name = watch_models[i].name;
                     model_name = watch_models[i].name;
@@ -329,7 +329,7 @@ static void extra_config(Ctx* ctx) {
                 value_index = watch_models_count + 1;
                 value_index = watch_models_count + 1;
             }
             }
             break;
             break;
-        case ProtocolModeBruteforce:
+        case PayloadModeBruteforce:
             model_name = "Bruteforce";
             model_name = "Bruteforce";
             value_index = watch_models_count + 1;
             value_index = watch_models_count + 1;
             break;
             break;
@@ -349,8 +349,8 @@ static uint8_t config_counts[EasysetupTypeCOUNT] = {
     [EasysetupTypeBuds] = ConfigBudsCOUNT - ConfigExtraStart - 1,
     [EasysetupTypeBuds] = ConfigBudsCOUNT - ConfigExtraStart - 1,
     [EasysetupTypeWatch] = ConfigWatchCOUNT - ConfigExtraStart - 1,
     [EasysetupTypeWatch] = ConfigWatchCOUNT - ConfigExtraStart - 1,
 };
 };
-static uint8_t config_count(const ProtocolCfg* _cfg) {
-    const EasysetupCfg* cfg = &_cfg->specific.easysetup;
+static uint8_t config_count(const Payload* payload) {
+    const EasysetupCfg* cfg = &payload->cfg.easysetup;
     return config_counts[cfg->type];
     return config_counts[cfg->type];
 }
 }
 
 
@@ -364,25 +364,25 @@ const Protocol protocol_easysetup = {
 
 
 static void buds_model_callback(void* _ctx, uint32_t index) {
 static void buds_model_callback(void* _ctx, uint32_t index) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     switch(index) {
     switch(index) {
     case 0:
     case 0:
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     case buds_models_count + 1:
     case buds_models_count + 1:
         scene_manager_next_scene(ctx->scene_manager, SceneEasysetupBudsModelCustom);
         scene_manager_next_scene(ctx->scene_manager, SceneEasysetupBudsModelCustom);
         break;
         break;
     case buds_models_count + 2:
     case buds_models_count + 2:
-        _cfg->mode = ProtocolModeBruteforce;
-        _cfg->bruteforce.counter = 0;
-        _cfg->bruteforce.value = cfg->data.buds.model;
-        _cfg->bruteforce.size = 3;
+        payload->mode = PayloadModeBruteforce;
+        payload->bruteforce.counter = 0;
+        payload->bruteforce.value = cfg->data.buds.model;
+        payload->bruteforce.size = 3;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     default:
     default:
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->data.buds.model = buds_models[index - 1].value;
         cfg->data.buds.model = buds_models[index - 1].value;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
@@ -390,33 +390,33 @@ static void buds_model_callback(void* _ctx, uint32_t index) {
 }
 }
 void scene_easysetup_buds_model_on_enter(void* _ctx) {
 void scene_easysetup_buds_model_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     Submenu* submenu = ctx->submenu;
     Submenu* submenu = ctx->submenu;
     uint32_t selected = 0;
     uint32_t selected = 0;
     submenu_reset(submenu);
     submenu_reset(submenu);
 
 
     submenu_add_item(submenu, "Random", 0, buds_model_callback, ctx);
     submenu_add_item(submenu, "Random", 0, buds_model_callback, ctx);
-    if(_cfg->mode == ProtocolModeRandom) {
+    if(payload->mode == PayloadModeRandom) {
         selected = 0;
         selected = 0;
     }
     }
 
 
     bool found = false;
     bool found = false;
     for(uint8_t i = 0; i < buds_models_count; i++) {
     for(uint8_t i = 0; i < buds_models_count; i++) {
         submenu_add_item(submenu, buds_models[i].name, i + 1, buds_model_callback, ctx);
         submenu_add_item(submenu, buds_models[i].name, i + 1, buds_model_callback, ctx);
-        if(!found && _cfg->mode == ProtocolModeValue &&
+        if(!found && payload->mode == PayloadModeValue &&
            cfg->data.buds.model == buds_models[i].value) {
            cfg->data.buds.model == buds_models[i].value) {
             found = true;
             found = true;
             selected = i + 1;
             selected = i + 1;
         }
         }
     }
     }
     submenu_add_item(submenu, "Custom", buds_models_count + 1, buds_model_callback, ctx);
     submenu_add_item(submenu, "Custom", buds_models_count + 1, buds_model_callback, ctx);
-    if(!found && _cfg->mode == ProtocolModeValue) {
+    if(!found && payload->mode == PayloadModeValue) {
         selected = buds_models_count + 1;
         selected = buds_models_count + 1;
     }
     }
 
 
     submenu_add_item(submenu, "Bruteforce", buds_models_count + 2, buds_model_callback, ctx);
     submenu_add_item(submenu, "Bruteforce", buds_models_count + 2, buds_model_callback, ctx);
-    if(_cfg->mode == ProtocolModeBruteforce) {
+    if(payload->mode == PayloadModeBruteforce) {
         selected = buds_models_count + 2;
         selected = buds_models_count + 2;
     }
     }
 
 
@@ -435,9 +435,9 @@ void scene_easysetup_buds_model_on_exit(void* _ctx) {
 
 
 static void buds_model_custom_callback(void* _ctx) {
 static void buds_model_custom_callback(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
-    _cfg->mode = ProtocolModeValue;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
+    payload->mode = PayloadModeValue;
     cfg->data.buds.model =
     cfg->data.buds.model =
         (ctx->byte_store[0] << 0x10) + (ctx->byte_store[1] << 0x08) + (ctx->byte_store[2] << 0x00);
         (ctx->byte_store[0] << 0x10) + (ctx->byte_store[1] << 0x08) + (ctx->byte_store[2] << 0x00);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
@@ -445,8 +445,8 @@ static void buds_model_custom_callback(void* _ctx) {
 }
 }
 void scene_easysetup_buds_model_custom_on_enter(void* _ctx) {
 void scene_easysetup_buds_model_custom_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     ByteInput* byte_input = ctx->byte_input;
     ByteInput* byte_input = ctx->byte_input;
 
 
     byte_input_set_header_text(byte_input, "Enter custom Model Code");
     byte_input_set_header_text(byte_input, "Enter custom Model Code");
@@ -471,25 +471,25 @@ void scene_easysetup_buds_model_custom_on_exit(void* _ctx) {
 
 
 static void watch_model_callback(void* _ctx, uint32_t index) {
 static void watch_model_callback(void* _ctx, uint32_t index) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     switch(index) {
     switch(index) {
     case 0:
     case 0:
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     case watch_models_count + 1:
     case watch_models_count + 1:
         scene_manager_next_scene(ctx->scene_manager, SceneEasysetupWatchModelCustom);
         scene_manager_next_scene(ctx->scene_manager, SceneEasysetupWatchModelCustom);
         break;
         break;
     case watch_models_count + 2:
     case watch_models_count + 2:
-        _cfg->mode = ProtocolModeBruteforce;
-        _cfg->bruteforce.counter = 0;
-        _cfg->bruteforce.value = cfg->data.watch.model;
-        _cfg->bruteforce.size = 1;
+        payload->mode = PayloadModeBruteforce;
+        payload->bruteforce.counter = 0;
+        payload->bruteforce.value = cfg->data.watch.model;
+        payload->bruteforce.size = 1;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     default:
     default:
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->data.watch.model = watch_models[index - 1].value;
         cfg->data.watch.model = watch_models[index - 1].value;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
@@ -497,33 +497,33 @@ static void watch_model_callback(void* _ctx, uint32_t index) {
 }
 }
 void scene_easysetup_watch_model_on_enter(void* _ctx) {
 void scene_easysetup_watch_model_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     Submenu* submenu = ctx->submenu;
     Submenu* submenu = ctx->submenu;
     uint32_t selected = 0;
     uint32_t selected = 0;
     submenu_reset(submenu);
     submenu_reset(submenu);
 
 
     submenu_add_item(submenu, "Random", 0, watch_model_callback, ctx);
     submenu_add_item(submenu, "Random", 0, watch_model_callback, ctx);
-    if(_cfg->mode == ProtocolModeRandom) {
+    if(payload->mode == PayloadModeRandom) {
         selected = 0;
         selected = 0;
     }
     }
 
 
     bool found = false;
     bool found = false;
     for(uint8_t i = 0; i < watch_models_count; i++) {
     for(uint8_t i = 0; i < watch_models_count; i++) {
         submenu_add_item(submenu, watch_models[i].name, i + 1, watch_model_callback, ctx);
         submenu_add_item(submenu, watch_models[i].name, i + 1, watch_model_callback, ctx);
-        if(!found && _cfg->mode == ProtocolModeValue &&
+        if(!found && payload->mode == PayloadModeValue &&
            cfg->data.watch.model == watch_models[i].value) {
            cfg->data.watch.model == watch_models[i].value) {
             found = true;
             found = true;
             selected = i + 1;
             selected = i + 1;
         }
         }
     }
     }
     submenu_add_item(submenu, "Custom", watch_models_count + 1, watch_model_callback, ctx);
     submenu_add_item(submenu, "Custom", watch_models_count + 1, watch_model_callback, ctx);
-    if(!found && _cfg->mode == ProtocolModeValue) {
+    if(!found && payload->mode == PayloadModeValue) {
         selected = watch_models_count + 1;
         selected = watch_models_count + 1;
     }
     }
 
 
     submenu_add_item(submenu, "Bruteforce", watch_models_count + 2, watch_model_callback, ctx);
     submenu_add_item(submenu, "Bruteforce", watch_models_count + 2, watch_model_callback, ctx);
-    if(_cfg->mode == ProtocolModeBruteforce) {
+    if(payload->mode == PayloadModeBruteforce) {
         selected = watch_models_count + 2;
         selected = watch_models_count + 2;
     }
     }
 
 
@@ -542,17 +542,17 @@ void scene_easysetup_watch_model_on_exit(void* _ctx) {
 
 
 static void watch_model_custom_callback(void* _ctx) {
 static void watch_model_custom_callback(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
-    _cfg->mode = ProtocolModeValue;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
+    payload->mode = PayloadModeValue;
     cfg->data.watch.model = (ctx->byte_store[0] << 0x00);
     cfg->data.watch.model = (ctx->byte_store[0] << 0x00);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
 }
 }
 void scene_easysetup_watch_model_custom_on_enter(void* _ctx) {
 void scene_easysetup_watch_model_custom_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    EasysetupCfg* cfg = &_cfg->specific.easysetup;
+    Payload* payload = &ctx->attack->payload;
+    EasysetupCfg* cfg = &payload->cfg.easysetup;
     ByteInput* byte_input = ctx->byte_input;
     ByteInput* byte_input = ctx->byte_input;
 
 
     byte_input_set_header_text(byte_input, "Enter custom Model Code");
     byte_input_set_header_text(byte_input, "Enter custom Model Code");

+ 501 - 64
base_pack/ble_spam/protocols/fastpair.c

@@ -8,12 +8,10 @@ const struct {
     uint32_t value;
     uint32_t value;
     const char* name;
     const char* name;
 } models[] = {
 } models[] = {
-    // Genuine actions
-    {0x00000C, "Set Up Device"},
-
     // Genuine non-production/forgotten (good job Google)
     // Genuine non-production/forgotten (good job Google)
     {0x0001F0, "Bisto CSR8670 Dev Board"},
     {0x0001F0, "Bisto CSR8670 Dev Board"},
     {0x000047, "Arduino 101"},
     {0x000047, "Arduino 101"},
+    {0x470000, "Arduino 101 2"},
     {0x00000A, "Anti-Spoof Test"},
     {0x00000A, "Anti-Spoof Test"},
     {0x0A0000, "Anti-Spoof Test 2"},
     {0x0A0000, "Anti-Spoof Test 2"},
     {0x00000B, "Google Gphones"},
     {0x00000B, "Google Gphones"},
@@ -26,12 +24,30 @@ const struct {
     {0x080000, "Foocorp Foophones 2"},
     {0x080000, "Foocorp Foophones 2"},
     {0x000009, "Test Android TV"},
     {0x000009, "Test Android TV"},
     {0x090000, "Test Android TV 2"},
     {0x090000, "Test Android TV 2"},
+    {0x000035, "Test 000035"},
+    {0x350000, "Test 000035 2"},
     {0x000048, "Fast Pair Headphones"},
     {0x000048, "Fast Pair Headphones"},
-    {0x000049, "Fast Pair Headphones 2"},
+    {0x480000, "Fast Pair Headphones 2"},
+    {0x000049, "Fast Pair Headphones 3"},
+    {0x490000, "Fast Pair Headphones 4"},
+    {0x001000, "LG HBS1110"},
+    {0x00B727, "Smart Controller 1"},
+    {0x01E5CE, "BLE-Phone"},
+    {0x0200F0, "Goodyear"},
+    {0x00F7D4, "Smart Setup"},
+    {0xF00002, "Goodyear"},
+    {0xF00400, "T10"},
+    {0x1E89A7, "ATS2833_EVB"},
+
+    // Phone setup
+    {0x00000C, "Google Gphones Transfer"},
+    {0x0577B1, "Galaxy S23 Ultra"},
+    {0x05A9BC, "Galaxy S20+"},
 
 
     // Genuine devices
     // Genuine devices
     {0xCD8256, "Bose NC 700"},
     {0xCD8256, "Bose NC 700"},
     {0x0000F0, "Bose QuietComfort 35 II"},
     {0x0000F0, "Bose QuietComfort 35 II"},
+    {0xF00000, "Bose QuietComfort 35 II 2"},
     {0x821F66, "JBL Flip 6"},
     {0x821F66, "JBL Flip 6"},
     {0xF52494, "JBL Buds Pro"},
     {0xF52494, "JBL Buds Pro"},
     {0x718FA4, "JBL Live 300TWS"},
     {0x718FA4, "JBL Live 300TWS"},
@@ -45,6 +61,447 @@ const struct {
     {0x72EF8D, "Razer Hammerhead TWS X"},
     {0x72EF8D, "Razer Hammerhead TWS X"},
     {0x72FB00, "Soundcore Spirit Pro GVA"},
     {0x72FB00, "Soundcore Spirit Pro GVA"},
     {0x0003F0, "LG HBS-835S"},
     {0x0003F0, "LG HBS-835S"},
+    {0x002000, "AIAIAI TMA-2 (H60)"},
+    {0x003000, "Libratone Q Adapt On-Ear"},
+    {0x003001, "Libratone Q Adapt On-Ear 2"},
+    {0x00A168, "boAt  Airdopes 621"},
+    {0x00AA48, "Jabra Elite 2"},
+    {0x00AA91, "Beoplay E8 2.0"},
+    {0x00C95C, "Sony WF-1000X"},
+    {0x01EEB4, "WH-1000XM4"},
+    {0x02AA91, "B&O Earset"},
+    {0x01C95C, "Sony WF-1000X"},
+    {0x02D815, "ATH-CK1TW"},
+    {0x035764, "PLT V8200 Series"},
+    {0x038CC7, "JBL TUNE760NC"},
+    {0x02DD4F, "JBL TUNE770NC"},
+    {0x02E2A9, "TCL MOVEAUDIO S200"},
+    {0x035754, "Plantronics PLT_K2"},
+    {0x02C95C, "Sony WH-1000XM2"},
+    {0x038B91, "DENON AH-C830NCW"},
+    {0x02F637, "JBL LIVE FLEX"},
+    {0x02D886, "JBL REFLECT MINI NC"},
+    {0xF00000, "Bose QuietComfort 35 II"},
+    {0xF00001, "Bose QuietComfort 35 II"},
+    {0xF00201, "JBL Everest 110GA"},
+    {0xF00204, "JBL Everest 310GA"},
+    {0xF00209, "JBL LIVE400BT"},
+    {0xF00205, "JBL Everest 310GA"},
+    {0xF00200, "JBL Everest 110GA"},
+    {0xF00208, "JBL Everest 710GA"},
+    {0xF00207, "JBL Everest 710GA"},
+    {0xF00206, "JBL Everest 310GA"},
+    {0xF0020A, "JBL LIVE400BT"},
+    {0xF0020B, "JBL LIVE400BT"},
+    {0xF0020C, "JBL LIVE400BT"},
+    {0xF00203, "JBL Everest 310GA"},
+    {0xF00202, "JBL Everest 110GA"},
+    {0xF00213, "JBL LIVE650BTNC"},
+    {0xF0020F, "JBL LIVE500BT"},
+    {0xF0020E, "JBL LIVE500BT"},
+    {0xF00214, "JBL LIVE650BTNC"},
+    {0xF00212, "JBL LIVE500BT"},
+    {0xF0020D, "JBL LIVE400BT"},
+    {0xF00211, "JBL LIVE500BT"},
+    {0xF00215, "JBL LIVE650BTNC"},
+    {0xF00210, "JBL LIVE500BT"},
+    {0xF00305, "LG HBS-1500"},
+    {0xF00304, "LG HBS-1010"},
+    {0xF00308, "LG HBS-1125"},
+    {0xF00303, "LG HBS-930"},
+    {0xF00306, "LG HBS-1700"},
+    {0xF00300, "LG HBS-835S"},
+    {0xF00309, "LG HBS-2000"},
+    {0xF00302, "LG HBS-830"},
+    {0xF00307, "LG HBS-1120"},
+    {0xF00301, "LG HBS-835"},
+    {0xF00E97, "JBL VIBE BEAM"},
+    {0x04ACFC, "JBL WAVE BEAM"},
+    {0x04AA91, "Beoplay H4"},
+    {0x04AFB8, "JBL TUNE 720BT"},
+    {0x05A963, "WONDERBOOM 3"},
+    {0x05AA91, "B&O Beoplay E6"},
+    {0x05C452, "JBL LIVE220BT"},
+    {0x05C95C, "Sony WI-1000X"},
+    {0x0602F0, "JBL Everest 310GA"},
+    {0x0603F0, "LG HBS-1700"},
+    {0x1E8B18, "SRS-XB43"},
+    {0x1E955B, "WI-1000XM2"},
+    {0x1EC95C, "Sony WF-SP700N"},
+    {0x1ED9F9, "JBL WAVE FLEX"},
+    {0x1EE890, "ATH-CKS30TW WH"},
+    {0x1EEDF5, "Teufel REAL BLUE TWS 3"},
+    {0x1F1101, "TAG Heuer Calibre E4 45mm"},
+    {0x1F181A, "LinkBuds S"},
+    {0x1F2E13, "Jabra Elite 2"},
+    {0x1F4589, "Jabra Elite 2"},
+    {0x1F4627, "SRS-XG300"},
+    {0x1F5865, "boAt Airdopes 441"},
+    {0x1FBB50, "WF-C700N"},
+    {0x1FC95C, "Sony WF-SP700N"},
+    {0x1FE765, "TONE-TF7Q"},
+    {0x1FF8FA, "JBL REFLECT MINI NC"},
+    {0x201C7C, "SUMMIT"},
+    {0x202B3D, "Amazfit PowerBuds"},
+    {0x20330C, "SRS-XB33"},
+    {0x003B41, "M&D MW65"},
+    {0x003D8A, "Cleer FLOW II"},
+    {0x005BC3, "Panasonic RP-HD610N"},
+    {0x008F7D, "soundcore Glow Mini"},
+    {0x00FA72, "Pioneer SE-MS9BN"},
+    {0x0100F0, "Bose QuietComfort 35 II"},
+    {0x011242, "Nirvana Ion"},
+    {0x013D8A, "Cleer EDGE Voice"},
+    {0x01AA91, "Beoplay H9 3rd Generation"},
+    {0x038F16, "Beats Studio Buds"},
+    {0x039F8F, "Michael Kors Darci 5e"},
+    {0x03AA91, "B&O Beoplay H8i"},
+    {0x03B716, "YY2963"},
+    {0x03C95C, "Sony WH-1000XM2"},
+    {0x03C99C, "MOTO BUDS 135"},
+    {0x03F5D4, "Writing Account Key"},
+    {0x045754, "Plantronics PLT_K2"},
+    {0x045764, "PLT V8200 Series"},
+    {0x04C95C, "Sony WI-1000X"},
+    {0x050F0C, "Major III Voice"},
+    {0x052CC7, "MINOR III"},
+    {0x057802, "TicWatch Pro 5"},
+    {0x0582FD, "Pixel Buds"},
+    {0x058D08, "WH-1000XM4"},
+    {0x06AE20, "Galaxy S21 5G"},
+    {0x06C197, "OPPO Enco Air3 Pro"},
+    {0x06C95C, "Sony WH-1000XM2"},
+    {0x06D8FC, "soundcore Liberty 4 NC"},
+    {0x0744B6, "Technics EAH-AZ60M2"},
+    {0x07A41C, "WF-C700N"},
+    {0x07C95C, "Sony WH-1000XM2"},
+    {0x07F426, "Nest Hub Max"},
+    {0x0102F0, "JBL Everest 110GA - Gun Metal"},
+    {0x0202F0, "JBL Everest 110GA - Silver"},
+    {0x0302F0, "JBL Everest 310GA - Brown"},
+    {0x0402F0, "JBL Everest 310GA - Gun Metal"},
+    {0x0502F0, "JBL Everest 310GA - Silver"},
+    {0x0702F0, "JBL Everest 710GA - Gun Metal"},
+    {0x0802F0, "JBL Everest 710GA - Silver"},
+    {0x054B2D, "JBL TUNE125TWS"},
+    {0x0660D7, "JBL LIVE770NC"},
+    {0x0103F0, "LG HBS-835"},
+    {0x0203F0, "LG HBS-830"},
+    {0x0303F0, "LG HBS-930"},
+    {0x0403F0, "LG HBS-1010"},
+    {0x0503F0, "LG HBS-1500"},
+    {0x0703F0, "LG HBS-1120"},
+    {0x0803F0, "LG HBS-1125"},
+    {0x0903F0, "LG HBS-2000"},
+    {0x0102F0, "JBL Everest 110GA"},
+    {0x0202F0, "JBL Everest 110GA"},
+    {0x0302F0, "JBL Everest 310GA"},
+    {0x0402F0, "JBL Everest 310GA"},
+    {0x0502F0, "JBL Everest 310GA"},
+    {0x060000, "Google Pixel Buds"},
+    {0x070000, "Android Auto"},
+    {0x0702F0, "JBL Everest 710GA"},
+    {0x071C74, "JBL Flip 6"},
+    {0x080000, "Foocorp Foophones"},
+    {0x0802F0, "JBL Everest 710GA"},
+    {0x090000, "Test Android TV"},
+    {0x0A0000, "Test 00000a - Anti-Spoofing"},
+    {0x0B0000, "Google Gphones"},
+    {0x0C0000, "Google Gphones"},
+    {0x0DC6BF, "My Awesome Device II"},
+    {0x0DC95C, "Sony WH-1000XM3"},
+    {0x0DEC2B, "Emporio Armani EA Connected"},
+    {0x0E138D, "WF-SP800N"},
+    {0x0EC95C, "Sony WI-C600N"},
+    {0x0ECE95, "Philips TAT3508"},
+    {0x0F0993, "COUMI TWS-834A"},
+    {0x0F1B8D, "JBL VIBE BEAM"},
+    {0x0F232A, "JBL TUNE BUDS"},
+    {0x0F2D16, "WH-CH520"},
+    {0x20A19B, "WF-SP800N"},
+    {0x20C95C, "Sony WF-SP700N"},
+    {0x20CC2C, "SRS-XB43"},
+    {0x213C8C, "DIZO Wireless Power"},
+    {0x21521D, "boAt Rockerz 355 (Green)"},
+    {0x21A04E, "oraimo FreePods Pro"},
+    {0x2D7A23, "WF-1000XM4"},
+    {0x350000, "Test 000035"},
+    {0x470000, "Arduino 101"},
+    {0x480000, "Fast Pair Headphones"},
+    {0x490000, "Fast Pair Headphones"},
+    {0x5BA9B5, "WF-SP800N"},
+    {0x5BACD6, "Bose QC Ultra Earbuds"},
+    {0x5BD6C9, "JBL TUNE225TWS"},
+    {0x5BE3D4, "JBL Flip 6"},
+    {0x5C0206, "UA | JBL TWS STREAK"},
+    {0x5C0C84, "JBL TUNE225TWS"},
+    {0x5C4833, "WH-CH720N"},
+    {0x5C4A7E, "LG HBS-XL7"},
+    {0x5C55E7, "TCL MOVEAUDIO S200"},
+    {0x5C7CDC, "WH-1000XM5"},
+    {0x5C8AA5, "JBL LIVE220BT"},
+    {0x5CC900, "Sony WF-1000X"},
+    {0x5CC901, "Sony WF-1000X"},
+    {0x5CC902, "Sony WH-1000XM2"},
+    {0x5CC903, "Sony WH-1000XM2"},
+    {0x5CC904, "Sony WI-1000X"},
+    {0x5CC905, "Sony WI-1000X"},
+    {0x5CC906, "Sony WH-1000XM2"},
+    {0x5CC907, "Sony WH-1000XM2"},
+    {0x5CC908, "Sony WI-1000X"},
+    {0x5CC909, "Sony WI-1000X"},
+    {0x5CC90A, "Sony WH-1000XM3"},
+    {0x5CC90B, "Sony WH-1000XM3"},
+    {0x5CC90C, "Sony WH-1000XM3"},
+    {0x5CC90D, "Sony WH-1000XM3"},
+    {0x5CC90E, "Sony WI-C600N"},
+    {0x5CC90F, "Sony WI-C600N"},
+    {0x5CC910, "Sony WI-C600N"},
+    {0x5CC911, "Sony WI-C600N"},
+    {0x5CC912, "Sony WI-C600N"},
+    {0x5CC913, "Sony WI-C600N"},
+    {0x5CC914, "Sony WI-SP600N"},
+    {0x5CC915, "Sony WI-SP600N"},
+    {0x5CC916, "Sony WI-SP600N"},
+    {0x5CC917, "Sony WI-SP600N"},
+    {0x5CC918, "Sony WI-SP600N"},
+    {0x5CC919, "Sony WI-SP600N"},
+    {0x5CC91A, "Sony WI-SP600N"},
+    {0x5CC91B, "Sony WI-SP600N"},
+    {0x5CC91C, "Sony WI-SP600N"},
+    {0x5CC91D, "Sony WI-SP600N"},
+    {0x5CC91E, "Sony WF-SP700N"},
+    {0x5CC91F, "Sony WF-SP700N"},
+    {0x5CC920, "Sony WF-SP700N"},
+    {0x5CC921, "Sony WF-SP700N"},
+    {0x5CC922, "Sony WF-SP700N"},
+    {0x5CC923, "Sony WF-SP700N"},
+    {0x5CC924, "Sony WF-SP700N"},
+    {0x5CC925, "Sony WF-SP700N"},
+    {0x5CC926, "Sony WF-SP700N"},
+    {0x5CC927, "Sony WF-SP700N"},
+    {0x5CC928, "Sony WH-H900N"},
+    {0x5CC929, "Sony WH-H900N"},
+    {0x5CC92A, "Sony WH-H900N"},
+    {0x5CC92B, "Sony WH-H900N"},
+    {0x5CC92C, "Sony WH-H900N"},
+    {0x5CC92D, "Sony WH-H900N"},
+    {0x5CC92E, "Sony WH-H900N"},
+    {0x5CC92F, "Sony WH-H900N"},
+    {0x5CC930, "Sony WH-H900N"},
+    {0x5CC931, "Sony WH-H900N"},
+    {0x5CC932, "Sony WH-CH700N"},
+    {0x5CC933, "Sony WH-CH700N"},
+    {0x5CC934, "Sony WH-CH700N"},
+    {0x5CC935, "Sony WH-CH700N"},
+    {0x5CC936, "Sony WH-CH700N"},
+    {0x5CC937, "Sony WH-CH700N"},
+    {0x5CC938, "Sony WF-1000XM3"},
+    {0x5CC939, "Sony WF-1000XM3"},
+    {0x5CC93A, "Sony WF-1000XM3"},
+    {0x5CC93B, "Sony WF-1000XM3"},
+    {0x5CC93C, "Sony WH-XB700"},
+    {0x5CC93D, "Sony WH-XB700"},
+    {0x5CC93E, "Sony WH-XB700"},
+    {0x5CC93F, "Sony WH-XB700"},
+    {0x5CC940, "Sony WH-XB900N"},
+    {0x5CC941, "Sony WH-XB900N"},
+    {0x5CC942, "Sony WH-XB900N"},
+    {0x5CC943, "Sony WH-XB900N"},
+    {0x5CC944, "Sony WH-XB900N"},
+    {0x5CC945, "Sony WH-XB900N"},
+    {0x5CEE3C, "Fitbit Charge 4"},
+    {0x6AD226, "TicWatch Pro 3"},
+    {0x6B1C64, "Pixel Buds"},
+    {0x6B8C65, "oraimo FreePods 4"},
+    {0x6B9304, "Nokia SB-101"},
+    {0x6BA5C3, "Jabra Elite 4"},
+    {0x6C42C0, "TWS05"},
+    {0x6C4DE5, "JBL LIVE PRO 2 TWS"},
+    {0x718FA4, "JBL LIVE300TWS"},
+    {0x89BAD5, "Galaxy A23 5G"},
+    {0x8A31B7, "Bose QC Ultra Headphones"},
+    {0x8A3D00, "Cleer FLOW Ⅱ"},
+    {0x8A3D01, "Cleer EDGE Voice"},
+    {0x8A8F23, "WF-1000XM5"},
+    {0x8AADAE, "JLab GO Work 2"},
+    {0x8B0A91, "Jabra Elite 5"},
+    {0x8B5A7B, "TicWatch Pro 3 GPS"},
+    {0x8B66AB, "Pixel Buds A-Series"},
+    {0x8BB0A0, "Nokia Solo Bud+"},
+    {0x8BF79A, "Oladance Whisper E1"},
+    {0x8C07D2, "Jabra Elite 4 Active"},
+    {0x8C1706, "YY7861E"},
+    {0x8C4236, "GLIDiC mameBuds"},
+    {0x8C6B6A, "realme Buds Air 3S"},
+    {0x8CAD81, "KENWOOD WS-A1"},
+    {0x8CB05C, "JBL LIVE PRO+ TWS"},
+    {0x8CD10F, "realme Buds Air Pro"},
+    {0x8D13B9, "BLE-TWS"},
+    {0x8D16EA, "Galaxy M14 5G"},
+    {0x8D5B67, "Pixel 90c"},
+    {0x8E14D7, "LG-TONE-TFP8"},
+    {0x8E1996, "Galaxy A24 5g"},
+    {0x8E4666, "Oladance Wearable Stereo"},
+    {0x8E5550, "boAt Airdopes 511v2"},
+    {0x9101F0, "Jabra Elite 2"},
+    {0x9128CB, "TCL MOVEAUDIO Neo"},
+    {0x913B0C, "YH-E700B"},
+    {0x915CFA, "Galaxy A14"},
+    {0x9171BE, "Jabra Evolve2 65 Flex"},
+    {0x917E46, "LinkBuds"},
+    {0x91AA00, "Beoplay E8 2.0"},
+    {0x91AA01, "Beoplay H9 3rd Generation"},
+    {0x91AA02, "B&O Earset"},
+    {0x91AA03, "B&O Beoplay H8i"},
+    {0x91AA04, "Beoplay H4"},
+    {0x91AA05, "B&O Beoplay E6"},
+    {0x91BD38, "LG HBS-FL7"},
+    {0x91C813, "JBL TUNE770NC"},
+    {0x91DABC, "SRS-XB33"},
+    {0x92255E, "LG-TONE-FP6"},
+    {0x989D0A, "Set up your new Pixel 2"},
+    {0x9939BC, "ATH-SQ1TW"},
+    {0x994374, "EDIFIER W320TN"},
+    {0x997B4A, "UA | JBL True Wireless Flash X"},
+    {0x99C87B, "WH-H810 (h.ear)"},
+    {0x99D7EA, "oraimo OpenCirclet"},
+    {0x99F098, "Galaxy S22 Ultra"},
+    {0x9A408A, "MOTO BUDS 065"},
+    {0x9A9BDD, "WH-XB910N"},
+    {0x9ADB11, "Pixel Buds Pro"},
+    {0x9AEEA4, "LG HBS-FN4"},
+    {0x9B7339, "AKG N9 Hybrid"},
+    {0x9B735A, "JBL RFL FLOW PRO"},
+    {0x9B9872, "Hyundai"},
+    {0x9BC64D, "JBL TUNE225TWS"},
+    {0x9BE931, "WI-C100"},
+    {0x9C0AF7, "JBL VIBE BUDS"},
+    {0x9C3997, "ATH-M50xBT2"},
+    {0x9C4058, "JBL WAVE FLEX"},
+    {0x9C6BC0, "LinkBuds S"},
+    {0x9C888B, "WH-H910N (h.ear)"},
+    {0x9C98DB, "JBL TUNE225TWS"},
+    {0x9CA277, "YY2963"},
+    {0x9CB5F3, "WH-1000XM5"},
+    {0x9CB881, "soundcore Motion 300"},
+    {0x9CD0F3, "LG HBS-TFN7"},
+    {0x9CE3C7, "EDIFIER NeoBuds Pro 2"},
+    {0x9CEFD1, "SRS-XG500"},
+    {0x9CF08F, "JLab Epic Air ANC"},
+    {0x9D00A6, "Urbanears Juno"},
+    {0x9D7D42, "Galaxy S20"},
+    {0x9DB896, "Your BMW"},
+    {0xA7E52B, "Bose NC 700 Headphones"},
+    {0xA7EF76, "JBL CLUB PRO+ TWS"},
+    {0xA8001A, "JBL CLUB ONE"},
+    {0xA83C10, "adidas Z.N.E. 01"},
+    {0xA8658F, "ROCKSTER GO"},
+    {0xA8845A, "oraimo FreePods 4"},
+    {0xA88B69, "WF-SP800N"},
+    {0xA8A00E, "Nokia CB-201"},
+    {0xA8A72A, "JBL LIVE670NC"},
+    {0xA8C636, "JBL TUNE660NC"},
+    {0xA8CAAD, "Galaxy F04"},
+    {0xA8E353, "JBL TUNE BEAM"},
+    {0xA8F96D, "JBL ENDURANCE RUN 2 WIRELESS"},
+    {0xA90358, "JBL LIVE220BT"},
+    {0xA92498, "JBL WAVE BUDS"},
+    {0xA9394A, "JBL TUNE230NC TWS"},
+    {0xC6936A, "JBL LIVE PRO+ TWS"},
+    {0xC69AFD, "WF-H800 (h.ear)"},
+    {0xC6ABEA, "UA | JBL True Wireless Flash X"},
+    {0xC6EC5F, "SRS-XE300"},
+    {0xC7736C, "Philips PH805"},
+    {0xC79B91, "Jabra Evolve2 75"},
+    {0xC7A267, "Fake Test Mouse"},
+    {0xC7D620, "JBL Pulse 5"},
+    {0xC7FBCC, "JBL VIBE FLEX"},
+    {0xC8162A, "LinkBuds S"},
+    {0xC85D7A, "JBL ENDURANCE PEAK II"},
+    {0xC8777E, "Jaybird Vista 2"},
+    {0xC878AA, "SRS-XV800"},
+    {0xC8C641, "Redmi Buds 4 Lite"},
+    {0xC8D335, "WF-1000XM4"},
+    {0xC8E228, "Pixel Buds Pro"},
+    {0xC9186B, "WF-1000XM4"},
+    {0xC9836A, "JBL Xtreme 4"},
+    {0xCA7030, "ATH-TWX7"},
+    {0xCAB6B8, "ATH-M20xBT"},
+    {0xCAF511, "Jaybird Vista 2"},
+    {0xCB093B, "Urbanears Juno"},
+    {0xCB529D, "soundcore Glow"},
+    {0xCC438E, "WH-1000XM4"},
+    {0xCC5F29, "JBL TUNE660NC"},
+    {0xCC754F, "YY2963"},
+    {0xCC93A5, "Sync"},
+    {0xCCBB7E, "MIDDLETON"},
+    {0xCD8256, "Bose NC 700 Headphones"},
+    {0xD446A7, "WH-1000XM5"},
+    {0xD5A59E, "Jabra Elite Speaker"},
+    {0xD5B5F7, "MOTO BUDS 600 ANC"},
+    {0xD5C6CE, "realme TechLife Buds T100"},
+    {0xD654CD, "JBL Xtreme 4"},
+    {0xD65F4E, "Philips Fidelio T2"},
+    {0xD69B2B, "TONE-T80S"},
+    {0xD6C195, "LG HBS-SL5"},
+    {0xD6E870, "Beoplay EX"},
+    {0xD6EE84, "Rockerz 255 Max"},
+    {0xD7102F, "ATH-SQ1TW SVN"},
+    {0xD7E3EB, "Cleer HALO"},
+    {0xD8058C, "MOTIF II A.N.C."},
+    {0xD820EA, "WH-XB910N"},
+    {0xD87A3E, "Pixel Buds Pro"},
+    {0xD8F3BA, "WH-1000XM5"},
+    {0xD8F4E8, "realme Buds T100"},
+    {0xD90617, "Redmi Buds 4 Active"},
+    {0xD933A7, "JBL ENDURANCE PEAK 3"},
+    {0xD9414F, "JBL SOUNDGEAR SENSE"},
+    {0xD97EBA, "JBL TUNE125TWS"},
+    {0xD9964B, "JBL TUNE670NC"},
+    {0xDA0F83, "SPACE"},
+    {0xDA4577, "Jabra Elite 4 Active"},
+    {0xDA5200, "blackbox TRIP II"},
+    {0xDAD3A6, "Jabra Elite 10"},
+    {0xDADE43, "Chromebox"},
+    {0xDAE096, "adidas RPT-02 SOL"},
+    {0xDB8AC7, "LG TONE-FREE"},
+    {0xDBE5B1, "WF-1000XM4"},
+    {0xDC5249, "WH-H810 (h.ear)"},
+    {0xDCF33C, "JBL REFLECT MINI NC"},
+    {0xDD4EC0, "OPPO Enco Air3 Pro"},
+    {0xDE215D, "WF-C500"},
+    {0xDE577F, "Teufel AIRY TWS 2"},
+    {0xDEC04C, "SUMMIT"},
+    {0xDEDD6F, "soundcore Space One"},
+    {0xDEE8C0, "Ear (2)"},
+    {0xDEEA86, "Xiaomi Buds 4 Pro"},
+    {0xDEF234, "WH-H810 (h.ear)"},
+    {0xDF01E3, "Sync"},
+    {0xDF271C, "Big Bang e Gen 3"},
+    {0xDF42DE, "TAG Heuer Calibre E4 42mm"},
+    {0xDF4B02, "SRS-XB13"},
+    {0xDF9BA4, "Bose NC 700 Headphones"},
+    {0xDFD433, "JBL REFLECT AERO"},
+    {0xE020C1, "soundcore Motion 300"},
+    {0xE06116, "LinkBuds S"},
+    {0xE07634, "OnePlus Buds Z"},
+    {0xE09172, "JBL TUNE BEAM"},
+    {0xE4E457, "Galaxy S20 5G"},
+    {0xE5440B, "TAG Heuer Calibre E4 45mm"},
+    {0xE57363, "Oladance Wearable Stereo"},
+    {0xE57B57, "Super Device"},
+    {0xE5B4B0, "WF-1000XM5"},
+    {0xE5B91B, "SRS-XB33"},
+    {0xE5E2E9, "Zone Wireless 2"},
+    {0xE64613, "JBL WAVE BEAM"},
+    {0xE64CC6, "Set up your new Pixel 3 XL"},
+    {0xE69877, "JBL REFLECT AERO"},
+    {0xE6E37E, "realme Buds  Air 5 Pro"},
+    {0xE6E771, "ATH-CKS50TW"},
+    {0xE6E8B8, "POCO Pods"},
+    {0xE750CE, "Jabra Evolve2 75"},
+    {0xF52494, "JBL LIVE PRO+ TWS"},
 
 
     // Custom debug popups
     // Custom debug popups
     {0xD99CA1, "Flipper Zero"},
     {0xD99CA1, "Flipper Zero"},
@@ -63,27 +520,27 @@ const struct {
     {0xE2106F, "FBI"},
     {0xE2106F, "FBI"},
     {0xB37A62, "Tesla"},
     {0xB37A62, "Tesla"},
 };
 };
-const uint8_t models_count = COUNT_OF(models);
+const uint16_t models_count = COUNT_OF(models);
 
 
-static const char* get_name(const ProtocolCfg* _cfg) {
-    UNUSED(_cfg);
+static const char* get_name(const Payload* payload) {
+    UNUSED(payload);
     return "FastPair";
     return "FastPair";
 }
 }
 
 
-static void make_packet(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg) {
-    FastpairCfg* cfg = _cfg ? &_cfg->specific.fastpair : NULL;
+static void make_packet(uint8_t* _size, uint8_t** _packet, Payload* payload) {
+    FastpairCfg* cfg = payload ? &payload->cfg.fastpair : NULL;
 
 
     uint32_t model;
     uint32_t model;
-    switch(cfg ? _cfg->mode : ProtocolModeRandom) {
-    case ProtocolModeRandom:
+    switch(cfg ? payload->mode : PayloadModeRandom) {
+    case PayloadModeRandom:
     default:
     default:
         model = models[rand() % models_count].value;
         model = models[rand() % models_count].value;
         break;
         break;
-    case ProtocolModeValue:
+    case PayloadModeValue:
         model = cfg->model;
         model = cfg->model;
         break;
         break;
-    case ProtocolModeBruteforce:
-        model = cfg->model = _cfg->bruteforce.value;
+    case PayloadModeBruteforce:
+        model = cfg->model = payload->bruteforce.value;
         break;
         break;
     }
     }
 
 
@@ -132,56 +589,36 @@ static void config_callback(void* _ctx, uint32_t index) {
         break;
         break;
     }
     }
 }
 }
-static void model_changed(VariableItem* item) {
-    ProtocolCfg* _cfg = variable_item_get_context(item);
-    FastpairCfg* cfg = &_cfg->specific.fastpair;
-    uint8_t index = variable_item_get_current_value_index(item);
-    if(index) {
-        index--;
-        _cfg->mode = ProtocolModeValue;
-        cfg->model = models[index].value;
-        variable_item_set_current_value_text(item, models[index].name);
-    } else {
-        _cfg->mode = ProtocolModeRandom;
-        variable_item_set_current_value_text(item, "Random");
-    }
-}
 static void extra_config(Ctx* ctx) {
 static void extra_config(Ctx* ctx) {
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    FastpairCfg* cfg = &_cfg->specific.fastpair;
+    Payload* payload = &ctx->attack->payload;
+    FastpairCfg* cfg = &payload->cfg.fastpair;
     VariableItemList* list = ctx->variable_item_list;
     VariableItemList* list = ctx->variable_item_list;
     VariableItem* item;
     VariableItem* item;
-    size_t value_index;
 
 
-    item = variable_item_list_add(list, "Model Code", models_count + 1, model_changed, _cfg);
+    item = variable_item_list_add(list, "Model Code", 0, NULL, NULL);
     const char* model_name = NULL;
     const char* model_name = NULL;
     char model_name_buf[9];
     char model_name_buf[9];
-    switch(_cfg->mode) {
-    case ProtocolModeRandom:
+    switch(payload->mode) {
+    case PayloadModeRandom:
     default:
     default:
         model_name = "Random";
         model_name = "Random";
-        value_index = 0;
         break;
         break;
-    case ProtocolModeValue:
-        for(uint8_t i = 0; i < models_count; i++) {
+    case PayloadModeValue:
+        for(uint16_t i = 0; i < models_count; i++) {
             if(cfg->model == models[i].value) {
             if(cfg->model == models[i].value) {
                 model_name = models[i].name;
                 model_name = models[i].name;
-                value_index = i + 1;
                 break;
                 break;
             }
             }
         }
         }
         if(!model_name) {
         if(!model_name) {
             snprintf(model_name_buf, sizeof(model_name_buf), "%06lX", cfg->model);
             snprintf(model_name_buf, sizeof(model_name_buf), "%06lX", cfg->model);
             model_name = model_name_buf;
             model_name = model_name_buf;
-            value_index = models_count + 1;
         }
         }
         break;
         break;
-    case ProtocolModeBruteforce:
+    case PayloadModeBruteforce:
         model_name = "Bruteforce";
         model_name = "Bruteforce";
-        value_index = models_count + 1;
         break;
         break;
     }
     }
-    variable_item_set_current_value_index(item, value_index);
     variable_item_set_current_value_text(item, model_name);
     variable_item_set_current_value_text(item, model_name);
 
 
     variable_item_list_add(list, "Requires Google services", 0, NULL, NULL);
     variable_item_list_add(list, "Requires Google services", 0, NULL, NULL);
@@ -189,8 +626,8 @@ static void extra_config(Ctx* ctx) {
     variable_item_list_set_enter_callback(list, config_callback, ctx);
     variable_item_list_set_enter_callback(list, config_callback, ctx);
 }
 }
 
 
-static uint8_t config_count(const ProtocolCfg* _cfg) {
-    UNUSED(_cfg);
+static uint8_t config_count(const Payload* payload) {
+    UNUSED(payload);
     return ConfigCOUNT - ConfigExtraStart - 1;
     return ConfigCOUNT - ConfigExtraStart - 1;
 }
 }
 
 
@@ -204,25 +641,25 @@ const Protocol protocol_fastpair = {
 
 
 static void model_callback(void* _ctx, uint32_t index) {
 static void model_callback(void* _ctx, uint32_t index) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    FastpairCfg* cfg = &_cfg->specific.fastpair;
+    Payload* payload = &ctx->attack->payload;
+    FastpairCfg* cfg = &payload->cfg.fastpair;
     switch(index) {
     switch(index) {
     case 0:
     case 0:
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     case models_count + 1:
     case models_count + 1:
         scene_manager_next_scene(ctx->scene_manager, SceneFastpairModelCustom);
         scene_manager_next_scene(ctx->scene_manager, SceneFastpairModelCustom);
         break;
         break;
     case models_count + 2:
     case models_count + 2:
-        _cfg->mode = ProtocolModeBruteforce;
-        _cfg->bruteforce.counter = 0;
-        _cfg->bruteforce.value = cfg->model;
-        _cfg->bruteforce.size = 3;
+        payload->mode = PayloadModeBruteforce;
+        payload->bruteforce.counter = 0;
+        payload->bruteforce.value = cfg->model;
+        payload->bruteforce.size = 3;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
     default:
     default:
-        _cfg->mode = ProtocolModeValue;
+        payload->mode = PayloadModeValue;
         cfg->model = models[index - 1].value;
         cfg->model = models[index - 1].value;
         scene_manager_previous_scene(ctx->scene_manager);
         scene_manager_previous_scene(ctx->scene_manager);
         break;
         break;
@@ -230,32 +667,32 @@ static void model_callback(void* _ctx, uint32_t index) {
 }
 }
 void scene_fastpair_model_on_enter(void* _ctx) {
 void scene_fastpair_model_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    FastpairCfg* cfg = &_cfg->specific.fastpair;
+    Payload* payload = &ctx->attack->payload;
+    FastpairCfg* cfg = &payload->cfg.fastpair;
     Submenu* submenu = ctx->submenu;
     Submenu* submenu = ctx->submenu;
     uint32_t selected = 0;
     uint32_t selected = 0;
     submenu_reset(submenu);
     submenu_reset(submenu);
 
 
     submenu_add_item(submenu, "Random", 0, model_callback, ctx);
     submenu_add_item(submenu, "Random", 0, model_callback, ctx);
-    if(_cfg->mode == ProtocolModeRandom) {
+    if(payload->mode == PayloadModeRandom) {
         selected = 0;
         selected = 0;
     }
     }
 
 
     bool found = false;
     bool found = false;
-    for(uint8_t i = 0; i < models_count; i++) {
+    for(uint16_t i = 0; i < models_count; i++) {
         submenu_add_item(submenu, models[i].name, i + 1, model_callback, ctx);
         submenu_add_item(submenu, models[i].name, i + 1, model_callback, ctx);
-        if(!found && _cfg->mode == ProtocolModeValue && cfg->model == models[i].value) {
+        if(!found && payload->mode == PayloadModeValue && cfg->model == models[i].value) {
             found = true;
             found = true;
             selected = i + 1;
             selected = i + 1;
         }
         }
     }
     }
     submenu_add_item(submenu, "Custom", models_count + 1, model_callback, ctx);
     submenu_add_item(submenu, "Custom", models_count + 1, model_callback, ctx);
-    if(!found && _cfg->mode == ProtocolModeValue) {
+    if(!found && payload->mode == PayloadModeValue) {
         selected = models_count + 1;
         selected = models_count + 1;
     }
     }
 
 
     submenu_add_item(submenu, "Bruteforce", models_count + 2, model_callback, ctx);
     submenu_add_item(submenu, "Bruteforce", models_count + 2, model_callback, ctx);
-    if(_cfg->mode == ProtocolModeBruteforce) {
+    if(payload->mode == PayloadModeBruteforce) {
         selected = models_count + 2;
         selected = models_count + 2;
     }
     }
 
 
@@ -274,9 +711,9 @@ void scene_fastpair_model_on_exit(void* _ctx) {
 
 
 static void model_custom_callback(void* _ctx) {
 static void model_custom_callback(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    FastpairCfg* cfg = &_cfg->specific.fastpair;
-    _cfg->mode = ProtocolModeValue;
+    Payload* payload = &ctx->attack->payload;
+    FastpairCfg* cfg = &payload->cfg.fastpair;
+    payload->mode = PayloadModeValue;
     cfg->model =
     cfg->model =
         (ctx->byte_store[0] << 0x10) + (ctx->byte_store[1] << 0x08) + (ctx->byte_store[2] << 0x00);
         (ctx->byte_store[0] << 0x10) + (ctx->byte_store[1] << 0x08) + (ctx->byte_store[2] << 0x00);
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
@@ -284,8 +721,8 @@ static void model_custom_callback(void* _ctx) {
 }
 }
 void scene_fastpair_model_custom_on_enter(void* _ctx) {
 void scene_fastpair_model_custom_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    FastpairCfg* cfg = &_cfg->specific.fastpair;
+    Payload* payload = &ctx->attack->payload;
+    FastpairCfg* cfg = &payload->cfg.fastpair;
     ByteInput* byte_input = ctx->byte_input;
     ByteInput* byte_input = ctx->byte_input;
 
 
     byte_input_set_header_text(byte_input, "Enter custom Model Code");
     byte_input_set_header_text(byte_input, "Enter custom Model Code");

+ 18 - 18
base_pack/ble_spam/protocols/swiftpair.c

@@ -14,21 +14,21 @@ const char* names[] = {
 };
 };
 const uint8_t names_count = COUNT_OF(names);
 const uint8_t names_count = COUNT_OF(names);
 
 
-static const char* get_name(const ProtocolCfg* _cfg) {
-    UNUSED(_cfg);
+static const char* get_name(const Payload* payload) {
+    UNUSED(payload);
     return "SwiftPair";
     return "SwiftPair";
 }
 }
 
 
-static void make_packet(uint8_t* _size, uint8_t** _packet, ProtocolCfg* _cfg) {
-    SwiftpairCfg* cfg = _cfg ? &_cfg->specific.swiftpair : NULL;
+static void make_packet(uint8_t* _size, uint8_t** _packet, Payload* payload) {
+    SwiftpairCfg* cfg = payload ? &payload->cfg.swiftpair : NULL;
 
 
     const char* name;
     const char* name;
-    switch(cfg ? _cfg->mode : ProtocolModeRandom) {
-    case ProtocolModeRandom:
+    switch(cfg ? payload->mode : PayloadModeRandom) {
+    case PayloadModeRandom:
     default:
     default:
         name = names[rand() % names_count];
         name = names[rand() % names_count];
         break;
         break;
-    case ProtocolModeValue:
+    case PayloadModeValue:
         name = cfg->name;
         name = cfg->name;
         break;
         break;
     }
     }
@@ -73,22 +73,22 @@ static void config_callback(void* _ctx, uint32_t index) {
     }
     }
 }
 }
 static void extra_config(Ctx* ctx) {
 static void extra_config(Ctx* ctx) {
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    SwiftpairCfg* cfg = &_cfg->specific.swiftpair;
+    Payload* payload = &ctx->attack->payload;
+    SwiftpairCfg* cfg = &payload->cfg.swiftpair;
     VariableItemList* list = ctx->variable_item_list;
     VariableItemList* list = ctx->variable_item_list;
     VariableItem* item;
     VariableItem* item;
 
 
     item = variable_item_list_add(list, "Display Name", 0, NULL, NULL);
     item = variable_item_list_add(list, "Display Name", 0, NULL, NULL);
     variable_item_set_current_value_text(
     variable_item_set_current_value_text(
-        item, _cfg->mode == ProtocolModeRandom ? "Random" : cfg->name);
+        item, payload->mode == PayloadModeRandom ? "Random" : cfg->name);
 
 
     variable_item_list_add(list, "Requires enabling SwiftPair", 0, NULL, NULL);
     variable_item_list_add(list, "Requires enabling SwiftPair", 0, NULL, NULL);
 
 
     variable_item_list_set_enter_callback(list, config_callback, ctx);
     variable_item_list_set_enter_callback(list, config_callback, ctx);
 }
 }
 
 
-static uint8_t config_count(const ProtocolCfg* _cfg) {
-    UNUSED(_cfg);
+static uint8_t config_count(const Payload* payload) {
+    UNUSED(payload);
     return ConfigCOUNT - ConfigExtraStart - 1;
     return ConfigCOUNT - ConfigExtraStart - 1;
 }
 }
 
 
@@ -102,14 +102,14 @@ const Protocol protocol_swiftpair = {
 
 
 static void name_callback(void* _ctx) {
 static void name_callback(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    _cfg->mode = ProtocolModeValue;
+    Payload* payload = &ctx->attack->payload;
+    payload->mode = PayloadModeValue;
     scene_manager_previous_scene(ctx->scene_manager);
     scene_manager_previous_scene(ctx->scene_manager);
 }
 }
 void scene_swiftpair_name_on_enter(void* _ctx) {
 void scene_swiftpair_name_on_enter(void* _ctx) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
-    SwiftpairCfg* cfg = &_cfg->specific.swiftpair;
+    Payload* payload = &ctx->attack->payload;
+    SwiftpairCfg* cfg = &payload->cfg.swiftpair;
     TextInput* text_input = ctx->text_input;
     TextInput* text_input = ctx->text_input;
     text_input_reset(text_input);
     text_input_reset(text_input);
 
 
@@ -124,9 +124,9 @@ void scene_swiftpair_name_on_enter(void* _ctx) {
 }
 }
 bool scene_swiftpair_name_on_event(void* _ctx, SceneManagerEvent event) {
 bool scene_swiftpair_name_on_event(void* _ctx, SceneManagerEvent event) {
     Ctx* ctx = _ctx;
     Ctx* ctx = _ctx;
-    ProtocolCfg* _cfg = &ctx->attack->payload.cfg;
+    Payload* payload = &ctx->attack->payload;
     if(event.type == SceneManagerEventTypeBack) {
     if(event.type == SceneManagerEventTypeBack) {
-        _cfg->mode = ProtocolModeRandom;
+        payload->mode = PayloadModeRandom;
     }
     }
     return false;
     return false;
 }
 }

+ 1 - 1
base_pack/ble_spam/scenes/config.c

@@ -19,7 +19,7 @@ static void config_callback(void* _ctx, uint32_t index) {
     if(!ctx->attack->protocol) {
     if(!ctx->attack->protocol) {
         index--;
         index--;
     } else if(ctx->attack->protocol->config_count) {
     } else if(ctx->attack->protocol->config_count) {
-        uint8_t extra = ctx->attack->protocol->config_count(&ctx->attack->payload.cfg);
+        uint8_t extra = ctx->attack->protocol->config_count(&ctx->attack->payload);
         if(index > extra) index -= extra;
         if(index > extra) index -= extra;
     }
     }