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
307 changes: 307 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
name: Build IDA Plugin

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build-linux:
runs-on: ubuntu-latest
env:
HCLI_API_KEY: ${{ secrets.HCLI_API_KEY }}
Comment on lines +12 to +13
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HCLI_API_KEY secret is exposed to the entire job environment, which could potentially leak through log outputs or error messages. Consider using the secret only in the specific steps that require it by setting it as an environment variable at the step level rather than the job level, limiting the exposure surface.

Copilot uses AI. Check for mistakes.

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build \
libgl1-mesa-dev libxcb-xinerama0-dev libxkbcommon-dev \
libxcb-cursor-dev libxcb-icccm4-dev libxcb-image0-dev \
libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev \
libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev \
libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev \
libxext-dev libxfixes-dev libxi-dev libxrender-dev libxkbcommon-x11-dev

- name: Install HCLI
run: pip install ida-hcli==0.14.2

- name: Download IDA SDK
run: |
hcli --disable-updates download release/9.2/sdk-and-utilities/idasdk92.zip
unzip -q idasdk92.zip -d ./ida-temp
mv ./ida-temp/src ./ida-sdk

- name: Download and Install IDA Free
run: |
hcli --disable-updates download release/9.2/ida-free/ida-free-pc_92_x64linux.run
chmod +x ida-free-pc_92_x64linux.run
./ida-free-pc_92_x64linux.run --mode unattended --prefix ${{ github.workspace }}/ida

Comment on lines +37 to +46
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hcli download commands and subsequent operations lack explicit error handling. If the download fails or the file is corrupted, the unzip/mv commands will fail with unclear error messages. Consider adding error checking after each critical step or using 'set -e' at the beginning of the script block to ensure the job fails immediately on any error.

Suggested change
hcli --disable-updates download release/9.2/sdk-and-utilities/idasdk92.zip
unzip -q idasdk92.zip -d ./ida-temp
mv ./ida-temp/src ./ida-sdk
- name: Download and Install IDA Free
run: |
hcli --disable-updates download release/9.2/ida-free/ida-free-pc_92_x64linux.run
chmod +x ida-free-pc_92_x64linux.run
./ida-free-pc_92_x64linux.run --mode unattended --prefix ${{ github.workspace }}/ida
set -euo pipefail
hcli --disable-updates download release/9.2/sdk-and-utilities/idasdk92.zip || { echo "ERROR: Failed to download IDA SDK (idasdk92.zip) with hcli."; exit 1; }
if [ ! -f idasdk92.zip ]; then
echo "ERROR: Expected IDA SDK archive 'idasdk92.zip' not found after download."
exit 1
fi
unzip -q idasdk92.zip -d ./ida-temp || { echo "ERROR: Failed to unzip IDA SDK archive 'idasdk92.zip'."; exit 1; }
if [ ! -d ./ida-temp/src ]; then
echo "ERROR: Expected IDA SDK directory './ida-temp/src' not found after unzip."
exit 1
fi
mv ./ida-temp/src ./ida-sdk || { echo "ERROR: Failed to move IDA SDK directory from './ida-temp/src' to './ida-sdk'."; exit 1; }
- name: Download and Install IDA Free
run: |
set -euo pipefail
hcli --disable-updates download release/9.2/ida-free/ida-free-pc_92_x64linux.run || { echo "ERROR: Failed to download IDA Free installer with hcli."; exit 1; }
if [ ! -f ida-free-pc_92_x64linux.run ]; then
echo "ERROR: Expected IDA Free installer 'ida-free-pc_92_x64linux.run' not found after download."
exit 1
fi
chmod +x ida-free-pc_92_x64linux.run || { echo "ERROR: Failed to make IDA Free installer executable."; exit 1; }
./ida-free-pc_92_x64linux.run --mode unattended --prefix ${{ github.workspace }}/ida || { echo "ERROR: IDA Free installer failed."; exit 1; }

Copilot uses AI. Check for mistakes.
- name: Cache Qt6 build
uses: actions/cache@v4
id: qt-cache
with:
path: qt-install
key: ${{ runner.os }}-qt6-6.8.2-qtnamespace-v1
restore-keys: |
${{ runner.os }}-qt6-

- name: Build Qt6 from source (if not cached)
if: steps.qt-cache.outputs.cache-hit != 'true'
run: |
# Download Qt source
curl -L -o qt-src.tar.xz https://download.qt.io/archive/qt/6.8/6.8.2/single/qt-everywhere-src-6.8.2.tar.xz
tar xf qt-src.tar.xz

