Package ghidra.app.util.opinion
Class MachoProgramBuilder
- java.lang.Object
-
- ghidra.app.util.opinion.MachoProgramBuilder
-
- Direct Known Subclasses:
MachoPrelinkProgramBuilder
public class MachoProgramBuilder extends java.lang.ObjectBuilds up a Mach-OProgramby parsing the Mach-O headers.
-
-
Field Summary
Fields Change Modifier and Type Field Description static java.lang.StringBLOCK_SOURCE_NAMENEW protected ListinglistingNEW protected MessageLoglogNEW protected MachHeadermachoHeaderNEW protected MemoryBlockUtilmbuNEW protected MemorymemoryNEW protected TaskMonitormonitorNEW protected ProgramprogramNEW protected ByteProviderproviderNEW protected AddressSpacespace
-
Constructor Summary
Constructors Change Modifier Constructor Description protectedMachoProgramBuilder(Program program, ByteProvider provider, MessageLog log, MemoryConflictHandler memoryConflictHandler, TaskMonitor monitor)Creates a newMachoProgramBuilderbased on the given information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Change Modifier and Type Method Description NEW protected voidbuild()static voidbuildProgram(Program program, ByteProvider provider, MessageLog log, MemoryConflictHandler memoryConflictHandler, TaskMonitor monitor)Builds up a Mach-OProgram.NEW protected voidmarkupHeaders(MachHeader header, Address headerAddr)NEW protected voidprocessMemoryBlocks(MachHeader header, java.lang.String source, boolean allowZeroAddr)Creates memory blocks for the given header.NEW protected voidrenameObjMsgSendRtpSymbol()
-
-
-
Field Detail
-
BLOCK_SOURCE_NAME
public static final java.lang.String BLOCK_SOURCE_NAME
- See Also:
- Constant Field Values
-
machoHeader NEW
protected MachHeader machoHeader
-
program NEW
protected Program program
-
provider NEW
protected ByteProvider provider
-
log NEW
protected MessageLog log
-
monitor NEW
protected TaskMonitor monitor
-
memory NEW
protected Memory memory
-
listing NEW
protected Listing listing
-
space NEW
protected AddressSpace space
Constructor Detail
-
MachoProgramBuilder
protected MachoProgramBuilder(Program program, ByteProvider provider, MessageLog log, MemoryConflictHandler memoryConflictHandler, TaskMonitor monitor)
Creates a newMachoProgramBuilderbased on the given information.- Parameters:
program- TheProgramto build up.provider- TheByteProviderthat contains the Mach-O's bytes.log- The log.memoryConflictHandler- How to handle memory conflicts that may occur.monitor- A cancelable task monitor.
-
-
Method Detail
-
buildProgram
public static void buildProgram(Program program, ByteProvider provider, MessageLog log, MemoryConflictHandler memoryConflictHandler, TaskMonitor monitor) throws java.lang.Exception
Builds up a Mach-OProgram.- Parameters:
program- TheProgramto build up.provider- TheByteProviderthat contains the Mach-O's bytes.log- The log.memoryConflictHandler- How to handle memory conflicts that may occur.monitor- A cancelable task monitor.- Throws:
java.lang.Exception- if a problem occurs.
-
processMemoryBlocks NEW
protected void processMemoryBlocks(MachHeader header, java.lang.String source, boolean allowZeroAddr) throws java.lang.Exception
Creates memory blocks for the given header.- Parameters:
header- The Mach-O header to process for memory block creation.source- A name that represents where the memory blocks came from.allowZeroAddr- True if memory blocks at address 0 should be processed; otherwise, false.- Throws:
java.lang.Exception- If there was a problem processing the memory blocks.
-
renameObjMsgSendRtpSymbol NEW
protected void renameObjMsgSendRtpSymbol() throws DuplicateNameException, InvalidInputException
-
markupHeaders NEW
protected void markupHeaders(MachHeader header, Address headerAddr) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-