Class LoadCommandFactory
java.lang.Object
ghidra.app.util.bin.format.macho.commands.LoadCommandFactory
A factory used to create
LoadCommand
s-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LoadCommand
getLoadCommand
(BinaryReader reader, MachHeader header, DyldCacheUtils.SplitDyldCache splitDyldCache) Create and parses aLoadCommand
-
Constructor Details
-
LoadCommandFactory
public LoadCommandFactory()
-
-
Method Details
-
getLoadCommand
public static LoadCommand getLoadCommand(BinaryReader reader, MachHeader header, DyldCacheUtils.SplitDyldCache splitDyldCache) throws IOException, MachException Create and parses aLoadCommand
NOTE: Parsing
LoadCommand
s whose data lives in the __LINKEDIT segment require that the __LINKEDITSegmentCommand
have already been parsed. Thus, it is required that this method be called onSegmentCommand
s before other types ofLoadCommand
s.- Parameters:
reader
- Areader
that points to the start of the load commandheader
- Theheader
associated with this load commandsplitDyldCache
- TheDyldCacheUtils.SplitDyldCache
that this header resides in. Could be null if a split DYLD cache is not being used.- Returns:
- A new
LoadCommand
- Throws:
IOException
- if an IO-related error occurs while parsingMachException
- if the load command is invalid
-