
π‘οΈ Open-source binary protection toolkit for Windows PE. Nanomite, VM protection, anti-debug, and more.
Secure Quality Uncrackable Runtime Encryption - Advanced Binary Protection Toolkit for Windows PE files.
SQURE provides multi-layered protection against reverse engineering, debugging, and tampering:
| Feature | Description |
|---|---|
| Nanomite | Replaces conditional branches with INT3, dispatched by VEH at runtime |
| XTEA Encryption | Per-page .text encryption with key derivation from PE headers |
| VM Protection | Virtualizes code into custom bytecode interpreter |
| Tidal Memory | Page-granular encryption with on-demand VEH decryption |
| Honeypot | Decoy functions and trap code to mislead analysis |
| Anti-Debug | PEB.BeingDebugged detection with key poisoning |
| Anti-Dump | Memory dump prevention techniques |
| Sandbox Detection | CPUID-based VM/hypervisor detection |
| Import Obfuscation | IAT hashing with runtime resolution |
| Integrity Checking | Cascade hash chain for tamper detection |
| Shamir Secret Sharing | Key split across 3 shares in GF(2^64) |
| White-box Crypto | Lookup tables resistant to DCA attacks |
# Clone the repository
git clone https://github.com/mttm2/squre.git
cd squre
# Build release binary
cargo build --release
# The CLI is at target/release/squre-cli.exe
# Basic protection
squre-cli protect app.exe -o protected.exe
# Maximum protection (all features enabled)
squre-cli protect app.exe -o protected.exe --level maximum
# Custom seed for reproducible builds
squre-cli protect app.exe -o protected.exe -s 0xDEADBEEF
squre-cli protect [OPTIONS] --output <OUTPUT> <INPUT>
Options:
-o, --output <OUTPUT> Output PE file path
-s, --seed <SEED> CEWE seed (hex, random if not specified)
-l, --level <LEVEL> Protection level: standard (default) or maximum
Protection Features:
--vm Enable VM protection (virtualized code)
--honeypot Enable honeypot mode (decoy functions, traps)
--tidal Enable Tidal Memory (page-granular encryption)
--ultra Enable ultra-hardened mode (16 anti-analysis phases)
--harden Enable hardened mode (polymorphic sections)
--anti-dump Enable anti-memory-dump protection
--integrity-check Enable code integrity checking
--direct-syscall Enable direct syscalls (bypass user-mode hooks)
Tuning:
--junk-level <0-3> Junk code insertion level
--fake-keys <N> Number of decoy keys to embed
--layers <1-3> Encryption layers (XTEA/XOR/Rolling)
--obfuscate <0-3> Obfuscation level
--no-nanomite Disable nanomite branches
--no-anti-debug Disable anti-debug checks
--level maximum)SQURE can automatically protect Rust binaries with source-level integration:
# Build and protect a Rust project
squre-cli build ./my-rust-project -o protected.exe --level maximum
Add the squre-core crate to enable macro-based protection:
use squre_core::anti_debug;
fn main() {
// Install anti-debug and nanomite handler
anti_debug!();
// Your code here
}
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Protection Flow β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. OS loads PE β entry = .sqpre (obfuscated stub) β
β 2. .sqpre decrypts .sqinit using PE-derived XOR key β
β 3. .sqinit decrypts .text using XTEA with page keys β
β 4. Jump to original entry point (CRT init β main) β
β 5. anti_debug!() installs VEH + loads nanomite table β
β 6. INT3 branches dispatched by VEH handler β
β 7. Tidal Memory encrypts pages β VEH decrypts on demand β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
squre/
βββ crates/
β βββ squre-cli/ # CLI tool for binary protection
β β βββ src/
β β β βββ main.rs # CLI entry point
β β β βββ pe/ # PE parsing and writing
β β β βββ transform/ # Protection transforms
β β β βββ hardening.rs # Anti-analysis phases
β β β βββ honeypot.rs # Decoy code generation
β β β βββ vm_protect.rs # VM bytecode compiler
β β β βββ ...
β βββ squre-core/ # Runtime macros for Rust integration
βββ examples/ # Example projects
βββ TUTORIAL.md # Detailed usage guide
SQURE is designed for legitimate software protection:
Do not use for malware. This tool is for defensive purposes only.
Protected binaries have minimal runtime overhead:
Contributions are welcome! Please feel free to submit issues and pull requests.
git checkout -b feature/amazing)git commit -m 'Add amazing feature')git push origin feature/amazing)MIT License - see LICENSE for details.
SQURE - Because your code deserves protection.