You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+22-8Lines changed: 22 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,23 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project
6
6
7
-
Python port of PlutoLLVM obfuscation passes using llvm-nanobind bindings. Six passes transform LLVM IR to obfuscate code: Substitution, MBA Obfuscation, Bogus Control Flow, Flattening, Global Encryption, and Indirect Call.
7
+
Python port of Pluto, Polaris, and VMwhere LLVM obfuscation passes using llvm-nanobind bindings. Passes transform LLVM IR to obfuscate code. See README.md for the full pass list.
8
8
9
9
## Commands
10
10
11
+
**Always use `uv` to run tests** — never use the system Python directly. The system Python may have a different llvm-nanobind build with incompatible API (e.g. `is_terminator` vs `is_terminator_inst`). Only `uv run` uses the correct project venv.
12
+
13
+
llvm-nanobind requires LLVM dev headers to build. Set `CMAKE_PREFIX_PATH` to your LLVM installation if `uv sync` fails to find LLVM (CI does this automatically).
14
+
11
15
```bash
12
-
# Run all tests
13
-
python -m uv run pytest tests/ -v
16
+
# Run all tests (always use this form)
17
+
CMAKE_PREFIX_PATH="C:\llvm\clang+llvm-21.1.0-x86_64-pc-windows-msvc"python -m uv run pytest tests/ -v
14
18
15
19
# Run a single test file
16
-
python -m uv run pytest tests/test_substitution.py -v
20
+
CMAKE_PREFIX_PATH="C:\llvm\clang+llvm-21.1.0-x86_64-pc-windows-msvc"python -m uv run pytest tests/test_substitution.py -v
17
21
18
22
# Run a single test by name
19
-
python -m uv run pytest tests/test_substitution.py -k "test_add_substitution" -v
23
+
CMAKE_PREFIX_PATH="C:\llvm\clang+llvm-21.1.0-x86_64-pc-windows-msvc"python -m uv run pytest tests/test_substitution.py -k "test_add_substitution" -v
-**`crypto.py`** — `CryptoRandom`: wraps `secrets` (production) or `random.Random(seed)` (testing). All passes accept an `rng` parameter for determinism.
51
55
-**`mba.py`** — Z3-based MBA coefficient generation with result caching. Generates linear (15 truth tables) and univariate polynomial expressions.
52
-
-**`ir_helpers.py`** — PHI/register demotion to stack (`demote_phi_to_stack`, `demote_regs_to_stack`), used by Flattening pass.
-**Keep README.md up to date.** When adding new passes, changing pass behavior, or making other significant changes, update the README pass tables, usage examples, and any other affected sections. The README is the public-facing documentation and must accurately reflect the current state of the project.
71
+
72
+
## Testing Policy
73
+
74
+
-**All tests pass on CI. There are no pre-existing test failures.** If tests fail after your changes, your changes broke them — investigate and fix. Never assume failures are pre-existing.
75
+
-**Always run tests via `uv run`**, not the system Python. The system Python has a different llvm-nanobind with incompatible API names.
76
+
- Test helper imports use `from conftest import ...` (not `from tests.conftest import ...`).
77
+
64
78
## llvm-nanobind API Pitfalls
65
79
66
80
-`ctx.types.ptr`, `ctx.types.i32`, `ctx.types.void` are **properties** (not methods)
Copy file name to clipboardExpand all lines: README.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Shifting Codes
2
2
3
-
Python port of [Pluto](https://github.com/bluesadi/Pluto) and [Polaris](https://github.com/za233/Polaris-Obfuscator/) LLVM obfuscation passes using [llvm-nanobind](https://github.com/LLVMParty/llvm-nanobind) bindings, with a PyQt6 visualization UI.
3
+
Python port of [Pluto](https://github.com/bluesadi/Pluto), [Polaris](https://github.com/za233/Polaris-Obfuscator/), and [VMwhere](https://github.com/MrRoy09/VMwhere) LLVM obfuscation passes using [llvm-nanobind](https://github.com/LLVMParty/llvm-nanobind) bindings, with a PyQt6 visualization UI.
4
4
5
5

6
6
@@ -32,6 +32,13 @@ Upgraded versions of four Pluto passes plus four new passes:
0 commit comments