diff --git a/.github/patches/binexport-bdb8c4430549e69d4a9a7531c59b197f3a0757e6.patch b/.github/patches/binexport-bdb8c4430549e69d4a9a7531c59b197f3a0757e6.patch new file mode 100644 index 000000000..c8a3f0590 --- /dev/null +++ b/.github/patches/binexport-bdb8c4430549e69d4a9a7531c59b197f3a0757e6.patch @@ -0,0 +1,83 @@ +diff --git a/cmake/FindIdaSdk.cmake b/cmake/FindIdaSdk.cmake +index 307f192..8f83322 100644 +--- a/cmake/FindIdaSdk.cmake ++++ b/cmake/FindIdaSdk.cmake +@@ -99,6 +99,7 @@ else() + endif() + + message(STATUS "IDA_SDK_VERSION = ${IDA_SDK_VERSION}") ++add_compile_definitions(IDA_SDK_VERSION=${IDA_SDK_VERSION}) + + # Define some platform specific variables for later use. + set(_so "${CMAKE_SHARED_LIBRARY_SUFFIX}") +@@ -193,37 +194,49 @@ if(APPLE) + ) + else() # IDA SDK 9.0+ + _ida_get_libpath_suffixes(_ida64_x64_suffixes "x64_mac_clang_64") +- find_path(IdaSdk_LIBPATH64_X64 libida.dylib ++ find_path(IdaSdk_LIBPATH64_X64 NAMES libida.tbd libida.dylib + PATHS "${IdaSdk_DIR}/lib" PATH_SUFFIXES ${_ida64_x64_suffixes} + NO_DEFAULT_PATH REQUIRED + ) + _ida_get_libpath_suffixes(_ida64_arm64_suffixes "arm64_mac_clang_64") +- find_path(IdaSdk_LIBPATH64_ARM64 libida.dylib ++ find_path(IdaSdk_LIBPATH64_ARM64 NAMES libida.tbd libida.dylib + PATHS "${IdaSdk_DIR}/lib" PATH_SUFFIXES ${_ida64_arm64_suffixes} + NO_DEFAULT_PATH REQUIRED + ) +- if(NOT TARGET ida64_universal) +- set(_ida64_universal_lib +- "${CMAKE_CURRENT_BINARY_DIR}/libida_universal.dylib" +- CACHE INTERNAL "" ++ add_library(ida64 SHARED IMPORTED) ++ if(EXISTS "${IdaSdk_LIBPATH64_ARM64}/libida.tbd") ++ set(_ida_tbd "${IdaSdk_LIBPATH64_ARM64}/libida.tbd") ++ elseif(EXISTS "${IdaSdk_LIBPATH64_X64}/libida.tbd") ++ set(_ida_tbd "${IdaSdk_LIBPATH64_X64}/libida.tbd") ++ endif() ++ if(_ida_tbd) ++ message(STATUS "Using IDA text-based stub library: ${_ida_tbd}") ++ set_target_properties(ida64 PROPERTIES ++ IMPORTED_LOCATION "${_ida_tbd}" + ) +- # Create a new "universal" library to allow the linker to select the +- # correct one per architecture. Ideally, Hex Rays would just compile +- # libida64.dylib as a universal bundle. +- add_custom_target(ida64_universal +- DEPENDS "${IdaSdk_LIBPATH64_ARM64}/libida.dylib" +- "${IdaSdk_LIBPATH64_X64}/libida.dylib" +- BYPRODUCTS "${_ida64_universal_lib}" +- COMMAND lipo -create "${IdaSdk_LIBPATH64_ARM64}/libida.dylib" +- "${IdaSdk_LIBPATH64_X64}/libida.dylib" +- -output "${_ida64_universal_lib}" ++ else() ++ if(NOT TARGET ida64_universal) ++ set(_ida64_universal_lib ++ "${CMAKE_CURRENT_BINARY_DIR}/libida_universal.dylib" ++ CACHE INTERNAL "" ++ ) ++ # Create a new "universal" library to allow the linker to select the ++ # correct one per architecture. Ideally, Hex Rays would just compile ++ # libida64.dylib as a universal bundle. ++ add_custom_target(ida64_universal ++ DEPENDS "${IdaSdk_LIBPATH64_ARM64}/libida.dylib" ++ "${IdaSdk_LIBPATH64_X64}/libida.dylib" ++ BYPRODUCTS "${_ida64_universal_lib}" ++ COMMAND lipo -create "${IdaSdk_LIBPATH64_ARM64}/libida.dylib" ++ "${IdaSdk_LIBPATH64_X64}/libida.dylib" ++ -output "${_ida64_universal_lib}" ++ ) ++ endif() ++ add_dependencies(ida64 ida64_universal) ++ set_target_properties(ida64 PROPERTIES ++ IMPORTED_LOCATION "${_ida64_universal_lib}" + ) + endif() +- add_library(ida SHARED IMPORTED) +- add_dependencies(ida ida64_universal) +- set_target_properties(ida PROPERTIES +- IMPORTED_LOCATION "${_ida64_universal_lib}" +- ) + + endif() + diff --git a/.github/patches/binexport-findidasdk-sdk94-libdirs.patch b/.github/patches/binexport-findidasdk-sdk94-libdirs.patch new file mode 100644 index 000000000..ad6cc3ceb --- /dev/null +++ b/.github/patches/binexport-findidasdk-sdk94-libdirs.patch @@ -0,0 +1,24 @@ +diff --git a/cmake/FindIdaSdk.cmake b/cmake/FindIdaSdk.cmake +index 9e0cfa1..ac692e8 100644 +--- a/cmake/FindIdaSdk.cmake ++++ b/cmake/FindIdaSdk.cmake +@@ -111,10 +111,16 @@ set(_llx "${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(_llx64 "64${CMAKE_SHARED_LIBRARY_SUFFIX}") # An additional "64" + + function(_ida_get_libpath_suffixes var basename) +- # IDA SDK 8.3 introduced lib path suffixes per edition +- foreach(_suffix IN ITEMS "" "_teams" "_pro" "_home") +- list(APPEND _suffixes "${basename}${_suffix}") ++ # The open-sourced SDK (9.4+) drops the compiler token from lib dir names, ++ # e.g. x64_mac_64 instead of x64_mac_clang_64. Search both spellings. ++ string(REGEX REPLACE "_(clang|gcc|vc)_" "_" _basename_nocompiler "${basename}") ++ foreach(_base IN ITEMS "${basename}" "${_basename_nocompiler}") ++ # IDA SDK 8.3 introduced lib path suffixes per edition ++ foreach(_suffix IN ITEMS "" "_teams" "_pro" "_home") ++ list(APPEND _suffixes "${_base}${_suffix}") ++ endforeach() + endforeach() ++ list(REMOVE_DUPLICATES _suffixes) + set("${var}" "${_suffixes}" PARENT_SCOPE) + endfunction() + diff --git a/.github/workflows/build-single.yml b/.github/workflows/build-single.yml new file mode 100644 index 000000000..aa01ae4c6 --- /dev/null +++ b/.github/workflows/build-single.yml @@ -0,0 +1,297 @@ +name: build-single + +on: + workflow_dispatch: + inputs: + ida_version: + description: "IDA version to build for (e.g. 9.3 or latest)" + required: false + default: "latest" + type: string + release_tag: + description: "Existing release tag to append the artifact to (e.g. v8.0.0, latest, or none to skip release)" + required: false + default: "none" + type: string + repository_dispatch: + types: [build-single] + +permissions: read-all + +concurrency: + group: build-single-${{ github.event.inputs.ida_version || github.event.client_payload.ida_version || 'latest' }} + cancel-in-progress: true + +jobs: + resolve: + runs-on: ubuntu-latest + outputs: + ida_version: ${{ steps.resolve.outputs.ida_version }} + release_tag: ${{ steps.resolve.outputs.release_tag }} + steps: + - name: Resolve inputs + id: resolve + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INPUT_VERSION: ${{ github.event.inputs.ida_version || github.event.client_payload.ida_version || 'latest' }} + INPUT_TAG: ${{ github.event.inputs.release_tag || github.event.client_payload.release_tag || 'latest' }} + shell: bash + run: | + # IDA versions covered by the SDK repo (tags vX.Y.Z-release / vX.Y.Z-sdk.N) + available=$(git ls-remote --tags --refs https://github.com/HexRaysSA/ida-sdk \ + | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+-(release|sdk\.[0-9]+)$' \ + | sed -E 's/^v([0-9]+\.[0-9]+)\..*/\1/' \ + | sort -Vu) + + # Resolve IDA version + if [ "$INPUT_VERSION" = "latest" ]; then + version=$(echo "$available" | tail -1) + if [ -z "$version" ]; then + echo "ERROR: Could not resolve latest IDA version from the SDK repo" + exit 1 + fi + echo "Resolved IDA version 'latest' to $version" + else + version="$INPUT_VERSION" + # Verify the requested version exists + if ! echo "$available" | grep -qx "$version"; then + echo "ERROR: IDA version $version not found. Available versions:" + echo "$available" + exit 1 + fi + fi + echo "ida_version=$version" >> "$GITHUB_OUTPUT" + + # Resolve release tag + if [ "$INPUT_TAG" = "none" ]; then + tag="none" + echo "Release: skipped" + elif [ "$INPUT_TAG" = "latest" ]; then + tag=$(gh release list --repo "${{ github.repository }}" --limit 1 --json tagName -q '.[0].tagName') + if [ -z "$tag" ]; then + echo "ERROR: No releases found in this repository" + exit 1 + fi + echo "Resolved release tag 'latest' to $tag" + else + tag="$INPUT_TAG" + # Verify the release exists + if ! gh release view "$tag" --repo "${{ github.repository }}" > /dev/null 2>&1; then + echo "ERROR: Release $tag not found" + exit 1 + fi + fi + echo "release_tag=$tag" >> "$GITHUB_OUTPUT" + + - name: Check if version already exists in release + if: steps.resolve.outputs.release_tag != 'none' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_TAG: ${{ steps.resolve.outputs.release_tag }} + IDA_VERSION: ${{ steps.resolve.outputs.ida_version }} + shell: bash + run: | + if gh release view "$RELEASE_TAG" --repo "${{ github.repository }}" --json assets -q '.assets[].name' \ + | grep -qx "bindiff-ida${IDA_VERSION}.zip"; then + echo "ERROR: bindiff-ida${IDA_VERSION}.zip already exists in release $RELEASE_TAG" + exit 1 + fi + + build: + needs: resolve + permissions: + contents: write + name: IDA ${{ needs.resolve.outputs.ida_version }} on ${{ matrix.os_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-2022 + - macos-latest + include: + - os: ubuntu-latest + os_name: "linux" + - os: windows-2022 + os_name: "windows" + - os: macos-latest + os_name: "macos" + env: + IDA_VERSION: ${{ needs.resolve.outputs.ida_version }} + + steps: + - name: Setup MSBuild + if: matrix.os_name == 'windows' + uses: microsoft/setup-msbuild@v1.1 + + - name: Setup Visual Studio 2022 + if: matrix.os_name == 'windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + vsversion: 2022 + + - name: Setup uv + uses: astral-sh/setup-uv@v5 + + - name: Fetch IDA SDK + shell: bash + run: | + # Use the newest SDK tag targeting this IDA version. sort -V orders + # vX.Y.Z-release before vX.Y.Z-sdk.N, i.e. chronologically. + SDK_TAG=$(git ls-remote --tags --refs https://github.com/HexRaysSA/ida-sdk \ + | grep -oE "v${IDA_VERSION}\.[0-9]+-(release|sdk\.[0-9]+)$" \ + | sort -V | tail -1) + if [ -z "$SDK_TAG" ]; then + echo "ERROR: no SDK tag found for IDA $IDA_VERSION" + exit 1 + fi + echo "Using SDK tag: $SDK_TAG" + + # Only check out the headers and this platform's stub libraries. + case "$RUNNER_OS" in + Linux) LIB_DIRS="/src/lib/x64_linux*_64/" ;; + macOS) LIB_DIRS="/src/lib/*_mac*_64/" ;; + Windows) LIB_DIRS="/src/lib/x64_win*_64/" ;; + esac + git -c advice.detachedHead=false clone --quiet --depth 1 --filter=blob:none --sparse --branch "$SDK_TAG" \ + https://github.com/HexRaysSA/ida-sdk ida-sdk-git + printf '%s\n' /src/include/ /src/plugins/exports.def "$LIB_DIRS" \ + | git -C ida-sdk-git sparse-checkout set --no-cone --stdin + mv ida-sdk-git/src ./ida-sdk + rm -rf ida-sdk-git + + if [ ! -f ida-sdk/include/pro.h ]; then + echo "ERROR: include/pro.h missing from the SDK checkout" + exit 1 + fi + echo "SDK lib dirs:" + ls ida-sdk/lib + + - name: Checkout bindiff + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: "recursive" + path: bindiff + ref: ${{ needs.resolve.outputs.release_tag != 'none' && needs.resolve.outputs.release_tag || '' }} + + - name: Setup CMake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.28.x' + + - name: Install Ninja + run: uv tool install ninja + + - name: Checkout BinExport + uses: actions/checkout@v4 + with: + repository: google/binexport + path: binexport + ref: 644786690fcb6bcf6d42a76e7d8b65056176054d + + # When building for an existing release, bindiff is checked out at the + # release tag, whose BinExport patches may predate the SDK being built + # against. Always take the patches from the ref this workflow runs from. + - name: Checkout CI patches + uses: actions/checkout@v4 + with: + path: ci + sparse-checkout: .github/patches + sparse-checkout-cone-mode: false + + - name: Patch BinExport FindIdaSdk for open-sourced SDK (9.4+) lib dirs + shell: bash + run: | + cd binexport + git apply --verbose ../ci/.github/patches/binexport-findidasdk-sdk94-libdirs.patch + + - name: Patch BinExport for IDA SDK 9.x on macOS + if: matrix.os_name == 'macos' + shell: bash + run: | + cd binexport + git apply --verbose ../ci/.github/patches/binexport-bdb8c4430549e69d4a9a7531c59b197f3a0757e6.patch + + - name: Configure BinDiff build + working-directory: ./bindiff/ + shell: bash + run: | + if [ "${{ matrix.os_name }}" = "macos" ]; then + CMAKE_EXTRA_FLAGS="-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" + else + CMAKE_EXTRA_FLAGS="" + fi + + cmake -S . -B ../build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=../install \ + -DBINDIFF_BINEXPORT_DIR=../binexport \ + "-DIdaSdk_ROOT_DIR=$PWD/../ida-sdk" \ + $CMAKE_EXTRA_FLAGS + + - name: Build BinDiff + shell: bash + run: cmake --build build --config Release --parallel 4 + + - name: Run tests + shell: bash + run: ctest --test-dir build --build-config Release --output-on-failure + + - name: Install BinDiff + shell: bash + run: cmake --install build --config Release + + - name: Collect artifacts + working-directory: ./bindiff/ + shell: bash + run: | + mkdir -p ../artifacts + cp -v ../install/bindiff-prefix/* ../artifacts/ + jq ".plugin.idaVersions = \"==${IDA_VERSION}\"" ida/ida-plugin.json > ../artifacts/ida-plugin.json + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: bindiff-ida${{ env.IDA_VERSION }}-${{ matrix.os_name }} + path: artifacts/* + if-no-files-found: error + + release: + if: needs.resolve.outputs.release_tag != 'none' + needs: [resolve, build] + runs-on: ubuntu-latest + permissions: + contents: write + env: + IDA_VERSION: ${{ needs.resolve.outputs.ida_version }} + RELEASE_TAG: ${{ needs.resolve.outputs.release_tag }} + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create archive + shell: bash + run: | + mkdir -p stage + for dir in artifacts/bindiff-ida${IDA_VERSION}-*/; do + [ -d "$dir" ] && cp -v "$dir"/* stage/ + done + + rm -f stage/bindiff stage/bindiff.exe + rm -f stage/bindiff_config_setup* + rm -f stage/bindiff_launcher_macos + + cd stage + zip -r "../bindiff-ida${IDA_VERSION}.zip" * + + - name: Append to release + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload "$RELEASE_TAG" "bindiff-ida${IDA_VERSION}.zip" \ + --repo "${{ github.repository }}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..4ec237ac9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,238 @@ +name: build + +on: + push: + branches: [main, ci-gha] + tags: + - "v*" + pull_request: + branches: [main] + workflow_dispatch: + +permissions: read-all + +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + +jobs: + discover: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.get-versions.outputs.versions }} + steps: + - name: Discover available IDA versions + id: get-versions + shell: bash + run: | + # The SDK repo tags every IDA release as vX.Y.Z-release and SDK-only + # follow-ups as vX.Y.Z-sdk.N. Extract the unique IDA X.Y versions. + versions=$(git ls-remote --tags --refs https://github.com/HexRaysSA/ida-sdk \ + | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+-(release|sdk\.[0-9]+)$' \ + | sed -E 's/^v([0-9]+\.[0-9]+)\..*/\1/' \ + | sort -Vu \ + | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "versions=$versions" >> "$GITHUB_OUTPUT" + echo "Discovered IDA versions: $versions" + + build: + needs: discover + permissions: + contents: write + name: IDA ${{ matrix.ida_version }} on ${{ matrix.os_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + ida_version: ${{ fromJson(needs.discover.outputs.versions) }} + os: + - ubuntu-latest + - windows-2022 + - macos-latest + include: + - os: ubuntu-latest + os_name: "linux" + - os: windows-2022 + os_name: "windows" + - os: macos-latest + os_name: "macos" + + steps: + - name: Setup MSBuild + if: matrix.os_name == 'windows' + uses: microsoft/setup-msbuild@v1.1 + + - name: Setup Visual Studio 2022 + if: matrix.os_name == 'windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + vsversion: 2022 + + - name: Setup uv + # on act, need use v5 instead of v6, due to: + # https://github.com/astral-sh/setup-uv/issues/535 + # (ultimately an issue with act images) + uses: astral-sh/setup-uv@v5 + + - name: Fetch IDA SDK ${{ matrix.ida_version }} + shell: bash + env: + IDA_VERSION: ${{ matrix.ida_version }} + run: | + # Use the newest SDK tag targeting this IDA version. sort -V orders + # vX.Y.Z-release before vX.Y.Z-sdk.N, i.e. chronologically. + SDK_TAG=$(git ls-remote --tags --refs https://github.com/HexRaysSA/ida-sdk \ + | grep -oE "v${IDA_VERSION}\.[0-9]+-(release|sdk\.[0-9]+)$" \ + | sort -V | tail -1) + if [ -z "$SDK_TAG" ]; then + echo "ERROR: no SDK tag found for IDA $IDA_VERSION" + exit 1 + fi + echo "Using SDK tag: $SDK_TAG" + + # Only check out the headers and this platform's stub libraries. + case "$RUNNER_OS" in + Linux) LIB_DIRS="/src/lib/x64_linux*_64/" ;; + macOS) LIB_DIRS="/src/lib/*_mac*_64/" ;; + Windows) LIB_DIRS="/src/lib/x64_win*_64/" ;; + esac + git -c advice.detachedHead=false clone --quiet --depth 1 --filter=blob:none --sparse --branch "$SDK_TAG" \ + https://github.com/HexRaysSA/ida-sdk ida-sdk-git + printf '%s\n' /src/include/ /src/plugins/exports.def "$LIB_DIRS" \ + | git -C ida-sdk-git sparse-checkout set --no-cone --stdin + mv ida-sdk-git/src ./ida-sdk + rm -rf ida-sdk-git + + if [ ! -f ida-sdk/include/pro.h ]; then + echo "ERROR: include/pro.h missing from the SDK checkout" + exit 1 + fi + echo "SDK lib dirs:" + ls ida-sdk/lib + + - name: Checkout bindiff + # on act, need use v4 instead of v5 due to node24 reference + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: "recursive" + path: bindiff + + - name: Setup CMake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.28.x' + + - name: Install Ninja + run: uv tool install ninja + + - name: Checkout BinExport + uses: actions/checkout@v4 + with: + repository: google/binexport + path: binexport + ref: 644786690fcb6bcf6d42a76e7d8b65056176054d + + - name: Patch BinExport FindIdaSdk for open-sourced SDK (9.4+) lib dirs + shell: bash + run: | + cd binexport + git apply --verbose ../bindiff/.github/patches/binexport-findidasdk-sdk94-libdirs.patch + + # There's a bug in BinExport's IDA 9+ support on macOS + # reported here: https://github.com/google/binexport/issues/159 + - name: Patch BinExport for IDA SDK 9.x on macOS + if: matrix.os_name == 'macos' + shell: bash + run: | + cd binexport + git apply --verbose ../bindiff/.github/patches/binexport-bdb8c4430549e69d4a9a7531c59b197f3a0757e6.patch + + - name: Configure BinDiff build + working-directory: ./bindiff/ + shell: bash + run: | + # Build universal binaries on macOS (both arm64 and x86_64) + if [ "${{ matrix.os_name }}" = "macos" ]; then + CMAKE_EXTRA_FLAGS="-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" + else + CMAKE_EXTRA_FLAGS="" + fi + + cmake -S . -B ../build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=../install \ + -DBINDIFF_BINEXPORT_DIR=../binexport \ + "-DIdaSdk_ROOT_DIR=$PWD/../ida-sdk" \ + $CMAKE_EXTRA_FLAGS + + - name: Build BinDiff + shell: bash + run: | + cmake --build build --config Release --parallel 4 + + - name: Run tests + shell: bash + run: ctest --test-dir build --build-config Release --output-on-failure + + - name: Install BinDiff + shell: bash + run: cmake --install build --config Release + + - name: Collect artifacts + working-directory: ./bindiff/ + shell: bash + run: | + mkdir -p ../artifacts + cp -v ../install/bindiff-prefix/* ../artifacts/ + jq '.plugin.idaVersions = "==${{ matrix.ida_version }}"' ida/ida-plugin.json > ../artifacts/ida-plugin.json + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: bindiff-ida${{ matrix.ida_version }}-${{ matrix.os_name }} + path: artifacts/* + if-no-files-found: error + + release: + if: startsWith(github.ref, 'refs/tags/v') + needs: [discover, build] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create per-version archives + shell: bash + run: | + versions='${{ needs.discover.outputs.versions }}' + for version in $(echo "$versions" | jq -r '.[]'); do + echo "Creating archive for IDA $version..." + mkdir -p "stage-${version}" + + # Merge artifacts from all OSes for this version + for dir in artifacts/bindiff-ida${version}-*/; do + [ -d "$dir" ] && cp -v "$dir"/* "stage-${version}/" + done + + # Remove non-plugin files + rm -f "stage-${version}/bindiff" "stage-${version}/bindiff.exe" + rm -f "stage-${version}"/bindiff_config_setup* + rm -f "stage-${version}"/bindiff_launcher_macos + + cd "stage-${version}" + zip -r "../bindiff-ida${version}.zip" * + cd .. + done + + - name: Upload release assets + uses: softprops/action-gh-release@v2 + with: + files: bindiff-ida*.zip + fail_on_unmatched_files: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index ca9ffeabb..000000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: cmake-build - -on: [push, pull_request] - -env: - BUILD_TYPE: Release - -jobs: - build: - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-22.04 - - os: macos-12 - - os: windows-2022 - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - with: - path: bindiff - - uses: actions/checkout@v4 - with: - repository: google/binexport - path: binexport - - - name: Install ninja-build tool - uses: turtlesec-no/get-ninja@1.1.0 - - - name: Create Build Environment - env: - IDASDK_SECRET: ${{ secrets.IDASDK_SECRET }} - working-directory: ${{ github.workspace }} - shell: bash - run: | - mkdir -p "${{ runner.workspace }}/build" \ - ida/idasdk - mv binexport/ida/idasdk/idasdk*.gpg \ - ida/idasdk/ - binexport/.github/scripts/decrypt_secret.sh - unzip -q "${{ runner.workspace }}/build/idasdk_teams82.zip" \ - -d "${{ runner.workspace }}/build/" - - - name: Enable Developer Command Prompt (Windows) - if: matrix.os == 'windows-2022' - uses: ilammy/msvc-dev-cmd@v1.12.1 - - - name: Enable mold linker (Linux) - if: matrix.os == 'ubuntu-22.04' - uses: rui314/setup-mold@v1 - - - name: Configure CMake - working-directory: ${{ runner.workspace }}/build - shell: bash - run: | - cmake "${{ github.workspace }}/bindiff" -G Ninja \ - "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \ - "-DIdaSdk_ROOT_DIR=${{ runner.workspace }}/build/idasdk_teams82" - - - name: Build - working-directory: ${{ runner.workspace }}/build - shell: bash - run: cmake --build . --config "${BUILD_TYPE}" - - - name: Test - working-directory: ${{ runner.workspace }}/build - shell: bash - run: ctest --build-config "${BUILD_TYPE}" --output-on-failure -R '^[A-Z]' - - - name: Upload Build Artifacts - uses: actions/upload-artifact@v3.1.2 - with: - name: BinDiff-${{ runner.os }} - path: | - ${{ runner.workspace }}/build/bindiff - ${{ runner.workspace }}/build/ida/bindiff* - ${{ runner.workspace }}/build/tools/bindiff* diff --git a/ida/ida-plugin.json b/ida/ida-plugin.json new file mode 100644 index 000000000..0f5f744c0 --- /dev/null +++ b/ida/ida-plugin.json @@ -0,0 +1,47 @@ +{ + "IDAMetadataDescriptorVersion": 1, + "plugin": { + "name": "bindiff", + "entryPoint": "bindiff8_ida64", + "version": "8.0.1", + "idaVersions": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5"], + "platforms": [ + "windows-x86_64", + "linux-x86_64", + "macos-x86_64", + "macos-aarch64" + ], + "description": "Compare binary files to quickly find differences and similarities in disassembled code", + "license": "Apache-2.0", + "categories": [ + "integration-with-third-parties-interoperability", + "collaboration-and-productivity" + ], + "keywords": [ + "bindiff", + "binary-diffing", + "comparison", + "vulnerability-research", + "patch-analysis" + ], + "urls": { + "repository": "https://github.com/HexRaysSA/bindiff" + }, + "authors": [ + { + "name": "Christian Blichmann", + "email": "cblichmann@google.com" + }, + { + "name": "BinDiff Authors", + "email": "bindiff-team@google.com" + } + ], + "maintainers": [ + { + "name": "Willi Ballenthin", + "email": "wballenthin@hex-rays.com" + } + ] + } +}