dyld

Replace static symbols in MacOS Mach-O binary with external symbols

怎甘沉沦 提交于 2021-01-28 06:22:35
问题 I have the following scenario: A proprietary MacOS game that statically links a graphics framework MoltenVK into its main Mach-O x86-64 binary. The version of MoltenVK linked in is very old. I have a newer version of MoltenVK in the form of a .dylib (along with newer versions of the SPIRV compiler, libVulkan, etc. if they are needed, also in dylib form). The older and newer version of MoltenVK are ABI compatible, meaning the exported symbol names and function signatures should be identical

Find pathname from dlopen handle on OSX

不羁岁月 提交于 2021-01-20 15:34:54
问题 I have dlopen() 'ed a library, and I want to invert back from the handle it passes to me to the full pathname of shared library. On Linux and friends, I know that I can use dlinfo() to get the linkmap and iterate through those structures, but I can't seem to find an analogue on OSX. The closest thing I can do is to either: Use dyld_image_count() and dyld_get_image_name() , iterate over all the currently opened libraries and hope I can guess which one corresponds to my handle Somehow find a

dyld: Symbol not found: _ffi_prep_closure_loc (on Mac)

Deadly 提交于 2021-01-01 06:57:45
问题 I did a regular flutter run on my Mac, targeting my iPhone simulator today and got these errors. Error output from CocoaPods: ↳ dyld: lazy symbol binding failed: Symbol not found: _ffi_prep_closure_loc Referenced from: /Users/toure/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle Expected in: /usr/lib/libffi.dylib dyld: Symbol not found: _ffi_prep_closure_loc Referenced from: /Users/toure/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle

dyld: could not load inserted library, but works on Simulator and another iPhone

心不动则不痛 提交于 2020-08-20 11:08:34
问题 So i was coding on my app the last few hours and on some point I decided to launch my app on my iPhone 8 (13.3.1) instead of using the simulator (13.3) and it crashed instantly with the following error: dyld: warning: could not load inserted library '@executable_path/Frameworks/libclang_rt.asan_ios_dynamic.dylib' into hardened process because no suitable image found. Did find: /private/var/containers/Bundle/Application/F8559B38-6434-4B39-BA14-DF1FF9689517/SmartBuy.app/Frameworks/libclang_rt

Extend section in Mach-O file

吃可爱长大的小学妹 提交于 2020-06-16 20:51:15
问题 I am trying to extract libraries from the Dyld_shared_cache, and need to fix in external references. For example, the pointers in the __DATA.__objc_selrefs section usually point to data outside the mach-o file, to fix that I would have to copy the corresponding c-string from the dyld and append it to the __TEXT.__objc_methname section. Though from my understanding of the Mach-O file format, this extension of the __TEXT.__objc_methname would shift all the sections after it and would force me

php dyld: Library not loaded for libldap

自古美人都是妖i 提交于 2020-05-26 01:15:56
问题 I installed ruby on my Mac OSX High Sierra and am running into issues now with my php installation for some reason. I'm on php 7.1 . Following this (also here) Github suggestion, I tried brew update && brew reinstall php71 While installing, it broke at ==> Pouring php@7.1-7.1.23.high_sierra.bottle.tar.gz ==> /usr/local/Cellar/php@7.1/7.1.23/bin/pear config-set php_ini /usr/local/etc/php/7.1/php.ini system With error: dyld: Library not loaded: /usr/local/opt/openldap/lib/libldap-2.4.2.dylib

php dyld: Library not loaded for libldap

南楼画角 提交于 2020-05-26 01:15:09
问题 I installed ruby on my Mac OSX High Sierra and am running into issues now with my php installation for some reason. I'm on php 7.1 . Following this (also here) Github suggestion, I tried brew update && brew reinstall php71 While installing, it broke at ==> Pouring php@7.1-7.1.23.high_sierra.bottle.tar.gz ==> /usr/local/Cellar/php@7.1/7.1.23/bin/pear config-set php_ini /usr/local/etc/php/7.1/php.ini system With error: dyld: Library not loaded: /usr/local/opt/openldap/lib/libldap-2.4.2.dylib

Self-modifying code on Darwin 10.15 resulting in “malformed mach-o image”?

前提是你 提交于 2020-05-09 04:35:08
问题 I have a program that generates self-modifying code (see https://tigress.wtf/selfModify.html in case you're interested). It runs on x86 Darwin and Linux. On Darwin, I compile with gcc -g -segprot __TEXT rwx rwx self_modifying.c -o self_modifying.exe Recently, this seems not to work, I get dyld: malformed mach-o image: __TEXT segment maps start of file but is writable when I run the program. I'm running clang version 6.0.1 on MacOS 10.15.3. Any help would be appreciated. 回答1: @AlexDenisov is