diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1dc97d2 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 }} + + 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 + + - 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 }} + + 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 + + - 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 }} + + 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" \ + -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 diff --git a/README.md b/README.md index b55e918..a4f1561 100644 --- a/README.md +++ b/README.md @@ -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] @@ -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 @@ -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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 6a8d74e..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,119 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- master - -jobs: -- job: Windows - - pool: - vmImage: windows-2019 - - steps: - - task: DownloadSecureFile@1 - inputs: - secureFile: 'idasdk70-win.7z' - - - task: DownloadSecureFile@1 - inputs: - secureFile: 'qt-win.7z' - - - checkout: self - submodules: true - - - powershell: | - cd $(Agent.TempDirectory) - - Import-Module BitsTransfer - Invoke-WebRequest -Uri https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip -OutFile ninja-win.zip - - 7z x "$(Agent.TempDirectory)\\qt-win.7z" '-oqt563' - 7z x "$(Agent.TempDirectory)\\idasdk70-win.7z" '-oidasdk70' - 7z x ninja-win.zip '-o$(Build.SourcesDirectory)' - - displayName: Install dependencies - - - task: BatchScript@1 - inputs: - filename: C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat - modifyEnvironment: true - - - powershell: | - mkdir "$(Build.ArtifactStagingDirectory)\\no-py" - - $env:PATH="$(Build.SourcesDirectory);$env:PATH" - $cl=Get-Command cl|Select-Object -ExpandProperty Definition - - mkdir build64-no-py - cd build64-no-py - - cmake .. "-DCMAKE_PREFIX_PATH=$(Agent.TempDirectory)\\qt563" -DPYTHON_SUPPORT=OFF -DIDA_BINARY_64=True -DIDA_EA_64=True "-DIDA_SDK=$(Agent.TempDirectory)\\idasdk70" -G Ninja -DCMAKE_CXX_COMPILER:FILEPATH=$cl -DCMAKE_C_COMPILER:FILEPATH=$cl -DCMAKE_BUILD_TYPE=RelWithDebInfo - ninja - - copy palette\\src\\ida\\ida_palette64.dll $(Build.ArtifactStagingDirectory)\\no-py - - cd .. - mkdir build32-no-py - cd build32-no-py - - cmake .. "-DCMAKE_PREFIX_PATH=$(Agent.TempDirectory)\\qt563" -DPYTHON_SUPPORT=OFF -DIDA_BINARY_64=True -DIDA_EA_64=False "-DIDA_SDK=$(Agent.TempDirectory)\\idasdk70" -G Ninja -DCMAKE_CXX_COMPILER:FILEPATH=$cl -DCMAKE_C_COMPILER:FILEPATH=$cl -DCMAKE_BUILD_TYPE=RelWithDebInfo - ninja - - copy palette\\src\\ida\\ida_palette.dll $(Build.ArtifactStagingDirectory)\\no-py - displayName: Build - - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'win-7.x-both' - -- job: MacOSX - pool: - vmImage: macOS-12 - - steps: - - task: DownloadSecureFile@1 - inputs: - secureFile: 'idasdk70-mac.zip' - - - task: DownloadSecureFile@1 - inputs: - secureFile: 'idalib-7.0-mac.zip' - - - task: DownloadSecureFile@1 - inputs: - secureFile: 'qt5.6.0.txz' - - - checkout: self - submodules: true - - - script: | - brew install cmake ninja - cd $(Build.SourcesDirectory) - unzip $(Agent.TempDirectory)/idasdk70-mac.zip -d idasdk70 - unzip $(Agent.TempDirectory)/idalib-7.0-mac.zip -d idalib-7.0 - tar xvf $(Agent.TempDirectory)/qt5.6.0.txz || exit 100 - - mkdir $(Build.ArtifactStagingDirectory) - - mkdir ../build64 - cd ../build64 - cmake $(Build.SourcesDirectory) -DPYTHON_SUPPORT=OFF -DCMAKE_PREFIX_PATH=$PWD/../qt560/clang_64 -DIDA_SDK=$PWD/../idasdk70 -DIDA_BINARY_64=True -DIDA_EA_64=True -GNinja -DIDA_INSTALL_DIR=$PWD/../idalib-7.0/MacOS -DCMAKE_BUILD_TYPE=RelWithDebInfo - ninja - cp palette/src/ida/ida_palette64.dylib $(Build.ArtifactStagingDirectory) - - mkdir ../build32 - cd ../build32 - cmake $(Build.SourcesDirectory) -DPYTHON_SUPPORT=OFF -DCMAKE_PREFIX_PATH=$PWD/../qt560/clang_64 -DIDA_SDK=$PWD/../idasdk70 -DIDA_BINARY_64=True -DIDA_EA_64=False -GNinja -DIDA_INSTALL_DIR=$PWD/../idalib-7.0/MacOS -DCMAKE_BUILD_TYPE=RelWithDebInfo - ninja - cp palette/src/ida/ida_palette.dylib $(Build.ArtifactStagingDirectory) - - displayName: 'Build' - - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'mac-7.x-both' diff --git a/ida-plugin.json b/ida-plugin.json new file mode 100644 index 0000000..501afcd --- /dev/null +++ b/ida-plugin.json @@ -0,0 +1,26 @@ +{ + "IDAMetadataDescriptorVersion": 2, + "plugin": { + "name": "ifred", + "version": "0.0.5", + "description": "IDA command palette & more", + "entryPoint": "ida_palette64", + "authors": [ + { + "name": "Jinmo", + "email": "jinmoteam@gmail.com" + } + ], + "urls": { + "repository": "https://github.com/Jinmo/ifred" + }, + "license": "MIT", + "platforms": [ + "windows-x86_64", + "linux-x86_64", + "macos-aarch64" + ], + "idaVersions": ["9.2"], + "keywords": ["palette", "command", "launcher", "fuzzy"] + } +}