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.Object
Builds up a Mach-OProgram
by parsing the Mach-O headers.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BLOCK_SOURCE_NAME
protected FileBytes
fileBytes
protected Listing
listing
protected MessageLog
log
protected MachHeader
machoHeader
protected Memory
memory
protected TaskMonitor
monitor
protected Program
program
protected ByteProvider
provider
protected AddressSpace
space
-
Constructor Summary
Constructors Modifier Constructor Description protected
MachoProgramBuilder(Program program, ByteProvider provider, FileBytes fileBytes, MessageLog log, TaskMonitor monitor)
Creates a newMachoProgramBuilder
based on the given information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
build()
static void
buildProgram(Program program, ByteProvider provider, FileBytes fileBytes, MessageLog log, TaskMonitor monitor)
Builds up a Mach-OProgram
.protected void
markupHeaders(MachHeader header, Address headerAddr)
protected void
processMemoryBlocks(MachHeader header, java.lang.String source, boolean processSections, boolean allowZeroAddr)
Creates memory blocks for the given header.protected void
renameObjMsgSendRtpSymbol()
-
-
-
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 newMachoProgramBuilder
based on the given information.- Parameters:
program
- TheProgram
to build up.provider
- TheByteProvider
that 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
- TheProgram
to build up.provider
- TheByteProvider
that 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
-
-