mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 04:05:39 +00:00
GP-4412: Fix default Image for Universal Binaries
This commit is contained in:
parent
77923fa693
commit
2958b9d868
@ -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…
Reference in New Issue
Block a user