diff options
| author | Rubens Brandao <git@rubens.io> | 2024-04-26 10:03:25 -0300 |
|---|---|---|
| committer | Kyle Martin <krm504@nyu.edu> | 2024-05-09 12:46:13 -0400 |
| commit | a01896d95ed78d5e0bdf7ffab2a941aaa400d326 (patch) | |
| tree | 341c4e3cd70cc9aa227c0880ac485eed7ca05617 | |
| parent | 4e2fbc2b9ad3b45b47b803b8e0ffd8e3dcdf29ec (diff) | |
Fix binja_path in case the lib is a symlink
| -rw-r--r-- | rust/src/headless.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/src/headless.rs b/rust/src/headless.rs index 1520fc58..e4024d8e 100644 --- a/rust/src/headless.rs +++ b/rust/src/headless.rs @@ -59,6 +59,11 @@ fn binja_path() -> PathBuf { let path = CStr::from_ptr(info.dli_fname); let path = OsStr::from_bytes(path.to_bytes()); let mut path = PathBuf::from(path); + while path.is_symlink() { + path = path + .read_link() + .expect("Failed to find libbinaryninjacore path!"); + } path.pop(); path |
