mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-04-23 07:31:28 +00:00
added all and all-safe attack types to blespam (#2003)
This commit is contained in:
parent
01e4ff65a2
commit
6e34343bde
@ -509,14 +509,18 @@ void BLESpamView::createFastPairPacket() {
|
|||||||
std::copy(res.begin(), res.end(), advertisementData);
|
std::copy(res.begin(), res.end(), advertisementData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BLESpamView::changePacket(bool forced = false) {
|
void BLESpamView::createAnyPacket(bool safe) {
|
||||||
counter++; // need to send it multiple times to be accepted
|
ATK_TYPE type[] = {
|
||||||
if (counter >= 4 || forced) {
|
ATK_ANDROID,
|
||||||
// really change packet and mac.
|
ATK_IOS,
|
||||||
counter = 0;
|
ATK_WINDOWS,
|
||||||
randomizeMac();
|
ATK_SAMSUNG,
|
||||||
randomChn();
|
ATK_IOS_CRASH};
|
||||||
if (randomDev || forced) {
|
ATK_TYPE attackType = type[rand() % (COUNT_OF(type) - (1 ? safe : 0))];
|
||||||
|
createPacket(attackType);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BLESpamView::createPacket(ATK_TYPE attackType) {
|
||||||
switch (attackType) {
|
switch (attackType) {
|
||||||
case ATK_IOS_CRASH:
|
case ATK_IOS_CRASH:
|
||||||
createIosPacket(true);
|
createIosPacket(true);
|
||||||
@ -530,11 +534,28 @@ void BLESpamView::changePacket(bool forced = false) {
|
|||||||
case ATK_WINDOWS:
|
case ATK_WINDOWS:
|
||||||
createWindowsPacket();
|
createWindowsPacket();
|
||||||
break;
|
break;
|
||||||
|
case ATK_ALL_SAFE:
|
||||||
|
createAnyPacket(true);
|
||||||
|
break;
|
||||||
|
case ATK_ALL:
|
||||||
|
createAnyPacket(false);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
case ATK_ANDROID:
|
case ATK_ANDROID:
|
||||||
createFastPairPacket();
|
createFastPairPacket();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BLESpamView::changePacket(bool forced = false) {
|
||||||
|
counter++; // need to send it multiple times to be accepted
|
||||||
|
if (counter >= 4 || forced) {
|
||||||
|
// really change packet and mac.
|
||||||
|
counter = 0;
|
||||||
|
randomizeMac();
|
||||||
|
randomChn();
|
||||||
|
if (randomDev || forced) {
|
||||||
|
createPacket(attackType);
|
||||||
}
|
}
|
||||||
// rate limit console display
|
// rate limit console display
|
||||||
#ifdef BLESPMUSECONSOLE
|
#ifdef BLESPMUSECONSOLE
|
||||||
|
@ -49,7 +49,9 @@ enum ATK_TYPE {
|
|||||||
ATK_IOS,
|
ATK_IOS,
|
||||||
ATK_IOS_CRASH,
|
ATK_IOS_CRASH,
|
||||||
ATK_WINDOWS,
|
ATK_WINDOWS,
|
||||||
ATK_SAMSUNG
|
ATK_SAMSUNG,
|
||||||
|
ATK_ALL_SAFE,
|
||||||
|
ATK_ALL
|
||||||
};
|
};
|
||||||
enum PKT_TYPE {
|
enum PKT_TYPE {
|
||||||
PKT_TYPE_INVALID_TYPE,
|
PKT_TYPE_INVALID_TYPE,
|
||||||
@ -124,7 +126,9 @@ class BLESpamView : public View {
|
|||||||
{"iOs", 1},
|
{"iOs", 1},
|
||||||
{"iOs crash", 2},
|
{"iOs crash", 2},
|
||||||
{"Windows", 3},
|
{"Windows", 3},
|
||||||
{"Samsung", 4}}};
|
{"Samsung", 4},
|
||||||
|
{"All-Safe", 5},
|
||||||
|
{"All", 6}}};
|
||||||
|
|
||||||
bool is_running{false};
|
bool is_running{false};
|
||||||
|
|
||||||
@ -148,6 +152,8 @@ class BLESpamView : public View {
|
|||||||
void createIosPacket(bool crash);
|
void createIosPacket(bool crash);
|
||||||
void createSamsungPacket();
|
void createSamsungPacket();
|
||||||
void createWindowsPacket();
|
void createWindowsPacket();
|
||||||
|
void createAnyPacket(bool safe);
|
||||||
|
void createPacket(ATK_TYPE attackType);
|
||||||
void changePacket(bool forced);
|
void changePacket(bool forced);
|
||||||
void on_tx_progress(const bool done);
|
void on_tx_progress(const bool done);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user