From a4a47cd3f915952fbd21b143e3c7316c83a2b013 Mon Sep 17 00:00:00 2001 From: r0ny123 Date: Thu, 12 Nov 2026 13:00:57 +0000 Subject: [PATCH 1/4] feat: make the plugin installable with hcli ida-plugin.json was failing hcli plugin lint (dot in the name, no urls, no authors), so fix that up and list the python deps so hcli can pull them in instead of relying on the vendored tree. shared_schema imported pydantic through reai_toolkit.vendor which only exists in the release zips. Import it normally, vendor/ is on sys.path anyway. The release job now stamps the version into the tagged commit, since hcli reads it from the tag's source archive. --- .github/workflows/release.yaml | 9 ++++++ README.md | 14 ++++++++ ida-plugin.json | 43 ++++++++++++++++++++++--- reai_toolkit/app/core/shared_schema.py | 4 +-- tests/unit/core/test_plugin_manifest.py | 35 ++++++++++++++++++++ 5 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 tests/unit/core/test_plugin_manifest.py diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 744a1fc..b1a11c4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -90,6 +90,15 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + + # hcli installs from the tag's source archive, so the version in + # there has to match the tag. The bump lives on the tagged commit + # only, main is left alone. + VERSION="${{ steps.version.outputs.version }}" + sed -i -E "s/(\"version\": *\")[^\"]+/\1${VERSION}/" ida-plugin.json + sed -i -E "s/^(__PLUGIN_VERSION__ = \")[^\"]+/\1${VERSION}/" reai_toolkit_entry.py + git diff --quiet || git commit -am "chore: release ${{ steps.version.outputs.tag }}" + git tag "${{ steps.version.outputs.tag }}" git push origin "${{ steps.version.outputs.tag }}" diff --git a/README.md b/README.md index 82233d1..9188314 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,20 @@ The package `PyQt5` must be installed. ### Setup +#### With HCLI (recommended) + +If you have [HCLI](https://hcli.docs.hex-rays.com/) installed, this is all you need: + +```bash +hcli plugin install reveng-ai +``` + +It drops the plugin into your IDA user plugin directory and installs the Python +dependencies into the interpreter IDA uses. `hcli plugin upgrade reveng-ai` picks +up new releases, `hcli plugin uninstall reveng-ai` removes it. + +#### Manually + 1. **Download** the plugin code for your platform and Python version from the [Releases](https://github.com/revengai/plugin-ida/releases/latest) page. 2. **Extract** the archive contents into your IDA user plugin directory. diff --git a/ida-plugin.json b/ida-plugin.json index 7f44b34..38363ee 100644 --- a/ida-plugin.json +++ b/ida-plugin.json @@ -1,12 +1,45 @@ { + "$schema": "https://hcli.docs.hex-rays.com/schemas/ida-plugin.json", "IDAMetadataDescriptorVersion": 1, "plugin": { - "name": "RevEng.AI", + "name": "reveng-ai", + "version": "3.4.0", "entryPoint": "reai_toolkit_entry.py", - "categories": ["decompilation", "integration-with-third-parties-interoperability", "malware-analysis", "other"], - "logoPath": "reai_toolkit/app/components/resources/reveng_ai_logo.jpg", - "idaVersions": ">=9.0", "description": "The RevEng.AI plugin integrates AI-powered code analysis and decompilation features into IDA Pro, enhancing reverse engineering workflows with advanced machine learning capabilities.", - "version": "3.0.0" + "license": "GPL-3.0", + "urls": { + "repository": "https://github.com/RevEngAI/plugin-ida", + "homepage": "https://reveng.ai" + }, + "authors": [ + { + "name": "RevEng.AI", + "email": "contact@reveng.ai" + } + ], + "categories": [ + "decompilation", + "integration-with-third-parties-interoperability", + "malware-analysis", + "other" + ], + "keywords": [ + "reveng.ai", + "ai", + "function-matching", + "binary-similarity", + "auto-unstrip", + "ai-decompiler" + ], + "logoPath": "reai_toolkit/app/components/resources/reveng_ai_logo.jpg", + "idaVersions": ["9.0", "9.0sp1", "9.1", "9.2", "9.3", "9.4", "9.5"], + "requiresPython": ">=3.10", + "pythonDependencies": [ + "requests>=2.32", + "loguru>=0.7", + "pydantic", + "revengai>=4.75.0", + "libbs>=3.8.1" + ] } } diff --git a/reai_toolkit/app/core/shared_schema.py b/reai_toolkit/app/core/shared_schema.py index 21cfc08..5e2a657 100644 --- a/reai_toolkit/app/core/shared_schema.py +++ b/reai_toolkit/app/core/shared_schema.py @@ -1,9 +1,7 @@ from enum import Enum from typing import Generic, List, Optional, TypeVar -from pydantic import BaseModel - -from reai_toolkit.vendor.pydantic import Field +from pydantic import BaseModel, Field T = TypeVar("T") diff --git a/tests/unit/core/test_plugin_manifest.py b/tests/unit/core/test_plugin_manifest.py new file mode 100644 index 0000000..a965c98 --- /dev/null +++ b/tests/unit/core/test_plugin_manifest.py @@ -0,0 +1,35 @@ +import json +import os +import re + +ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) + + +def _manifest(): + with open(os.path.join(ROOT, "ida-plugin.json")) as fh: + return json.load(fh)["plugin"] + + +def test_python_dependencies_match_pyproject(): + # no tomllib on 3.10, the block is simple enough to pull out by hand + with open(os.path.join(ROOT, "pyproject.toml")) as fh: + block = re.search(r"^dependencies = \[(.*?)^\]", fh.read(), re.M | re.S).group(1) + declared = re.findall(r'"([^"]+)"', block) + + assert sorted(_manifest()["pythonDependencies"]) == sorted(declared) + + +def test_entry_point_exists(): + assert os.path.isfile(os.path.join(ROOT, _manifest()["entryPoint"])) + + +def test_logo_exists(): + assert os.path.isfile(os.path.join(ROOT, _manifest()["logoPath"])) + + +def test_version_matches_entry_point(): + plugin = _manifest() + with open(os.path.join(ROOT, plugin["entryPoint"])) as fh: + match = re.search(r'^__PLUGIN_VERSION__ = "([^"]+)"', fh.read(), re.M) + + assert match and match.group(1) == plugin["version"] From 06d4cbf9ce5b90f055940e53337e44c06b4b7a69 Mon Sep 17 00:00:00 2001 From: r0ny123 Date: Thu, 12 Nov 2026 13:08:10 +0000 Subject: [PATCH 2/4] chore: set plugin version to the current release --- ida-plugin.json | 2 +- reai_toolkit_entry.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ida-plugin.json b/ida-plugin.json index 38363ee..7b9f4c4 100644 --- a/ida-plugin.json +++ b/ida-plugin.json @@ -3,7 +3,7 @@ "IDAMetadataDescriptorVersion": 1, "plugin": { "name": "reveng-ai", - "version": "3.4.0", + "version": "3.27.1", "entryPoint": "reai_toolkit_entry.py", "description": "The RevEng.AI plugin integrates AI-powered code analysis and decompilation features into IDA Pro, enhancing reverse engineering workflows with advanced machine learning capabilities.", "license": "GPL-3.0", diff --git a/reai_toolkit_entry.py b/reai_toolkit_entry.py index 4b98efa..158280d 100644 --- a/reai_toolkit_entry.py +++ b/reai_toolkit_entry.py @@ -44,7 +44,7 @@ def _add_vendor_paths(): # flake8: noqa: E402 # TODO: Obtain this from package metadata or ship pyproject.toml with plugin. -__PLUGIN_VERSION__ = "3.4.0" +__PLUGIN_VERSION__ = "3.27.1" __IDA_VERSION__ = idaapi.get_kernel_version() From c979d08dac0408d5654ff4510f98e7d4c2b069b8 Mon Sep 17 00:00:00 2001 From: Rob Marsal Date: Mon, 16 Nov 2026 12:50:12 +0000 Subject: [PATCH 3/4] chore: rename plugin to revengai --- README.md | 6 +++--- ida-plugin.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9188314..54b3054 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,12 @@ The package `PyQt5` must be installed. If you have [HCLI](https://hcli.docs.hex-rays.com/) installed, this is all you need: ```bash -hcli plugin install reveng-ai +hcli plugin install revengai ``` It drops the plugin into your IDA user plugin directory and installs the Python -dependencies into the interpreter IDA uses. `hcli plugin upgrade reveng-ai` picks -up new releases, `hcli plugin uninstall reveng-ai` removes it. +dependencies into the interpreter IDA uses. `hcli plugin upgrade revengai` picks +up new releases, `hcli plugin uninstall revengai` removes it. #### Manually diff --git a/ida-plugin.json b/ida-plugin.json index 7b9f4c4..cc3d462 100644 --- a/ida-plugin.json +++ b/ida-plugin.json @@ -2,7 +2,7 @@ "$schema": "https://hcli.docs.hex-rays.com/schemas/ida-plugin.json", "IDAMetadataDescriptorVersion": 1, "plugin": { - "name": "reveng-ai", + "name": "revengai", "version": "3.27.1", "entryPoint": "reai_toolkit_entry.py", "description": "The RevEng.AI plugin integrates AI-powered code analysis and decompilation features into IDA Pro, enhancing reverse engineering workflows with advanced machine learning capabilities.", From 9159b08af79cbd9b9543efb752c95b2ba6e0712e Mon Sep 17 00:00:00 2001 From: Rob Marsal Date: Mon, 16 Nov 2026 12:55:35 +0000 Subject: [PATCH 4/4] chore: pin plugin dependencies from uv.lock --- .github/workflows/features-drift.yml | 3 ++ ida-plugin.json | 10 ++-- scripts/emit_plugin_deps.py | 69 +++++++++++++++++++++++++ tests/unit/core/test_plugin_manifest.py | 11 ++-- 4 files changed, 82 insertions(+), 11 deletions(-) create mode 100644 scripts/emit_plugin_deps.py diff --git a/.github/workflows/features-drift.yml b/.github/workflows/features-drift.yml index f4cf3f7..59931b7 100644 --- a/.github/workflows/features-drift.yml +++ b/.github/workflows/features-drift.yml @@ -19,3 +19,6 @@ jobs: - name: Check .revengai/features.json is up to date run: python scripts/emit_features.py --check + + - name: Check ida-plugin.json dependencies match uv.lock + run: python scripts/emit_plugin_deps.py --check diff --git a/ida-plugin.json b/ida-plugin.json index cc3d462..64833c9 100644 --- a/ida-plugin.json +++ b/ida-plugin.json @@ -35,11 +35,11 @@ "idaVersions": ["9.0", "9.0sp1", "9.1", "9.2", "9.3", "9.4", "9.5"], "requiresPython": ">=3.10", "pythonDependencies": [ - "requests>=2.32", - "loguru>=0.7", - "pydantic", - "revengai>=4.75.0", - "libbs>=3.8.1" + "requests==2.32.5", + "loguru==0.7.3", + "pydantic==2.12.3", + "revengai==4.75.0", + "libbs==3.8.1" ] } } diff --git a/scripts/emit_plugin_deps.py b/scripts/emit_plugin_deps.py new file mode 100644 index 0000000..5542c9c --- /dev/null +++ b/scripts/emit_plugin_deps.py @@ -0,0 +1,69 @@ +import argparse +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +MANIFEST_PATH = ROOT / "ida-plugin.json" +BLOCK = re.compile(r'("pythonDependencies": \[)(.*?)(\n *\])', re.S) + + +def normalise(name): + return re.sub(r"[-_.]+", "-", name).lower() + + +def direct(): + # no tomllib on 3.10, the block is simple enough to pull out by hand + text = (ROOT / "pyproject.toml").read_text() + block = re.search(r"^dependencies = \[(.*?)^\]", text, re.M | re.S).group(1) + return [re.match(r"[A-Za-z0-9._-]+", d).group(0) for d in re.findall(r'"([^"]+)"', block)] + + +def locked(): + text = (ROOT / "uv.lock").read_text() + versions = {} + for name, version in re.findall(r'^\[\[package\]\]\nname = "([^"]+)"\nversion = "([^"]+)"', text, re.M): + versions.setdefault(normalise(name), set()).add(version) + return versions + + +def build_dependencies(): + versions = locked() + pins = [] + for name in direct(): + found = versions.get(normalise(name), set()) + if len(found) != 1: + raise SystemExit(f"expected one locked version of {name}, found {sorted(found)}") + pins.append(f"{name}=={found.pop()}") + return pins + + +def serialize(current): + body = "".join(f'\n "{pin}",' for pin in build_dependencies()).rstrip(",") + return BLOCK.sub(lambda m: m.group(1) + body + m.group(3), current, count=1) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--check", action="store_true") + args = parser.parse_args() + + current = MANIFEST_PATH.read_text() + content = serialize(current) + if args.check: + if current != content: + print( + "ida-plugin.json pythonDependencies are out of date; run: python scripts/emit_plugin_deps.py", + file=sys.stderr, + ) + return 1 + print("ida-plugin.json pythonDependencies are up to date.") + return 0 + + MANIFEST_PATH.write_text(content) + print(f"wrote {MANIFEST_PATH}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/unit/core/test_plugin_manifest.py b/tests/unit/core/test_plugin_manifest.py index a965c98..c74cc34 100644 --- a/tests/unit/core/test_plugin_manifest.py +++ b/tests/unit/core/test_plugin_manifest.py @@ -1,6 +1,8 @@ import json import os import re +import subprocess +import sys ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) @@ -10,13 +12,10 @@ def _manifest(): return json.load(fh)["plugin"] -def test_python_dependencies_match_pyproject(): - # no tomllib on 3.10, the block is simple enough to pull out by hand - with open(os.path.join(ROOT, "pyproject.toml")) as fh: - block = re.search(r"^dependencies = \[(.*?)^\]", fh.read(), re.M | re.S).group(1) - declared = re.findall(r'"([^"]+)"', block) +def test_python_dependencies_match_uv_lock(): + result = subprocess.run([sys.executable, os.path.join(ROOT, "scripts", "emit_plugin_deps.py"), "--check"]) - assert sorted(_manifest()["pythonDependencies"]) == sorted(declared) + assert result.returncode == 0 def test_entry_point_exists():