rikune 2.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. rikune-2.3.3/.github/workflows/ci.yml +76 -0
  2. rikune-2.3.3/.github/workflows/release.yml +239 -0
  3. rikune-2.3.3/.gitignore +23 -0
  4. rikune-2.3.3/CHANGELOG.md +123 -0
  5. rikune-2.3.3/DISCLOSURE +30 -0
  6. rikune-2.3.3/LICENSE +21 -0
  7. rikune-2.3.3/PKG-INFO +314 -0
  8. rikune-2.3.3/README.md +269 -0
  9. rikune-2.3.3/README_zh.md +266 -0
  10. rikune-2.3.3/SECURITY.md +135 -0
  11. rikune-2.3.3/SKILL.md +67 -0
  12. rikune-2.3.3/benchmarks/ab_harness_eval.py +587 -0
  13. rikune-2.3.3/benchmarks/agent_eval.py +228 -0
  14. rikune-2.3.3/benchmarks/cases/api_hash_bench.c +44 -0
  15. rikune-2.3.3/benchmarks/cases/crypto_anchor_bench.c +56 -0
  16. rikune-2.3.3/benchmarks/cases/patch_v1.c +26 -0
  17. rikune-2.3.3/benchmarks/cases/patch_v2.c +35 -0
  18. rikune-2.3.3/benchmarks/cases/stage2_loader.c +33 -0
  19. rikune-2.3.3/benchmarks/cases/xor_decryptor.c +46 -0
  20. rikune-2.3.3/benchmarks/runner.py +597 -0
  21. rikune-2.3.3/bridges/README.md +269 -0
  22. rikune-2.3.3/bridges/frida_rikune_bridge.py +956 -0
  23. rikune-2.3.3/bridges/ghidra_rikune_bridge.py +823 -0
  24. rikune-2.3.3/bridges/ida_rikune_bridge.py +807 -0
  25. rikune-2.3.3/docker/Dockerfile.core +70 -0
  26. rikune-2.3.3/docker/Dockerfile.full +79 -0
  27. rikune-2.3.3/docs/ARCHITECTURE.md +75 -0
  28. rikune-2.3.3/pyproject.toml +96 -0
  29. rikune-2.3.3/rules/default.yar +54 -0
  30. rikune-2.3.3/rules/malware_families.yar +93 -0
  31. rikune-2.3.3/rules/packers.yar +80 -0
  32. rikune-2.3.3/src/rikune/__init__.py +7 -0
  33. rikune-2.3.3/src/rikune/backends/__init__.py +14 -0
  34. rikune-2.3.3/src/rikune/backends/base.py +92 -0
  35. rikune-2.3.3/src/rikune/backends/bridge.py +702 -0
  36. rikune-2.3.3/src/rikune/backends/fast_native.py +436 -0
  37. rikune-2.3.3/src/rikune/backends/ghidra.py +297 -0
  38. rikune-2.3.3/src/rikune/backends/ghidra_scripts/AnalyzeCrossReferences.java +644 -0
  39. rikune-2.3.3/src/rikune/backends/ghidra_scripts/DecompileFunction.java +487 -0
  40. rikune-2.3.3/src/rikune/backends/ghidra_scripts/ExtractCFG.java +256 -0
  41. rikune-2.3.3/src/rikune/backends/ghidra_scripts/ExtractFunctions.java +442 -0
  42. rikune-2.3.3/src/rikune/backends/ghidra_scripts/SearchFunctionReferences.java +380 -0
  43. rikune-2.3.3/src/rikune/backends/rizin.py +799 -0
  44. rikune-2.3.3/src/rikune/cli.py +1043 -0
  45. rikune-2.3.3/src/rikune/config.py +91 -0
  46. rikune-2.3.3/src/rikune/core/__init__.py +8 -0
  47. rikune-2.3.3/src/rikune/core/guard.py +306 -0
  48. rikune-2.3.3/src/rikune/core/jobs.py +66 -0
  49. rikune-2.3.3/src/rikune/core/models.py +305 -0
  50. rikune-2.3.3/src/rikune/core/store.py +509 -0
  51. rikune-2.3.3/src/rikune/core/workspace.py +179 -0
  52. rikune-2.3.3/src/rikune/engine.py +1504 -0
  53. rikune-2.3.3/src/rikune/graph/__init__.py +36 -0
  54. rikune-2.3.3/src/rikune/graph/export.py +539 -0
  55. rikune-2.3.3/src/rikune/graph/lifter.py +1000 -0
  56. rikune-2.3.3/src/rikune/graph/overlay.py +127 -0
  57. rikune-2.3.3/src/rikune/graph/slicer.py +1303 -0
  58. rikune-2.3.3/src/rikune/mcp_server.py +1022 -0
  59. rikune-2.3.3/src/rikune/static/__init__.py +94 -0
  60. rikune-2.3.3/src/rikune/static/axml.py +518 -0
  61. rikune-2.3.3/src/rikune/static/crypto_ops.py +502 -0
  62. rikune-2.3.3/src/rikune/static/crypto_scan.py +1044 -0
  63. rikune-2.3.3/src/rikune/static/dex_disasm.py +1063 -0
  64. rikune-2.3.3/src/rikune/static/disasm.py +422 -0
  65. rikune-2.3.3/src/rikune/static/dotnet_il.py +904 -0
  66. rikune-2.3.3/src/rikune/static/firmware.py +188 -0
  67. rikune-2.3.3/src/rikune/static/formats.py +532 -0
  68. rikune-2.3.3/src/rikune/static/heuristics.py +469 -0
  69. rikune-2.3.3/src/rikune/static/js_deobf.py +2473 -0
  70. rikune-2.3.3/src/rikune/static/lang_symbols.py +770 -0
  71. rikune-2.3.3/src/rikune/static/managed.py +653 -0
  72. rikune-2.3.3/src/rikune/static/memory.py +234 -0
  73. rikune-2.3.3/src/rikune/static/patcher.py +317 -0
  74. rikune-2.3.3/src/rikune/static/pattern.py +929 -0
  75. rikune-2.3.3/src/rikune/static/protocol.py +916 -0
  76. rikune-2.3.3/src/rikune/static/rtti.py +988 -0
  77. rikune-2.3.3/src/rikune/static/strings.py +115 -0
  78. rikune-2.3.3/src/rikune/static/unpacker.py +303 -0
  79. rikune-2.3.3/src/rikune/static/wasm_parser.py +386 -0
  80. rikune-2.3.3/src/rikune/static/yara_scanner.py +77 -0
  81. rikune-2.3.3/src/rikune/verify/__init__.py +60 -0
  82. rikune-2.3.3/src/rikune/verify/api_hash.py +862 -0
  83. rikune-2.3.3/src/rikune/verify/batch_decrypt.py +1172 -0
  84. rikune-2.3.3/src/rikune/verify/data/api_names.txt +575 -0
  85. rikune-2.3.3/src/rikune/verify/peb.py +1284 -0
  86. rikune-2.3.3/src/rikune/verify/stubs.py +1216 -0
  87. rikune-2.3.3/src/rikune/verify/symbolic.py +363 -0
  88. rikune-2.3.3/src/rikune/verify/syscall.py +384 -0
  89. rikune-2.3.3/src/rikune/verify/trace.py +803 -0
  90. rikune-2.3.3/src/rikune/verify/unicorn_emu.py +1827 -0
  91. rikune-2.3.3/tests/conftest.py +33 -0
  92. rikune-2.3.3/tests/fixtures/crackmes/complex_crackme.c +168 -0
  93. rikune-2.3.3/tests/test_anchor_slicing.py +405 -0
  94. rikune-2.3.3/tests/test_api_hash.py +400 -0
  95. rikune-2.3.3/tests/test_batch_decrypt.py +468 -0
  96. rikune-2.3.3/tests/test_bridge.py +575 -0
  97. rikune-2.3.3/tests/test_byte_diff_and_z3.py +287 -0
  98. rikune-2.3.3/tests/test_cache.py +355 -0
  99. rikune-2.3.3/tests/test_cli_and_mcp.py +134 -0
  100. rikune-2.3.3/tests/test_core.py +75 -0
  101. rikune-2.3.3/tests/test_crypto_scan.py +299 -0
  102. rikune-2.3.3/tests/test_crypto_slicing.py +422 -0
  103. rikune-2.3.3/tests/test_export.py +450 -0
  104. rikune-2.3.3/tests/test_graph_overlay.py +79 -0
  105. rikune-2.3.3/tests/test_iat_slicing_and_decompile_kind.py +731 -0
  106. rikune-2.3.3/tests/test_ide_bridges.py +488 -0
  107. rikune-2.3.3/tests/test_lang_symbols.py +460 -0
  108. rikune-2.3.3/tests/test_m17_backend_and_hash.py +527 -0
  109. rikune-2.3.3/tests/test_m17_hooks_and_iat.py +436 -0
  110. rikune-2.3.3/tests/test_m17_ring3_win64.py +559 -0
  111. rikune-2.3.3/tests/test_m17_static_polish.py +342 -0
  112. rikune-2.3.3/tests/test_m18_final_wave.py +216 -0
  113. rikune-2.3.3/tests/test_m19_benchmark_hardening.py +180 -0
  114. rikune-2.3.3/tests/test_m20_cross_arch_fast_firmware.py +233 -0
  115. rikune-2.3.3/tests/test_m22_crypto_and_filters.py +122 -0
  116. rikune-2.3.3/tests/test_managed.py +427 -0
  117. rikune-2.3.3/tests/test_mcp_ux.py +169 -0
  118. rikune-2.3.3/tests/test_memory_and_disasm.py +408 -0
  119. rikune-2.3.3/tests/test_patcher.py +435 -0
  120. rikune-2.3.3/tests/test_pattern_carve.py +481 -0
  121. rikune-2.3.3/tests/test_pe_hardening.py +334 -0
  122. rikune-2.3.3/tests/test_peb_exports_and_dump.py +659 -0
  123. rikune-2.3.3/tests/test_peb_stubs.py +686 -0
  124. rikune-2.3.3/tests/test_security_and_types.py +432 -0
  125. rikune-2.3.3/tests/test_smc_oep.py +242 -0
  126. rikune-2.3.3/tests/test_static.py +58 -0
  127. rikune-2.3.3/tests/test_stubs.py +572 -0
  128. rikune-2.3.3/tests/test_symbolic.py +576 -0
  129. rikune-2.3.3/tests/test_trace.py +441 -0
  130. rikune-2.3.3/tests/test_unicorn_hardening.py +517 -0
  131. rikune-2.3.3/tests/test_unpacker.py +330 -0
  132. rikune-2.3.3/tests/test_v201_exam_fixes.py +155 -0
  133. rikune-2.3.3/tests/test_verify.py +110 -0
  134. rikune-2.3.3/tests/test_wasm_and_safety.py +392 -0
  135. rikune-2.3.3/tests/test_wave_a_lifter_rtti.py +804 -0
  136. rikune-2.3.3/tests/test_wave_b_mobile_dotnet.py +890 -0
  137. rikune-2.3.3/tests/test_wave_c_js_deobf.py +239 -0
  138. rikune-2.3.3/tests/test_wave_d_protocol_bridge.py +578 -0
  139. rikune-2.3.3/tests/test_wave_e_integration.py +67 -0
  140. rikune-2.3.3/uv.lock +1918 -0
