Frida Engine

5 cooperative dump strategies (including FART-style ClassLinker::DefineClass) paired with 7 unified pre-resume anti-detection bypasses, jailed-Gadget USB detection, and safe output filename sanitization.

5 种协同脱壳策略(含 FART 风格 ClassLinker::DefineClass 类注册挂钩)+ 7 项 resume 前同步生效的统一反检测绕过,具备越狱/Gadget USB 预检与安全文件名清洗。

5 STRATEGIES · 7 ANTI-DETECT
USB Preflight → Spawn → 7 Anti-Detect (Pre-Resume) → Resume → 5 Strategies (S1–S5) → Sanitized Save → 10-Step Repair
1. Device Preflight & Suspended Spawn query_system_parameters() rejects jailed Gadget-only USB → frida.spawn() → attach(pid) 2. Unified Anti-Detection Module (7 Bypasses · Synchronous Pre-Resume IIFE) 1. /proc/self/maps filter 2. sigaction watchdog 3. prctl thread rename 4. port 27042 hide 5. TracerPid = 0 6. ClassLoader frida hide 7. gettimeofday timing disable: --no-anti-detect 3. device.resume(pid) All hooks live before packer anti-Frida thread initializes S1: Mem Scan enumerateRanges('r--') DEX magic search file_size & header 0x70 endian + string_ids Polls every 2s S2: ART Hook libart.so exports: DexFile::OpenCommon DexFile::OpenMemory captures base & size Fires on DEX load S3: ClassLoader enumerateClassLoaders pathList.dexElements dexFile.mCookie extract native ptr Final sweep S4: SO Dump hook dlopen() android_dlopen_ext() skip system libs save decrypted .so output_dir/so/ S5: DefineClass ClassLinker::DefineClass FART-style ART hook deref DexFile.begin_ captures post-decrypt FART Hook Point 5. on_message Collector + Safe Filename Sanitization utils/fs.py sanitize_filename() prevents path traversal → output_dir/classes_*.dex & so/ 6. Streaming SHA-256 Dedup + 10-Step DEX Repair CDEX → Magic → Size → Sections → Truncation → Map → Align → Debug → NOP → SHA1/Adler32 7. Quality & Coverage Report classes | methods | coverage% | NOP count | audit score

5 Cooperative Strategies5 种协同脱壳策略

  • S1: Polling memory scan with strict DEX header validation轮询内存扫描 + 严格 DEX 头部校验
  • S2: DexFile::OpenCommon / OpenMemory hooks加载挂钩
  • S3: ClassLoader mCookie native pointer sweepClassLoader mCookie 指针遍历
  • S4: dlopen / android_dlopen_ext decrypted SO dump解密 SO 同步提取
  • S5: art::ClassLinker::DefineClass (FART-style class registration capture)(FART 风格类注册精准捕获)

7 Unified Anti-Detect Hooks7 项统一反检测绕过

  • 1. /proc/self/maps filtering • 2. sigaction watchdog blocking1. /proc/self/maps 过滤 • 2. sigaction 看门狗信号拦截
  • 3. prctl(PR_SET_NAME) thread masquerade • 4. Port 27042 hiding3. prctl 线程名伪装 • 4. 27042 端口扫描隐藏
  • 5. TracerPid=0 spoof • 6. Frida class hiding • 7. gettimeofday timing5. TracerPid=0 伪造 • 6. Frida 类名隐藏 • 7. 时间差检测缓解
  • Shared across Frida Engine & Active Invocation (disable with --no-anti-detect)Frida 引擎与主动调用共用同一实现(可通过 --no-anti-detect 关闭)

Hardening & Usage安全加固与使用

  • Rejects jailed Gadget-only USB devices during is_available() preflightis_available() 自动识别并排除仅 Gadget 的非越狱 USB 设备
  • Sanitizes JS payload tags & SO names to block path traversal对 JS 回传的标签与 SO 文件名执行路径穿越清洗
  • unpack dump app.apk -e frida [--no-anti-detect]