Package ghidra.pcode.emu.linux
Class AbstractEmuLinuxSyscallUseropLibrary<T>
java.lang.Object
ghidra.pcode.exec.AnnotatedPcodeUseropLibrary<T>
ghidra.pcode.emu.sys.AnnotatedEmuSyscallUseropLibrary<T>
ghidra.pcode.emu.unix.AbstractEmuUnixSyscallUseropLibrary<T>
ghidra.pcode.emu.linux.AbstractEmuLinuxSyscallUseropLibrary<T>
- Type Parameters:
T
- the type of values processed by the library
- All Implemented Interfaces:
EmuSyscallLibrary<T>
,PcodeUseropLibrary<T>
- Direct Known Subclasses:
EmuLinuxAmd64SyscallUseropLibrary
,EmuLinuxX86SyscallUseropLibrary
public abstract class AbstractEmuLinuxSyscallUseropLibrary<T>
extends AbstractEmuUnixSyscallUseropLibrary<T>
An abstract library of Linux system calls, suitable for use with any processor
-
Nested Class Summary
Nested classes/interfaces inherited from class ghidra.pcode.emu.unix.AbstractEmuUnixSyscallUseropLibrary
AbstractEmuUnixSyscallUseropLibrary.Errno, AbstractEmuUnixSyscallUseropLibrary.UnixStructuredPart
Nested classes/interfaces inherited from class ghidra.pcode.emu.sys.AnnotatedEmuSyscallUseropLibrary
AnnotatedEmuSyscallUseropLibrary.EmuSyscall, AnnotatedEmuSyscallUseropLibrary.StructuredPart
Nested classes/interfaces inherited from class ghidra.pcode.exec.AnnotatedPcodeUseropLibrary
AnnotatedPcodeUseropLibrary.AnnotatedPcodeUseropDefinition<T>, AnnotatedPcodeUseropLibrary.FixedArgsAnnotatedPcodeUseropDefinition<T>, AnnotatedPcodeUseropLibrary.OpExecutor, AnnotatedPcodeUseropLibrary.OpLibrary, AnnotatedPcodeUseropLibrary.OpOutput, AnnotatedPcodeUseropLibrary.OpState, AnnotatedPcodeUseropLibrary.PcodeUserop, AnnotatedPcodeUseropLibrary.VariadicAnnotatedPcodeUseropDefinition<T>
Nested classes/interfaces inherited from interface ghidra.pcode.emu.sys.EmuSyscallLibrary
EmuSyscallLibrary.EmuSyscallDefinition<T>, EmuSyscallLibrary.SyscallPcodeUseropDefinition<T>
Nested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeUseropLibrary
PcodeUseropLibrary.EmptyPcodeUseropLibrary, PcodeUseropLibrary.PcodeUseropDefinition<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final Map
<AbstractEmuUnixSyscallUseropLibrary.Errno, Integer> TODO: A map from simulator-defined errno to Linux-defined errnostatic final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class ghidra.pcode.emu.unix.AbstractEmuUnixSyscallUseropLibrary
closedFds, descriptors, fs, intSize, user
Fields inherited from class ghidra.pcode.emu.sys.AnnotatedEmuSyscallUseropLibrary
additionalArchives, CACHE_BY_CLASS, cSpec, dtMachineWord, machine, program, SYSCALL_SPACE_NAME, syscallMap
Fields inherited from class ghidra.pcode.exec.AnnotatedPcodeUseropLibrary
ops
Fields inherited from interface ghidra.pcode.emu.sys.EmuSyscallLibrary
SYSCALL_CONVENTION_NAME
Fields inherited from interface ghidra.pcode.exec.PcodeUseropLibrary
NIL
-
Constructor Summary
ConstructorDescriptionAbstractEmuLinuxSyscallUseropLibrary
(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program) Construct a new libraryAbstractEmuLinuxSyscallUseropLibrary
(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program, EmuUnixUser user) Construct a new library -
Method Summary
Modifier and TypeMethodDescriptionprotected Set
<EmuUnixFileSystem.OpenFlag> convertFlags
(int flags) Convert the flags as defined for this platform to flags understood by the simulatorprotected int
Get the platform-specific errno value for the given simulator-defined errnoMethods inherited from class ghidra.pcode.emu.unix.AbstractEmuUnixSyscallUseropLibrary
claimFd, createHandle, findFd, handleError, lowestFd, newStructuredPart, putDescriptor, releaseFd, returnErrno, unix_close, unix_exit, unix_group_exit, unix_open, unix_read, unix_write
Methods inherited from class ghidra.pcode.emu.sys.AnnotatedEmuSyscallUseropLibrary
disposeAdditionalArchives, getAdditionalArchives, getSyscalls, getSyscallUserop, mapAndBindSyscalls, mapAndBindSyscalls, newBoundSyscall
Methods inherited from class ghidra.pcode.exec.AnnotatedPcodeUseropLibrary
getMethodLookup, getOperandType, getUserops
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ghidra.pcode.emu.sys.EmuSyscallLibrary
readSyscallNumber, syscall
Methods inherited from interface ghidra.pcode.exec.PcodeUseropLibrary
compose, getSymbols, getUserops
-
Field Details
-
O_MASK_RDWR
public static final int O_MASK_RDWR- See Also:
-
O_RDONLY
public static final int O_RDONLY- See Also:
-
O_WRONLY
public static final int O_WRONLY- See Also:
-
O_RDWR
public static final int O_RDWR- See Also:
-
O_CREAT
public static final int O_CREAT- See Also:
-
O_TRUNC
public static final int O_TRUNC- See Also:
-
O_APPEND
public static final int O_APPEND- See Also:
-
ERRNOS
TODO: A map from simulator-defined errno to Linux-defined errnoTODO: These may be applicable to all Linux, not just amd64....
-
-
Constructor Details
-
AbstractEmuLinuxSyscallUseropLibrary
public AbstractEmuLinuxSyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program) Construct a new library- Parameters:
machine
- the machine emulating the hardwarefs
- the file system to export to the user-space programprogram
- a program containing the syscall definitions and conventions, likely the target program
-
AbstractEmuLinuxSyscallUseropLibrary
public AbstractEmuLinuxSyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program, EmuUnixUser user) Construct a new library- Parameters:
machine
- the machine emulating the hardwarefs
- the file system to export to the user-space programprogram
- a program containing the syscall definitions and conventions, likely the target programuser
- the "current user" to simulate
-
-
Method Details
-
convertFlags
Description copied from class:AbstractEmuUnixSyscallUseropLibrary
Convert the flags as defined for this platform to flags understood by the simulator- Specified by:
convertFlags
in classAbstractEmuUnixSyscallUseropLibrary<T>
- Parameters:
flags
- the platform-defined flags- Returns:
- the simulator-defined flags
-
getErrno
Description copied from class:AbstractEmuUnixSyscallUseropLibrary
Get the platform-specific errno value for the given simulator-defined errno- Specified by:
getErrno
in classAbstractEmuUnixSyscallUseropLibrary<T>
- Parameters:
err
- the simulator-defined errno- Returns:
- the platform-defined errno
-