Class LoadCommandFactory
java.lang.Object
ghidra.app.util.bin.format.macho.commands.LoadCommandFactory
A factory used to create
LoadCommands-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LoadCommandgetLoadCommand(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 aLoadCommandNOTE: Parsing
LoadCommands whose data lives in the __LINKEDIT segment require that the __LINKEDITSegmentCommandhave already been parsed. Thus, it is required that this method be called onSegmentCommands before other types ofLoadCommands.- Parameters:
reader- Areaderthat points to the start of the load commandheader- Theheaderassociated with this load commandsplitDyldCache- TheDyldCacheUtils.SplitDyldCachethat 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
-