Skip to content

Commit a01896d

Browse files
rbranElykDeer
authored andcommitted
Fix binja_path in case the lib is a symlink
1 parent 4e2fbc2 commit a01896d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rust/src/headless.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ fn binja_path() -> PathBuf {
5959
let path = CStr::from_ptr(info.dli_fname);
6060
let path = OsStr::from_bytes(path.to_bytes());
6161
let mut path = PathBuf::from(path);
62+
while path.is_symlink() {
63+
path = path
64+
.read_link()
65+
.expect("Failed to find libbinaryninjacore path!");
66+
}
6267

6368
path.pop();
6469
path

0 commit comments

Comments
 (0)