mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Merge remote-tracking branch 'origin/GP-4412_Dan_fixDefaultImageForMachO'
This commit is contained in:
commit
fa0cb8d881
1 changed files with 22 additions and 5 deletions
|
@ -37,6 +37,7 @@ import ghidra.debug.api.tracermi.TraceRmiLaunchOffer;
|
|||
import ghidra.debug.api.tracermi.TraceRmiLaunchOffer.LaunchConfigurator;
|
||||
import ghidra.debug.api.tracermi.TraceRmiLaunchOffer.PromptMode;
|
||||
import ghidra.debug.spi.tracermi.TraceRmiLaunchOpinion;
|
||||
import ghidra.formats.gfilesystem.FSRL;
|
||||
import ghidra.framework.options.*;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
|
@ -122,11 +123,7 @@ public class TraceRmiLauncherServicePlugin extends Plugin
|
|||
}
|
||||
}
|
||||
|
||||
public static File getProgramPath(Program program) {
|
||||
if (program == null) {
|
||||
return null;
|
||||
}
|
||||
String path = program.getExecutablePath();
|
||||
public static File tryProgramPath(String path) {
|
||||
if (path == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -143,6 +140,26 @@ public class TraceRmiLauncherServicePlugin extends Plugin
|
|||
}
|
||||
}
|
||||
|
||||
public static String extractFirstFsrl(Program program) {
|
||||
FSRL fsrl = FSRL.fromProgram(program);
|
||||
if (fsrl == null) {
|
||||
return null;
|
||||
}
|
||||
FSRL first = fsrl.split().get(0);
|
||||
return first.getPath();
|
||||
}
|
||||
|
||||
public static File getProgramPath(Program program) {
|
||||
if (program == null) {
|
||||
return null;
|
||||
}
|
||||
File exec = tryProgramPath(program.getExecutablePath());
|
||||
if (exec != null) {
|
||||
return exec;
|
||||
}
|
||||
return tryProgramPath(extractFirstFsrl(program));
|
||||
}
|
||||
|
||||
protected final ToolOptions options;
|
||||
|
||||
protected Program currentProgram;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue