Understanding filesystem loaders
Ghidra also allows us to load filesystems. Filesystems are, basically, archive files (a file containing other files):
A good example of a filesystem loader implemented by Ghidra is the ZIP compressed format loader, which is available here: https://github.com/NationalSecurityAgency/ghidra/tree/master/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/zip.
To develop a filesystem, you will need to implement the GFileSystem
interface with the following methods: getDescription
, getFileCount
, getFSRL
, getInfo
, getInputStream
, getListing
, getName
, getRefManager
, getType
, isClosed
, isStatic
lookup
, and close
.
FileSystem Resource Locator
A remarkable method of the GFileSystem
interface is getFSRL
, which allows you to retrieve the FileSystem Resource Locator (FSRL). An FSRL is a string allowing Ghidra to access files and directories stored...