Skip to content

Commit dba4e49

Browse files
Merge pull request #2 from reversedcodes/feat/hcli-plugin-manager-support
Feat/hcli plugin manager support
2 parents 5b026a3 + 5176e9c commit dba4e49

4 files changed

Lines changed: 75 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ jobs:
1919
- os: ubuntu-latest
2020
artifact: linux-x64
2121
binary: build/ida_plugins/ida_discord_rpc.so
22+
cmake_args: ''
2223
- os: windows-latest
2324
artifact: windows-x64
2425
binary: build/ida_plugins/ida_discord_rpc.dll
26+
cmake_args: ''
2527
- os: macos-latest
26-
artifact: macos-x64
28+
artifact: macos-universal
2729
binary: build/ida_plugins/ida_discord_rpc.dylib
30+
cmake_args: '-DCMAKE_OSX_ARCHITECTURES=arm64'
2831
runs-on: ${{ matrix.os }}
2932
steps:
3033
- uses: actions/checkout@v4
@@ -41,10 +44,28 @@ jobs:
4144
- if: runner.os == 'Windows'
4245
uses: ilammy/msvc-dev-cmd@v1
4346

44-
- run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
47+
- run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_args }}
4548

4649
- run: cmake --build build
4750

51+
- if: runner.os == 'macOS'
52+
run: |
53+
cmake -S . -B build-x64 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64
54+
cmake --build build-x64
55+
lipo -create \
56+
build/ida_plugins/ida_discord_rpc.dylib \
57+
build-x64/ida_plugins/ida_discord_rpc.dylib \
58+
-output ida_discord_rpc-universal.dylib
59+
mv ida_discord_rpc-universal.dylib build/ida_plugins/ida_discord_rpc.dylib
60+
archs=$(lipo -archs build/ida_plugins/ida_discord_rpc.dylib)
61+
echo "universal dylib architectures: $archs"
62+
for want in arm64 x86_64; do
63+
case " $archs " in
64+
*" $want "*) ;;
65+
*) echo "::error::missing $want slice in universal dylib"; exit 1 ;;
66+
esac
67+
done
68+
4869
- uses: actions/upload-artifact@v4
4970
with:
5071
name: ida_discord_rpc-${{ matrix.artifact }}
@@ -71,7 +92,7 @@ jobs:
7192
cp assets/ida-discord.png pkg/assets/
7293
cp dist/ida_discord_rpc-linux-x64/ida_discord_rpc.so pkg/
7394
cp dist/ida_discord_rpc-windows-x64/ida_discord_rpc.dll pkg/
74-
cp dist/ida_discord_rpc-macos-x64/ida_discord_rpc.dylib pkg/
95+
cp dist/ida_discord_rpc-macos-universal/ida_discord_rpc.dylib pkg/
7596
cd pkg && zip -r "../ida_discord_rpc-${GITHUB_REF_NAME}.zip" . && cd ..
7697
unzip -l ida_discord_rpc-*.zip
7798

cmake/FindIdaSDK.cmake

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@ if(WIN32)
33
set(_idasdk_libdir "x64_win_vc_64")
44
set(_idasdk_platform_def "__NT__")
55
elseif(APPLE)
6-
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64")
6+
set(_idasdk_mac_arch "${CMAKE_SYSTEM_PROCESSOR}")
7+
if(CMAKE_OSX_ARCHITECTURES)
8+
list(LENGTH CMAKE_OSX_ARCHITECTURES _idasdk_mac_arch_count)
9+
if(_idasdk_mac_arch_count GREATER 1)
10+
message(FATAL_ERROR
11+
"The IDA SDK ships a separate import library per macOS architecture, "
12+
"so a multi-architecture build cannot link. Configure one build tree "
13+
"per architecture and merge the resulting dylibs with lipo.")
14+
endif()
15+
set(_idasdk_mac_arch "${CMAKE_OSX_ARCHITECTURES}")
16+
endif()
17+
if(_idasdk_mac_arch MATCHES "arm64|aarch64")
718
set(_idasdk_libdir "arm64_mac_clang_64")
819
else()
920
set(_idasdk_libdir "x64_mac_clang_64")
@@ -75,6 +86,8 @@ endif()
7586

7687
mark_as_advanced(IdaSDK_INCLUDE_DIR IdaSDK_LIBRARY)
7788

89+
unset(_idasdk_mac_arch)
90+
unset(_idasdk_mac_arch_count)
7891
unset(_idasdk_libdir)
7992
unset(_idasdk_platform_def)
8093
unset(_idasdk_hints)

ida-plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"entryPoint": "ida_discord_rpc",
77
"version": "1.1.0",
88
"idaVersions": ["9.0", "9.1", "9.2", "9.3", "9.4"],
9-
"platforms": ["windows-x86_64", "linux-x86_64", "macos-x86_64"],
9+
"platforms": ["windows-x86_64", "linux-x86_64", "macos-x86_64", "macos-aarch64"],
1010
"description": "IDA Discord RPC integrates Discord Rich Presence into IDA, displaying real-time information about your reverse engineering activity directly in your Discord profile: current function, view, file, debugging status and more - all configurable from a settings dialog.",
1111
"license": "Apache-2.0",
1212
"logoPath": "assets/ida-discord.png",

readme.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,42 @@ IDA Discord RPC is a plugin for IDA that displays your current activity as Disco
2222

2323
## Installation
2424

25+
### Using HCLI (recommended)
26+
27+
The plugin ships [IDA plugin metadata](ida-plugin.json), so the [Hex-Rays CLI](https://hcli.docs.hex-rays.com/) plugin manager can install it, place the right binary for your platform and keep it updated:
28+
29+
```bash
30+
hcli plugin install IDA-Discord-RPC@https://github.com/reversedcodes/IDA-RPC
31+
```
32+
33+
Once the plugin is listed in the Hex-Rays plugin repository, the short form works as well:
34+
35+
```bash
36+
hcli plugin install IDA-Discord-RPC
37+
```
38+
39+
Managing the installation:
40+
41+
```bash
42+
hcli plugin status
43+
hcli plugin upgrade IDA-Discord-RPC
44+
hcli plugin uninstall IDA-Discord-RPC
45+
```
46+
47+
If HCLI is not installed yet, on macOS and Linux:
48+
49+
```bash
50+
curl -LsSf https://hcli.docs.hex-rays.com/install | sh
51+
```
52+
53+
On Windows, in PowerShell:
54+
55+
```powershell
56+
iwr -useb https://hcli.docs.hex-rays.com/install.ps1 | iex
57+
```
58+
59+
### Manual
60+
2561
Download the ZIP from the [latest release](https://github.com/reversedcodes/IDA-RPC/releases) and copy the binary for your OS into your IDA plugins directory:
2662

2763
| OS | Plugins directory |

0 commit comments

Comments
 (0)