diff options
| author | Mark Rowe <mrowe@bdash.net.nz> | 2025-02-17 11:04:35 -0800 |
|---|---|---|
| committer | kat <kat@vector35.com> | 2025-07-08 15:12:46 -0400 |
| commit | d7445e232501ba60fb780f2c18500c0b509fc97e (patch) | |
| tree | dfaff0a3c5f64786424a8ba0eb2ad4f53f9ebd5a /objectivec/objc.h | |
| parent | 9ff07a92f51ded6376174a0a023875256d6776bd (diff) | |
Parse sections containing Objective-C constants
This adds support for the `__objc_arrayobj`, `_objc_dictobj`,
`__objc_intobj`, `__objc_floatobj`, `__objc_doubleobj` and
`__objc_dateobj` sections that contain Objective-C constants. These are
emitted by Apple's versions of Clang for `const` literals, amongst other
things.
Diffstat (limited to 'objectivec/objc.h')
| -rw-r--r-- | objectivec/objc.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/objectivec/objc.h b/objectivec/objc.h index a8769ba6..61df2b0d 100644 --- a/objectivec/objc.h +++ b/objectivec/objc.h @@ -274,6 +274,13 @@ namespace BinaryNinja { QualifiedName protocolList; QualifiedName ivar; QualifiedName ivarList; + QualifiedName nsConstantArray; + QualifiedName nsConstantDictionary; + QualifiedName nsConstantDoubleNumber; + QualifiedName nsConstantFloatNumber; + QualifiedName nsConstantIntegerNumber; + QualifiedName nsConstantDate; + QualifiedName nsConstantData; } m_typeNames; // TODO(WeiN76LQh): this is to avoid a bug with defining a classes protocol list in the DSC plugin. Remove once fixed @@ -314,6 +321,13 @@ namespace BinaryNinja { std::optional<std::string> ClassNameForTargetOfPointerAt(ObjCReader* reader, uint64_t offset); + void ProcessCFStrings(); + void ProcessNSConstantArrays(); + void ProcessNSConstantDictionaries(); + void ProcessNSConstantIntegerNumbers(); + void ProcessNSConstantFloatingPointNumbers(); + void ProcessNSConstantDatas(); + void PostProcessObjCSections(ObjCReader* reader); protected: @@ -333,7 +347,7 @@ namespace BinaryNinja { ObjCProcessor(BinaryView* data, const char* loggerName, bool skipClassBaseProtocols = false); void ProcessObjCData(); - void ProcessCFStrings(); + void ProcessObjCLiterals(); void AddRelocatedPointer(uint64_t location, uint64_t rewrite); }; } |
