Handle pdc.ghidra to avoid pd subcommand hijacking issues

This commit is contained in:
pancake authored and GitHub committed 2025-10-29 21:31:24 +01:00
1 parent b4138b1174
commit 306702a1c1
1 file changed
+13 -1
+13 -1
View File
@@ -686,8 +686,20 @@ static void _cmd(RCore *core, const char *input) {
#if R2_VERSION_NUMBER >= 50909
extern "C" bool r2ghidra_core_cmd(RCorePluginSession *cps, const char *input) {
RCore *core = cps->core;
if (!strcmp (input, "pdc.")) {
r_cons_println (core->cons, "pdc.ghidra");
return false;
}
if (r_str_startswith (input, "pdc.ghidra")) {
_cmd (core, input + strlen ("pdc.ghidra"));
return true;
}
if (r_str_startswith (input, "pdc.g")) {
_cmd (core, input + strlen ("pdc.g"));
return true;
}
if (r_str_startswith (input, "pdg")) {
_cmd (core, input + 3);
_cmd (core, input + strlen ("pdg"));
return true;
}
return false;