Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-6257: rwx

d-millar2af329d71570
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerSearchRegionFactory.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerSearchRegionFactory.java
index 10e94f360e..91e321cbee 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerSearchRegionFactory.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerSearchRegionFactory.java
@@ -39,14 +39,15 @@ public enum DebuggerSearchRegionFactory {
return set;
}
},
- VALID("Valid Addresses", """
- Searches listed memory regions in the space.""") {
+ READABLE("Readable Addresses", """
+ Searches listed regions marked as readable in the space.""") {
@Override
AddressSetView getAddresses(AddressSpace space, Program program) {
AddressSet set = new AddressSet();
for (MemoryBlock block : program.getMemory().getBlocks()) {
- if (space == null || space == block.getStart().getAddressSpace()) {
+ if (block.isRead() &&
+ (space == null || space == block.getStart().getAddressSpace())) {
set.add(block.getAddressRange());
}
}
@@ -72,6 +73,21 @@ public enum DebuggerSearchRegionFactory {
}
return set;
}
+ },
+ EXECUTABLE("Executable Addresses", """
+ Searches listed regions marked as executable in the space.""") {
+
+ @Override
+ AddressSetView getAddresses(AddressSpace space, Program program) {
+ AddressSet set = new AddressSet();
+ for (MemoryBlock block : program.getMemory().getBlocks()) {
+ if (block.isExecute() &&
+ (space == null || space == block.getStart().getAddressSpace())) {
+ set.add(block.getAddressRange());
+ }
+ }
+ return set;
+ }
};
public static final List<DebuggerSearchRegionFactory> ALL = List.of(values());