summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/ObjC.h
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-09-12 10:01:37 -0700
committerMark Rowe <mark@vector35.com>2025-09-17 20:45:26 -0700
commit11dc8b216d0852c83ff5c9bfd7d3ca146a93fe84 (patch)
tree2ba043a08032a73ad53b762716ada0cd64f84608 /view/sharedcache/core/ObjC.h
parentbdb62855f9b6cb85fcf64dba0a067d9056f09af5 (diff)
[DSC] Support relative direct selectors in older shared cache versions
Prior to macOS 13 / iOS 16, the base offset to use for relative direct selector references within Objective-C message lists was stored within the `__TEXT,__objc_opt_ro` section of /usr/lib/libobjc.A.dylib.
Diffstat (limited to 'view/sharedcache/core/ObjC.h')
-rw-r--r--view/sharedcache/core/ObjC.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/view/sharedcache/core/ObjC.h b/view/sharedcache/core/ObjC.h
index a30b9de4..e8c47e70 100644
--- a/view/sharedcache/core/ObjC.h
+++ b/view/sharedcache/core/ObjC.h
@@ -16,6 +16,22 @@ struct ObjCOptimizationHeader
uint64_t relativeMethodSelectorBaseAddressOffset;
};
+// `objc_opt_t` from dyld/include/objc-shared-cache.h
+struct LegacyObjCOptimizationHeader
+{
+ uint32_t version;
+ uint32_t flags;
+ int32_t selopt_offset;
+ int32_t headeropt_ro_offset;
+ int32_t unused_clsopt_offset;
+ int32_t unused_protocolopt_offset;
+ int32_t headeropt_rw_offset;
+ int32_t unused_protocolopt2_offset;
+ int32_t largeSharedCachesClassOffset;
+ int32_t largeSharedCachesProtocolOffset;
+ int64_t relativeMethodSelectorBaseAddressOffset;
+};
+
namespace DSCObjC {
class SharedCacheObjCReader : public BinaryNinja::ObjCReader
{