Class GoBuildInfo
java.lang.Object
ghidra.app.util.bin.format.golang.GoBuildInfo
- All Implemented Interfaces:
ElfInfoItem
A program section that contains Go build information strings, namely go module package names,
go module dependencies, and build/compiler flags, as well as the golang version itself.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.app.util.bin.format.elf.info.ElfInfoItem
ElfInfoItem.ItemWithAddress<T>, ElfInfoItem.ReaderFunc<T>
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
decorateProgramInfo
(Options props) findBuildInfo
(Program program) Searches for the GoBuildInfo structure in the most common and easy locations.static GoBuildInfo
fromProgram
(Program program) Reads a GoBuildInfo ".go.buildinfo" section from the specified Program, if present.getGoVer()
getPath()
int
static boolean
isPresent
(InputStream is) Probes the specified InputStream and returns true if it starts with a go buildinfo magic signature.void
markupProgram
(Program program, Address address) Markup a program's info and memory with this item.static GoBuildInfo
read
(BinaryReader reader, Program program) Reads a GoBuildInfo ".go.buildinfo" section from the specified stream.toString()
-
Field Details
-
SECTION_NAME
- See Also:
-
ELF_SECTION_NAME
- See Also:
-
MACHO_SECTION_NAME
- See Also:
-
-
Method Details
-
fromProgram
Reads a GoBuildInfo ".go.buildinfo" section from the specified Program, if present.- Parameters:
program
-Program
that contains the ".go.buildinfo" section- Returns:
- new
GoBuildInfo
instance, if present, null if missing or error
-
findBuildInfo
Searches for the GoBuildInfo structure in the most common and easy locations.- Parameters:
program
-Program
to search- Returns:
- new
GoBuildInfo
instance, if present, null if missing or error
-
read
Reads a GoBuildInfo ".go.buildinfo" section from the specified stream.- Parameters:
reader
- BinaryReader that contains the ".go.buildinfo" sectionprogram
- Program that contains the ".go.buildinfo" section- Returns:
- new
GoBuildInfo
instance, never null - Throws:
IOException
- if error reading or bad data
-
isPresent
Probes the specified InputStream and returns true if it starts with a go buildinfo magic signature.- Parameters:
is
- InputStream- Returns:
- true if starts with buildinfo magic signature
-
getPointerSize
public int getPointerSize() -
getEndian
-
getVersion
-
getGoVer
-
getPath
-
getModuleInfo
-
getDependencies
-
getBuildSettings
-
markupProgram
Description copied from interface:ElfInfoItem
Markup a program's info and memory with this item.- Specified by:
markupProgram
in interfaceElfInfoItem
- Parameters:
program
-Program
to markupaddress
-Address
of the item in the program
-
decorateProgramInfo
-
toString
-