diff --git a/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/fileinfo/FileAttributeType.java b/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/fileinfo/FileAttributeType.java index a7bffc7d57..f112d7496c 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/fileinfo/FileAttributeType.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/fileinfo/FileAttributeType.java @@ -56,6 +56,7 @@ public enum FileAttributeType { SYMLINK_DEST_ATTR("Symbolic link destination", MISC_INFO, String.class), COMMENT_ATTR("Comment", MISC_INFO, String.class), + FILENAME_EXT_OVERRIDE("Extension override", MISC_INFO, String.class), UNKNOWN_ATTRIBUTE("Other attribute", ADDITIONAL_INFO, Object.class); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/plugins/fsbrowser/FSBComponentProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/plugins/fsbrowser/FSBComponentProvider.java index d5b8e32b55..e4a74757dd 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/plugins/fsbrowser/FSBComponentProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/plugins/fsbrowser/FSBComponentProvider.java @@ -192,6 +192,15 @@ public class FSBComponentProvider extends ComponentProviderAdapter overlays.add(FSBIcons.MISSING_PASSWORD_OVERLAY_ICON); } + String ext = node.getFilenameExtOverride(); + if (ext != null && !ext.isEmpty()) { + if (!ext.startsWith(".")) { + Msg.error(this, "Extension override '" + ext + "' does not begin with a dot"); + } else { + filename += ext; + } + } + Icon icon = fsbIcons.getIcon(filename, overlays); setIcon(icon); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/plugins/fsbrowser/FSBFileNode.java b/Ghidra/Features/Base/src/main/java/ghidra/plugins/fsbrowser/FSBFileNode.java index 4c6b6c4347..17391b73ec 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/plugins/fsbrowser/FSBFileNode.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/plugins/fsbrowser/FSBFileNode.java @@ -38,6 +38,7 @@ public class FSBFileNode extends FSBNode { protected boolean hasPassword; protected String symlinkDest; protected long lastModified; + protected String filenameExtOverride; FSBFileNode(GFile file) { this.file = file; @@ -83,6 +84,10 @@ public class FSBFileNode extends FSBNode { return symlinkDest != null; } + public String getFilenameExtOverride() { + return filenameExtOverride; + } + @Override public int hashCode() { return file.hashCode(); @@ -95,6 +100,7 @@ public class FSBFileNode extends FSBNode { symlinkDest = fattrs.get(SYMLINK_DEST_ATTR, String.class, null); Date lastModDate = fattrs.get(MODIFIED_DATE_ATTR, Date.class, null); lastModified = lastModDate != null ? lastModDate.getTime() : 0; + filenameExtOverride = fattrs.get(FILENAME_EXT_OVERRIDE, String.class, null); } @Override