Skip to content

Commit

Permalink
Fix binja_path in case the lib is a symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
rbran authored and ElykDeer committed May 9, 2024
1 parent 4e2fbc2 commit a01896d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rust/src/headless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a01896d

Please sign in to comment.