Skip to content
Back to search

reverse-skill

SkillWorks with Claude CodeGitHub

Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Claude Code / Kiro / Cursor / Cline 等代码 AI 客户端

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/zhaoxuya520/reverse-skill with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/zhaoxuya520/reverse-skill'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/zhaoxuya520-reverse-skill/badge.svg)](/listings/zhaoxuya520-reverse-skill)

HTML

<a href="/listings/zhaoxuya520-reverse-skill"><img src="/api/listings/zhaoxuya520-reverse-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prerequisites

- **Java / JDK** — for jadx and apktool - **Node.js 22.12+** — for JS toolchain and MCP servers - **Python 3.x** — for Frida and helper scripts - **A code AI client** — Claude Code, Codex, Cursor, OpenCode, or another compatible client

Installation

git clone https://github.com/zhaoxuya520/reverse-skill.git

Then refresh the tool index per platform:

| Platform | Command | |----------|---------| | Windows | `powershell -File skills/scripts/refresh-tool-index.ps1` | | Linux / macOS | `bash skills/scripts/refresh-tool-index.sh` | | Kali Linux | `bash kali/scripts/refresh-tool-index.sh` |

Check [skills/tool-index.md](skills/tool-index.md) to see detected tools.

Platform-specific docs: - **Kali Linux** → [kali/README-kali.md](kali/README-kali.md) - **Ubuntu/Debian** → [docs/platforms/linux.md](docs/platforms/linux.md) - **macOS** → [docs/platforms/macos.md](docs/platforms/macos.md)

<p align="right">(<a href="#getting-started">back to top</a>)</p>

