Class EmuLinuxAmd64SyscallUseropLibrary<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>
ghidra.pcode.emu.linux.EmuLinuxAmd64SyscallUseropLibrary<T>
- Type Parameters:
T- the type of values processed by the library
- All Implemented Interfaces:
EmuSyscallLibrary<T>, PcodeUseropLibrary<T>
- Direct Known Subclasses:
TaintFileReadsLinuxAmd64SyscallLibrary
A system call library simulating Linux for amd64 / x86_64
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractEmuUnixSyscallUseropLibrary
AbstractEmuUnixSyscallUseropLibrary.Errno, AbstractEmuUnixSyscallUseropLibrary.UnixStructuredPartNested classes/interfaces inherited from class AnnotatedEmuSyscallUseropLibrary
AnnotatedEmuSyscallUseropLibrary.EmuSyscall, AnnotatedEmuSyscallUseropLibrary.StructuredPartNested classes/interfaces inherited from class 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 EmuSyscallLibrary
EmuSyscallLibrary.EmuSyscallDefinition<T>, EmuSyscallLibrary.SyscallPcodeUseropDefinition<T>Nested classes/interfaces inherited from interface PcodeUseropLibrary
PcodeUseropLibrary.EmptyPcodeUseropLibrary, PcodeUseropLibrary.PcodeUseropDefinition<T> -
Field Summary
FieldsFields inherited from class AbstractEmuLinuxSyscallUseropLibrary
ERRNOS, O_APPEND, O_CREAT, O_MASK_RDWR, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLYFields inherited from class AbstractEmuUnixSyscallUseropLibrary
closedFds, descriptors, fs, intSize, userFields inherited from class AnnotatedEmuSyscallUseropLibrary
additionalArchives, CACHE_BY_CLASS, cSpec, dtMachineWord, machine, program, SYSCALL_SPACE_NAME, syscallMapFields inherited from class AnnotatedPcodeUseropLibrary
opsFields inherited from interface EmuSyscallLibrary
SYSCALL_CONVENTION_NAMEFields inherited from interface PcodeUseropLibrary
NIL -
Constructor Summary
ConstructorsConstructorDescriptionEmuLinuxAmd64SyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program) Construct the system call library for Linux-amd64EmuLinuxAmd64SyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program, EmuUnixUser user) Construct the system call library for Linux-amd64 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected Collection<DataTypeManager> longreadSyscallNumber(PcodeExecutorState<T> state, PcodeExecutorStatePiece.Reason reason) Retrieve the desired system call number according to the emulated system's conventionsprotected booleanreturnErrno(PcodeExecutor<T> executor, int errno) Place the errno into the machine as expected by the simulated platform's ABIMethods inherited from class AbstractEmuLinuxSyscallUseropLibrary
convertFlags, getErrnoMethods inherited from class AbstractEmuUnixSyscallUseropLibrary
claimFd, createHandle, findFd, handleError, lowestFd, newStructuredPart, putDescriptor, releaseFd, unix_close, unix_exit, unix_group_exit, unix_open, unix_read, unix_writeMethods inherited from class AnnotatedEmuSyscallUseropLibrary
getSyscalls, getSyscallUserop, mapAndBindSyscalls, mapAndBindSyscalls, newBoundSyscallMethods inherited from class AnnotatedPcodeUseropLibrary
getMethodLookup, getOperandType, getUseropsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmuSyscallLibrary
syscallMethods inherited from interface PcodeUseropLibrary
compose, getSymbols, getUserops
-
Field Details
-
regRAX
-
clib64
-
-
Constructor Details
-
EmuLinuxAmd64SyscallUseropLibrary
public EmuLinuxAmd64SyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program) Construct the system call library for Linux-amd64- Parameters:
machine- the machine emulating the hardwarefs- the file system to export to the user-space programprogram- a program containing syscall definitions and conventions, likely the target program
-
EmuLinuxAmd64SyscallUseropLibrary
public EmuLinuxAmd64SyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program, EmuUnixUser user) Construct the system call library for Linux-amd64- Parameters:
machine- the machine emulating the hardwarefs- the file system to export to the user-space programprogram- a program containing syscall definitions and conventions, likely the target programuser- the "current user" to simulate
-
-
Method Details
-
getAdditionalArchives
- Overrides:
getAdditionalArchivesin classAnnotatedEmuSyscallUseropLibrary<T>
-
disposeAdditionalArchives
protected void disposeAdditionalArchives()- Overrides:
disposeAdditionalArchivesin classAnnotatedEmuSyscallUseropLibrary<T>
-
readSyscallNumber
Description copied from interface:EmuSyscallLibraryRetrieve the desired system call number according to the emulated system's conventionsTODO: This should go away in favor of some specification stored in the emulated program database. Until then, we require system-specific implementations.
- Parameters:
state- the executor's statereason- the reason for reading state, probablyPcodeExecutorStatePiece.Reason.EXECUTE_READ, but should be taken from the executor- Returns:
- the system call number
-
returnErrno
Description copied from class:AbstractEmuUnixSyscallUseropLibraryPlace the errno into the machine as expected by the simulated platform's ABI- Specified by:
returnErrnoin classAbstractEmuUnixSyscallUseropLibrary<T>- Parameters:
executor- the executor for the thread running this system callerrno- the error number- Returns:
- true if the errno was successfully placed
-