A fast, cross-platform CLI tool to unwrap Oracle PL/SQL 10g+ wrapped code.
Written in Rust — single binary, no runtime dependencies, works on macOS, Linux, and Windows.
Download the latest binary for your platform from the Releases page and place it in your PATH.
cargo install --path .Or build manually:
cargo build --release
cp target/release/unwrap /usr/local/bin/# Unwrap all .pkw and .plb files in a directory (recursive)
unwrap -i ./my_wrapped_files -p '\.(pkw|plb)$'
# Unwrap a single file
unwrap -i ./package.plb -p '\.plb$'
# Unwrap to a specific output directory
unwrap -i ./my_wrapped_files -p '\.(pkw|plb|pks)$' -o ./output| Option | Short | Description |
|---|---|---|
--input <PATH> |
-i |
Input file or directory path (required) |
--pattern <REGEX> |
-p |
Regex to match filenames (required) |
--output-dir <DIR> |
-o |
Output directory (default: same as input file) |
--help |
-h |
Print help |
--version |
-V |
Print version |
filename.ext → filename_unwrapped.ext
For example:
my_package.pkb→my_package_unwrapped.pkbutils.plb→utils_unwrapped.plb
Oracle 10g+ wraps PL/SQL source code using:
- Base64 encoding of the payload
- A 20-byte header (SHA-1 hash)
- A 256-byte substitution cipher
- zlib compression
This tool reverses the process:
- Extracts the base64 payload from the wrapped file
- Decodes base64
- Skips the 20-byte Oracle header
- Applies the reverse substitution cipher
- Decompresses with zlib
- Outputs clean
CREATE OR REPLACE ...PL/SQL source
Any Oracle wrapped file format, including:
.plb(PL/SQL body).pkb(package body).pks(package spec).pkw(wrapped package).fnc,.prc,.trg, etc.