<a id="usage"></a>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 337 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <p align="center">
  2. <img src="https://cdn.jsdelivr.net/gh/webkubor/free-imgbed@main/reverse-skill/reverse-skill.webp" alt="reverse-skill" width="140" />
  3. </p>
  4. <h1 align="center">reverse-skill</h1>
  5. <h3 align="center">Cybersecurity Skills Router · 逆向技能路由包</h3>
  6. <p align="center"><em style="font-family: Georgia, serif; font-size: 1.2em; color: #777;">Navigate the dark waters, sail against the stream.</em></p>
  7. <p align="center">
  8. <a href="https://github.com/zhaoxuya520/reverse-skill/releases"><img src="https://img.shields.io/badge/release-v1.0.1-blue" alt="release v1.0.1"></a>
  9. <a href="https://github.com/zhaoxuya520/reverse-skill/stargazers"><img src="https://img.shields.io/github/stars/zhaoxuya520/reverse-skill?style=flat&logo=github" alt="stars"></a>
  10. <a href="https://github.com/zhaoxuya520/reverse-skill/forks"><img src="https://img.shields.io/github/forks/zhaoxuya520/reverse-skill?style=flat&logo=github" alt="forks"></a>
  11. <a href="https://github.com/zhaoxuya520/reverse-skill/issues"><img src="https://img.shields.io/github/issues/zhaoxuya520/reverse-skill?style=flat&logo=github" alt="issues"></a>
  12. <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="license"></a>
  13. <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/changelog-Keep%20a%20Changelog-orange" alt="changelog"></a>
  14. </p>
  15. <p align="center">
  16. <a href="https://trendshift.io/repositories/43969?utm_source=repository-badge&amp;utm_medium=badge&amp;utm_campaign=badge-repository-43969" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/repositories/43969" alt="zhaoxuya520%2Freverse-skill | Trendshift" width="250" height="55"/></a>
  17. <a href="https://trendshift.io/repositories/43969?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-43969" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/43969/daily" alt="zhaoxuya520%2Freverse-skill | Trendshift" width="250" height="55"/></a>
  18. </p>
  19. <br/>
  20. <p align="center">
  21. <a href="#about">About</a> ·
  22. <a href="#getting-started">Getting Started</a> ·
  23. <a href="#usage">Usage</a> ·
  24. <a href="https://reverse.apivix.com/docs/">Tutorial</a> ·
  25. <a href="skills/MASTER-ROUTING.md">Fast route</a> ·
  26. <a href="skills/routing.md">Routing</a> ·
  27. <a href="skills/ops/">Ops contracts</a> ·
  28. <a href="README_AI.md">AI Bootstrap</a> ·
  29. <a href="#sponsors">Sponsors</a> ·
  30. <a href="#contributing">Contributing</a>
  31. </p>
  32. <p align="center">
  33. 🌐 <a href="README_zh.md">中文</a> ·
  34. <a href="https://reverse.apivix.com/">Project website</a> ·
  35. <a href="https://reverse.apivix.com/docs/">Online tutorial</a>
  36. </p>
  37. <br/>
  38. <a id="about"></a>
  39. ## About
  40. > **If you are an AI Agent, jump to [README_AI.md](README_AI.md) and follow the instructions strictly.**
  41. When an AI agent (Claude Code, Codex, Cursor, OpenCode, or another compatible client) encounters an APK, a binary, frontend JS encryption, a CTF challenge, or a pentesting target, this package routes it to the right methodology, checks available tools, and executes a repeatable workflow instead of guessing commands.
  42. ```
  43. User task
  44. → RULES.md
  45. → MASTER-ROUTING / master-route.ps1|.sh (PRIMARY)
  46. → case-init / scope.md (auth + network_profile; no target ACT until ready)
  47. → Scenario skill → tools / MCP / scripts
  48. → timeline + Evidence→Finding→Path → report + field-journal
  49. ```
  50. **Why this exists:**
  51. - AI agents don't know whether to use jadx, apktool, Frida, IDA, or BurpSuite for a given task
  52. - APK, ELF, JS, PCAP, and CTF tasks each need different playbooks
  53. - Tools, MCP servers, and scripts are scattered across machines
  54. - The same mistakes get repeated because experience isn't reused
  55. ### Current status
  56. | Routing rules | Regression benchmark | Core skill modules | CI platforms | Client model |
  57. |---:|---:|---:|---|---|
  58. | 44 (R0–R45) | 221 cases | 45 tracked modules | Windows + Ubuntu | Client-neutral |
  59. The routing core is driven by one structured configuration, validated by cross-platform CI, and kept separate from optional client adapters.
  60. PRIMARY ladder: [skills/MASTER-ROUTING.md](skills/MASTER-ROUTING.md) · Full matrix: [skills/routing.md](skills/routing.md) · Ops: [skills/ops/](skills/ops/)
  61. <br/>
  62. <div align="center">
  63. <a href="https://www.star-history.com/?repos=zhaoxuya520%2Freverse-skill&amp;type=date&amp;legend=top-left">
  64. <img src="https://history.apivix.com/star-history.svg?v=hourly-v1" alt="Star History chart for zhaoxuya520/reverse-skill" width="650" />
  65. </a>
  66. </div>
  67. <br/>
  68. <p align="right">(<a href="#about">back to top</a>)</p>
  69. <a id="sponsors"></a>
  70. ## Sponsors
  71. <table>
  72. <tr>
  73. <td align="center" width="220">
  74. <a href="https://www.ucloud.cn/site/active/astraflow?ytag=geo_waituo_reverse">
  75. <img src="https://cdn.jsdelivr.net/gh/webkubor/free-imgbed@main/reverse-skill/ucloud-astraflow.png" alt="UCloud AstraFlow" width="110" />
  76. </a>
  77. <br />
  78. <strong>AstraFlow</strong>
  79. </td>
  80. <td>
  81. <strong><a href="https://www.ucloud.cn/site/active/astraflow?ytag=geo_waituo_reverse">UCloud AstraFlow</a></strong> provides one-click access to 200+ leading open-source models, including Kimi K3, DeepSeek V4/V3, Qwen 3, GLM 5.2, and HappyHorse—no model training required, ready to use out of the box.
  82. </td>
  83. </tr>
  84. <tr>
  85. <td align="center" width="220">
  86. <a href="https://www.atlascloud.ai/?ref=W3Q77C">
  87. <img src="https://cdn.jsdelivr.net/gh/webkubor/free-imgbed@main/reverse-skill/atlas-cloud.svg" alt="Atlas Cloud" width="190" />
  88. </a>
  89. <br />
  90. <a href="https://www.atlascloud.ai/oss-program">
  91. <img src="https://www.atlascloud.ai/oss-program/powered-by-atlas-cloud.svg" alt="Powered by Atlas Cloud" height="24" />
  92. </a>
  93. </td>
  94. <td>
  95. <strong><a href="https://www.atlascloud.ai/?ref=W3Q77C">Atlas Cloud</a></strong> is a full-modal AI inference platform that provides unified API access to 400+ curated image, video, audio, 3D, and language models. Atlas Cloud supports reverse-skill with model services for cross-platform routing verification, documentation, and open security workflows.
  96. </td>
  97. </tr>
  98. <tr>
  99. <td align="center" width="220">
  100. <a href="https://gokite.ai/">
  101. <img src="https://gokite.ai/images/Kite_Logo.svg" alt="Kite AI" width="150" />
  102. </a>
  103. </td>
  104. <td>
  105. <strong><a href="https://gokite.ai/">Kite AI</a></strong> builds identity and payment infrastructure for the agent economy. Its support helps sustain reverse-skill's open-source maintenance, routing benchmarks, and platform-neutral security workflows.
  106. </td>
  107. </tr>
  108. </table>
  109. ### Built With
  110. <p align="left">
  111. <img src="https://skillicons.dev/icons?i=py,nodejs,powershell,bash,java,docker,git&theme=light" /><br/>
  112. <code>IDA Pro</code> · <code>radare2</code> · <code>Ghidra</code> · <code>Binary Ninja</code>
  113. </p>
  114. <p align="right">(<a href="#about">back to top</a>)</p>
  115. <a id="getting-started"></a>
  116. ## Getting Started
  117. ### Prerequisites
  118. - **Java / JDK** — for jadx and apktool
  119. - **Node.js 22.12+** — for JS toolchain and MCP servers
  120. - **Python 3.x** — for Frida and helper scripts
  121. - **A code AI client** — Claude Code, Codex, Cursor, OpenCode, or another compatible client
  122. ### Installation
  123. ```
  124. git clone https://github.com/zhaoxuya520/reverse-skill.git
  125. ```
  126. Then refresh the tool index per platform:
  127. | Platform | Command |
  128. |----------|---------|
  129. | Windows | `powershell -File skills/scripts/refresh-tool-index.ps1` |
  130. | Linux / macOS | `bash skills/scripts/refresh-tool-index.sh` |
  131. | Kali Linux | `bash kali/scripts/refresh-tool-index.sh` |
  132. Check [skills/tool-index.md](skills/tool-index.md) to see detected tools.
  133. Platform-specific docs:
  134. - **Kali Linux** → [kali/README-kali.md](kali/README-kali.md)
  135. - **Ubuntu/Debian** → [docs/platforms/linux.md](docs/platforms/linux.md)
  136. - **macOS** → [docs/platforms/macos.md](docs/platforms/macos.md)
  137. - **All-in-one Docker** → [docker/README.md](docker/README.md) (`docker compose -f docker/docker-compose.yml run --rm reverse-skill`)
  138. <p align="right">(<a href="#getting-started">back to top</a>)</p>
  139. <a id="usage"></a>
  140. ## Usage
  141. ### Supported scenarios
  142. | Scenario | Entry |
  143. |----------|-------|
  144. | APK / Android analysis | `skills/apk-reverse/` |
  145. | iOS / mobile | `skills/mobile-reverse/` |
  146. | Binary reverse (exe/dll/so/elf) | `skills/ida-reverse/` / `skills/radare2/` |
  147. | Binary Ninja / HLIL / MLIL / MCP | `skills/binary-ninja-reverse/` |
  148. | .NET / C# | `skills/dotnet-reverse/` |
  149. | Frontend JS / encrypted params | `skills/js-reverse/` |
  150. | DSL VM / custom JS opcode VM | `skills/reverse-engineering/dsl-vm-reverse/` |
  151. | HTTP capture / request replay | anything-analyzer, Reqable MCP + `js-reverse/` |
  152. | Malware / YARA | `skills/malware-analysis/` |
  153. | Penetration testing / scanning | `skills/pentest-tools/` |
  154. | Attack chain / red-team orchestration | `skills/attack-chain/` |
  155. | Case evidence review / report handoff | `skills/case-review/` |
  156. | CTF competition | `CTF-Sandbox-Orchestrator/` (42 sub-skills) |
  157. | Firmware / IoT | `skills/firmware-pentest/` |
  158. | Patch diff / N-day | `skills/patch-diff-exploit/` |
  159. | Pwn / exploit development | `skills/pwn-chain/` |
  160. | EDR bypass | `skills/edr-bypass-re/` |
  161. | API / GraphQL | `skills/api-security/` |
  162. | Supply chain / SBOM | `skills/supply-chain-security/` |
  163. | LLM / AI security | `skills/llm-security/` |
  164. | OLLVM deobfuscation | `skills/reverse-engineering/references/ollvm-deobfuscation.md` |
  165. | Diagrams / reports | `skills/diagram-generator/` / `skills/docs-generator/` |
  166. ### Key files
  167. | File | Purpose |
  168. |------|---------|
  169. | [README_AI.md](README_AI.md) | AI agent bootstrap and configuration |
  170. | [RULES.md](RULES.md) | Global routing rules (scope gate before ACT) |
  171. | [skills/MASTER-ROUTING.md](skills/MASTER-ROUTING.md) | PRIMARY fast ladder |
  172. | [skills/routing.md](skills/routing.md) | Task → skill routing matrix |
  173. | [skills/SKILL.md](skills/SKILL.md) | Master entry point |
  174. | [skills/INDEX.md](skills/INDEX.md) | Auto-generated, client-neutral skill navigation index |
  175. | [skills/config/routing.json](skills/config/routing.json) | **Routing single source of truth** (44 routes, R0–R45 with R42/R43 unused) |
  176. | [skills/tool-index.md](skills/tool-index.md) | Local tool status (auto-generated) |
  177. | [skills/scripts/master-route.ps1](skills/scripts/master-route.ps1) | Windows PRIMARY triage (reads routing.json) |
  178. | [skills/scripts/master-route.sh](skills/scripts/master-route.sh) | Linux/macOS/Kali PRIMARY triage (same routing.json) |
  179. | [skills/scripts/case-init.ps1](skills/scripts/case-init.ps1) | Case dir: scope / timeline / workitems (Windows) |
  180. | [skills/scripts/case-init.sh](skills/scripts/case-init.sh) | Case dir: scope / timeline / workitems (Linux/macOS/Kali) |
  181. | [skills/case-review/](skills/case-review/) | Read-only Evidence graph review and artifact fixity checks |
  182. | [skills/scripts/test-routing.ps1](skills/scripts/test-routing.ps1) | Routing regression runner (221 benchmark cases) |
  183. | [skills/scripts/verify-routing-coherence.ps1](skills/scripts/verify-routing-coherence.ps1) | Structure + supply-chain pin gate checks |
  184. | [skills/scripts/extract-summaries.ps1](skills/scripts/extract-summaries.ps1) | Regenerates INDEX.md from skill frontmatter |
  185. | [AGENTS.md](AGENTS.md) | Platform-neutral repository instructions |
  186. | [skills/ops/](skills/ops/) | Scope, Evidence chain, roles, timeline (skill-router form) |
  187. ### Testing (run after any routing/config change)
  188. ```powershell
  189. # 1. Routing regression — 221 (hint → expected PRIMARY) cases, fails CI on any mismatch
  190. powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/test-routing.ps1
  191. # 2. Structure coherence + supply-chain pin gate (unpinned auto-install fails)
  192. powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/verify-routing-coherence.ps1
  193. # 3. Smoke: verify + script parse + quick route matrix
  194. powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/smoke.ps1
  195. # 4. INDEX.md drift check (regenerate with extract-summaries.ps1 if dirty)
  196. powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/extract-summaries.ps1 -Check
  197. ```
  198. GitHub Actions CI runs all of the above on **Windows + Ubuntu** for every push/PR.
  199. ### Client-neutral integration
  200. The routing core, regression suite, manifests, and case workflow do not depend on a specific AI client. Claude Code, Codex, Cursor, OpenCode, and other clients should load the repository through their own adapter or project-instruction mechanism. Client-specific configuration must remain optional and outside the core routing contract.
  201. For Codex, the repository also exposes an optional adapter plugin at [`plugins/reverse-skill/`](plugins/reverse-skill/). It delegates to the repository's existing routing core and does not register external MCP servers automatically.
  202. ### Repository layout
  203. ```
  204. .
  205. ├── README.md / README_zh.md / README_AI.md
  206. ├── RULES.md / RULES_zh.md
  207. ├── skills/
  208. │ ├── MASTER-ROUTING.md / SKILL.md / routing.md
  209. │ ├── ops/ # ops contracts
  210. │ ├── scripts/ # master-route, case-init, bootstrap, verify
  211. │ ├── field-journal/
  212. │ ├── apk-reverse/ mobile-reverse/ js-reverse/ dotnet-reverse/
  213. │ ├── ida-reverse/ radare2/ reverse-engineering/ malware-analysis/
  214. │ ├── pentest-tools/ attack-chain/ pwn-chain/ firmware-pentest/
  215. │ ├── api-security/ supply-chain-security/ llm-security/
  216. │ └── ...
  217. ├── CTF-Sandbox-Orchestrator/
  218. ├── docs/
  219. ├── kali/ # see kali/README-kali.md
  220. └── work/ # local cases (gitignored)
  221. ```
  222. <p align="right">(<a href="#usage">back to top</a>)</p>
  223. <a id="contributing"></a>
  224. ## Contributing
  225. Contributions are welcome! Fork the repo, create a feature branch, and open a PR.
  226. 1. Fork the Project
  227. 2. `git checkout -b feature/AmazingFeature`
  228. 3. `git commit -m 'Add some AmazingFeature'`
  229. 4. `git push origin feature/AmazingFeature`
  230. 5. Open a Pull Request
  231. ### Contributors
  232. <a href="https://github.com/zhaoxuya520/reverse-skill/graphs/contributors">
  233. <img src="https://contrib.rocks/image?repo=zhaoxuya520/reverse-skill" alt="contributors" />
  234. </a>
  235. <p align="right">(<a href="#contributing">back to top</a>)</p>
  236. <a id="license"></a>
  237. ## License
  238. This project (`reverse-skill`) is primarily licensed under the **MIT License** (see [LICENSE](LICENSE)).
  239. **Submodule and third-party dependencies:**
  240. - **CTF-Sandbox-Orchestrator/**: **GNU GPLv3**
  241. - **Pentest Swarm AI**: Original project is **AGPL-3.0**. This repo only invokes it via CLI or MCP and does not include its source code
  242. - Other tools (jadx, frida, nmap, burpsuite-mcp, etc.) are subject to their respective official licenses
  243. <p align="right">(<a href="#license">back to top</a>)</p>
  244. <a id="acknowledgments"></a>
  245. ## Acknowledgments
  246. Thanks to all open-source tool authors. This project integrates tools across reverse engineering, penetration testing, CTF, and security analysis — every tool is the fruit of community effort.
  247. Special thanks to the OLLVM deobfuscation ecosystem contributors and everyone who submitted test samples, issues, and PRs.
  248. <p align="right">(<a href="#acknowledgments">back to top</a>)</p>
  249. ## Contact
  250. - **Email:** [ww7517437@gmail.com](mailto:ww7517437@gmail.com)
  251. - **Issues:** [GitHub Issues](https://github.com/zhaoxuya520/reverse-skill/issues)
  252. ## Disclaimer
  253. This project is intended solely for lawful security research, education, CTF competitions, and testing of systems that you own or have explicit authorization to assess.
  254. **Unauthorized access, scanning, exploitation, disruption, data acquisition, or any other use against systems without prior permission is strictly prohibited.** Users are solely responsible for complying with applicable laws, regulations, and the authorized scope of testing. The maintainers accept no liability for misuse of this project or for any resulting damage or legal consequences
  255. ## Installation and download security
  256. See [Security Policy](SECURITY.md), [Installation and Download Security Guidance](docs/UV-AND-DOWNLOAD-SECURITY.md), and the [2026-09-03 repository security review](docs/SECURITY-REVIEW-2026-09-03.md).
  257. ## Community quick start and issue triage
  258. See [Quick Start](docs/QUICKSTART_zh.md) and [Community Issue Triage](docs/COMMUNITY-ISSUE-TRIAGE.md) for installation, client integration, and how community issues are classified. Installation/archive security details remain in [Installation and Download Security Guidance](docs/UV-AND-DOWNLOAD-SECURITY.md).
skills/ida-reverse/scripts/test-apply-asm-patch.py · Bundled script · 99 lines · 1 finding marked
  1. #!/usr/bin/env python3
  2. """Offline regression for apply-asm-patch.py plan validation (no IDA required)."""
  3. from __future__ import annotations
  4. import json
  5. import subprocess
  6. import sys
  7. import tempfile
  8. from pathlib import Path
  9. SCRIPT = Path(__file__).resolve().parent / "apply-asm-patch.py"
  10. FAILURES = 0
  11. def run(args: list[str]) -> tuple[int, str, str]:
  12. proc = subprocess.run(
  13. [sys.executable, str(SCRIPT), *args],
  14. capture_output=True,
  15. text=True,
  16. )
  17. return proc.returncode, proc.stdout, proc.stderr
  18. def expect(name: str, ok: bool, detail: str = "") -> None:
  19. global FAILURES
  20. if ok:
  21. print(f"PASS {name}")
  22. else:
  23. FAILURES += 1
  24. print(f"FAIL {name} {detail}")
  25. def main() -> int:
  26. with tempfile.TemporaryDirectory() as td:
  27. td_path = Path(td)
  28. good = td_path / "good.json"
  29. good.write_text(
  30. json.dumps(
  31. {
  32. "database": "sess-1",
  33. "items": [
  34. {"addr": "0x401050", "asm": "nop"},
  35. {"addr": "0x401060", "asm": "jmp 0x401080"},
  36. {"addr": "4198400", "bytes": "90 90"},
  37. ],
  38. }
  39. ),
  40. encoding="utf-8",
  41. )
  42. code, out, err = run(["--plan", str(good), "--dry-run"])
  43. expect("valid plan dry-run", code == 0 and "validated" in out, err)
  44. bad_addr = td_path / "bad_addr.json"
  45. bad_addr.write_text(
  46. json.dumps({"items": [{"addr": "not-an-addr", "asm": "nop"}]}),
  47. encoding="utf-8",
  48. )
  49. code, _, err = run(["--plan", str(bad_addr), "--dry-run"])
  50. expect("reject bad addr", code != 0 and "addr" in err, err)
  51. both = td_path / "both.json"
  52. both.write_text(
  53. json.dumps({"items": [{"addr": "0x401000", "asm": "nop", "bytes": "90"}]}),
  54. encoding="utf-8",
  55. )
  56. code, _, err = run(["--plan", str(both), "--dry-run"])
  57. expect("reject asm+bytes", code != 0 and "exactly one" in err, err)
  58. shellish = td_path / "shellish.json"
  59. shellish.write_text(
  60. json.dumps({"items": [{"addr": "0x401000", "asm": "nop; rm -rf /"}]}),
    • Note: Quoted as data in code: Runs `rm -rf` against a root or home-directory path
    • Line 72 on GitHub
  61. encoding="utf-8",
  62. )
  63. code, _, err = run(["--plan", str(shellish), "--dry-run"])
  64. expect("reject shell-like asm", code != 0, err)
  65. empty = td_path / "empty.json"
  66. empty.write_text(json.dumps({"items": []}), encoding="utf-8")
  67. code, _, err = run(["--plan", str(empty), "--dry-run"])
  68. expect("reject empty items", code != 0, err)
  69. array_form = td_path / "array.json"
  70. array_form.write_text(
  71. json.dumps([{"addr": "0x401000", "asm": "ret"}]),
  72. encoding="utf-8",
  73. )
  74. code, out, err = run(["--plan", str(array_form), "--dry-run"])
  75. expect("accept bare array plan", code == 0 and "validated" in out, err)
  76. if FAILURES:
  77. print(f"TOTAL FAIL={FAILURES}")
  78. return 1
  79. print("TOTAL FAIL=0")
  80. return 0
  81. if __name__ == "__main__":
  82. raise SystemExit(main())

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.