-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from valentin8709/feature/palnagotchi
Feature/pwnagotchi_pwngrid_spam
- Loading branch information
Showing
13 changed files
with
1,058 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
faces="(STOP)","♬♪♬♪♬♪♬","(X‿‿X)","(u W u)","(EVIL)","(.)(.)","ლ(o_oლ)","(O﹏o)","(✖╭╮✖)","SKIDZ!","(ɹoɹɹƎ)","(H4cK)","NOPWND!\n■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■", | ||
|
||
names="Check M5 Bruce Project","┌∩┐(◣_◢)┌∩┐","(╯°□°)╯╭╮(XoX)","STOP DEAUTH SKIDZ!","System Breached oups","Unauthorized Access","Security Compromised.. reboot","Warning...Bruce's here","Critical Error need reboot","No more Battery","Never gonna give you up","Never gonna let you down","Never gonna run around","and desert you","Never gonna make you cry","Never gonna say goodbye","Never gonna tell a lie","and hurt you" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
Thanks to thoses developers for their projects: | ||
* @7h30th3r0n3 : https://github.com/7h30th3r0n3/Evil-M5Core2 and https://github.com/7h30th3r0n3/PwnGridSpam | ||
* @viniciusbo : https://github.com/viniciusbo/m5-palnagotchi | ||
* @sduenasg : https://github.com/sduenasg/pio_palnagotchi | ||
Thanks to @bmorcelli for his help doing a better code. | ||
*/ | ||
|
||
#ifndef LITE_VERSION | ||
#include "mood.h" | ||
|
||
// ASCII equivalent | ||
const String palnagotchi_moods[] = { | ||
"(v__v)", // 0 - sleeping | ||
"(=__=)", // 1 - awakening | ||
"(O__O)", // 2 - awake | ||
"( O_O)", // 3 - observing (neutral) right | ||
"(O_O )", // 4 - observig (neutral) left | ||
"( 0_0)", // 5 - observing (happy) right | ||
"(0_0 )", // 6 - observing (happy) left | ||
"(+__+)", // 7 - intense | ||
"(-@_@)", // 8 - cool | ||
"(0__0)", // 9 - happy | ||
"(^__^)", // 10 - grateful | ||
"(UwU )", // 11 - excited | ||
"(+__+)", // 12 - smart | ||
"(*__*)", // 13 - friendly | ||
"(@__@)", // 14 - motivated | ||
"(>__<)", // 15 - demotivated | ||
"(-__-)", // 16 - bored | ||
"(T_T )", // 17 - sad | ||
"(;__;)", // 18 - lonely | ||
"(X__X)", // 19 - broken | ||
"(#__#)", // 20 - debugging | ||
"(-_-')", // 21 - angry | ||
"(^__^)", // 22- helping | ||
}; | ||
|
||
const String palnagotchi_moods_desc[] = { | ||
"Zzzz...", // 0 - sleeping | ||
"...", // 1 - awakening | ||
"Let's MAKE FRENS!", // 2 - awake | ||
"WANTED: FRENS", // 3 - observing (neutral) right | ||
"WANTED: FRENS", // 4 - observig (neutral) left | ||
"Looking for frens that pwn.", // 5 - observing (happy) right | ||
"Looking for frens that pwn.", // 6 - observing (happy) left | ||
"YEAH! So many pwnagotchis!", // 7 - intense | ||
"The coolest pal in the neighbourhood", // 8 - cool | ||
"Can we have even more frens?", // 9 - happy | ||
"I LOVE PWNAGOTCHIS!", // 10 - grateful | ||
"When I grow up, I'll PWN myself!!", // 11 - excited | ||
"3.1415926535897932384626433832795", // 12 - smart | ||
"HEY YOU! LETS BE FRENS!", // 13 - friendly | ||
"IT RUNS! PWND!", // 14 - motivated | ||
"I don't PWN, therefore i don't am.", // 15 - demotivated | ||
"Seriously, let's go for a walk...", // 16 - bored | ||
"Really? This hardware? can't PWN...", // 17 - sad | ||
"Where are all the Pwnagotchis?", // 18 - lonely | ||
"It works on my end.", // 19 - broken | ||
"My frens pwn.", // 20 - debugging | ||
"SO ANGERY, BUT CANT PWN", // 21 - angry | ||
"Helping Pwnagotchis be sane since 2024", | ||
}; | ||
|
||
uint8_t current_mood = 0; | ||
String current_phrase = ""; | ||
String current_face = ""; | ||
bool current_broken = false; | ||
const int number_of_moods = 23; //sizeof(palnagotchi_moods); | ||
|
||
uint8_t getCurrentMoodId() { return current_mood; } | ||
int getNumberOfMoods() { return number_of_moods; } | ||
String getCurrentMoodFace() { return current_face; } | ||
String getCurrentMoodPhrase() { return current_phrase; } | ||
bool isCurrentMoodBroken() { return current_broken; } | ||
|
||
void setMood(uint8_t mood, String face, String phrase, bool broken) { | ||
current_mood = mood; | ||
current_broken = broken; | ||
|
||
if (face != "") { | ||
current_face = face; | ||
} else { | ||
current_face = palnagotchi_moods[current_mood]; | ||
} | ||
|
||
if (phrase != "") { | ||
current_phrase = phrase; | ||
} else { | ||
current_phrase = palnagotchi_moods_desc[current_mood]; | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
Thanks to thoses developers for their projects: | ||
* @7h30th3r0n3 : https://github.com/7h30th3r0n3/Evil-M5Core2 and https://github.com/7h30th3r0n3/PwnGridSpam | ||
* @viniciusbo : https://github.com/viniciusbo/m5-palnagotchi | ||
* @sduenasg : https://github.com/sduenasg/pio_palnagotchi | ||
Thanks to @bmorcelli for his help doing a better code. | ||
*/ | ||
|
||
#ifndef LITE_VERSION | ||
#include <Arduino.h> | ||
|
||
#define MOOD_BROKEN 19 | ||
|
||
void setMood(uint8_t mood, String face = "", String phrase = "", | ||
bool broken = false); | ||
uint8_t getCurrentMoodId(); | ||
int getNumberOfMoods(); | ||
String getCurrentMoodFace(); | ||
String getCurrentMoodPhrase(); | ||
bool isCurrentMoodBroken(); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* | ||
Thanks to thoses developers for their projects: | ||
* @7h30th3r0n3 : https://github.com/7h30th3r0n3/Evil-M5Core2 and https://github.com/7h30th3r0n3/PwnGridSpam | ||
* @viniciusbo : https://github.com/viniciusbo/m5-palnagotchi | ||
* @sduenasg : https://github.com/sduenasg/pio_palnagotchi | ||
Thanks to @bmorcelli for his help doing a better code. | ||
*/ | ||
|
||
#ifndef LITE_VERSION | ||
#include <Arduino.h> | ||
#include "core/mykeyboard.h" | ||
#include "ui.h" | ||
#include "spam.h" | ||
|
||
#define STATE_INIT 0 | ||
#define STATE_WAKE 1 | ||
#define STATE_HALT 255 | ||
|
||
void advertise(uint8_t channel); | ||
void wakeUp(); | ||
|
||
uint8_t state; | ||
uint8_t current_channel = 1; | ||
uint32_t last_mood_switch = 10001; | ||
bool pwnagotchi_exit = false; | ||
|
||
void pwnagotchi_setup() { | ||
initPwngrid(); | ||
initUi(); | ||
state = STATE_INIT; | ||
Serial.println("Pwnagotchi Initialized"); | ||
} | ||
|
||
void pwnagotchi_update() { | ||
if (state == STATE_HALT) { | ||
return; | ||
} | ||
|
||
if (state == STATE_INIT) { | ||
state = STATE_WAKE; | ||
wakeUp(); | ||
} | ||
|
||
if (state == STATE_WAKE) { | ||
checkPwngridGoneFriends(); | ||
advertise(current_channel++); | ||
if (current_channel == 15) { | ||
current_channel = 1; | ||
} | ||
} | ||
updateUi(true); | ||
} | ||
|
||
void wakeUp() { | ||
for (uint8_t i = 0; i < 3; i++) { | ||
setMood(i); | ||
updateUi(false); | ||
delay(1250); | ||
} | ||
} | ||
|
||
void advertise(uint8_t channel) { | ||
uint32_t elapsed = millis() - last_mood_switch; | ||
if (elapsed > 8000) { | ||
setMood(random(2, getNumberOfMoods() - 1)); //random mood | ||
last_mood_switch = millis(); | ||
} | ||
|
||
esp_err_t result = pwngridAdvertise(channel, getCurrentMoodFace()); | ||
|
||
if (result == ESP_ERR_WIFI_IF) { | ||
setMood(MOOD_BROKEN, "", "Error: invalid interface", true); | ||
state = STATE_HALT; | ||
} else if (result == ESP_ERR_INVALID_ARG) { | ||
setMood(MOOD_BROKEN, "", "Error: invalid argument", true); | ||
state = STATE_HALT; | ||
} else if (result != ESP_OK) { | ||
setMood(MOOD_BROKEN, "", "Error: unknown", true); | ||
state = STATE_HALT; | ||
} | ||
} | ||
|
||
void set_pwnagotchi_exit(bool new_value) { | ||
pwnagotchi_exit = new_value; | ||
} | ||
|
||
void pwnagotchi_start() { | ||
int tmp = 0; | ||
|
||
tft.fillScreen(BGCOLOR); | ||
options = { | ||
{"Find frens", [=]() { }}, | ||
{"Pwngrid spam", [=]() { send_pwnagotchi_beacon_main(); }}, | ||
{"Main Menu", [=]() { set_pwnagotchi_exit(true); }}, | ||
}; | ||
|
||
pwnagotchi_setup(); | ||
delay(300); // Due to select button pressed to enter / quit this feature* | ||
|
||
// Draw footer & header | ||
drawTopCanvas(); | ||
drawBottomCanvas(); | ||
|
||
while(true) { | ||
if(millis()-tmp>3000) { | ||
tmp=millis(); | ||
pwnagotchi_update(); | ||
} | ||
if (checkSelPress()) { | ||
// Display menu | ||
loopOptions(options); | ||
// Redraw footer & header | ||
tft.fillScreen(BGCOLOR); | ||
drawTopCanvas(); | ||
drawBottomCanvas(); | ||
} | ||
if (pwnagotchi_exit) { | ||
break; | ||
} | ||
delay(50); | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
Thanks to thoses developers for their projects: | ||
* @7h30th3r0n3 : https://github.com/7h30th3r0n3/Evil-M5Core2 and https://github.com/7h30th3r0n3/PwnGridSpam | ||
* @viniciusbo : https://github.com/viniciusbo/m5-palnagotchi | ||
* @sduenasg : https://github.com/sduenasg/pio_palnagotchi | ||
Thanks to @bmorcelli for his help doing a better code. | ||
*/ | ||
|
||
#ifndef LITE_VERSION | ||
void pwnagotchi_start(); | ||
void pwnagotchi_setup(); | ||
void pwnagotchi_update(); | ||
#endif |
Oops, something went wrong.