diff --git a/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/GFileImpl.java b/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/GFileImpl.java index b369796fa9..acfd707276 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/GFileImpl.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/GFileImpl.java @@ -76,6 +76,12 @@ public class GFileImpl implements GFile { public static GFileImpl fromPathString(GFileSystem fileSystem, GFile parent, String path, FSRL fsrl, boolean isDirectory, long length) { String[] split = path.split(FSUtilities.SEPARATOR); + if (split.length >= 3 && split[0].isEmpty() && split[1].isEmpty() && !split[2].isEmpty()) { + // The path was in UNC format, either //unc or \\unc. + // Put a unc prefix "//" back into the element that has the unc name. The leading empty + // elements will be skipped when building the parentage. + split[2] = "//" + split[2]; + } for (int i = 0; i < split.length - 1; ++i) { if (split[i].length() == 0) { continue;