From dae2391bb0b14e49f07a08fe683e5afd4a6ed955 Mon Sep 17 00:00:00 2001 From: mio Date: Fri, 8 Mar 2024 16:19:53 +0800 Subject: [PATCH] Apply fix for linux2 --- bindings/python/unicorn/unicorn_py3/unicorn.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bindings/python/unicorn/unicorn_py3/unicorn.py b/bindings/python/unicorn/unicorn_py3/unicorn.py index 2621c0f7..ad2d0c60 100644 --- a/bindings/python/unicorn/unicorn_py3/unicorn.py +++ b/bindings/python/unicorn/unicorn_py3/unicorn.py @@ -92,8 +92,9 @@ def __load_uc_lib() -> ctypes.CDLL: os.getenv('LIBUNICORN_PATH'), pkg_resources.resource_filename(__name__, 'lib'), PurePath(inspect.getfile(__load_uc_lib)).parent / 'lib', - '' - ] + [PurePath(p) / 'unicorn' / 'lib' for p in sys.path] + '', + "/usr/local/lib/" if sys.platform == 'darwin' else '/usr/lib64', + ] + [PurePath(p) / 'unicorn' / 'lib' for p in sys.path] # lazymio: ??? why PATH ?? # filter out None elements lib_locations = tuple(Path(loc) for loc in lib_locations if loc is not None) @@ -102,6 +103,7 @@ def __load_uc_lib() -> ctypes.CDLL: 'cygwin' : 'cygunicorn.dll', 'darwin' : 'libunicorn.2.dylib', 'linux' : 'libunicorn.so.2', + 'linux2': 'libunicorn.so.2', 'win32' : 'unicorn.dll' }.get(platform, "libunicorn.so")