Loading...
dyld3/APIs_macOS.cpp dyld-852.2 dyld-832.7.3
--- dyld/dyld-852.2/dyld3/APIs_macOS.cpp
+++ dyld/dyld-832.7.3/dyld3/APIs_macOS.cpp
@@ -37,10 +37,6 @@
 #include <mach-o/dyld_images.h>
 
 #include <algorithm>
-
-#if __has_feature(ptrauth_calls)
-  #include <ptrauth.h>
-#endif
 
 #include "dlfcn.h"
 
@@ -455,35 +451,8 @@
 {
     log_apis("NSAddressOfSymbol(%p)\n", symbol);
 
-	if ( symbol == nullptr )
-		return nullptr;
-
     // in dyld 1.0, NSSymbol was a pointer to the nlist entry in the symbol table
-    void *result = (void*)symbol;
-
-#if __has_feature(ptrauth_calls)
-    __block const MachOLoaded *module = nullptr;
-    gAllImages.infoForImageMappedAt(symbol, ^(const LoadedImage& foundImage, uint8_t permissions) {
-        module = foundImage.loadedAddress();
-    });
-
-    int64_t slide = module->getSlide();
-    __block bool resultPointsToInstructions = false;
-    module->forEachSection(^(const MachOAnalyzer::SectionInfo& sectInfo, bool malformedSectionRange, bool& stop) {
-        uint64_t sectStartAddr = sectInfo.sectAddr + slide;
-        uint64_t sectEndAddr = sectStartAddr + sectInfo.sectSize;
-        if ( ((uint64_t)result >= sectStartAddr) && ((uint64_t)result < sectEndAddr) ) {
-            resultPointsToInstructions = (sectInfo.sectFlags & S_ATTR_PURE_INSTRUCTIONS) || (sectInfo.sectFlags & S_ATTR_SOME_INSTRUCTIONS);
-            stop = true;
-        }
-    });
-
-    if (resultPointsToInstructions) {
-        result = __builtin_ptrauth_sign_unauthenticated(result, ptrauth_key_asia, 0);
-    }
-#endif
-
-    return result;
+    return (void*)symbol;
 }
 
 NSModule NSModuleForSymbol(NSSymbol symbol)