summaryrefslogtreecommitdiffstats
path: root/debug/risc-v-gsp-rm-vm/ghidra
diff options
context:
space:
mode:
Diffstat (limited to 'debug/risc-v-gsp-rm-vm/ghidra')
-rw-r--r--debug/risc-v-gsp-rm-vm/ghidra/ExportForGreenEye.java8
-rw-r--r--debug/risc-v-gsp-rm-vm/ghidra/GreenEyeControl.java16
-rw-r--r--debug/risc-v-gsp-rm-vm/ghidra/MarkGreenEyeHits.java12
-rw-r--r--debug/risc-v-gsp-rm-vm/ghidra/README.md8
4 files changed, 22 insertions, 22 deletions
diff --git a/debug/risc-v-gsp-rm-vm/ghidra/ExportForGreenEye.java b/debug/risc-v-gsp-rm-vm/ghidra/ExportForGreenEye.java
index 29cc1cd..14d29f6 100644
--- a/debug/risc-v-gsp-rm-vm/ghidra/ExportForGreenEye.java
+++ b/debug/risc-v-gsp-rm-vm/ghidra/ExportForGreenEye.java
@@ -1,4 +1,4 @@
-// Export functions as a green-eye-compatible symbol TSV.
+// Export functions as a risc-v-gsp-rm-debugger-compatible symbol TSV.
//
// Usage (Ghidra headless):
// analyzeHeadless <proj> <name> -process <program> -noanalysis \
@@ -6,10 +6,10 @@
// -postScript ExportForGreenEye.java /abs/path/ghidra-symbols.tsv
//
// Columns: addr (program address) <TAB> name <TAB> size.
-// green-eye's `symbols export --index` accepts this form directly.
+// risc-v-gsp-rm-debugger's `symbols export --index` accepts this form directly.
//
//@category OpenIOV
-//@menupath Tools.OpenIOV.Export for green-eye
+//@menupath Tools.OpenIOV.Export for risc-v-gsp-rm-debugger
import java.io.File;
import java.io.PrintWriter;
@@ -41,6 +41,6 @@ public class ExportForGreenEye extends GhidraScript {
count++;
}
}
- println("green-eye: exported " + count + " functions to " + out.getAbsolutePath());
+ println("risc-v-gsp-rm-debugger: exported " + count + " functions to " + out.getAbsolutePath());
}
}
diff --git a/debug/risc-v-gsp-rm-vm/ghidra/GreenEyeControl.java b/debug/risc-v-gsp-rm-vm/ghidra/GreenEyeControl.java
index abeee82..b0a6628 100644
--- a/debug/risc-v-gsp-rm-vm/ghidra/GreenEyeControl.java
+++ b/debug/risc-v-gsp-rm-vm/ghidra/GreenEyeControl.java
@@ -1,7 +1,7 @@
-// GreenEyeControl - drive a live green-eye session from Ghidra.
+// GreenEyeControl - drive a live risc-v-gsp-rm-debugger session from Ghidra.
//
-// The script connects to the green-eye JSON-lines bridge (start it with
-// `./greeneye.sh ghidra [--kernel <elf>]`), and exposes the operations a
+// The script connects to the risc-v-gsp-rm-debugger JSON-lines bridge (start it with
+// `./risc-v-gsp-rm-debugger.sh ghidra [--kernel <elf>]`), and exposes the operations a
// reverse engineer needs while reading the decompiler:
//
// ping() - check the bridge
@@ -59,14 +59,14 @@ public class GreenEyeControl extends GhidraScript {
int port = Integer.parseInt(args[0]);
try {
connect(port);
- println("green-eye: " + info());
+ println("risc-v-gsp-rm-debugger: " + info());
String target = args.length > 1 ? args[1] : null;
if (target == null && currentAddress != null) {
target = "0x" + Long.toHexString(currentAddress.getOffset());
}
if (target != null) {
- println("green-eye run_until " + target + " -> " + runUntil(target));
- println("green-eye hits: " + listHits());
+ println("risc-v-gsp-rm-debugger run_until " + target + " -> " + runUntil(target));
+ println("risc-v-gsp-rm-debugger hits: " + listHits());
}
} finally {
disconnect();
@@ -95,11 +95,11 @@ public class GreenEyeControl extends GhidraScript {
writer.println(request);
String response = reader.readLine();
if (response == null) {
- throw new Exception("green-eye bridge closed the connection");
+ throw new Exception("risc-v-gsp-rm-debugger bridge closed the connection");
}
Matcher ok = OK.matcher(response);
if (ok.find() && "false".equals(ok.group(1))) {
- throw new Exception("green-eye error: " + response);
+ throw new Exception("risc-v-gsp-rm-debugger error: " + response);
}
return response;
}
diff --git a/debug/risc-v-gsp-rm-vm/ghidra/MarkGreenEyeHits.java b/debug/risc-v-gsp-rm-vm/ghidra/MarkGreenEyeHits.java
index b140ddd..bff3dfd 100644
--- a/debug/risc-v-gsp-rm-vm/ghidra/MarkGreenEyeHits.java
+++ b/debug/risc-v-gsp-rm-vm/ghidra/MarkGreenEyeHits.java
@@ -1,4 +1,4 @@
-// Annotate green-eye runtime hits in the current Ghidra program.
+// Annotate risc-v-gsp-rm-debugger runtime hits in the current Ghidra program.
//
// Input: the TSV produced by greeneye.ghidra.export_hits():
// addr <TAB> hits <TAB> symbol <TAB> annotation
@@ -9,10 +9,10 @@
// -postScript MarkGreenEyeHits.java /abs/path/greeneye_hits.tsv
//
// For each address it adds a plate comment on the containing function
-// ("green-eye: N hits") and a bookmark at the exact address.
+// ("risc-v-gsp-rm-debugger: N hits") and a bookmark at the exact address.
//
//@category OpenIOV
-//@menupath Tools.OpenIOV.Mark green-eye hits
+//@menupath Tools.OpenIOV.Mark risc-v-gsp-rm-debugger hits
import java.io.BufferedReader;
import java.io.File;
@@ -62,7 +62,7 @@ public class MarkGreenEyeHits extends GhidraScript {
Address address = toAddr(addrValue);
Function function = getFunctionContaining(address);
if (function != null) {
- String note = "green-eye: " + hits + " hit(s)"
+ String note = "risc-v-gsp-rm-debugger: " + hits + " hit(s)"
+ (symbol.isEmpty() ? "" : " (" + symbol + ")");
String existing = function.getComment();
function.setComment(existing == null ? note : existing + "\n" + note);
@@ -70,10 +70,10 @@ public class MarkGreenEyeHits extends GhidraScript {
} else {
missed++;
}
- createBookmark(address, "Note", "green-eye");
+ createBookmark(address, "Note", "risc-v-gsp-rm-debugger");
}
}
- println("green-eye: annotated " + marked + " functions (" + missed
+ println("risc-v-gsp-rm-debugger: annotated " + marked + " functions (" + missed
+ " addresses outside any function) from " + in.getAbsolutePath());
}
}
diff --git a/debug/risc-v-gsp-rm-vm/ghidra/README.md b/debug/risc-v-gsp-rm-vm/ghidra/README.md
index e0bb2c0..ce7b4c7 100644
--- a/debug/risc-v-gsp-rm-vm/ghidra/README.md
+++ b/debug/risc-v-gsp-rm-vm/ghidra/README.md
@@ -4,8 +4,8 @@ Two Java scripts run inside Ghidra (GUI or headless):
| Script | Direction | Purpose |
|---|---|---|
-| `ExportForGreenEye.java` | Ghidra → green-eye | write `addr<TAB>name<TAB>size` for every function |
-| `MarkGreenEyeHits.java` | green-eye → Ghidra | annotate functions with runtime hit counts + bookmarks |
+| `ExportForGreenEye.java` | Ghidra → risc-v-gsp-rm-debugger | write `addr<TAB>name<TAB>size` for every function |
+| `MarkGreenEyeHits.java` | risc-v-gsp-rm-debugger → Ghidra | annotate functions with runtime hit counts + bookmarks |
Typical loop:
@@ -15,8 +15,8 @@ $GHIDRA/support/analyzeHeadless <proj_dir> <project> -process <program> -noanaly
-scriptPath debug/risc-v-gsp-rm-vm/ghidra \
-postScript ExportForGreenEye.java /tmp/ghidra-symbols.tsv
-# 2. Build a green-eye symbol DB from it.
-./greeneye.sh symbols export --index /tmp/ghidra-symbols.tsv -o symbols.json
+# 2. Build a risc-v-gsp-rm-debugger symbol DB from it.
+./risc-v-gsp-rm-debugger.sh symbols export --index /tmp/ghidra-symbols.tsv -o symbols.json
# 3. Run a session, then export its hits.
python3 - <<'PY'