Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/features-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 revengai
```

It drops the plugin into your IDA user plugin directory and installs the Python
dependencies into the interpreter IDA uses. `hcli plugin upgrade revengai` picks
up new releases, `hcli plugin uninstall revengai` 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.

Expand Down
43 changes: 38 additions & 5 deletions ida-plugin.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
{
"$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",
"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.5",
"loguru==0.7.3",
"pydantic==2.12.3",
"revengai==4.75.0",
"libbs==3.8.1"
]
}
}
4 changes: 1 addition & 3 deletions reai_toolkit/app/core/shared_schema.py
Original file line number Diff line number Diff line change
@@ -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")

Expand Down
2 changes: 1 addition & 1 deletion reai_toolkit_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
69 changes: 69 additions & 0 deletions scripts/emit_plugin_deps.py
Original file line number Diff line number Diff line change
@@ -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())
34 changes: 34 additions & 0 deletions tests/unit/core/test_plugin_manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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__)))))


def _manifest():
with open(os.path.join(ROOT, "ida-plugin.json")) as fh:
return json.load(fh)["plugin"]


def test_python_dependencies_match_uv_lock():
result = subprocess.run([sys.executable, os.path.join(ROOT, "scripts", "emit_plugin_deps.py"), "--check"])

assert result.returncode == 0


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"]
Loading