# Configure Qt with QT_NAMESPACE=QT (required for IDA)
cmake -S qt-everywhere-src-6.8.2 -B qt-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/qt-install \
-DQT_BUILD_EXAMPLES=OFF \
-DQT_BUILD_TESTS=OFF \
-DQT_NAMESPACE=QT \
-DQT_BUILD_SUBMODULES=qtbase \
-DFEATURE_gui=ON \
-DFEATURE_widgets=ON \
-DFEATURE_opengl=ON \
-DFEATURE_network=OFF \
-DFEATURE_sql=OFF \
-DFEATURE_dbus=OFF \
-DFEATURE_concurrent=OFF \
-DFEATURE_printsupport=OFF

# Build and install
cmake --build qt-build --parallel
cmake --install qt-build

- name: Configure CMake
run: |
cmake -B build -G Ninja \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/qt-install \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DPYTHON_SUPPORT=OFF \
-DIDA_SDK=${{ github.workspace }}/ida-sdk \
-DIDA_INSTALL_DIR=${{ github.workspace }}/ida \
-DIDA_BINARY_64=ON \
-DIDA_EA_64=ON

- name: Build
run: cmake --build build --parallel

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ifred-linux-64
path: build/palette/src/ida/*.so

build-windows:
runs-on: windows-latest
env:
HCLI_API_KEY: ${{ secrets.HCLI_API_KEY }}
Comment on lines +106 to +107
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HCLI_API_KEY secret is exposed to the entire job environment, which could potentially leak through log outputs or error messages. Consider using the secret only in the specific steps that require it by setting it as an environment variable at the step level rather than the job level, limiting the exposure surface.

Copilot uses AI. Check for mistakes.

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Setup Visual Studio Developer Environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Install HCLI
run: pip install ida-hcli==0.14.2

- name: Download IDA SDK
shell: bash
run: |
hcli --disable-updates download release/9.2/sdk-and-utilities/idasdk92.zip
unzip -q idasdk92.zip -d ./ida-temp
mv ./ida-temp/src ./ida-sdk

- name: Cache Qt6 build
uses: actions/cache@v4
id: qt-cache
with:
path: qt-install
key: ${{ runner.os }}-qt6-6.8.2-qtnamespace-v1
restore-keys: |
${{ runner.os }}-qt6-

- name: Build Qt6 from source (if not cached)
if: steps.qt-cache.outputs.cache-hit != 'true'
shell: bash
run: |
# Download Qt source
curl -L -o qt-src.tar.xz https://download.qt.io/archive/qt/6.8/6.8.2/single/qt-everywhere-src-6.8.2.tar.xz
tar xf qt-src.tar.xz

# Configure Qt with QT_NAMESPACE=QT (required for IDA)
cmake -S qt-everywhere-src-6.8.2 -B qt-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/qt-install" \
-DQT_BUILD_EXAMPLES=OFF \
-DQT_BUILD_TESTS=OFF \
-DQT_NAMESPACE=QT \
-DQT_BUILD_SUBMODULES=qtbase \
-DFEATURE_gui=ON \
-DFEATURE_widgets=ON \
-DFEATURE_opengl=ON \
-DFEATURE_network=OFF \
-DFEATURE_sql=OFF \
-DFEATURE_dbus=OFF \
-DFEATURE_concurrent=OFF \
-DFEATURE_printsupport=OFF

# Build and install
cmake --build qt-build --parallel
cmake --install qt-build

- name: Configure CMake
shell: bash
run: |
cmake -B build -G Ninja \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/qt-install" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DPYTHON_SUPPORT=OFF \
-DIDA_SDK="${{ github.workspace }}/ida-sdk" \
-DIDA_BINARY_64=ON \
-DIDA_EA_64=ON
Comment on lines +173 to +182
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows build job is missing the IDA installation step that is present in both the Linux (line 41-45) and macOS (line 218-223) jobs. Without IDA installed, the DIDA_INSTALL_DIR CMake variable is not set, which may cause the build to fail if the CMake configuration requires it. Consider adding a step to download and install IDA Free for Windows similar to the other platforms.

Copilot uses AI. Check for mistakes.

- name: Build
run: cmake --build build --parallel

- name: Upload artifacts (64-bit)
uses: actions/upload-artifact@v4
with:
name: ifred-windows-64
path: build/palette/src/ida/*.dll

build-macos:
runs-on: macos-latest # arm64 runner
env:
HCLI_API_KEY: ${{ secrets.HCLI_API_KEY }}
Comment on lines +195 to +196
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HCLI_API_KEY secret is exposed to the entire job environment, which could potentially leak through log outputs or error messages. Consider using the secret only in the specific steps that require it by setting it as an environment variable at the step level rather than the job level, limiting the exposure surface.

Copilot uses AI. Check for mistakes.

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install build dependencies
run: brew install cmake ninja

- name: Install HCLI
run: pip3 install ida-hcli==0.14.2 --break-system-packages

- name: Download IDA SDK
run: |
hcli --disable-updates download release/9.2/sdk-and-utilities/idasdk92.zip
unzip -q idasdk92.zip -d ./ida-temp
mv ./ida-temp/src ./ida-sdk

- name: Download and Install IDA Free
run: |
hcli --disable-updates download "release/9.2/ida-free/ida-free-pc_92_armmac.app.zip"
unzip -q ida-free-pc_92_armmac.app.zip
./ida-free-pc_92_armmac.app/Contents/MacOS/installbuilder.sh --mode unattended --prefix ${{ github.workspace }}/ida-install

- name: Cache Qt6 build
uses: actions/cache@v4
id: qt-cache
with:
path: qt-install
key: ${{ runner.os }}-qt6-6.8.2-arm64-qtnamespace-v1
restore-keys: |
${{ runner.os }}-qt6-arm64-

- name: Build Qt6 from source (if not cached)
if: steps.qt-cache.outputs.cache-hit != 'true'
run: |
# Download Qt source
curl -L -o qt-src.tar.xz https://download.qt.io/archive/qt/6.8/6.8.2/single/qt-everywhere-src-6.8.2.tar.xz
tar xf qt-src.tar.xz

# Configure Qt with QT_NAMESPACE=QT (required for IDA)
cmake -S qt-everywhere-src-6.8.2 -B qt-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/qt-install \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DQT_BUILD_EXAMPLES=OFF \
-DQT_BUILD_TESTS=OFF \
-DQT_NAMESPACE=QT \
-DQT_BUILD_SUBMODULES=qtbase \
-DFEATURE_gui=ON \
-DFEATURE_widgets=ON \
-DFEATURE_opengl=ON \
-DFEATURE_network=OFF \
-DFEATURE_sql=OFF \
-DFEATURE_dbus=OFF \
-DFEATURE_concurrent=OFF \
-DFEATURE_printsupport=OFF

# Build and install
cmake --build qt-build --parallel
cmake --install qt-build

- name: Configure CMake
run: |
cmake -B build -G Ninja \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/qt-install \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DPYTHON_SUPPORT=OFF \
-DIDA_SDK=${{ github.workspace }}/ida-sdk \
-DIDA_INSTALL_DIR="${{ github.workspace }}/ida-install/IDA Free 9.2.app/Contents/MacOS" \
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DIDA_INSTALL_DIR path contains a hardcoded version-specific directory name "IDA Free 9.2.app". This creates a maintenance burden as the path will need to be updated whenever IDA version changes. Consider using a variable or dynamically finding the IDA installation path to make the workflow more maintainable.

Copilot uses AI. Check for mistakes.
-DIDA_BINARY_64=ON \
-DIDA_EA_64=ON

- name: Build
run: cmake --build build --parallel

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ifred-macos-arm64
path: build/palette/src/ida/*.dylib

package:
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-macos]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Create plugin package
run: |
mkdir -p package
cp ida-plugin.json package/
cp artifacts/ifred-linux-64/*.so package/
cp artifacts/ifred-windows-64/*.dll package/
cp artifacts/ifred-macos-arm64/*.dylib package/
cd package && zip -r ../ifred-plugin.zip .

- name: Upload plugin package
uses: actions/upload-artifact@v4
with:
name: ifred-plugin
path: ifred-plugin.zip
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# IDA command palette & more

[![Build Status](https://jinmo123.visualstudio.com/idapkg/_apis/build/status/Jinmo.ifred?branchName=master)](https://jinmo123.visualstudio.com/idapkg/_build/latest?definitionId=1&branchName=master) ![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/jinmo/ifred)
[![Build IDA Plugin](https://github.com/Jinmo/ifred/actions/workflows/build.yml/badge.svg)](https://github.com/Jinmo/ifred/actions/workflows/build.yml)
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/jinmo/ifred)

![screenshot1][01]

Expand All @@ -22,7 +23,7 @@ For easier compiling, use Qt6 artifacts provided by [Binary Ninja Crew][05]

You can download prebuilt binaries with Qt6 from this [repo][06].

You can download older [prebuilt plugins][07] with Qt5 from azure pipelines.
You can download older [prebuilt plugins][07] with Qt5 from the releases page.

## Python API

Expand Down Expand Up @@ -108,4 +109,4 @@ solarized dark:
[04]: https://github.com/Jinmo/ifred/tree/qt5
[05]: https://github.com/Vector35/qt-artifacts/releases
[06]: https://github.com/blue-devil/ifred/releases
[07]: https://jinmo123.visualstudio.com/idapkg/_build/latest?definitionId=1&branchName=master
[07]: https://github.com/Jinmo/ifred/releases
Loading
Loading