
🛡️ Windows PE를 위한 오픈소스 바이너리 보호 툴킷. Nanomite, VM 보호, 안티 디버그 등.
Secure Quality Uncrackable Runtime Encryption - Windows PE 파일을 위한 고급 바이너리 보호 툴킷
SQURE는 리버스 엔지니어링, 디버깅 및 변조에 대한 다층적 보호를 제공합니다:
| 기능 | 설명 |
|---|---|
| Nanomite | 조건부 분기를 INT3으로 대체하고, 런타임에 VEH가 디스패치합니다 |
| XTEA 암호화 | PE 헤더에서 키 파생을 통한 페이지별 .text 암호화 |
| VM 보호 | 코드를 사용자 정의 바이트코드 인터프리터로 가상화 |
| Tidal Memory | 페이지 단위 암호화와 요청 시 VEH 복호화 |
| 허니팟 | 분석을 오도하기 위한 유인 함수 및 트랩 코드 |
| 안티 디버그 | PEB.BeingDebugged 감지 및 키 포이즈닝 |
| 안티 덤프 | 메모리 덤프 방지 기술 |
| 샌드박스 탐지 | CPUID 기반 VM/하이퍼바이저 탐지 |
| 임포트 난독화 | 런타임 해석을 통한 IAT 해싱 |
| 무결성 검사 | 변조 탐지를 위한 캐스케이드 해시 체인 |
| 샤미르 비밀 공유 | GF(2^64)에서 3개의 공유로 키 분할 |
| 화이트박스 암호 | DCA 공격에 내성이 있는 룩업 테이블 |
# 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는 소스 수준 통합을 통해 Rust 바이너리를 자동으로 보호할 수 있습니다:
# Build and protect a Rust project
squre-cli build ./my-rust-project -o protected.exe --level maximum
매크로 기반 보호를 활성화하려면 squre-core 크레이트를 추가하세요:
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는 합법적인 소프트웨어 보호를 위해 설계되었습니다:
악성 코드에 사용하지 마십시오. 이 도구는 방어 목적으로만 사용됩니다.
보호된 바이너리는 런타임 오버헤드가 최소화됩니다:
기여를 환영합니다! 이슈와 풀 리퀘스트를 자유롭게 제출해 주세요.
git checkout -b feature/amazing)git commit -m 'Add amazing feature')git push origin feature/amazing)MIT 라이선스 - 자세한 내용은 LICENSE를 참조하세요.
SQURE - 코드가 보호받을 자격이 있기 때문입니다.