diff options
| author | Mason Reed <mason@vector35.com> | 2025-04-08 13:17:30 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-04-08 13:21:48 -0400 |
| commit | a45466fc3227c615c72e77eb7368d7e83220b325 (patch) | |
| tree | 7a1060a6e98a0faa6fe81324553f65f4cafdbfed /objectivec/objc.h | |
| parent | a6c5c22f08032374481aa060b59ef3492d124200 (diff) | |
Remove notion of image name from objective-c processor
This made the macho objective-c processor aware of images and was passed around everywhere, instead we have an overridable section getter that gives the control over the section retrieval to the derived processor.
In the case of shared cache this means we can store the image to be processed and then use the header to locate the relevant sections.
Fixes: https://github.com/Vector35/binaryninja-api/issues/6594
Diffstat (limited to 'objectivec/objc.h')
| -rw-r--r-- | objectivec/objc.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/objectivec/objc.h b/objectivec/objc.h index 935773c1..dad86f08 100644 --- a/objectivec/objc.h +++ b/objectivec/objc.h @@ -314,8 +314,7 @@ namespace BinaryNinja { bool ApplyMethodType(Class& cls, Method& method, bool isInstanceMethod); void ApplyMethodTypes(Class& cls); - Ref<Section> GetSectionForImage(std::optional<std::string> imageName, const char* sectionName); - void PostProcessObjCSections(ObjCReader* reader, std::optional<std::string> imageName); + void PostProcessObjCSections(ObjCReader* reader); protected: Ref<BinaryView> m_data; @@ -327,13 +326,15 @@ namespace BinaryNinja { // Because an objective-c processor might have access to other non-view symbols that we want to retrieve. // By default, this will just get symbol at the address in the view. virtual Ref<Symbol> GetSymbol(uint64_t address); + virtual Ref<Section> GetSectionWithName(const char* sectionName); public: virtual ~ObjCProcessor() = default; ObjCProcessor(BinaryView* data, const char* loggerName, bool isBackedByDatabase, bool skipClassBaseProtocols = false); - void ProcessObjCData(std::optional<std::string> imageName); - void ProcessCFStrings(std::optional<std::string> imageName); + // TODO: Instead of passing in image name the processor must be given section refs in a structure that outlines all objc sections. + void ProcessObjCData(); + void ProcessCFStrings(); void AddRelocatedPointer(uint64_t location, uint64_t rewrite); }; } |
