pub struct Binary { /* private fields */ }
Implementations§
§impl Binary
impl Binary
pub fn sections(&self) -> Sections<'_> ⓘ
pub fn sections(&self) -> Sections<'_> ⓘ
Iterator over the different sections located in this COFF binary
pub fn relocations(&self) -> Relocations<'_> ⓘ
pub fn relocations(&self) -> Relocations<'_> ⓘ
Iterator over all the relocations used by this COFF binary
pub fn string_table(&self) -> Strings<'_> ⓘ
pub fn string_table(&self) -> Strings<'_> ⓘ
Iterator over the COFF’s strings
pub fn find_string(&self, offset: u32) -> Option<String<'_>>
pub fn find_string(&self, offset: u32) -> Option<String<'_>>
Try to find the COFF string at the given offset in the COFF string table.
This offset must include the first 4 bytes holding the size of the table. Hence,
the first string starts a the offset 4.
pub fn find_function(&self, name: &str) -> Option<Symbol<'_>>
pub fn find_function(&self, name: &str) -> Option<Symbol<'_>>
Try to find the function (symbol) with the given name
pub fn find_demangled_function(&self, name: &str) -> Option<Symbol<'_>>
pub fn find_demangled_function(&self, name: &str) -> Option<Symbol<'_>>
Try to find the function (symbol) with the given demangled name
pub fn disassemble_slice(
&self,
slice: &[u8],
address: u64
) -> InstructionsIt<'_> ⓘ
pub fn disassemble_slice( &self, slice: &[u8], address: u64 ) -> InstructionsIt<'_> ⓘ
Disassemble code provided by the given slice at the specified address
parameter.
See also crate::assembly::Instruction
and crate::assembly::Instructions
pub fn disassemble_function(&self, name: &str) -> InstructionsIt<'_> ⓘ
pub fn disassemble_function(&self, name: &str) -> InstructionsIt<'_> ⓘ
Disassemble code for the given function name
let insts = binary.disassemble_function("int __cdecl bar(int, int)");
for inst in insts {
println!("{}", inst.to_string());
}
See also crate::assembly::Instruction
and crate::assembly::Instructions
pub fn disassemble_symbol(&self, symbol: &Symbol<'_>) -> InstructionsIt<'_> ⓘ
pub fn disassemble_symbol(&self, symbol: &Symbol<'_>) -> InstructionsIt<'_> ⓘ
Disassemble code for the given symbol
let symbol = binary.find_demangled_function("int __cdecl bar(int, int)").unwrap();
let insts = binary.disassemble_symbol(&symbol);
for inst in insts {
println!("{}", inst.to_string());
}
See also crate::assembly::Instruction
and crate::assembly::Instructions
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Binary
impl !Send for Binary
impl !Sync for Binary
impl Unpin for Binary
impl UnwindSafe for Binary
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more