Package ghidra.app.util.opinion
Class MachoProgramBuilder
- java.lang.Object
-
- ghidra.app.util.opinion.MachoProgramBuilder
-
- Direct Known Subclasses:
DyldCacheProgramBuilder,MachoPrelinkProgramBuilder
public class MachoProgramBuilder extends java.lang.ObjectBuilds up a Mach-OProgramby parsing the Mach-O headers.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBLOCK_SOURCE_NAMEprotected FileBytesfileBytesprotected Listinglistingprotected MessageLoglogprotected MachHeadermachoHeaderprotected Memorymemoryprotected TaskMonitormonitorprotected Programprogramprotected ByteProviderproviderprotected AddressSpacespace
-
Constructor Summary
Constructors Modifier Constructor Description protectedMachoProgramBuilder(Program program, ByteProvider provider, FileBytes fileBytes, MessageLog log, TaskMonitor monitor)Creates a newMachoProgramBuilderbased on the given information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuild()static voidbuildProgram(Program program, ByteProvider provider, FileBytes fileBytes, MessageLog log, TaskMonitor monitor)Builds up a Mach-OProgram.protected voidmarkupHeaders(MachHeader header, Address headerAddr)protected voidprocessMemoryBlocks(MachHeader header, java.lang.String source, boolean processSections, boolean allowZeroAddr)Creates memory blocks for the given header.protected voidrenameObjMsgSendRtpSymbol()
-
-
-
Field Detail
-
BLOCK_SOURCE_NAME
public static final java.lang.String BLOCK_SOURCE_NAME
- See Also:
- Constant Field Values
-
machoHeader
protected MachHeader machoHeader
-
program
protected Program program
-
provider
protected ByteProvider provider
-
fileBytes
protected FileBytes fileBytes
-
log
protected MessageLog log
-
monitor
protected TaskMonitor monitor
-
memory
protected Memory memory
-
listing
protected Listing listing
-
space
protected AddressSpace space
-
-
Constructor Detail
-
MachoProgramBuilder
protected MachoProgramBuilder(Program program, ByteProvider provider, FileBytes fileBytes, MessageLog log, TaskMonitor monitor)
Creates a newMachoProgramBuilderbased on the given information.- Parameters:
program- TheProgramto build up.provider- TheByteProviderthat contains the Mach-O's bytes.fileBytes- Where the Mach-O's bytes came from.log- The log.monitor- A cancelable task monitor.
-
-
Method Detail
-
buildProgram
public static void buildProgram(Program program, ByteProvider provider, FileBytes fileBytes, MessageLog log, TaskMonitor monitor) throws java.lang.Exception
Builds up a Mach-OProgram.- Parameters:
program- TheProgramto build up.provider- TheByteProviderthat contains the Mach-O's bytes.fileBytes- Where the Mach-O's bytes came from.log- The log.monitor- A cancelable task monitor.- Throws:
java.lang.Exception- if a problem occurs.
-
build
protected void build() throws java.lang.Exception- Throws:
java.lang.Exception
-
processMemoryBlocks
protected void processMemoryBlocks(MachHeader header, java.lang.String source, boolean processSections, 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.processSections- True to split segments into their sections.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
protected void renameObjMsgSendRtpSymbol() throws DuplicateNameException, InvalidInputException
-
markupHeaders
protected void markupHeaders(MachHeader header, Address headerAddr) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-