Package ghidra.app.emulator
Class Emulator
java.lang.Object
ghidra.app.emulator.Emulator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addProvider
(MemoryLoadImage provider, AddressSetView view) Add memory load image providerdisassemble
(Integer count) Disassemble from the current execute addressvoid
dispose()
void
executeInstruction
(boolean stopAtBreakpoint, TaskMonitor monitor) genAddress
(String addr) Returns the current context register value.ghidra.app.emulator.FilteredMemoryState
boolean
getHalt()
getMemoryBank
(AddressSpace space, int ps) long
getPC()
int
boolean
boolean
void
setContextRegisterValue
(RegisterValue regValue) Sets the context register value at the current execute address.void
setExecuteAddress
(long addressableWordOffset) void
setHalt
(boolean halt)
-
Constructor Details
-
Emulator
-
-
Method Details
-
cloneMemory
-
getMemoryBank
-
dispose
public void dispose() -
genAddress
-
getPC
public long getPC() -
getPCRegisterName
-
getMemState
-
getFilteredMemState
public ghidra.app.emulator.FilteredMemoryState getFilteredMemState() -
addMemoryAccessFilter
-
getBreakTable
-
setExecuteAddress
public void setExecuteAddress(long addressableWordOffset) -
getExecuteAddress
-
getLastExecuteAddress
-
getDefaultContext
-
setHalt
public void setHalt(boolean halt) -
getHalt
public boolean getHalt() -
executeInstruction
public void executeInstruction(boolean stopAtBreakpoint, TaskMonitor monitor) throws CancelledException, LowlevelError, InstructionDecodeException -
isAtBreakpoint
public boolean isAtBreakpoint()- Returns:
- true if halted at a breakpoint
-
getEmulateExecutionState
- Returns:
- emulator execution state. This can be useful within a memory fault handler to determine if a memory read was associated with instruction parsing (i.e., PCODE_EMIT) or normal an actual emulated read (i.e., EXECUTE).
-
isExecuting
public boolean isExecuting()- Returns:
- true if emulator is busy executing an instruction
-
getLanguage
-
disassemble
Disassemble from the current execute address- Parameters:
count
- number of contiguous instructions to disassemble- Returns:
- list of instructions
-
getTickCount
public int getTickCount() -
getContextRegisterValue
Returns the current context register value. The context value returned reflects its state when the previously executed instruction was parsed/executed. The context value returned will feed into the next instruction to be parsed with its non-flowing bits cleared and any future context state merged in.- Returns:
- context as a RegisterValue object
-
setContextRegisterValue
Sets the context register value at the current execute address. The Emulator should not be running when this method is invoked. Only flowing context bits should be set, as non-flowing bits will be cleared prior to parsing on instruction. In addition, any future context state set by the pcode emitter will take precedence over context set using this method. This method is primarily intended to be used to establish the initial context state.- Parameters:
regValue
- is the value to set context to
-
addProvider
Add memory load image provider- Parameters:
provider
- memory load image providerview
- memory region which corresponds to provider
-