https://github.com/brianoy/sketchobfus
Just scrambles your arduino code variable names to make the code harder to read. Focused on what it does best: making things slightly uglier.
https://github.com/brianoy/sketchobfus
arduino arduino-uglier obfuscate uglier
Last synced: about 1 year ago
JSON representation
Just scrambles your arduino code variable names to make the code harder to read. Focused on what it does best: making things slightly uglier.
- Host: GitHub
- URL: https://github.com/brianoy/sketchobfus
- Owner: brianoy
- License: gpl-3.0
- Created: 2025-04-22T16:16:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-22T17:52:39.000Z (about 1 year ago)
- Last Synced: 2025-04-22T17:57:21.158Z (about 1 year ago)
- Topics: arduino, arduino-uglier, obfuscate, uglier
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SketchObfus
Just scrambles your arduino code variable names to make the code harder to read. Focused on what it does best: making things slightly uglier.
| before | after |
|:------------:|:-------------:|
|
|
|
## 🔧 Features
- Removes both C-style (`/* */`) and C++-style (`//`) comments
- Obfuscates:
- Global and local variables
- Function names
- Function parameters
- Object instances (e.g., `Servo myServo;`)
- Ignores Arduino reserved keywords and function names
- Outputs clean, comment-free obfuscated code
## 📦 Requirements
- Python 3.13
## 🚀 Usage
1. Clone this project
```bash
git clone https://github.com/brianoy/SketchObfus.git
```
2. Start obfuscated
```bash
python SketchObfus.py your_sketch.ino
```
This generates an obfuscated version of the sketch named `your_sketch_obf.ino`.
You can also specify a custom output filename:
```bash
python SketchObfus.py your_sketch.ino obfuscated_output.ino
```
## 📁 Example
Before:
```cpp
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
```
After:
```cpp
int _0xA3B1C2D4 = 13;
void _0x1F9A3B7C() {
pinMode(_0xA3B1C2D4, OUTPUT);
}
void _0x6D9C7A2E() {
digitalWrite(_0xA3B1C2D4, HIGH);
delay(1000);
digitalWrite(_0xA3B1C2D4, LOW);
delay(1000);
}
```
## 🛡️ Limitations
- Not suitable for sketches that rely on external macro-generated names or dynamically referenced variables.
- Does not analyze code semantically — relies solely on regex patterns.