Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 152693f

Browse files
authored
Merge pull request #95 from n0xa/develop
Merge Develop changes into main
2 parents 71228c8 + 9c430ab commit 152693f

12 files changed

+770
-79
lines changed

.github/workflows/compile.yml

+41-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
name: "M5Cardputer",
3636
fqbn: "m5stack:esp32:m5stack_cardputer",
3737
extra_flags: "-DCARDPUTER",
38-
libraries: "M5Cardputer IRRemoteESP8266",
38+
libraries: "M5Cardputer IRRemoteESP8266 M5Stack-SD-Updater M5Unified",
3939
partitions: {
4040
bootloader_addr: "0x0000",
4141
},
@@ -44,7 +44,7 @@ jobs:
4444
name: "M5StickCPlus2",
4545
fqbn: "m5stack:esp32:m5stack_stickc_plus2",
4646
extra_flags: "-DSTICK_C_PLUS2",
47-
libraries: "M5StickCPlus2 IRRemoteESP8266",
47+
libraries: "M5StickCPlus2 IRRemoteESP8266 M5Stack-SD-Updater M5Unified",
4848
partitions: {
4949
bootloader_addr: "0x1000",
5050
},
@@ -53,7 +53,7 @@ jobs:
5353
name: "M5StickCPlus",
5454
fqbn: "m5stack:esp32:m5stack_stickc_plus",
5555
extra_flags: "-DSTICK_C_PLUS",
56-
libraries: "M5StickCPlus IRRemoteESP8266",
56+
libraries: "M5StickCPlus IRRemoteESP8266 M5Stack-SD-Updater M5Unified",
5757
partitions: {
5858
bootloader_addr: "0x1000",
5959
},
@@ -63,7 +63,7 @@ jobs:
6363
fqbn: "m5stack:esp32:m5stack_stickc",
6464
extra_flags: "-DSTICK_C",
6565
# TODO: M5StickC's latest version has some dependency issues with M5Hat-JoyC library
66-
libraries: "M5StickC@0.2.8 IRRemoteESP8266",
66+
libraries: "M5StickC@0.2.8 IRRemoteESP8266 M5Stack-SD-Updater M5Unified",
6767
partitions: {
6868
bootloader_addr: "0x1000",
6969
},
@@ -104,6 +104,43 @@ jobs:
104104
run: |
105105
pip install -U esptool
106106
107+
- name: Setup platform.txt
108+
run: |
109+
baseFolder="$HOME/.arduino15/packages/m5stack/hardware/esp32"
110+
111+
# Find the latest version of the folder
112+
latestVersion=$(find "$baseFolder" -maxdepth 1 -type d -exec basename {} \; | sort -V | head -n 1)
113+
114+
if [ -z "$latestVersion" ]; then
115+
echo "No version found."
116+
read -p "Press Enter to exit."
117+
exit 1
118+
fi
119+
120+
# Full path to the file to be edited
121+
file="$baseFolder/$latestVersion/platform.txt"
122+
backupFile="$baseFolder/$latestVersion/platform.txt.bkp"
123+
prefix="build.extra_flags.esp32"
124+
option=" -w "
125+
126+
prefix2="compiler.c.elf.libs.esp32"
127+
option2=" -zmuldefs "
128+
129+
# Use awk to insert options after the first equals sign on lines with specified prefixes
130+
awk -v prefix="$prefix" -v option="$option" -v prefix2="$prefix2" -v option2="$option2" '{
131+
if ($0 ~ "^" prefix) {
132+
sub(/=/, "=" option);
133+
print;
134+
} else if ($0 ~ "^" prefix2) {
135+
sub(/=/, "=" option2);
136+
print;
137+
} else {
138+
print;
139+
}
140+
}' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
141+
142+
echo "Done."
143+
107144
- name: Compile ${{ matrix.board.name }} Sketch
108145
run: |
109146
set -x
@@ -200,4 +237,3 @@ jobs:
200237
files: |
201238
M5Nemo-*.bin
202239
203-

