Skip to main content

js_deobfuscator/targets/
mod.rs

1//! Obfuscator-specific transforms.
2//!
3//! Each submodule targets a specific obfuscator or protection system.
4//! These are opt-in transforms selected by the user or auto-detected.
5//!
6//! ## Available Targets
7//!
8//! | Target | Patterns |
9//! |--------|----------|
10//! | `obfuscator_io` | String array + rotation, control flow flattening |
11//!
12//! ## Usage
13//!
14//! ```ignore
15//! JSDeobfuscator::new()
16//!     .target(Target::ObfuscatorIO)
17//!     .deobfuscate(source)
18//! ```
19
20pub mod obfuscator_io;
21
22/// Known obfuscation targets.
23#[derive(Debug, Clone, Copy, PartialEq, Eq)]
24pub enum Target {
25    /// obfuscator.io / javascript-obfuscator
26    ObfuscatorIO,
27    // Future:
28    // Shape,
29    // Kasada,
30    // DataDome,
31}
32
33impl Target {
34    /// Get all modules for this target (as locked modules).
35    pub fn modules(&self) -> Vec<Box<dyn crate::engine::module::Module>> {
36        match self {
37            Target::ObfuscatorIO => vec![
38                Box::new(obfuscator_io::StringArrayDecoder::default()),
39            ],
40        }
41    }
42}