Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-6176: Forgot to make Objc2TypeMetadata getters

Ryan Kurtzb3424594a1a6
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objc/objc2/Objc2TypeMetadata.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objc/objc2/Objc2TypeMetadata.java
index d48cfdb63b..8e2ab3e68b 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objc/objc2/Objc2TypeMetadata.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/objc/objc2/Objc2TypeMetadata.java
@@ -37,6 +37,13 @@ import ghidra.util.task.TaskMonitor;
public class Objc2TypeMetadata extends AbstractObjcTypeMetadata {
+ private Set<Address> refs = new HashSet<>();
+ private List<Objc2ImageInfo> imageInfos = new ArrayList<>();
+ private List<Objc2Category> categories = new ArrayList<>();
+ private List<Objc2Class> classes = new ArrayList<>();
+ private List<Objc2Protocol> protocols = new ArrayList<>();
+ private List<Objc2MessageReference> messageRefs = new ArrayList<>();
+
/**
* Creates a new {@link Objc2TypeMetadata}
*
@@ -52,6 +59,48 @@ public class Objc2TypeMetadata extends AbstractObjcTypeMetadata {
parse();
}
+ /**
+ * {@return the {@link Set} of {@link Address refs}}
+ */
+ public Set<Address> getRefs() {
+ return refs;
+ }
+
+ /**
+ * {@return the {@link List} of {@link Objc2ImageInfo image info entries}}
+ */
+ public List<Objc2ImageInfo> getImageInfos() {
+ return imageInfos;
+ }
+
+ /**
+ * {@return the {@link List} of {@link Objc2Category categories}}
+ */
+ public List<Objc2Category> getCategories() {
+ return categories;
+ }
+
+ /**
+ * {@return the {@link List} of {@link Objc2Class classes}}
+ */
+ public List<Objc2Class> getClasses() {
+ return classes;
+ }
+
+ /**
+ * {@return the {@link List} of {@link Objc2Protocol protocols}}
+ */
+ public List<Objc2Protocol> getProtocols() {
+ return protocols;
+ }
+
+ /**
+ * {@return the {@link List} of {@link Objc2MessageReference message references}}
+ */
+ public List<Objc2MessageReference> getMessageRefs() {
+ return messageRefs;
+ }
+
/**
* Parses the {@link Objc1TypeMetadata}
*
@@ -84,13 +133,6 @@ public class Objc2TypeMetadata extends AbstractObjcTypeMetadata {
}
}
- private Set<Address> refs = new HashSet<>();
- private List<Objc2ImageInfo> imageInfos = new ArrayList<>();
- private List<Objc2Category> categories = new ArrayList<>();
- private List<Objc2Class> classes = new ArrayList<>();
- private List<Objc2Protocol> protocols = new ArrayList<>();
- private List<Objc2MessageReference> messageRefs = new ArrayList<>();
-
private void parseRefs(String section, Set<Address> set,
Map<String, List<MemoryBlock>> objcBlockMap) throws CancelledException {
monitor.setMessage("Parsing Objective-C %s references...".formatted(section));