Skip to content

Instantly share code, notes, and snippets.

@lingol
Created July 13, 2018 03:58
Show Gist options
  • Save lingol/88ddda603a3cc420db7d9daf023b9958 to your computer and use it in GitHub Desktop.
Save lingol/88ddda603a3cc420db7d9daf023b9958 to your computer and use it in GitHub Desktop.
How to edit dynamic library's dynamic-entry-library name
How to edit dynamic library's dynamic-entry-library name.
Using LIEF lib (https://github.com/lief-project/LIEF).
GUOLING-MC4:~/Desktop$ pip install setuptools --upgrade
GUOLING-MC4:~/Desktop$ pip install lief 130
GUOLING-MC4:~/Desktop$ python
Python 2.7.15 (default, May 1 2018, 16:44:08)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lief
>>> lib = lief.parse('libmmkv_x86.so')
>>> cpp = lib.get_library('libc++_shared.so')
>>> cpp.name = 'libc++_shared_x86.so'
>>> lib.write('libmmkv_x86.so')
>>> exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment