Package ghidra.pcode.emu.sys
Class UseropEmuSyscallDefinition<T>
java.lang.Object
ghidra.pcode.emu.sys.UseropEmuSyscallDefinition<T>
- Type Parameters:
T
- the type of values processed by the library
- All Implemented Interfaces:
EmuSyscallLibrary.EmuSyscallDefinition<T>
public class UseropEmuSyscallDefinition<T>
extends Object
implements EmuSyscallLibrary.EmuSyscallDefinition<T>
A system call that is defined by delegating to a p-code userop
This is essentially a wrapper of the p-code userop. Knowing the number of inputs to the userop and by applying the calling conventions of the platform, the wrapper aliases each parameter's storage to its respective parameter of the userop. The userop's output is also aliased to the system call's return storage, again as defined by the platform's conventions.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionUseropEmuSyscallDefinition
(PcodeUseropLibrary.PcodeUseropDefinition<T> opdef, Program program, PrototypeModel convention, DataType dtMachineWord) Construct a syscall definition -
Method Summary
Modifier and TypeMethodDescriptionprotected Varnode
Assert variable storage is a single varnode, and get that varnodevoid
invoke
(PcodeExecutor<T> executor, PcodeUseropLibrary<T> library) Invoke the system callprotected static DataType
requirePointerDataType
(Program program) Obtain the program's "pointer" data type, throwing an exception if absent
-
Field Details
-
opdef
-
inVars
-
outVar
-
-
Constructor Details
-
UseropEmuSyscallDefinition
public UseropEmuSyscallDefinition(PcodeUseropLibrary.PcodeUseropDefinition<T> opdef, Program program, PrototypeModel convention, DataType dtMachineWord) Construct a syscall definition- Parameters:
opdef
- the wrapped userop definitionprogram
- the program, used for storage computationconvention
- the "syscall" calling conventiondtMachineWord
- the "pointer" data type- See Also:
-
-
Method Details
-
requirePointerDataType
Obtain the program's "pointer" data type, throwing an exception if absent- Parameters:
program
- the program- Returns:
- the "pointer" data type
-
getSingleVnStorage
Assert variable storage is a single varnode, and get that varnode- Parameters:
vs
- the storage- Returns:
- the single varnode
-
invoke
Description copied from interface:EmuSyscallLibrary.EmuSyscallDefinition
Invoke the system call- Specified by:
invoke
in interfaceEmuSyscallLibrary.EmuSyscallDefinition<T>
- Parameters:
executor
- the executor for the system/thread invoking the calllibrary
- the complete sleigh userop library for the system
-