@@ -0,0 +1,76 @@
1
+ name: Rikune v2 CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, v2]
6
+ pull_request:
7
+ branches: [main, v2]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test (${{ matrix.os }})
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest, macos-latest]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v5
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Install Rizin & UPX (Ubuntu)
27
+ if: runner.os == 'Linux'
28
+ run: |
29
+ sudo apt-get update
30
+ sudo apt-get install -y build-essential curl xz-utils
31
+ curl -fsSL https://github.com/rizinorg/rizin/releases/download/v0.9.1/rizin-v0.9.1-static-x86_64.tar.xz -o /tmp/rizin.tar.xz
32
+ sudo mkdir -p /opt/rizin && sudo tar -xf /tmp/rizin.tar.xz -C /opt/rizin
33
+ echo "/opt/rizin/bin" >> "$GITHUB_PATH"
34
+ curl -fsSL https://github.com/upx/upx/releases/download/v5.3.1/upx-5.3.1-amd64_linux.tar.xz -o /tmp/upx.tar.xz
35
+ tar -xf /tmp/upx.tar.xz -C /tmp
36
+ sudo install -m 0755 /tmp/upx-5.3.1-amd64_linux/upx /usr/local/bin/upx
37
+
38
+ - name: Install Rizin (macOS)
39
+ if: runner.os == 'macOS'
40
+ run: brew install rizin
41
+
42
+ - name: Sync dependencies
43
+ run: uv sync --python 3.12 --extra dev
44
+
45
+ - name: Lint (ruff)
46
+ run: uv run ruff check src tests benchmarks bridges
47
+
48
+ - name: Typecheck (mypy)
49
+ run: uv run mypy src
50
+
51
+ - name: Unit & E2E Tests (pytest)
52
+ run: uv run pytest -v
53
+
54
+ - name: Run Verified RE Benchmark Suite
55
+ run: |
56
+ uv run python benchmarks/runner.py --json
57
+ uv run python benchmarks/agent_eval.py --self-test
58
+
59
+ - name: Build Wheel & Sdist
60
+ run: uv build
61
+
62
+ docker:
63
+ name: Docker Core Build Check
64
+ runs-on: ubuntu-latest
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+ - uses: docker/setup-buildx-action@v3
68
+ - name: Build core image
69
+ uses: docker/build-push-action@v6
70
+ with:
71
+ context: .
72
+ file: docker/Dockerfile.core
73
+ load: true
74
+ tags: rikune:core-ci
75
+ - name: Smoke-test container status
76
+ run: docker run --rm rikune:core-ci status --json
@@ -0,0 +1,239 @@
1
+ name: Release & Package (v2)
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: "Release tag (e.g. v2.0.0)"
11
+ required: true
12
+ type: string
13
+
14
+ permissions:
15
+ contents: write
16
+ packages: write
17
+ id-token: write
18
+
19
+ jobs:
20
+ verify:
21
+ name: Verify (Lint, Typecheck, Tests & 10 Benchmarks)
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v5
28
+ with:
29
+ python-version: "3.12"
30
+
31
+ - name: Install Rizin & UPX
32
+ run: |
33
+ sudo apt-get update
34
+ sudo apt-get install -y build-essential curl xz-utils
35
+ curl -fsSL https://github.com/rizinorg/rizin/releases/download/v0.9.1/rizin-v0.9.1-static-x86_64.tar.xz -o /tmp/rizin.tar.xz
36
+ sudo mkdir -p /opt/rizin && sudo tar -xf /tmp/rizin.tar.xz -C /opt/rizin
37
+ echo "/opt/rizin/bin" >> "$GITHUB_PATH"
38
+ curl -fsSL https://github.com/upx/upx/releases/download/v5.3.1/upx-5.3.1-amd64_linux.tar.xz -o /tmp/upx.tar.xz
39
+ tar -xf /tmp/upx.tar.xz -C /tmp
40
+ sudo install -m 0755 /tmp/upx-5.3.1-amd64_linux/upx /usr/local/bin/upx
41
+
42
+ - name: Sync & Validate
43
+ run: |
44
+ uv sync --python 3.12 --extra dev
45
+ uv run ruff check src tests benchmarks bridges
46
+ uv run mypy src
47
+ uv run pytest -v
48
+ uv run python benchmarks/runner.py --json
49
+ uv run python benchmarks/agent_eval.py --self-test
50
+
51
+ build-packages:
52
+ name: Build Wheel & Sdist
53
+ needs: verify
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+
58
+ - name: Install uv
59
+ uses: astral-sh/setup-uv@v5
60
+ with:
61
+ python-version: "3.12"
62
+
63
+ - name: Build distributions
64
+ run: |
65
+ uv build
66
+ cd dist && sha256sum *.whl *.tar.gz > SHA256SUMS.txt
67
+ cat SHA256SUMS.txt
68
+
69
+ - name: Smoke-test installed wheel in clean venv
70
+ run: |
71
+ python3 -m venv /tmp/wheel-smoke
72
+ /tmp/wheel-smoke/bin/pip install --no-cache-dir dist/*.whl
73
+ /tmp/wheel-smoke/bin/rikune status --json
74
+
75
+ - uses: actions/upload-artifact@v4
76
+ with:
77
+ name: dist-packages
78
+ path: dist/
79
+
80
+ standalone-binaries:
81
+ name: Build Standalone Single-File Binary (${{ matrix.label }})
82
+ needs: verify
83
+ strategy:
84
+ fail-fast: false
85
+ matrix:
86
+ include:
87
+ - os: ubuntu-latest
88
+ label: linux-x86_64
89
+ bin_name: rikune-linux-x86_64
90
+ asset: rikune-linux-x86_64
91
+ - os: macos-latest
92
+ label: macos-arm64
93
+ bin_name: rikune-macos-arm64
94
+ asset: rikune-macos-arm64
95
+ - os: windows-latest
96
+ label: windows-x86_64
97
+ bin_name: rikune-windows-x86_64
98
+ asset: rikune-windows-x86_64.exe
99
+ runs-on: ${{ matrix.os }}
100
+ steps:
101
+ - uses: actions/checkout@v4
102
+
103
+ - name: Install uv
104
+ uses: astral-sh/setup-uv@v5
105
+ with:
106
+ python-version: "3.12"
107
+
108
+ - name: Build single-file executable (zero-venv user UX)
109
+ shell: bash
110
+ run: |
111
+ uv sync --python 3.12
112
+ uv run --with pyinstaller pyinstaller \
113
+ --onefile \
114
+ --name "${{ matrix.bin_name }}" \
115
+ --collect-data rikune \
116
+ --collect-all unicorn \
117
+ --collect-all capstone \
118
+ --collect-all yara_x \
119
+ --collect-all lief \
120
+ --collect-all mcp \
121
+ --collect-all rich \
122
+ src/rikune/cli.py
123
+ ls -lh dist/
124
+
125
+ - name: Smoke-test standalone executable
126
+ shell: bash
127
+ run: |
128
+ if [ "${{ matrix.label }}" = "windows-x86_64" ]; then
129
+ ./dist/${{ matrix.asset }} status --json
130
+ else
131
+ chmod +x ./dist/${{ matrix.asset }}
132
+ ./dist/${{ matrix.asset }} status --json
133
+ fi
134
+
135
+ - uses: actions/upload-artifact@v4
136
+ with:
137
+ name: standalone-${{ matrix.label }}
138
+ path: dist/${{ matrix.asset }}
139
+
140
+ github-release:
141
+ name: Publish GitHub Release
142
+ needs: [build-packages, standalone-binaries]
143
+ runs-on: ubuntu-latest
144
+ steps:
145
+ - uses: actions/checkout@v4
146
+
147
+ - uses: actions/download-artifact@v4
148
+ with:
149
+ name: dist-packages
150
+ path: dist/
151
+
152
+ - uses: actions/download-artifact@v4
153
+ with:
154
+ pattern: standalone-*
155
+ path: dist/
156
+ merge-multiple: true
157
+
158
+ - name: Refresh SHA256SUMS & publish release assets
159
+ env:
160
+ GH_TOKEN: ${{ github.token }}
161
+ run: |
162
+ cd dist
163
+ rm -f SHA256SUMS.txt
164
+ sha256sum *.whl *.tar.gz rikune-linux-* rikune-macos-* rikune-windows-* > SHA256SUMS.txt
165
+ cat SHA256SUMS.txt
166
+ cd ..
167
+ TAG="${GITHUB_REF_NAME}"
168
+ if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
169
+ TAG="${{ inputs.tag }}"
170
+ fi
171
+ ASSETS=(dist/*.whl dist/*.tar.gz dist/rikune-linux-* dist/rikune-macos-* dist/rikune-windows-* dist/SHA256SUMS.txt)
172
+ if gh release view "${TAG}" >/dev/null 2>&1; then
173
+ gh release upload "${TAG}" "${ASSETS[@]}" --clobber
174
+ else
175
+ gh release create "${TAG}" \
176
+ "${ASSETS[@]}" \
177
+ --title "Rikune ${TAG}" \
178
+ --notes-file CHANGELOG.md \
179
+ --generate-notes
180
+ fi
181
+
182
+ docker-ghcr:
183
+ name: Build & Push Docker Image (GHCR)
184
+ needs: verify
185
+ runs-on: ubuntu-latest
186
+ steps:
187
+ - uses: actions/checkout@v4
188
+
189
+ - uses: docker/setup-buildx-action@v3
190
+
191
+ - name: Log in to GitHub Container Registry
192
+ uses: docker/login-action@v3
193
+ with:
194
+ registry: ghcr.io
195
+ username: ${{ github.actor }}
196
+ password: ${{ secrets.GITHUB_TOKEN }}
197
+
198
+ - name: Extract Docker metadata
199
+ id: meta
200
+ uses: docker/metadata-action@v5
201
+ with:
202
+ images: ghcr.io/${{ github.repository }}
203
+ tags: |
204
+ type=semver,pattern={{version}}
205
+ type=semver,pattern={{major}}.{{minor}}
206
+ type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
207
+
208
+ - name: Build and push core image
209
+ uses: docker/build-push-action@v6
210
+ with:
211
+ context: .
212
+ file: docker/Dockerfile.core
213
+ platforms: linux/amd64
214
+ push: true
215
+ tags: ${{ steps.meta.outputs.tags }}
216
+ labels: ${{ steps.meta.outputs.labels }}
217
+ cache-from: type=gha
218
+ cache-to: type=gha,mode=max
219
+
220
+ pypi:
221
+ name: Publish to PyPI (OIDC, optional)
222
+ needs: build-packages
223
+ if: startsWith(github.ref, 'refs/tags/v') && vars.ENABLE_PYPI_PUBLISH == 'true'
224
+ runs-on: ubuntu-latest
225
+ environment:
226
+ name: pypi
227
+ url: https://pypi.org/p/rikune
228
+ steps:
229
+ - uses: actions/download-artifact@v4
230
+ with:
231
+ name: dist-packages
232
+ path: dist/
233
+
234
+ - name: Remove non-distribution checksum file before PyPI upload
235
+ run: rm -f dist/SHA256SUMS.txt
236
+
237
+ - uses: pypa/gh-action-pypi-publish@release/v1
238
+ with:
239
+ packages-dir: dist/
@@ -0,0 +1,23 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ .venv/
6
+ .pytest_cache/
7
+ .mypy_cache/
8
+ .ruff_cache/
9
+ dist/
10
+ build/
11
+ *.egg-info/
12
+
13
+ # Rikune local runtime data
14
+ .rikune/
15
+ *.sqlite
16
+ *.sqlite-wal
17
+ *.sqlite-shm
18
+
19
+ # OS / Editor
20
+ .DS_Store
21
+ .vscode/
22
+ .idea/
23
+ *.swp
@@ -0,0 +1,123 @@
1
+ # Changelog
2
+
3
+ ## 2.3.3 — Official PyPI OIDC Trusted Publishing Release
4
+
5
+ - **PyPI Publish CI (`.github/workflows/release.yml`)**: Strip `dist/SHA256SUMS.txt` before `pypa/gh-action-pypi-publish` so `rikune` publishes cleanly to official PyPI (`uvx rikune` / `uv tool install rikune` / `pip install rikune`).
6
+
7
+ ## 2.3.2 — Release Asset Deduplication & PyPI Metadata Polish
8
+
9
+ - **GitHub Release CI (`.github/workflows/release.yml`)**: Deduplicate release asset globs (`rikune-linux-*`, `rikune-macos-*`, `rikune-windows-*`) so wheel/sdist are never uploaded twice alongside standalone binaries.
10
+ - **PyPI Metadata (`pyproject.toml`)**: Add PyPI trove classifiers and `[project.urls]` (`Homepage`, `Repository`, `Issues`, `Changelog`) ready for official PyPI Trusted Publishing.
11
+
12
+ ## 2.3.1 — Standalone Single-File Binary Packaging Fix (`--collect-data rikune`)
13
+
14
+ - **PyInstaller Standalone Packaging (`.github/workflows/release.yml`)**: Include `--collect-data rikune` (so `rikune/verify/data/api_names.txt` is bundled into single-file executables) and normalize Windows `--name` without double `.exe` suffix.
15
+
16
+ ## 2.3.0 — Business, Software, Mobile, Protocol & Frontend JS RE (Zero-Venv, Single-Binary Releases)
17
+
18
+ Zero new mandatory dependencies — every new core capability runs in-process in pure Python, plus automated single-file executable builds for Linux, macOS, and Windows:
19
+
20
+ - **Wave A — Software & Business Logic RE (`graph/lifter.py`, `static/rtti.py`, `static/heuristics.py`)**:
21
+ - Added zero-dep structured CFG pseudocode lifter (`decompile --lift` / `function_decompile(lift=True)`) lifting x86/ARM64 `cmp`/`test`/`cbz` predicates, inlining short leaf branches, resolving annotations/calls/strings, and highlighting duplicate-branch control-flow anomalies.
22
+ - Added pure-Python C++ RTTI & vtable recovery for Itanium ABI (ELF/Mach-O `_ZTV`/`_ZTI`) and MSVC PE (x64/x86 `TypeDescriptor` + `CompleteObjectLocator` + vtable method pointers), surfaced automatically in `static_triage`.
23
+ - **Wave B — Mobile (Android APK/AXML/DEX) & .NET CIL RE (`static/axml.py`, `static/dex_disasm.py`, `static/dotnet_il.py`, CLI `rikune managed`, MCP `managed_inspect`)**:
24
+ - Zero-JDK binary `AndroidManifest.xml` (AXML) decoder (UTF-8/UTF-16LE string pools, permissions, exported components, deep links).
25
+ - Pure-Python Dalvik DEX method indexer & bytecode disassembler with inline `const-string`, field, and `invoke-*` method resolution, plus APK `lib/*.so` lineage derivation for Unicorn ARM64 JNI emulation.
26
+ - Pure-Python .NET `MethodDef` & Tiny/Fat CIL/MSIL disassembler with `#US` user-string and `MemberRef` token resolution.
27
+ - **Wave C — Frontend JavaScript & Mini-Program Deobfuscation (`static/js_deobf.py`, CLI `rikune js-deobf`, MCP `js_deobfuscate`)**:
28
+ - Safe offline pure-Python deobfuscator (zero Node.js, zero `eval`): lexical-safe beautifier, `\xNN`/`\uNNNN`/`\u{...}` unescaping, constant folding, bracket-to-dot normalization, static `obfuscator.io` string-array/rotation/Base64 decoding, business signal extraction (endpoints, headers, crypto/key/IV candidates), and `--derive` lineage support.
29
+ - **Wave D — Binary Wire Protocols & Optional Runtime Bridge (`static/protocol.py`, `bridges/frida_rikune_bridge.py`, CLI `rikune protocol`, MCP `protocol_inspect`)**:
30
+ - Zero-dep schema-less Protobuf wire decoder (recursive nested messages), TLV/length-prefixed framing detector, and classic PCAP + PCAPNG L4 payload parser (with automatic embedded Protobuf decode).
31
+ - Optional drop-in `bridges/frida_rikune_bridge.py` (loopback HTTP + Bearer auth + offline `--self-test`) for pushing live runtime captures into Rikune annotations.
32
+ - **Wave E — Truly Zero-Venv Standalone Distribution (`.github/workflows/release.yml`)**:
33
+ - Added cross-platform single-file executable builds (`rikune-linux-x86_64`, `rikune-macos-arm64`, `rikune-windows-x86_64.exe`) uploaded directly to GitHub Releases alongside wheel/sdist and GHCR Docker images.
34
+
35
+ ## 2.2.0 — Verified Cipher Primitive, Large-Function Digests & Stdlib Noise Filtering
36
+
37
+ Driven by controlled same-model (`deepseek-v4.1-flash-fast`) A/B ablation findings:
38
+
39
+ - **Verified Pure-Python Cipher Primitive (`static/crypto_ops.py`, CLI `rikune crypto`, MCP `crypto_transform`)**:
40
+ - Added 33rd executable MCP primitive and `rikune crypto encrypt|decrypt` CLI supporting FIPS/RFC-verified `aes-ecb/cbc/ctr` (128/192/256), `sm4-ecb/cbc`, `chacha20` (IETF & DJB), `rc4`, `xtea-ecb/cbc`, `tea-ecb`, `rc5-ecb/cbc`, and `xor` with zero new external dependencies.
41
+ - **Large-Function Disassembly Digest & Budget Cap (`engine.py`, `cli.py`)**:
42
+ - Automatically prepends a compact structural digest (`Calls`, `Key Immediates` prioritizing 64-bit inline IVs/magics, and `Data/String Refs`) to large `disassembly_fallback` outputs (>6 KB), plus `--max-chars` on `rikune decompile` to prevent LLM context dilution.
43
+ - **Business-Code Function Filtering (`engine.py`, `cli.py`, `mcp_server.py`)**:
44
+ - Added `--exclude-stdlib` and `--regex` to `functions_list` / `rikune functions` to strip Go/C++/CRT stdlib noise when auditing 50 MB+ binaries.
45
+ - **Controlled A/B Verification (`deepseek-v4.1-flash-fast`)**:
46
+ - Cut average wall time across 4 hard `CREBench` tasks (`AES-constxor`, `RC5-constxor`, `XTEA-constxor`, `RC4-O3`) by **1.82×** (`148.0s` vs `269.6s`) and total tokens by **28.5%** (`1.53M` vs `2.14M`) under strictly symmetric `run_python` parity.
47
+
48
+ ## 2.1.1 — Controlled A/B Harness Evaluator, Full 100k Go `.gopclntab`, ARIA/Camellia Detection & Verification Rule
49
+
50
+ Driven by controlled same-model A/B ablation (`deepseek-v4.1-flash-fast`: Baseline Unix tools vs. Rikune v2.1):
51
+
52
+ - **Full Go `.gopclntab` Recovery (`static/lang_symbols.py`)**: Raised default `parse_go_pclntab` cap from `2,000` to `100,000` functions and prioritized main/third-party module packages ahead of Go stdlib (verified on a 50 MB stripped Go 1.25 `Caddy` binary: all 62,449 functions indexed in `1.9s` via `--backend fast`, instantly surfacing `caddyhttp.checkDebugMode @ 0x15d3220`).
53
+ - **Expanded Obscure Cipher Detection (`static/crypto_scan.py`)**: Added static & inline-immediate detection for **ARIA-128** (`aria_ck1_*`, `aria_ck1_inline_imm`, `aria_ck1_xor_masked`) and **Camellia-128** (`camellia_sigma1/2`).
54
+ - **Controlled Same-Model A/B Harness Evaluator (`benchmarks/ab_harness_eval.py`)**: Added reusable, environment-configured OpenAI-compatible A/B harness (`baseline` vs. `rikune`) to measure true Harness Uplift independent of frontier model strength; fixed stale expected token in `benchmarks/agent_eval.py`.
55
+ - **Verification-First Prompting (`SKILL.md`, `mcp_server.py`)**: Elevated the rule to always validate candidate solutions on the binary's real validator/oracle via `emulate_function` instead of trusting hand-written Python reimplementations.
56
+
57
+ ## 2.1.0 — Cross-Arch Embedded Emulation, Linux Syscalls, Stack-Buffer Batch Decrypt & FastNativeBackend
58
+
59
+ - **MIPS32 (BE/LE) & ARM32 Emulation + Linux User-Mode Syscall Engine (`verify/syscall.py`, `verify/unicorn_emu.py`)**:
60
+ - Extended Unicorn micro-emulation to full **MIPS32 (big- and little-endian)** and **ARM32** calling conventions, register maps, return hooks, and fault disassembly.
61
+ - Added cross-architecture Linux user-mode `syscall` / `svc` / `swi` / `int 0x80` emulation (`write`, `read`, `brk`, `mmap`, `mprotect`, `munmap`, `exit`, `exit_group`, `getpid`/`getuid`/`gettid`, `uname`, `clock_gettime`, `gettimeofday`, `getrandom`, `arch_prctl`), capturing stdout to `__syscall_stdout__` and structured traces to `__syscalls__`.
62
+ - **Stack-Constructed Ciphertext Forwarding in `batch-decrypt` (`verify/batch_decrypt.py`)**:
63
+ - Automatically captures caller-initialized stack buffers and non-stack writes during the pre-call micro-emulation window (32+ instruction lookback) and seeds the remapped scratch buffer via `write_memory`, recovering stack-assembled ciphertexts/keys cleanly.
64
+ - **Zero-Subprocess `FastNativeBackend` (`backends/fast_native.py`, `engine.py`)**:
65
+ - Added `--backend fast` powered in-process by LIEF + Go `.gopclntab` + PE64 `.pdata` + WASM exports + Capstone (`list_functions`, `decompile`, `xrefs`, `cfg`, `diff`).
66
+ - Indexes 40–50 MB production Go binaries in **~1.1s** (zero Rizin `aaa` wait) and acts as an always-available fallback backend on hosts without Rizin or Ghidra.
67
+ - **Embedded Firmware Inspection (`static/firmware.py`, `static/heuristics.py`)**:
68
+ - Added zero-dependency inspection of `U-Boot uImage` (CRC32-verified), `SquashFS v4` (exact 10-field superblock: compression, inodes, block size, bytes used), `FDT/DTB`, and `CPIO` SVR4 archive file listings (with ELF member tagging), surfaced directly in `static_triage`.
69
+
70
+ ## 2.0.2 — External Benchmark Hardening (AgentRE-Bench, CREBench, BinaryAudit & BIOPSY-Bench)
71
+
72
+ Driven by live blind evaluations across four public 2026 RE benchmarks (`AgentRE-Bench`, `CREBench`, `BinaryAudit`, `BIOPSY-Bench`):
73
+
74
+ - **ELF `SHT_NOBITS` (`.bss`) Fix (`static/formats.py`, `static/disasm.py`)**: Stop mapping `NOBITS` sections (`.bss`) to overlapping `.comment`/`.shstrtab` file offsets (`raw_size=0, raw_offset=0, entropy=0.0`), and annotate RIP-relative `.bss` references cleanly as `[.bss]`.
75
+ - **Obfuscated & Inline Crypto Detection (`static/crypto_scan.py`)**: Detect single-byte XORed AES/SM4 S-boxes, adjacent two-share XOR-masked tables (`constxor` AES/SM4 S-Box, FK, CK), and inline `.text` 32-bit immediate ChaCha20 sigma constants.
76
+ - **Firmware Carving (`static/pattern.py`)**: Add validated carving for embedded router/IoT firmware artifacts — `SquashFS` (`hsqs`/`sqsh`), `U-Boot uImage` (with header CRC32 verification), `FDT/DTB` (`0xd00dfeed`), and `CPIO` (`070701`).
77
+ - **Decompile, Xrefs & Slicer Accuracy (`backends/rizin.py`, `graph/slicer.py`, `static/strings.py`, `static/heuristics.py`)**:
78
+ - Prefer exact start-address match (then narrowest enclosing span) in Rizin target resolution so overlapping `entry.init0` never hijacks user functions.
79
+ - Use exact PE64 `.pdata` spans in Capstone fallback so tail-jumped `WinMain` functions are never truncated.
80
+ - Reverse-index `callrefs` + `axtj` fallback in `RizinBackend.xrefs` so PLT imports (e.g. `sym.imp.execl`) report all calling functions.
81
+ - Support `.pdata` and explicit-address seeds in `call_graph_slice`.
82
+ - Prioritize non-executable data sections (`.rdata`/`.rodata`/`.data`) over `.text` opcode noise in default `strings_search`, and downgrade standard MinGW CRT TLS callbacks to `info`.
83
+ - **Unicorn PIE ELF & `@argN` Reads (`verify/stubs.py`, `verify/unicorn_emu.py`)**: Add fortified glibc `_chk` stubs (`__printf_chk`, `__fprintf_chk`, `__sprintf_chk`, `__snprintf_chk`), mount safe default fallback stubs on unimplemented ELF GOT/PLT function slots (preventing jumps to `0x0` into `\x7fELF`), and snapshot initial ABI argument registers so `--read-mem out:@arg0:16` survives caller-saved clobbering.
84
+ - **CLI & MCP Parity (`cli.py`, `engine.py`, `mcp_server.py`)**: Add `rikune xrefs`, `rikune cfg`, `functions --sort score|addr|size --min-addr --max-addr`, positional length in `rikune mem <sample> <addr> [len]`, positional seed in `rikune slice <sample> [seed]`, and `--length`/`--size` aliases on `rikune disasm`.
85
+
86
+ ## 2.0.1 — Final Exam A+ Polish (Win64 BCrypt HMAC, ntdll Syscall Prologues, PEB Heaps & CLI Parity)
87
+
88
+ Driven by the full `v2.0.0` field exam on the 5.25 MB XYVM `crackme.exe`:
89
+
90
+ - **Win64 `BCrypt*` 32-bit `ULONG` masking (`verify/peb.py`)**: Mask 32-bit `ULONG`/`DWORD` stack/register parameters (`cbSecret`, `cbInput`, `cbOutput`, `dwFlags`, `cbBuffer`) with `& 0xFFFFFFFF` so MSVC 32-bit stack writes with stale upper bits never corrupt HMAC-SHA256.
91
+ - **Stealthier Synthetic DLLs & Stubs (`verify/peb.py`, `verify/stubs.py`)**: Emit realistic Win10 x64 `ntdll.dll` syscall prologues (`4c 8b d1 b8 <ssn>`), bump stub/trampoline stride to 32 bytes with pure `0x90` NOP padding (zero `0xCC`), populate `KUSER_SHARED_DATA` `InterruptTime`/`SystemTime` and PEB `ProcessHeap`/`NumberOfHeaps`/`ProcessHeaps`, and add `TerminateProcess`/`TerminateThread`/`NtGetContextThread`/`NtContinue`/`RtlPcToFileHeader`/`HeapFree`/`Fls*`/`RaiseException` stubs.
92
+ - **Slicer, Xrefs & Rizin Fixes (`graph/slicer.py`, `static/pattern.py`, `backends/rizin.py`)**: Register synthetic `code_*`/`pdata_*` string-anchor seeds into `by_addr` so `slice --string-anchor` never returns empty; expand `data_xrefs` budget to 12 MiB with entry-point resync inside large encrypted sections; filter `addr == 0` noise from Rizin xrefs.
93
+ - **CLI & Trace Parity (`cli.py`, `verify/trace.py`)**: Add `rikune diff`, `rikune trace --manual-iat`, segment registers (`cs`/`ss`/`ds`/`es`/`fs`/`gs`) in `trace --regs`, and document `type` in `rikune annotate --help`.
94
+
95
+ ## 2.0.0 — Clean-Slate Rewrite (Verified Reverse-Engineering Core Engine)
96
+
97
+ Rikune v2 is a ground-up architectural rewrite of the v1 TypeScript/Node monolith (preserved on git tag `v1-legacy`), shrinking the codebase by >97% while adding a verification-first execution loop.
98
+
99
+ ### Highlights
100
+ - **Native Python Core (`uv`)**: Unified single-language engine running natively on macOS (Apple Silicon & Intel), Linux, and Windows — no Linux-only/amd64 container wall.
101
+ - **27 Real Executable MCP Tools + `tool_search` + Native Prompts & Resources + CLI-First UX**: Replaced v1's 117 plugins and `plan-only` stubs with 27 direct, real executable MCP tools (including `memory_read`, `function_cfg`, `solve_z3`, and advisory `tool_search`), 3 MCP prompts (`triage-binary`, `decrypt-and-verify`, `diff-security-patch`), 3 read-only MCP resources, and matching `rikune` CLI commands (`--json` + Rich tables).
102
+ - **Modern Binary Static Analysis (`static/`)**:
103
+ - Unified LIEF PE/ELF/Mach-O parsing (PE IAT VA normalization + PE64 `.pdata` `RUNTIME_FUNCTION` recovery), VA/offset `memory_read`, entropy/suspicious-import heuristics, VA/section-filtered ASCII/UTF-16LE strings, YARA-X, RIP/ADRP-annotated Capstone disassembly.
104
+ - Zero-dependency cryptographic & compression constant scanner (`AES`/`ChaCha20`/`SHA256`/`CRC32`/`SM4`/`TEA`/`Base64`/`Zstd`/`XZ`).
105
+ - Go `.gopclntab` function/package recovery and pure-Python Rust/Itanium C++ symbol demangling.
106
+ - **Verification Loop (`verify/`)**:
107
+ - Unicorn function-level micro-emulator across x86 / x86_64 (SysV & Win64) / ARM64 (AAPCS64) on PE, ELF, and Mach-O, with `pre_calls` initializer chaining, coalesced `.data`/`.bss` write capture, and automatic SMC/OEP detection (`stop_on_smc`).
108
+ - Cross-ABI libc/WinAPI stub engine (incl. `GetCurrentProcess`/`GetCurrentThread`/`GetThreadContext`/timing stubs + safe default logging fallback for unimplemented PE IAT slots) + synthetic Windows TEB/PEB (`gs:[0x60]` / `fs:[0x30]`) + dynamic `LoadLibrary`/`GetProcAddress`/`dlsym` stub slot allocation.
109
+ - Automatic call-site argument recovery and batch micro-emulation string decryption (`emulate_batch_decrypt`).
110
+ - Static (ROR13/ROR7/DJB2/SDBM/FNV1a/CRC32) and Unicorn dynamic custom-hash API resolution (`resolve_api_hashes`).
111
+ - Optional `angr`/`Z3` symbolic & SMT constraint solving with Unicorn deterministic cross-verification.
112
+ - **Token-Aware Graph & Live Overlay (`graph/`)**:
113
+ - Call-graph slicing by seed functions, string anchors, suspicious API anchors (including MSVC direct-IAT `call qword [iat_va]` resolution), and detected crypto constants (`AES`/`ChaCha20`/`SHA256`/`CRC32`/`SM4`/`TEA`).
114
+ - Explicit `DecompileResult.output_kind` (`"pseudocode"` vs `"disassembly_fallback"`) and Rizin decompiler capability probing.
115
+ - Persistent live overlay for `rename`, `comment`, `decoded_value`, `tag`, and `type` annotations.
116
+ - Injection-safe two-way exporters for IDA Python, Ghidra, Rizin (`.rz`), and Markdown reports.
117
+ - **Pluggable Backends & Drop-In Live IDE Bridges (`backends/`, `bridges/`)**:
118
+ - Headless Rizin and Ghidra backends backed by a persistent SQLite cache (`backend_cache`).
119
+ - `ExternalBridgeBackend` + drop-in `bridges/ida_rikune_bridge.py` and `bridges/ghidra_rikune_bridge.py` scripts for live two-way GUI interop (`push_annotations`).
120
+ - **Security & Benchmarks**:
121
+ - Untrusted-binary prompt-injection detection and framing in `ResponseGuard`.
122
+ - SHA-256 read-only sample vault with parent-child derivation lineage (`sample_derive`, `unpack_sample`).
123
+ - Reproducible 8-case benchmark suite (`benchmarks/runner.py`) + LLM-in-the-loop agent eval harness (`benchmarks/agent_eval.py`).
@@ -0,0 +1,30 @@
1
+ Rikune Dual-Use Disclosure
2
+
3
+ Rikune is a dual-use reverse-engineering and security-analysis workbench. It can
4
+ inspect binaries, recover program structure, identify suspicious behavior, and
5
+ support defensive malware research. The same capabilities could be misused
6
+ against systems or software without authorization.
7
+
8
+ Use Rikune only on samples, systems, and environments that you own or are
9
+ explicitly authorized to assess. Users are responsible for complying with
10
+ applicable law, license terms, organizational policy, privacy requirements, and
11
+ safe malware-handling practices. Do not use Rikune to deploy malware, evade
12
+ security controls, obtain unauthorized access, or harm third parties.
13
+
14
+ Official npm releases are prepared as immutable staged candidates by CI. The
15
+ publishable `npm-release-candidate` artifact is exposed only after the exact-tag
16
+ stage run has completed its static OCI build, signature, attestation, and
17
+ runtime verification. A human maintainer must wait for that entire run to
18
+ succeed, verify the artifact manifest's tag, commit, integrity, run URL, and OCI
19
+ digest, acknowledge this disclosure, and publish the exact tarball through an
20
+ interactive npm ceremony protected by account 2FA. CI is not authorized to hold
21
+ an npm publication token or publish the package.
22
+
23
+ The reviewed ceremony publishes the staged tarball explicitly as the latest
24
+ release with `npm publish rikune-1.4.0.tgz --tag latest --access public`; the
25
+ maintainer completes npm's interactive 2FA prompt locally and never transmits
26
+ the one-time code to CI or an AI assistant.
27
+
28
+ Security issues should be reported privately through the repository's GitHub
29
+ Security Advisories. Do not include live malware, credentials, or sensitive
30
+ third-party data in public issues.
rikune-2.3.3/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.