Package ghidra.app.util.opinion
Class MachoPrelinkProgramBuilder
- java.lang.Object
-
- ghidra.app.util.opinion.MachoProgramBuilder
-
- ghidra.app.util.opinion.MachoPrelinkProgramBuilder
-
public class MachoPrelinkProgramBuilder extends MachoProgramBuilder
Builds up a PRELINK Mach-OProgram
by parsing the Mach-O headers.
-
-
Field Summary
-
Fields inherited from class ghidra.app.util.opinion.MachoProgramBuilder
BLOCK_SOURCE_NAME, fileBytes, listing, log, machoHeader, memory, monitor, program, provider, space
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MachoPrelinkProgramBuilder(Program program, ByteProvider provider, FileBytes fileBytes, java.util.List<PrelinkMap> prelinkList, boolean shouldAddRelocationEntries, MessageLog log, TaskMonitor monitor)
Creates a newMachoPrelinkProgramBuilder
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, java.util.List<PrelinkMap> prelinkList, boolean addRelocationEntries, MessageLog log, TaskMonitor monitor)
Builds up a PRELINK Mach-OProgram
.protected void
doRelocations()
protected void
fixPreLinkAddresses()
protected void
processPreLinkMachoInfo()
protected void
renameObjMsgSendRtpSymbol()
-
Methods inherited from class ghidra.app.util.opinion.MachoProgramBuilder
buildProgram, loadExternalRelocations, loadLocalRelocations, loadSectionRelocations, markupHeaders, markupSections, processDyldInfo, processMemoryBlocks, processProgramVars, setupHeaderAddr
-
-
-
-
Constructor Detail
-
MachoPrelinkProgramBuilder
protected MachoPrelinkProgramBuilder(Program program, ByteProvider provider, FileBytes fileBytes, java.util.List<PrelinkMap> prelinkList, boolean shouldAddRelocationEntries, MessageLog log, TaskMonitor monitor)
Creates a newMachoPrelinkProgramBuilder
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.prelinkList
- ParsedPRELINK
information.shouldAddRelocationEntries
- true if relocation records should be createdlog
- The log.monitor
- A cancelable task monitor.
-
-
Method Detail
-
buildProgram
public static void buildProgram(Program program, ByteProvider provider, FileBytes fileBytes, java.util.List<PrelinkMap> prelinkList, boolean addRelocationEntries, MessageLog log, TaskMonitor monitor) throws java.lang.Exception
Builds up a PRELINK 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.prelinkList
- ParsedPRELINK
information.addRelocationEntries
- true if relocation records should be addedlog
- The log.monitor
- A cancelable task monitor.- Throws:
java.lang.Exception
- if a problem occurs.
-
build
protected void build() throws java.lang.Exception
- Overrides:
build
in classMachoProgramBuilder
- Throws:
java.lang.Exception
-
doRelocations
protected void doRelocations() throws java.lang.Exception
- Overrides:
doRelocations
in classMachoProgramBuilder
- Throws:
java.lang.Exception
-
fixPreLinkAddresses
protected void fixPreLinkAddresses() throws MemoryAccessException, CancelledException, java.lang.Exception, java.io.IOException, MachException
- Throws:
MemoryAccessException
CancelledException
java.lang.Exception
java.io.IOException
MachException
-
processPreLinkMachoInfo
protected void processPreLinkMachoInfo() throws java.lang.Exception, java.io.IOException, MachException
- Throws:
java.lang.Exception
java.io.IOException
MachException
-
renameObjMsgSendRtpSymbol
protected void renameObjMsgSendRtpSymbol() throws DuplicateNameException, InvalidInputException
- Overrides:
renameObjMsgSendRtpSymbol
in classMachoProgramBuilder
- Throws:
DuplicateNameException
InvalidInputException
-
-