-
-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a366089
commit 9f7230e
Showing
3 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,34 @@ | ||
# LIEF Rust Bindings | ||
|
||
These are the offical rust bindings for LIEF. | ||
|
||
![LIEF Architecture](https://raw.githubusercontent.com/lief-project/LIEF/main/.github/images/architecture.png) | ||
|
||
## Getting Started | ||
|
||
```toml | ||
[dependencies] | ||
lief = = "0.15.0" | ||
``` | ||
|
||
The bindings require Rust edition 2021 and `rustc >= 1.74.0` | ||
|
||
```rust | ||
use lief; | ||
|
||
if let Some(lief::Binary::ELF(elf)) = lief::Binary::from(&mut file) { | ||
println!("Dependencies:"); | ||
for entry in elf.dynamic_entries() { | ||
if let dynamic::Entries::Library(lib) = entry { | ||
println!(" - {}", lib.name()); | ||
} | ||
} | ||
println!("Versions:"); | ||
for version in elf.symbols_version_requirement() { | ||
println!(" From {}", version.name()); | ||
for aux in version.auxiliary_symbols() { | ||
println!(" - {}", aux.name()); | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters