Package ghidra.pcode.emu.linux
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>
A system call library simulating Linux for amd64 / x86_64
- 
Nested Class SummaryNested classes/interfaces inherited from class ghidra.pcode.emu.unix.AbstractEmuUnixSyscallUseropLibraryAbstractEmuUnixSyscallUseropLibrary.Errno, AbstractEmuUnixSyscallUseropLibrary.UnixStructuredPartNested classes/interfaces inherited from class ghidra.pcode.emu.sys.AnnotatedEmuSyscallUseropLibraryAnnotatedEmuSyscallUseropLibrary.EmuSyscall, AnnotatedEmuSyscallUseropLibrary.StructuredPartNested classes/interfaces inherited from class ghidra.pcode.exec.AnnotatedPcodeUseropLibraryAnnotatedPcodeUseropLibrary.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.EmuSyscallLibraryEmuSyscallLibrary.EmuSyscallDefinition<T>, EmuSyscallLibrary.SyscallPcodeUseropDefinition<T>Nested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeUseropLibraryPcodeUseropLibrary.EmptyPcodeUseropLibrary, PcodeUseropLibrary.PcodeUseropDefinition<T>
- 
Field SummaryFieldsFields inherited from class ghidra.pcode.emu.linux.AbstractEmuLinuxSyscallUseropLibraryERRNOS, O_APPEND, O_CREAT, O_MASK_RDWR, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLYFields inherited from class ghidra.pcode.emu.unix.AbstractEmuUnixSyscallUseropLibraryclosedFds, descriptors, fs, intSize, userFields inherited from class ghidra.pcode.emu.sys.AnnotatedEmuSyscallUseropLibraryadditionalArchives, CACHE_BY_CLASS, cSpec, dtMachineWord, machine, program, SYSCALL_SPACE_NAME, syscallMapFields inherited from class ghidra.pcode.exec.AnnotatedPcodeUseropLibraryopsFields inherited from interface ghidra.pcode.emu.sys.EmuSyscallLibrarySYSCALL_CONVENTION_NAMEFields inherited from interface ghidra.pcode.exec.PcodeUseropLibraryNIL
- 
Constructor SummaryConstructorsConstructorDescriptionEmuLinuxAmd64SyscallUseropLibrary(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 SummaryModifier 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 ghidra.pcode.emu.linux.AbstractEmuLinuxSyscallUseropLibraryconvertFlags, getErrnoMethods inherited from class ghidra.pcode.emu.unix.AbstractEmuUnixSyscallUseropLibraryclaimFd, createHandle, findFd, handleError, lowestFd, newStructuredPart, putDescriptor, releaseFd, unix_close, unix_exit, unix_group_exit, unix_open, unix_read, unix_writeMethods inherited from class ghidra.pcode.emu.sys.AnnotatedEmuSyscallUseropLibrarygetSyscalls, getSyscallUserop, mapAndBindSyscalls, mapAndBindSyscalls, newBoundSyscallMethods inherited from class ghidra.pcode.exec.AnnotatedPcodeUseropLibrarygetMethodLookup, getOperandType, getUseropsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.pcode.emu.sys.EmuSyscallLibrarysyscallMethods inherited from interface ghidra.pcode.exec.PcodeUseropLibrarycompose, getSymbols, getUserops
- 
Field Details- 
regRAX
- 
clib64
 
- 
- 
Constructor Details- 
EmuLinuxAmd64SyscallUseropLibrarypublic EmuLinuxAmd64SyscallUseropLibrary(PcodeMachine<T> machine, EmuUnixFileSystem<T> fs, Program program) Construct the system call library for Linux-amd64- Parameters:
- machine- the machine emulating the hardware
- fs- the file system to export to the user-space program
- program- a program containing syscall definitions and conventions, likely the target program
 
- 
EmuLinuxAmd64SyscallUseropLibrarypublic 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 hardware
- fs- the file system to export to the user-space program
- program- a program containing syscall definitions and conventions, likely the target program
- user- the "current user" to simulate
 
 
- 
- 
Method Details- 
getAdditionalArchives- Overrides:
- getAdditionalArchivesin class- AnnotatedEmuSyscallUseropLibrary<T>
 
- 
disposeAdditionalArchivesprotected void disposeAdditionalArchives()- Overrides:
- disposeAdditionalArchivesin class- AnnotatedEmuSyscallUseropLibrary<T>
 
- 
readSyscallNumberDescription 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 state
- reason- the reason for reading state, probably- PcodeExecutorStatePiece.Reason.EXECUTE_READ, but should be taken from the executor
- Returns:
- the system call number
 
- 
returnErrnoDescription copied from class:AbstractEmuUnixSyscallUseropLibraryPlace the errno into the machine as expected by the simulated platform's ABI- Specified by:
- returnErrnoin class- AbstractEmuUnixSyscallUseropLibrary<T>
- Parameters:
- executor- the executor for the thread running this system call
- errno- the error number
- Returns:
- true if the errno was successfully placed
 
 
-