mirror of
https://github.com/NohamR/IDA-9.1-Discord-RPC.git
synced 2026-05-25 12:17:17 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88139fe2bf | ||
|
|
73bf4e90a1 | ||
|
|
2df6123759 | ||
|
|
acbb9a32d6 | ||
|
|
1a686d49ac | ||
|
|
581005df64 | ||
|
|
d740445cf2 | ||
|
|
3e478df322 | ||
|
|
21edf8ab14 | ||
|
|
9d2c3fed40 | ||
|
|
232d87b63d | ||
|
|
e08dcd7090 |
14
README.md
14
README.md
@@ -1,7 +1,13 @@
|
|||||||
# IDA-9.0-RPC
|
# IDA 9.1 Discord RPC
|
||||||
Discord Rich Presence plugin for IDA 9.0
|
**Discord Rich Presence plugin for IDA 9.1**
|
||||||
|
|
||||||
# Instructions
|
# Instructions
|
||||||
1. Install pypresence (pip install pypresence)
|
1. Install pypresence and cxxfilt (**pip install pypresence cxxfilt**)
|
||||||
2. Drag "ida-rpc.py" over to "your_ida_installation_folder\plugins\"
|
2. Drag "**ida-rpc.py**" over to "**your_ida_installation_folder\plugins**"
|
||||||
3. That's it!
|
3. That's it!
|
||||||
|
|
||||||
|
The plugin starts automatically along with IDA.
|
||||||
|
You can stop/start the plugin with **Ctrl+Alt+D**.
|
||||||
|
The RPC looks like this:
|
||||||
|
|
||||||
|
<img width="447" height="159" alt="preview" src="https://github.com/user-attachments/assets/ce58be2b-8326-4d6d-a3d0-b916ea7ebbc3" />
|
||||||
|
|||||||
20
ida-rpc.py
20
ida-rpc.py
@@ -4,6 +4,7 @@ import ida_funcs
|
|||||||
import ida_name
|
import ida_name
|
||||||
import ida_nalt
|
import ida_nalt
|
||||||
import time
|
import time
|
||||||
|
import cxxfilt
|
||||||
from pypresence import Presence
|
from pypresence import Presence
|
||||||
|
|
||||||
PLUGIN_NAME = "Discord RPC for IDA"
|
PLUGIN_NAME = "Discord RPC for IDA"
|
||||||
@@ -12,7 +13,7 @@ PLUGIN_COMMENT = "Display IDA status in Discord"
|
|||||||
PLUGIN_HELP = "This plugin updates your Discord status with IDA information"
|
PLUGIN_HELP = "This plugin updates your Discord status with IDA information"
|
||||||
PLUGIN_VERSION = "1.0"
|
PLUGIN_VERSION = "1.0"
|
||||||
|
|
||||||
CLIENT_ID = "1274210451273551973"
|
CLIENT_ID = "1396262435471491112"
|
||||||
THROTTLE_TIME = 5 # Minimum time between updates in seconds
|
THROTTLE_TIME = 5 # Minimum time between updates in seconds
|
||||||
|
|
||||||
class DiscordRPCPlugin(ida_idaapi.plugin_t):
|
class DiscordRPCPlugin(ida_idaapi.plugin_t):
|
||||||
@@ -85,6 +86,18 @@ class DiscordRPCPlugin(ida_idaapi.plugin_t):
|
|||||||
self._perform_update()
|
self._perform_update()
|
||||||
return -1 # Unregister the timer
|
return -1 # Unregister the timer
|
||||||
|
|
||||||
|
def sanitize_func_name(self, func_name):
|
||||||
|
"""Sanitize function names to avoid issues with Discord presence (max 128 chars for state)."""
|
||||||
|
if not func_name:
|
||||||
|
func_name = "Unknown"
|
||||||
|
# Parse C++ mangled symbol into human-readable name
|
||||||
|
func_name = cxxfilt.demangle(func_name)
|
||||||
|
prefix = "Function: "
|
||||||
|
max_func_len = 128 - len(prefix)
|
||||||
|
if len(func_name) > max_func_len:
|
||||||
|
func_name = func_name[:max_func_len]
|
||||||
|
return func_name
|
||||||
|
|
||||||
def _perform_update(self):
|
def _perform_update(self):
|
||||||
try:
|
try:
|
||||||
current_function = ida_funcs.get_func(ida_kernwin.get_screen_ea())
|
current_function = ida_funcs.get_func(ida_kernwin.get_screen_ea())
|
||||||
@@ -99,12 +112,11 @@ class DiscordRPCPlugin(ida_idaapi.plugin_t):
|
|||||||
|
|
||||||
self.rpc.update(
|
self.rpc.update(
|
||||||
details=f"Analyzing: {file_name}",
|
details=f"Analyzing: {file_name}",
|
||||||
state=f"Function: {func_name}",
|
state=f"Function: {self.sanitize_func_name(func_name)}",
|
||||||
large_image="ida_logo",
|
large_image="ida_logo",
|
||||||
large_text="IDA Pro 9.0",
|
large_text="IDA Pro 9.1",
|
||||||
start=self.start_time
|
start=self.start_time
|
||||||
)
|
)
|
||||||
print(f"Updated presence: {file_name} - {func_name}") # Debug print
|
|
||||||
self.last_update_time = time.time()
|
self.last_update_time = time.time()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error updating presence: {str(e)}")
|
print(f"Error updating presence: {str(e)}")
|
||||||
|
|||||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
cxxfilt==0.3.0
|
||||||
|
pypresence==4.3.0
|
||||||
Reference in New Issue
Block a user