Sovereign 8s.is mirror of standardgalactic/wasm-slice
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| wasm_slice | ||
| .gitignore | ||
| LICENSE | ||
| main.py | ||
| README.md | ||
| setup.py | ||
wasm-slice
A tool for slicing WebAssembly binaries to generate multiple sub-binaries.
Installation
Dependencies
- Python 3.x
- wabt (
wasm-validaterequired)
# Ubuntu
sudo apt install wabt
Python Package
pip install -e .
Usage
python3 main.py -b <input.wasm> -o <output_dir> [options]
Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
-b |
✓ | - | Input wasm file path |
-o |
✓ | - | Output directory path |
-n |
10 |
Number of sub-binaries to generate | |
-cd |
3 |
Maximum call depth | |
-il |
2000 |
Maximum instruction length | |
-mt |
5 |
Maximum slicing retry count |
Example
python3 main.py -b ../filtered/aadd7a55c2a8edee34cc2a933e8330b1ad8b00d7b1598d074e90685ae725f0fb.wasm -o output
Generated files will be saved as module-0.wasm, module-1.wasm, ... in the output directory.