Routing Priority for IDA Pro and Ghidra in reverse-skill: How Tool Selection Works
In reverse-skill, IDA Pro has higher routing priority than Ghidra because "IDA reverse" appears before "Ghidra reverse" in the priority array defined in skills/config/routing.json.
Understanding the routing priority between IDA Pro and Ghidra is essential for reverse engineers who want predictable tool selection in automated workflows. This article examines how the reverse-skill repository determines which disassembler—IDA Pro or Ghidra—handles a given decompilation request based on its configuration-driven routing system.
Understanding the Routing System Architecture
The reverse-skill repository implements a priority-based routing engine that maps incoming requests to the most appropriate reverse engineering tool. This system uses a centralized configuration file to establish an explicit ordering of skills, ensuring deterministic behavior when multiple tools could handle the same task.
The Priority Array in routing.json
The core routing logic resides in skills/config/routing.json. This file contains a priority array that lists all available skills in order of precedence. The router evaluates this array sequentially, selecting the first matching skill for any given request.
Based on the source analysis:
- Line 51 of
routing.jsondefines the entry labeled "IDA reverse" — representing IDA Pro integration - "Ghidra reverse" appears later in the same
priorityarray
Because the router processes the array from left to right, IDA reverse receives priority over Ghidra reverse when both tools match the request pattern.
How Routing Decisions Are Made
The master routing script (skills/scripts/master-route.ps1) implements this priority evaluation. When a request arrives with a hint or pattern that could match both IDA Pro and Ghidra capabilities, the engine consults the priority array before making its selection.
Priority Evaluation Order
- Parse the incoming request hint
- Identify all skills whose patterns match the hint
- Select the matching skill with the lowest index in the
priorityarray - Execute the corresponding skill scripts
This means even if Ghidra's patterns match a request perfectly, IDA Pro will be chosen if it also matches and appears earlier in the array.
Practical Code Examples
Example 1: Ambiguous Hint (Both Tools Match)
powershell -NoProfile -ExecutionPolicy Bypass `
-File skills/scripts/master-route.ps1 -Hint "IDA decompile PE"
Result: Primary skill chosen is IDA reverse due to higher priority ranking.
Example 2: Ghidra-Specific Hint
powershell -NoProfile -ExecutionPolicy Bypass `
-File skills/scripts/master-route.ps1 -Hint "Ghidra decompile binary"
Result: Primary skill chosen is Ghidra reverse — this executes when the hint specifically targets Ghidra's unique capabilities or when IDA Pro patterns do not match.
File Structure and Implementation Details
The reverse-skill repository organizes tool-specific logic in clearly separated directories:
| Component | Path | Purpose |
|---|---|---|
| Routing configuration | skills/config/routing.json |
Defines priority array with "IDA reverse" before "Ghidra reverse" |
| Master routing script | skills/scripts/master-route.ps1 |
Executes priority-based skill selection |
| IDA Pro scripts | skills/ida-reverse/scripts/*.ps1 |
Implements IDA Pro integration and decompilation workflows |
| Ghidra scripts | skills/ghidra-reverse/scripts/*.ps1 |
Implements Ghidra integration and decompilation workflows |
| Documentation | skills/MASTER-ROUTING.md |
Documents the mapping between priority array and human-readable skill labels |
Modifying Routing Priority
To change the routing priority between IDA Pro and Ghidra, edit the priority array in skills/config/routing.json. Reordering the entries directly affects tool selection:
// Current priority (IDA Pro first)
"priority": [
...
"IDA reverse",
...
"Ghidra reverse",
...
]
// Modified priority (Ghidra first)
"priority": [
...
"Ghidra reverse",
...
"IDA reverse",
...
]
After modifying routing.json, the master routing engine immediately respects the new ordering on subsequent requests.
Summary
- IDA Pro has higher routing priority than Ghidra in reverse-skill due to its earlier position in the
priorityarray withinskills/config/routing.json - The "IDA reverse" label appears at line 51 of the routing configuration, preceding "Ghidra reverse"
- The master routing script processes the priority array sequentially, selecting the first matching skill
- Tool priority can be modified by editing the array order in
routing.json - Specific hints can override default priority by targeting unique patterns associated with one tool
Frequently Asked Questions
How do I override the default priority for a single request?
Pass a hint that matches only your preferred tool's patterns. For Ghidra specifically, include "Ghidra" in the hint string. For IDA Pro, use "IDA" terminology. The router still checks priority, but only the explicitly targeted tool will match the pattern.
Where is the priority array documented besides routing.json?
The skills/MASTER-ROUTING.md file contains human-readable documentation mapping the numeric priority array to skill labels. This file explains the relationship between the configuration structure and the actual tool implementations in skills/ida-reverse/ and skills/ghidra-reverse/.
Does changing routing.json require a restart?
No. The master routing script reads routing.json on each invocation, so priority changes take effect immediately for subsequent requests without any service restart.
What happens if I remove "IDA reverse" from the priority array?
If "IDA reverse" is removed, Ghidra becomes the highest-priority reverse engineering tool (assuming no other tools match). Requests that previously routed to IDA Pro will now route to Ghidra or fail if no matching skill exists.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →