This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 170
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 #95 from n0xa/develop
Merge Develop changes into main
- Loading branch information
Showing
12 changed files
with
770 additions
and
79 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ jobs: | |
name: "M5Cardputer", | ||
fqbn: "m5stack:esp32:m5stack_cardputer", | ||
extra_flags: "-DCARDPUTER", | ||
libraries: "M5Cardputer IRRemoteESP8266", | ||
libraries: "M5Cardputer IRRemoteESP8266 M5Stack-SD-Updater M5Unified", | ||
partitions: { | ||
bootloader_addr: "0x0000", | ||
}, | ||
|
@@ -44,7 +44,7 @@ jobs: | |
name: "M5StickCPlus2", | ||
fqbn: "m5stack:esp32:m5stack_stickc_plus2", | ||
extra_flags: "-DSTICK_C_PLUS2", | ||
libraries: "M5StickCPlus2 IRRemoteESP8266", | ||
libraries: "M5StickCPlus2 IRRemoteESP8266 M5Stack-SD-Updater M5Unified", | ||
partitions: { | ||
bootloader_addr: "0x1000", | ||
}, | ||
|
@@ -53,7 +53,7 @@ jobs: | |
name: "M5StickCPlus", | ||
fqbn: "m5stack:esp32:m5stack_stickc_plus", | ||
extra_flags: "-DSTICK_C_PLUS", | ||
libraries: "M5StickCPlus IRRemoteESP8266", | ||
libraries: "M5StickCPlus IRRemoteESP8266 M5Stack-SD-Updater M5Unified", | ||
partitions: { | ||
bootloader_addr: "0x1000", | ||
}, | ||
|
@@ -63,7 +63,7 @@ jobs: | |
fqbn: "m5stack:esp32:m5stack_stickc", | ||
extra_flags: "-DSTICK_C", | ||
# TODO: M5StickC's latest version has some dependency issues with M5Hat-JoyC library | ||
libraries: "[email protected] IRRemoteESP8266", | ||
libraries: "[email protected] IRRemoteESP8266 M5Stack-SD-Updater M5Unified", | ||
partitions: { | ||
bootloader_addr: "0x1000", | ||
}, | ||
|
@@ -104,6 +104,43 @@ jobs: | |
run: | | ||
pip install -U esptool | ||
- name: Setup platform.txt | ||
run: | | ||
baseFolder="$HOME/.arduino15/packages/m5stack/hardware/esp32" | ||
# Find the latest version of the folder | ||
latestVersion=$(find "$baseFolder" -maxdepth 1 -type d -exec basename {} \; | sort -V | head -n 1) | ||
if [ -z "$latestVersion" ]; then | ||
echo "No version found." | ||
read -p "Press Enter to exit." | ||
exit 1 | ||
fi | ||
# Full path to the file to be edited | ||
file="$baseFolder/$latestVersion/platform.txt" | ||
backupFile="$baseFolder/$latestVersion/platform.txt.bkp" | ||
prefix="build.extra_flags.esp32" | ||
option=" -w " | ||
prefix2="compiler.c.elf.libs.esp32" | ||
option2=" -zmuldefs " | ||
# Use awk to insert options after the first equals sign on lines with specified prefixes | ||
awk -v prefix="$prefix" -v option="$option" -v prefix2="$prefix2" -v option2="$option2" '{ | ||
if ($0 ~ "^" prefix) { | ||
sub(/=/, "=" option); | ||
print; | ||
} else if ($0 ~ "^" prefix2) { | ||
sub(/=/, "=" option2); | ||
print; | ||
} else { | ||
print; | ||
} | ||
}' "$file" > "$file.tmp" && mv "$file.tmp" "$file" | ||
|
||
echo "Done." | ||
|
||
- name: Compile ${{ matrix.board.name }} Sketch | ||
run: | | ||
set -x | ||
|
@@ -200,4 +237,3 @@ jobs: | |
files: | | ||
M5Nemo-*.bin | ||
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,51 @@ | ||
# M5Stick-NEMO - DEAUTHENTICATOR | ||
In order to make the Deauthentication broadcast work properly, you must follow some steps before uncomment the "#define DEAUTHER" line | ||
|
||
|
||
## Why these prerequisites | ||
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.. | ||
|
||
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. | ||
|
||
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 | ||
|
||
|
||
## What you need to do.. | ||
* Win+R, and run: %localappdata%\Arduino15\packages\m5stack\hardware\esp32 | ||
* open the folder with the version of your board, it will be something like: 2.1.0, or 2.0.9, or whatever | ||
* in this floder, open the file "platform.txt", you will need to edit this badboy. | ||
* Ctrl+F and search for: build.extra_flags.esp32 | ||
- You will find a line that looks like that: 'build.extra_flags.esp32=-DARDUINO_USB_CDC_ON_BOOT=0' | ||
- Add an "-w " after the =, or at the end of the line: 'build.extra_flags.esp32=-w -DARDUINO_USB_CDC_ON_BOOT=0' | ||
* you should make these changes to the lines: | ||
- build.extra_flags.esp32 | ||
- build.extra_flags.esp32s2 | ||
- build.extra_flags.esp32s3 | ||
- build.extra_flags.esp32c3 | ||
* Ctrl+F again and search for: compiler.c.elf.libs.esp32 | ||
- 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... | ||
- Add an "-zmuldefs " after the =, shoul look like this: "compiler.c.elf.libs.esp32s3=-zmuldefs -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls .............." | ||
* you should make these changes to the lines: | ||
- compiler.c.elf.libs.esp32 | ||
- compiler.c.elf.libs.esp32s2 | ||
- compiler.c.elf.libs.esp32s3 | ||
- compiler.c.elf.libs.esp32c3 | ||
* Save the file | ||
* Restart your arduino IDE | ||
* Note: everytime you update your M5 boards to a new version, you will need to do this again.. | ||
|
||
|
||
## What did I do to help.. | ||
I Created a batch file to meka all these changes automatically, you just need to download the "install-prerequisites.bat" file and run. | ||
|
||
Mac users: You can use install-prerequisites_MAC.sh (thanks to @danny8972) | ||
|
||
Linux users: You can use install-prerequisites_Linux.sh (thanks to @danny8972, Just changed folder address might work just fine) | ||
|
||
|
||
## Helps? | ||
I'm all ears! | ||
|
||
## Thanks | ||
* Thanks to @danny8972 (https://github.com/danny8972) for dev the MAC batch file. | ||
|
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,51 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
set "baseFolder=%localappdata%\Arduino15\packages\m5stack\hardware\esp32" | ||
|
||
rem Find the latest version of the folder | ||
set "latestVersion=" | ||
for /d %%I in ("%baseFolder%\*") do ( | ||
set "latestVersion=%%~nxI" | ||
) | ||
|
||
if not defined latestVersion ( | ||
echo No version found. | ||
pause | ||
exit /b | ||
) | ||
|
||
rem Full path to the file to be edited | ||
set "file=%baseFolder%\%latestVersion%\platform.txt" | ||
set "backupFile=%baseFolder%\%latestVersion%\platform.txt.bkp" | ||
set "prefix=build.extra_flags.esp32" | ||
set "option= -w" | ||
|
||
set "prefix2=compiler.c.elf.libs.esp32" | ||
set "option2= -zmuldefs" | ||
|
||
set "readyMark=##NEMO_DEAUTH_READY##" | ||
|
||
rem Check if the ready mark already exists in the file | ||
findstr /C:"%readyMark%" "%file%" >nul | ||
if %errorlevel% equ 0 ( | ||
echo The file is already OK. | ||
pause | ||
exit /b | ||
) | ||
|
||
rem Create a backup copy of the original file | ||
copy "%file%" "%backupFile%" | ||
|
||
rem Use PowerShell to edit the file | ||
powershell -Command "(Get-Content '%file%') | ForEach-Object { $_ -replace ('^(%prefix%.*?)$', '$1%option%') -replace ('^(%prefix2%.*?)$', '$1%option2%') } | Set-Content '%file%'" | ||
|
||
rem Add the ready mark to the end of the file | ||
echo %readyMark%>> "%file%" | ||
|
||
rem Open the latest version of the folder in Windows Explorer | ||
start explorer "%baseFolder%\%latestVersion%" | ||
|
||
echo Done. | ||
pause | ||
|
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,56 @@ | ||
#!/bin/bash | ||
|
||
baseFolder="$HOME/Library/Arduino15/packages/m5stack/hardware/esp32" | ||
|
||
# Find the latest version of the folder | ||
latestVersion=$(find "$baseFolder" -maxdepth 1 -type d -exec basename {} \; | sort -V | head -n 1) | ||
|
||
if [ -z "$latestVersion" ]; then | ||
echo "No version found." | ||
read -p "Press Enter to exit." | ||
exit 1 | ||
fi | ||
|
||
# Full path to the file to be edited | ||
file="$baseFolder/$latestVersion/platform.txt" | ||
backupFile="$baseFolder/$latestVersion/platform.txt.bkp" | ||
prefix="build.extra_flags.esp32" | ||
option=" -w " | ||
|
||
prefix2="compiler.c.elf.libs.esp32" | ||
option2=" -zmuldefs " | ||
|
||
readyMark="##NEMO_DEAUTH_READY##" | ||
|
||
# Check if the ready mark already exists in the file | ||
grep -q "$readyMark" "$file" | ||
if [ $? -eq 0 ]; then | ||
echo "The file is already OK." | ||
read -p "Press Enter to exit." | ||
exit 0 | ||
fi | ||
|
||
# Create a backup copy of the original file | ||
cp "$file" "$backupFile" | ||
|
||
# Use awk to insert options after the first equals sign on lines with specified prefixes | ||
awk -v prefix="$prefix" -v option="$option" -v prefix2="$prefix2" -v option2="$option2" '{ | ||
if ($0 ~ "^" prefix) { | ||
sub(/=/, "=" option); | ||
print; | ||
} else if ($0 ~ "^" prefix2) { | ||
sub(/=/, "=" option2); | ||
print; | ||
} else { | ||
print; | ||
} | ||
}' "$file" > "$file.tmp" && mv "$file.tmp" "$file" | ||
|
||
# Add the ready mark to the end of the file | ||
echo "$readyMark" >> "$file" | ||
|
||
# Open the latest version of the folder in Finder | ||
open "$baseFolder/$latestVersion" | ||
|
||
echo "Done." | ||
read -p "Press Enter to exit." |
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,58 @@ | ||
#!/bin/bash | ||
|
||
# | ||
|
||
baseFolder="$HOME/.arduino15/packages/m5stack/hardware/esp32" | ||
|
||
# Find the latest version of the folder | ||
latestVersion=$(find "$baseFolder" -maxdepth 1 -type d -exec basename {} \; | sort -V | head -n 1) | ||
|
||
if [ -z "$latestVersion" ]; then | ||
echo "No version found." | ||
read -p "Press Enter to exit." | ||
exit 1 | ||
fi | ||
|
||
# Full path to the file to be edited | ||
file="$baseFolder/$latestVersion/platform.txt" | ||
backupFile="$baseFolder/$latestVersion/platform.txt.bkp" | ||
prefix="build.extra_flags.esp32" | ||
option=" -w " | ||
|
||
prefix2="compiler.c.elf.libs.esp32" | ||
option2=" -zmuldefs " | ||
|
||
readyMark="##NEMO_DEAUTH_READY##" | ||
|
||
# Check if the ready mark already exists in the file | ||
grep -q "$readyMark" "$file" | ||
if [ $? -eq 0 ]; then | ||
echo "The file is already OK." | ||
read -p "Press Enter to exit." | ||
exit 0 | ||
fi | ||
|
||
# Create a backup copy of the original file | ||
cp "$file" "$backupFile" | ||
|
||
# Use awk to insert options after the first equals sign on lines with specified prefixes | ||
awk -v prefix="$prefix" -v option="$option" -v prefix2="$prefix2" -v option2="$option2" '{ | ||
if ($0 ~ "^" prefix) { | ||
sub(/=/, "=" option); | ||
print; | ||
} else if ($0 ~ "^" prefix2) { | ||
sub(/=/, "=" option2); | ||
print; | ||
} else { | ||
print; | ||
} | ||
}' "$file" > "$file.tmp" && mv "$file.tmp" "$file" | ||
|
||
# Add the ready mark to the end of the file | ||
echo "$readyMark" >> "$file" | ||
|
||
# Open the latest version of the folder in Finder | ||
open "$baseFolder/$latestVersion" | ||
|
||
echo "Done." | ||
read -p "Press Enter to exit." |
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
Oops, something went wrong.