Crate leviso_elf

Crate leviso_elf 

Source
Expand description

ELF binary analysis and copying utilities.

Uses readelf -d instead of ldd to extract library dependencies. This works for cross-compilation since readelf reads ELF headers directly without executing the binary (which ldd does via the host dynamic linker).

Functions§

copy_dir_recursive
Copy a directory recursively, handling symlinks.
copy_library_to
Copy a library from source to destination, handling symlinks.
create_symlink_if_missing
Create a symlink if it doesn’t already exist.
find_binary
Find a binary in standard bin/sbin directories.
find_library
Find a library in standard paths within a rootfs.
find_sbin_binary
Find a binary, prioritizing sbin directories.
get_all_dependencies
Recursively get all library dependencies (including transitive).
get_library_dependencies
Extract library dependencies from an ELF binary using readelf.
make_executable
Make a file executable (chmod 755).
parse_readelf_output
Parse readelf -d output to extract NEEDED library names.