DEAUTH Prerequisites/README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# M5Stick-NEMO - DEAUTHENTICATOR
2+
In order to make the Deauthentication broadcast work properly, you must follow some steps before uncomment the "#define DEAUTHER" line
3+
4+
5+
## Why these prerequisites
6+
Every time you build your project, using ESP boards, compiler will look uppon your code to see if you are trying to use their boards to something not allowed..
7+
8+
As sending deauthentication frames (and some others wifi packets) is not something desireable, they have a funcion called: ieee80211_raw_frame_sanity_check, wich should be "silenced" in order to use this attack.
9+
10+
To do that, we must change some flags on the board "platform.txt" file and declare this function in your code, returning 0, you will see this funcion in the deauth.h file
11+
12+
13+
## What you need to do..
14+
* Win+R, and run: %localappdata%\Arduino15\packages\m5stack\hardware\esp32
15+
* open the folder with the version of your board, it will be something like: 2.1.0, or 2.0.9, or whatever
16+
* in this floder, open the file "platform.txt", you will need to edit this badboy.
17+
* Ctrl+F and search for: build.extra_flags.esp32
18+
- You will find a line that looks like that: 'build.extra_flags.esp32=-DARDUINO_USB_CDC_ON_BOOT=0'
19+
- Add an "-w " after the =, or at the end of the line: 'build.extra_flags.esp32=-w -DARDUINO_USB_CDC_ON_BOOT=0'
20+
* you should make these changes to the lines:
21+
- build.extra_flags.esp32
22+
- build.extra_flags.esp32s2
23+
- build.extra_flags.esp32s3
24+
- build.extra_flags.esp32c3
25+
* Ctrl+F again and search for: compiler.c.elf.libs.esp32
26+
- You will find a line that looks like that: "compiler.c.elf.libs.esp32s3=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls....... " this is a huuuuuuge line...
27+
- Add an "-zmuldefs " after the =, shoul look like this: "compiler.c.elf.libs.esp32s3=-zmuldefs -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls .............."
28+
* you should make these changes to the lines:
29+
- compiler.c.elf.libs.esp32
30+
- compiler.c.elf.libs.esp32s2
31+
- compiler.c.elf.libs.esp32s3
32+
- compiler.c.elf.libs.esp32c3
33+
* Save the file
34+
* Restart your arduino IDE
35+
* Note: everytime you update your M5 boards to a new version, you will need to do this again..
36+
37+
38+
## What did I do to help..
39+
I Created a batch file to meka all these changes automatically, you just need to download the "install-prerequisites.bat" file and run.
40+
41+
Mac users: You can use install-prerequisites_MAC.sh (thanks to @danny8972)
42+
43+
Linux users: You can use install-prerequisites_Linux.sh (thanks to @danny8972, Just changed folder address might work just fine)
44+
45+
46+
## Helps?
47+
I'm all ears!
48+
49+
## Thanks
50+
* Thanks to @danny8972 (https://github.com/danny8972) for dev the MAC batch file.
51+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
set "baseFolder=%localappdata%\Arduino15\packages\m5stack\hardware\esp32"
5+
6+
rem Find the latest version of the folder
7+
set "latestVersion="
8+
for /d %%I in ("%baseFolder%\*") do (
9+
set "latestVersion=%%~nxI"
10+
)
11+
12+
if not defined latestVersion (
13+
echo No version found.
14+
pause
15+
exit /b
16+
)
17+
18+
rem Full path to the file to be edited
19+
set "file=%baseFolder%\%latestVersion%\platform.txt"
20+
set "backupFile=%baseFolder%\%latestVersion%\platform.txt.bkp"
21+
set "prefix=build.extra_flags.esp32"
22+
set "option= -w"
23+
24+
set "prefix2=compiler.c.elf.libs.esp32"
25+
set "option2= -zmuldefs"
26+
27+
set "readyMark=##NEMO_DEAUTH_READY##"
28+
29+
rem Check if the ready mark already exists in the file
30+
findstr /C:"%readyMark%" "%file%" >nul
31+
if %errorlevel% equ 0 (
32+
echo The file is already OK.
33+
pause
34+
exit /b
35+
)
36+
37+
rem Create a backup copy of the original file
38+
copy "%file%" "%backupFile%"
39+
40+
rem Use PowerShell to edit the file
41+
powershell -Command "(Get-Content '%file%') | ForEach-Object { $_ -replace ('^(%prefix%.*?)$', '$1%option%') -replace ('^(%prefix2%.*?)$', '$1%option2%') } | Set-Content '%file%'"
42+
43+
rem Add the ready mark to the end of the file
44+
echo %readyMark%>> "%file%"
45+
46+
rem Open the latest version of the folder in Windows Explorer
47+
start explorer "%baseFolder%\%latestVersion%"
48+
49+
echo Done.
50+
pause
51+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
baseFolder="$HOME/Library/Arduino15/packages/m5stack/hardware/esp32"
4+
5+
# Find the latest version of the folder
6+
latestVersion=$(find "$baseFolder" -maxdepth 1 -type d -exec basename {} \; | sort -V | head -n 1)
7+
8+
if [ -z "$latestVersion" ]; then
9+
echo "No version found."
10+
read -p "Press Enter to exit."
11+
exit 1
12+
fi
13+
14+
# Full path to the file to be edited
15+
file="$baseFolder/$latestVersion/platform.txt"
16+
backupFile="$baseFolder/$latestVersion/platform.txt.bkp"
17+
prefix="build.extra_flags.esp32"
18+
option=" -w "
19+
20+
prefix2="compiler.c.elf.libs.esp32"
21+
option2=" -zmuldefs "
22+
23+
readyMark="##NEMO_DEAUTH_READY##"
24+
25+
# Check if the ready mark already exists in the file
26+
grep -q "$readyMark" "$file"
27+
if [ $? -eq 0 ]; then
28+
echo "The file is already OK."
29+
read -p "Press Enter to exit."
30+
exit 0
31+
fi
32+
33+
# Create a backup copy of the original file
34+
cp "$file" "$backupFile"
35+
36+
# Use awk to insert options after the first equals sign on lines with specified prefixes
37+
awk -v prefix="$prefix" -v option="$option" -v prefix2="$prefix2" -v option2="$option2" '{
38+
if ($0 ~ "^" prefix) {
39+
sub(/=/, "=" option);
40+
print;
41+
} else if ($0 ~ "^" prefix2) {
42+
sub(/=/, "=" option2);
43+
print;
44+
} else {
45+
print;
46+
}
47+
}' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
48+
49+
# Add the ready mark to the end of the file
50+
echo "$readyMark" >> "$file"
51+
52+
# Open the latest version of the folder in Finder
53+
open "$baseFolder/$latestVersion"
54+
55+
echo "Done."
56+
read -p "Press Enter to exit."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
#
4+
5+
baseFolder="$HOME/.arduino15/packages/m5stack/hardware/esp32"
6+
7+
# Find the latest version of the folder
8+
latestVersion=$(find "$baseFolder" -maxdepth 1 -type d -exec basename {} \; | sort -V | head -n 1)
9+
10+
if [ -z "$latestVersion" ]; then
11+
echo "No version found."
12+
read -p "Press Enter to exit."
13+
exit 1
14+
fi
15+
16+
# Full path to the file to be edited
17+
file="$baseFolder/$latestVersion/platform.txt"
18+
backupFile="$baseFolder/$latestVersion/platform.txt.bkp"
19+
prefix="build.extra_flags.esp32"
20+
option=" -w "
21+
22+
prefix2="compiler.c.elf.libs.esp32"
23+
option2=" -zmuldefs "
24+
25+
readyMark="##NEMO_DEAUTH_READY##"
26+
27+
# Check if the ready mark already exists in the file
28+
grep -q "$readyMark" "$file"
29+
if [ $? -eq 0 ]; then
30+
echo "The file is already OK."
31+
read -p "Press Enter to exit."
32+
exit 0
33+
fi
34+
35+
# Create a backup copy of the original file
36+
cp "$file" "$backupFile"
37+
38+
# Use awk to insert options after the first equals sign on lines with specified prefixes
39+
awk -v prefix="$prefix" -v option="$option" -v prefix2="$prefix2" -v option2="$option2" '{
40+
if ($0 ~ "^" prefix) {
41+
sub(/=/, "=" option);
42+
print;
43+
} else if ($0 ~ "^" prefix2) {
44+
sub(/=/, "=" option2);
45+
print;
46+
} else {
47+
print;
48+
}
49+
}' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
50+
51+
# Add the ready mark to the end of the file
52+
echo "$readyMark" >> "$file"
53+
54+
# Open the latest version of the folder in Finder
55+
open "$baseFolder/$latestVersion"
56+
57+
echo "Done."
58+
read -p "Press Enter to exit."

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ NEMO is named after the small, clever and stubborn fish in Finding Nemo. This pr
1010

