Ghidra is a software reverse engineering (SRE) framework
GP-0: Add Features SystemEmulation to javadocs.
Dand0a0bce22647
diff --git a/Ghidra/Features/SystemEmulation/build.gradle b/Ghidra/Features/SystemEmulation/build.gradleindex 79814fad40..d479db7895 100644--- a/Ghidra/Features/SystemEmulation/build.gradle+++ b/Ghidra/Features/SystemEmulation/build.gradle@@ -17,6 +17,7 @@ apply from: "${rootProject.projectDir}/gradle/javaProject.gradle"apply from: "${rootProject.projectDir}/gradle/jacocoProject.gradle"apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle"apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle"+apply from: "${rootProject.projectDir}/gradle/javadoc.gradle"apply plugin: 'eclipse'eclipse.project.name = 'Features SystemEmulation'diff --git a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/sys/EmuSyscallLibrary.java b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/sys/EmuSyscallLibrary.javaindex a4c0dacd94..d2ae18e8a1 100644--- a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/sys/EmuSyscallLibrary.java+++ b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/sys/EmuSyscallLibrary.java@@ -37,12 +37,13 @@ import ghidra.program.model.symbol.*;** <p>* A system call library is a collection of p-code executable routines, invoked by a system call- * dispatcher. That dispatcher is represented by {@link #syscall(PcodeExecutor)}, and is exported as- * a sleigh userop. If this interface is "mixed in" with {@link AnnotatedPcodeUseropLibrary}, that- * userop is automatically included in the userop library. The simplest means of implementing a- * syscall library is probably via {@link AnnotatedEmuSyscallUseropLibrary}. It implements this- * interface and extends {@link AnnotatedPcodeUseropLibrary}. In addition, it provides its own- * annotation system for exporting userops as system calls.+ * dispatcher. That dispatcher is represented by+ * {@link #syscall(PcodeExecutor, PcodeUseropLibrary)}, and is exported as a sleigh userop. If this+ * interface is "mixed in" with {@link AnnotatedPcodeUseropLibrary}, that userop is automatically+ * included in the userop library. The simplest means of implementing a syscall library is probably+ * via {@link AnnotatedEmuSyscallUseropLibrary}. It implements this interface and extends+ * {@link AnnotatedPcodeUseropLibrary}. In addition, it provides its own annotation system for+ * exporting userops as system calls.** @param <T> the type of data processed by the system calls, typically {@code byte[]}*/@@ -141,7 +142,8 @@ public interface EmuSyscallLibrary<T> extends PcodeUseropLibrary<T> {}/**- * The {@link EmuSyscallLibrary#syscall(PcodeExecutor)} method wrapped as a userop definition+ * The {@link EmuSyscallLibrary#syscall(PcodeExecutor, PcodeUseropLibrary)} method wrapped as a+ * userop definition** @param <T> the type of data processed by the userop, typically {@code byte[]}*/@@ -207,8 +209,8 @@ public interface EmuSyscallLibrary<T> extends PcodeUseropLibrary<T> {* database. Until then, we require system-specific implementations.** @param state the executor's state- * @param the reason for reading state, probably {@link Reason#EXECUTE}, but should be taken- * from the executor+ * @param reason the reason for reading state, probably {@link Reason#EXECUTE_READ}, but should+ * be taken from the executor* @return the system call number*/long readSyscallNumber(PcodeExecutorState<T> state, Reason reason);@@ -233,7 +235,7 @@ public interface EmuSyscallLibrary<T> extends PcodeUseropLibrary<T> {* <p>* The executor's state must already be prepared according to the relevant system calling* conventions. This will determine the system call number, according to- * {@link #readSyscallNumber(PcodeExecutorStatePiece)}, retrieve the relevant system call+ * {@link #readSyscallNumber(PcodeExecutorState, Reason)}, retrieve the relevant system call* definition, and invoke it.** @param executor the executordiff --git a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixFile.java b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixFile.javaindex 55a518e35e..bc34cfa28f 100644--- a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixFile.java+++ b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixFile.java@@ -42,7 +42,7 @@ public abstract class AbstractEmuUnixFile<T> implements EmuUnixFile<T> {* TODO: Technically, a file can be hardlinked to several pathnames, but for simplicity, or for* diagnostics, we let the file know its own original name.*- * @see AbstractEmuUnixFileSystem#newFile(String)+ * @see AbstractEmuUnixFileSystem#newFile(String, int)* @param pathname the pathname of the file* @param mode the mode of the file*/diff --git a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixSyscallUseropLibrary.java b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixSyscallUseropLibrary.javaindex 08055867ad..de8c7d2139 100644--- a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixSyscallUseropLibrary.java+++ b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractEmuUnixSyscallUseropLibrary.java@@ -347,7 +347,6 @@ public abstract class AbstractEmuUnixSyscallUseropLibrary<T>* This just throws an exception, which the overall simulator or script should catch.** @param status the status code- * @return never* @throws EmuProcessExitedException always*/@PcodeUseropdiff --git a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractStreamEmuUnixFileHandle.java b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractStreamEmuUnixFileHandle.javaindex 94648df1f8..5a31cd13d8 100644--- a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractStreamEmuUnixFileHandle.java+++ b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/AbstractStreamEmuUnixFileHandle.java@@ -35,7 +35,7 @@ public abstract class AbstractStreamEmuUnixFileHandle<T> implements EmuUnixFileD/*** Construct a new handle*- * @see AbstractEmuUnixSyscallUseropLibrary#createHandle(int, EmuUnixFile, int)+ * @see AbstractEmuUnixSyscallUseropLibrary#createHandle(EmuUnixFile, int)* @param machine the machine emulating the hardware* @param cSpec the ABI of the target platform*/diff --git a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/DefaultEmuUnixFileHandle.java b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/DefaultEmuUnixFileHandle.javaindex c84778cdf2..1cfbea0121 100644--- a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/DefaultEmuUnixFileHandle.java+++ b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/DefaultEmuUnixFileHandle.java@@ -43,7 +43,7 @@ public class DefaultEmuUnixFileHandle<T> implements EmuUnixFileDescriptor<T> {/*** Construct a new handle on the given file*- * @see AbstractEmuUnixSyscallUseropLibrary#createHandle(int, EmuUnixFile, int)+ * @see AbstractEmuUnixSyscallUseropLibrary#createHandle(EmuUnixFile, int)* @param machine the machine emulating the hardware* @param cSpec the ABI of the target platform* @param file the file opened by this handlediff --git a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/EmuUnixFileSystem.java b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/EmuUnixFileSystem.javaindex 8115f7a257..3cb5c97843 100644--- a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/EmuUnixFileSystem.java+++ b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/EmuUnixFileSystem.java@@ -90,7 +90,7 @@ public interface EmuUnixFileSystem<T> {* A factory for constructing a new file (without adding it to the file system)** @param pathname the path of the file- * @param the mode of the new file+ * @param mode the mode of the new file* @return the new file* @throws EmuIOException if the file cannot be constructed*/diff --git a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/IOStreamEmuUnixFileHandle.java b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/IOStreamEmuUnixFileHandle.javaindex 281f46233e..43c03a2f4a 100644--- a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/IOStreamEmuUnixFileHandle.java+++ b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/IOStreamEmuUnixFileHandle.java@@ -76,7 +76,6 @@ public class IOStreamEmuUnixFileHandle extends AbstractStreamEmuUnixFileHandle<b* @param cSpec the ABI of the target platform* @param input the stream representing the input side of the descriptor, if applicable* @param output the stream representing the output side of the descriptor, if applicable- * @return the proxy's handle*/public IOStreamEmuUnixFileHandle(PcodeMachine<byte[]> machine, CompilerSpec cSpec,InputStream input, OutputStream output) {diff --git a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/struct/StructuredSleigh.java b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/struct/StructuredSleigh.javaindex 7882a48ffb..ce6f26b715 100644--- a/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/struct/StructuredSleigh.java+++ b/Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/struct/StructuredSleigh.java@@ -1574,7 +1574,7 @@ public class StructuredSleigh {** <pre>* Var arr = lang("r0", "/int *");- * for (int i = 1; i < 16; i++) {+ * for (int i = 1; i < 16; i++) {* arr.index(i).deref().set(arr.index(0).deref());* }* </pre>@@ -1904,8 +1904,7 @@ public class StructuredSleigh {** <p>* The default is to log a warning and continue. If permitted to continue, the resulting type- * will be {@code void}, likely resulting in more issues. See- * {@link #computeDerefType(DataType)}.+ * will be {@code void}, likely resulting in more issues. See {@link #computeDerefType(RVal)}.** @param addr the value being dereferenced*/