unpeek 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/README.tr.md +5 -5
- package/dist/ast/index.cjs +393 -141
- package/dist/ast/index.cjs.map +1 -1
- package/dist/ast/index.js +393 -141
- package/dist/ast/index.js.map +1 -1
- package/dist/browser.cjs +393 -141
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +393 -141
- package/dist/browser.js.map +1 -1
- package/dist/bundler/unplugin.cjs +397 -144
- package/dist/bundler/unplugin.cjs.map +1 -1
- package/dist/bundler/unplugin.js +397 -144
- package/dist/bundler/unplugin.js.map +1 -1
- package/dist/cli/index.cjs +397 -144
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +397 -144
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/protect.cjs +396 -143
- package/dist/cli/protect.cjs.map +1 -1
- package/dist/cli/protect.js +396 -143
- package/dist/cli/protect.js.map +1 -1
- package/dist/esbuild.cjs +397 -144
- package/dist/esbuild.cjs.map +1 -1
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.js +397 -144
- package/dist/esbuild.js.map +1 -1
- package/dist/index.cjs +401 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +401 -147
- package/dist/index.js.map +1 -1
- package/dist/rollup.cjs +397 -144
- package/dist/rollup.cjs.map +1 -1
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +397 -144
- package/dist/rollup.js.map +1 -1
- package/dist/runtime/index.cjs +2 -2
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/{types-BTMkXmVE.d.cts → types-D-lVfaDU.d.cts} +1 -1
- package/dist/{types-BTMkXmVE.d.ts → types-D-lVfaDU.d.ts} +1 -1
- package/dist/vite.cjs +397 -144
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +397 -144
- package/dist/vite.js.map +1 -1
- package/dist/webpack.cjs +397 -144
- package/dist/webpack.cjs.map +1 -1
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +397 -144
- package/dist/webpack.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,8 +35,8 @@ Existing tools force an uncomfortable trade-off:
|
|
|
35
35
|
| Capability | Standard Minifiers (`Terser` / `SWC`) | Legacy AST Obfuscators | `unpeek` |
|
|
36
36
|
| :--- | :--- | :--- | :--- |
|
|
37
37
|
| **Runtime CPU Overhead** | ~0% | 15% to 85% (throttles UI loops) | **< 2.0%** (Call-Graph Hot-Path Exemption) |
|
|
38
|
-
| **Gzip Bundle Growth** | 0% (Baseline) | +45% to +300% | **< 15%** (O(1)
|
|
39
|
-
| **String & Endpoint Encryption** | Plaintext in bundle | Eager array rotation (high CPU) | **Polymorphic XOR + O(1)
|
|
38
|
+
| **Gzip Bundle Growth** | 0% (Baseline) | +45% to +300% | **< 15%** (O(1) `kConst` String Vault) |
|
|
39
|
+
| **String & Endpoint Encryption** | Plaintext in bundle | Eager array rotation (high CPU) | **Polymorphic Period-2 XOR + O(1) `kConst` Vault** |
|
|
40
40
|
| **DevTools Pretty-Print (`{}`) Defense** | None | `debugger` infinite loops (easily bypassed) | **`Function.prototype.toString()` FNV-1a Integrity** |
|
|
41
41
|
| **Source Map Isolation** | Manual CI scripts | Manual configuration | **Automatic `.unpeek-maps/` Vault + Comment Strip** |
|
|
42
42
|
| **Static Deobfuscator Resistance** | None | Fixed templates (fingerprinted by deobfuscators) | **Per-Build Polymorphic AST Seed** |
|
|
@@ -53,7 +53,7 @@ flowchart TD
|
|
|
53
53
|
E --> F["AST Hot-Path Traversal (detectHotPaths)"]
|
|
54
54
|
F -->|Loops, Array Callbacks, UI Renders| G["Hot Path: 0% Tax (Skip Opaque Predicates)"]
|
|
55
55
|
F -->|Cold Functions: Auth, Licensing, Signers| H["Cold Path: Opaque Control-Flow Predicates"]
|
|
56
|
-
G --> I["Polymorphic String Vault (O(1)
|
|
56
|
+
G --> I["Polymorphic String Vault (O(1) kConst XOR)"]
|
|
57
57
|
H --> I
|
|
58
58
|
I --> J["Identifier and Symbol Mangling"]
|
|
59
59
|
J --> K["Runtime Integrity Shield (FNV-1a Checksum)"]
|
|
@@ -63,7 +63,7 @@ flowchart TD
|
|
|
63
63
|
1. **Call-Graph Hot-Path Exemption (`<2%` CPU Budget)**
|
|
64
64
|
Before modifying an AST node, [`detectHotPaths`](packages/unpeek/src/ast/index.ts) traverses the file call graph bidirectionally. Functions containing loops (`for`, `while`, `do-while`, `for-of`), array higher-order callbacks (`.map`, `.filter`, `.reduce`, `.forEach`), `requestAnimationFrame` tickers, React/UI render components (`useState`, `useEffect`, `createElement`), and all helper callees invoked from hot loops are flagged as hot paths. `unpeek` exempts hot loops and their callees from both opaque control-flow predicates and string vault rewriting, while protecting cold functions (such as license checks, request signers, and auth validators). V8 JIT optimization inside hot loops remains untouched.
|
|
65
65
|
2. **O(1) Const-Array String Vault & Tamper Entanglement (`<15%` Gzip Budget)**
|
|
66
|
-
Cold string literals (`minStringLength >= 4`) are encrypted at build time with a period-2 polymorphic XOR stream cipher keyed by a per-build 32-bit seed that preserves LZ77/Gzip compressibility. At module initialization, the injected `const _uC` vault decodes strings once into a V8 `kConst` array slot so every subsequent read resolves in O(1) constant time via direct array indexing, while entangling the XOR key with the runtime integrity state.
|
|
66
|
+
Cold string literals (`minStringLength >= 4`) are encrypted at build time with a period-2 polymorphic XOR stream cipher keyed by a per-build 32-bit seed that preserves LZ77/Gzip compressibility. At module initialization, the injected `const _uC` vault decodes strings once into a V8 `kConst` array slot so every subsequent read resolves in O(1) constant time via direct array indexing, while dual-entangling the XOR key with both the runtime integrity state (`String.prototype._u`) and self-verifying decoder formatting (`/\n/.test(f)`).
|
|
67
67
|
3. **Self-Defending `Function.prototype.toString()` Integrity and Passive Deterrent**
|
|
68
68
|
When an analyst formats a protected chunk using DevTools Pretty-Print (`{}`) or edits a branch instruction in the Sources panel, the formatted source alters `Function.prototype.toString()`. [`verifyCodeIntegrity`](packages/unpeek/src/runtime/index.ts) validates a seeded 32-bit FNV-1a checksum against the function source representation with zero false positives on untouched minified code, triggering gradual state degradation (`deterrentMode: 'gradual'`) rather than an obvious crash point that attackers can patch out.
|
|
69
69
|
4. **Automatic Source Map Vault (`.unpeek-maps/`)**
|
|
@@ -105,7 +105,7 @@ npx unpeek protect
|
|
|
105
105
|
| `--seed <number>` | Deterministic 32-bit polymorphic build seed | Random per build |
|
|
106
106
|
| `--passive` | Use passive deterrent mode instead of gradual state degradation | Default: gradual degradation |
|
|
107
107
|
| `--no-maps` | Permanently delete `.map` files instead of moving them to `.unpeek-maps/` | Moves to `.unpeek-maps/` |
|
|
108
|
-
| `--min-string-length <num>` | Minimum string length for
|
|
108
|
+
| `--min-string-length <num>` | Minimum string length for O(1) `kConst` encryption vault | `4` |
|
|
109
109
|
| `--private-maps-dir <dir>` | Directory to store vaulted private source maps | `.unpeek-maps` |
|
|
110
110
|
| `--no-shield` | Do not inject runtime anti-tamper deterrent shield | Shield injected into entry chunks |
|
|
111
111
|
| `-h, --help` | Show CLI help message | |
|
package/README.tr.md
CHANGED
|
@@ -35,8 +35,8 @@ Mevcut araçlar geliştiricileri zor bir ödünleşime zorlar:
|
|
|
35
35
|
| Yetenek | Standart Küçültücüler (`Terser` / `SWC`) | Geleneksel AST Karmaşıklaştırıcılar | `unpeek` |
|
|
36
36
|
| :--- | :--- | :--- | :--- |
|
|
37
37
|
| **Çalışma Zamanı CPU Ek Yükü** | ~%0 | %15 ile %85 (arayüz döngülerini yavaşlatır) | **< %2.0** (Çağrı Grafiği Hot-Path Muafiyeti) |
|
|
38
|
-
| **Gzip Paket Büyümesi** | %0 (Referans) | +%45 ile +%300 | **< %15** (O(1)
|
|
39
|
-
| **Metin ve API Uç Noktası Şifreleme** | Pakette düz metin (plaintext) | Başlangıçta tam dizi çözme (yüksek CPU) | **Polimorfik XOR + O(1)
|
|
38
|
+
| **Gzip Paket Büyümesi** | %0 (Referans) | +%45 ile +%300 | **< %15** (O(1) `kConst` Sabit-Dizi Metin Kasası) |
|
|
39
|
+
| **Metin ve API Uç Noktası Şifreleme** | Pakette düz metin (plaintext) | Başlangıçta tam dizi çözme (yüksek CPU) | **Polimorfik Periyot-2 XOR + O(1) `kConst` Kasa** |
|
|
40
40
|
| **DevTools Pretty-Print (`{}`) Koruması** | Yok | `debugger` döngüleri (kolayca devre dışı bırakılır) | **`Function.prototype.toString()` FNV-1a Bütünlük Doğrulaması** |
|
|
41
41
|
| **Source Map Yalıtımı** | Manuel CI betikleri | Manuel yapılandırma | **Otomatik `.unpeek-maps/` Kasası + Yorum Temizliği** |
|
|
42
42
|
| **Statik Deobfuscator Direnci** | Yok | Sabit şablonlar (`webcrack` tarafından tanınır) | **Derleme Başına Polimorfik AST Tohumu (Seed)** |
|
|
@@ -53,7 +53,7 @@ flowchart TD
|
|
|
53
53
|
E --> F["AST Sıcak Yol Analizi (detectHotPaths)"]
|
|
54
54
|
F -->|Döngüler, Dizi Fonksiyonları, UI Render| G["Sıcak Yol: %0 Vergi (Opak Akış Atlanır)"]
|
|
55
55
|
F -->|Soğuk Fonksiyonlar: Yetki, Lisans, İmza| H["Soğuk Yol: Opak Kontrol Akışı Koruması"]
|
|
56
|
-
G --> I["Polimorfik Metin Kasası (O(1)
|
|
56
|
+
G --> I["Polimorfik Metin Kasası (O(1) kConst XOR)"]
|
|
57
57
|
H --> I
|
|
58
58
|
I --> J["Tanımlayıcı ve Sembol Maskeleme"]
|
|
59
59
|
J --> K["Çalışma Zamanı Bütünlük Kalkanı (FNV-1a Özeti)"]
|
|
@@ -63,7 +63,7 @@ flowchart TD
|
|
|
63
63
|
1. **Çağrı Grafiği (Call-Graph) Hot-Path Muafiyeti (`<%2` CPU Bütçesi)**
|
|
64
64
|
[`detectHotPaths`](packages/unpeek/src/ast/index.ts), tek bir AST düğümünü değiştirmeden önce dosyanın çağrı grafiğini çift yönlü tarar. Döngü içeren fonksiyonlar (`for`, `while`, `do-while`, `for-of`), dizi yüksek mertebe geri çağrıları (`.map`, `.filter`, `.reduce`, `.forEach`), `requestAnimationFrame` zamanlayıcıları, React/UI bileşenleri (`useState`, `useEffect`, `createElement`) ve sıcak döngülerden çağrılan tüm yardımcı fonksiyonlar sıcak yol (hot path) olarak işaretlenir. `unpeek` sıcak döngüleri ve yardımcılarını hem opak kontrol akışı korumalarından hem de metin kasası dönüşümünden muaf tutar; korumayı yalnızca soğuk fonksiyonlara (lisans doğrulama, istek imzalama, yetki kontrolü gibi) uygular. Sıcak döngülerdeki V8 JIT optimizasyonu doğal hızında çalışmayı sürdürür.
|
|
65
65
|
2. **O(1) Sabit-Dizi Metin Kasası ve Kalkan Dolanıklığı (`<%15` Gzip Bütçesi)**
|
|
66
|
-
Soğuk metin sabitleri (`minStringLength >= 4`), derleme zamanında LZ77/Gzip sıkıştırılabilirliğini koruyan periyot-2 polimorfik bir XOR akış şifresiyle kodlanır. Modül başlangıcında enjekte edilen `const _uC` kasası metinleri tek seferde V8 `kConst` sabit dizi hücrelerine çözer ve XOR anahtarını çalışma zamanı bütünlük kalkanına bağlar. Sonraki tüm okumalar doğrudan dizi indeksleme ile O(1) sürede tamamlanır.
|
|
66
|
+
Soğuk metin sabitleri (`minStringLength >= 4`), derleme zamanında LZ77/Gzip sıkıştırılabilirliğini koruyan periyot-2 polimorfik bir XOR akış şifresiyle kodlanır. Modül başlangıcında enjekte edilen `const _uC` kasası metinleri tek seferde V8 `kConst` sabit dizi hücrelerine çözer ve XOR anahtarını hem çalışma zamanı bütünlük kalkanına (`String.prototype._u`) hem de çözücü fonksiyonun kendi biçimlendirme kontrolüne (`/\n/.test(f)`) ikili olarak bağlar. Sonraki tüm okumalar doğrudan dizi indeksleme ile O(1) sürede tamamlanır.
|
|
67
67
|
3. **Öz-Savunmalı `Function.prototype.toString()` Bütünlük Kontrolü ve Pasif Caydırıcı**
|
|
68
68
|
Bir analist korumalı bir dosyayı DevTools Pretty-Print (`{}`) ile biçimlendirdiğinde veya Sources panelinde bir koşulu değiştirdiğinde, biçimlendirilen kod `Function.prototype.toString()` çıktısını değiştirir. [`verifyCodeIntegrity`](packages/unpeek/src/runtime/index.ts), dokunulmamış küçültülmüş kodda sıfır yanlış pozitif oranıyla 32-bit FNV-1a özetini doğrular ve saldırganların doğrudan yamayabileceği ani bir çökme yerine kademeli durum bozulması (`deterrentMode: 'gradual'`) başlatır.
|
|
69
69
|
4. **Otomatik Source Map Kasası (`.unpeek-maps/`)**
|
|
@@ -105,7 +105,7 @@ npx unpeek protect
|
|
|
105
105
|
| `--seed <sayı>` | Deterministik 32-bit polimorfik derleme tohumu (seed) | Derleme başına rastgele |
|
|
106
106
|
| `--passive` | Kademeli bozulma yerine pasif telemetri caydırıcı modunu kullan | Varsayılan: kademeli bozulma (`gradual`) |
|
|
107
107
|
| `--no-maps` | `.map` dosyalarını `.unpeek-maps/` klasörüne taşımak yerine kalıcı olarak sil | `.unpeek-maps/` içine taşır |
|
|
108
|
-
| `--min-string-length <sayı>` |
|
|
108
|
+
| `--min-string-length <sayı>` | O(1) `kConst` şifreleme kasasına alınacak minimum metin uzunluğu | `4` |
|
|
109
109
|
| `--private-maps-dir <dizin>` | Kaynak haritalarının taşınacağı özel kasa klasörü | `.unpeek-maps` |
|
|
110
110
|
| `--no-shield` | Çalışma zamanı anti-tamper kalkanının enjekte edilmesini devre dışı bırak | Giriş paketlerine kalkan eklenir |
|
|
111
111
|
| `-h, --help` | Yardım iletisini göster | |
|