Skip to content

Instantly share code, notes, and snippets.

@osa1
Created December 19, 2020 09:29
Show Gist options
  • Save osa1/eef653680d360bfa3202f6ec67fa45cb to your computer and use it in GitHub Desktop.
Save osa1/eef653680d360bfa3202f6ec67fa45cb to your computer and use it in GitHub Desktop.
use goblin::Object;
fn main() {
let file = std::env::args().nth(1).unwrap();
let contents = std::fs::read(file).unwrap();
let obj = Object::parse(&contents).unwrap();
if let Object::Elf(elf) = obj {
for sym in elf.dynsyms.iter() {
let sym_name = elf.dynstrtab.get(sym.st_name);
println!("{:?} name={:?}", sym, sym_name);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment