-
-
Notifications
You must be signed in to change notification settings - Fork 0
pre commit
disrobe ships a pre-commit.com hook that scans staged files and fails the commit when a packed or protected artifact is detected. Use it to stop someone from accidentally (or maliciously) committing a UPX-packed binary, a PyArmor-protected module, a PyInstaller one-file build, or a SourceDefender/Nuitka/PyFreeze blob.
Add the hook to a consuming project's .pre-commit-config.yaml:
repos:
- repo: https://github.com/1-3-7/disrobe
rev: v0.10.0
hooks:
- id: disrobeThen install it:
pre-commit installThe hook requires the disrobe binary on PATH (install from the Releases page), or point it at an explicit path with the DISROBE_BIN environment variable. It also needs python3 available to parse the chain report.
For each staged file the hook runs disrobe auto <file> --json against a throwaway output directory and inspects the chain's chosen detector picks. By default it blocks only the high-precision packer/protector detectors, which key off unambiguous structural magic and do not false-positive on ordinary source:
| Detector pass | Blocks |
|---|---|
native.packer-unpack |
UPX, Petite, kkrunchy, and other native packers |
pyarmor.unpack |
PyArmor-protected Python |
pyinstaller.extract |
PyInstaller one-file / one-dir builds |
sourcedefender.decrypt |
SourceDefender-encrypted Python |
nuitka.extract |
Nuitka-compiled binaries |
pyfreeze.extract |
Frozen-Python blobs |
This is deliberately conservative: it blocks exactly the formats above, nothing more.
Two environment variables tune the gate:
| Variable | Default | Effect |
|---|---|---|
DISROBE_BIN |
disrobe |
Path to the disrobe binary. |
DISROBE_BLOCK_PASSES |
the six passes above | Comma-separated detector pass-ids to block. |
DISROBE_BLOCK_FAMILIES |
(empty) | Comma-separated detector families to additionally block. |
The family override is broader but noisier. disrobe's source-level obfuscation classifiers (js.deob, lua.deob, py.deob) are tuned to attempt recovery aggressively, so they can fire at high confidence on ordinary text and markdown. Enabling DISROBE_BLOCK_FAMILIES=obfuscator-wrapper,packer-archive will catch source-level obfuscation but expect false positives on benign files; scope it with the hook's files:/exclude: patterns.
repos:
- repo: https://github.com/1-3-7/disrobe
rev: v0.10.0
hooks:
- id: disrobe
files: '\.(exe|dll|so|dylib|pyc|pyz|bin)$'A legitimately-committed protected artifact can skip the hook for one commit:
SKIP=disrobe git commit -m "vendor signed third-party binary"The hook runs disrobe auto, which performs pure static analysis by default; it does not execute the staged file. See the forensics and malware-safety posture. The scan writes recovered artifacts only into a temporary directory that the hook deletes on exit; your working tree is never modified.
This wiki is generated from docs/src in the disrobe repository by scripts/wiki_sync.py. Edit the docs there, not the wiki pages here.
Getting started
Architecture
- Overview
- The five-rung IR ladder
- Passes and the capability model
- The chain runner
- The .dr envelope
- LLM sidecar and provenance
Reverse-engineering toolkit
Language and format guides
- Python
- JavaScript / TypeScript
- WebAssembly
- JVM and Android
- .NET / CIL
- Native (PE / ELF / Mach-O)
- Go
- Lua
- PHP
- Ruby
- BEAM (Erlang / Elixir)
- Swift / Objective-C
- ActionScript 3 / Flash
- Mobile (Hermes / Flutter)
- Python pickle
- Shell / PowerShell
- Containers and archives
Reference
- CLI overview
- Global flags
- Command reference
- Project configuration
- Batch directory processing
- Run reports
- Analysis-depth commands
- Diff and guard tooling
- The daemon: HTTP, gRPC, LSP, MCP
- Use it as a library
- Python bindings
- The browser playground
- Forensics and malware-safety posture
- Threat model
Integrations
Project