Community
Contributing
Contribute to Shell[SNIP] — style, testing, and adding snippets.
Contributing
ShellSNIP follows the Google Python Style Guide (see docs/contribute/code_rules.md).
Code style
- Use
importfor modules andfrom x import yfor names. - Keep public methods documented with NumPy-style docstrings, matching the existing
app/modules. - Run
pylintbefore submitting; suppress false positives inline with a short comment explaining why.
Running tests
The test suite is a standard unittest/pytest project (see tests/test_00_managers.py).
poetry run pytest
# or
python3 -m pytest
The tests cover recipe loading (win/posix, exec/dlexec/connect/inject), helper correctness (e.g. api_hash ROR13 values matched against known references), template rendering, and the helper whitelist guard.
Adding a recipe or snippet
- Recipes live in
templates/recipes/{os}_{arch}/<name>.asmand are the top-level entry points a user invokes. - Snippets live in
templates/snippets/{os}_{arch}/<name>.asmand are the reusable building blocks referenced via[[SNIPPET_NAME]]. - Snippet names are matched case-insensitively against the file basename (no extension); a
calc.asmsnippet is referenced as[[CALC]]. - Keep nesting under 10 levels (
TemplateManager.MAX_RESOLVE_DEPTH). - Any helper you reference inside a snippet must be in
TemplateManager.ALLOWED_HELPERS— otherwise the template engine raisesValueError.
Adding an encoder
Subclass AbstractEncoder (see Encoders API) and register it in app/encoders/__init__.py so it is auto-loaded alongside xor and chunk.