1111
![M5-Nemo on M5StickC family and M5Cardputer](https://github.com/n0xa/m5stick-nemo/blob/main/M5-Nemo.jpg)
1212

13+
## My Changelog
14+
* Adjusted .github/workflow/compile.yml to compile with the DEAUTH function.
15+
* Added suport to SONG on StickC Plus and Plus2
16+
* Added an "Attack Menu" when seeing details of an Access Point
17+
- Clone Portal (Creates an Evil portal with the same SSID of the target)
18+
- Deauth attack (broadcasts deauthentication frames to devices connected to this Access Point)
19+
- Deauth+Clone (Creates the evil portal with the same SSID and sends deauthentication frames to that AP)
20+
* Added option in Settings to Mount/Unmount SDCard when using M5StickC devices
21+
* Created new file to handle SPI/SD if not using CARDPUTER
22+
* SDCARD is now working on M5StickC Plus2
23+
24+
## My ToDo list
25+
* ideas?
26+
1327
## Features
1428
* [TV B-Gone](http://www.righto.com/2010/11/improved-arduino-tv-b-gone.html) port (thanks to MrArm's [HAKRWATCH](https://github.com/MrARM/hakrwatch)) to shut off many infrared-controlled TVs, projectors and other devices
1529
* [AppleJuice](https://github.com/ECTO-1A/AppleJuice) iOS Bluetooth device pairing spam

0 commit comments

Comments
 (0)