pub struct RawFileContext<'data> { /* private fields */ }Implementations§
Source§impl<'data> RawFileContext<'data>
impl<'data> RawFileContext<'data>
Sourcepub fn from_bytes(
target_platform: &str,
data: &'data [u8],
) -> Result<Self, DecompError>
pub fn from_bytes( target_platform: &str, data: &'data [u8], ) -> Result<Self, DecompError>
Examples found in repository?
examples/decompile.rs (line 22)
14fn main() -> Result<(), DecompError> {
15 let ghidra_dir = env::var("GHIDRA_INSTALL_DIR").expect(
16 "Please provide an environment variable \
17 GHIDRA_INSTALL_DIR with the path to the Ghidra root directory. \
18 This is needed to find the SLEIGH specification files",
19 );
20
21 initialize_decompiler(Path::new(&ghidra_dir), true)?;
22 let mut ctx = RawFileContext::from_bytes("x86:LE:64:default", &PROGRAM)?;
23
24 let addr = 0x0;
25 ctx.define_function(addr, "fib")?;
26 let decomp = ctx.decompile_function(addr)?;
27 println!("{}", decomp);
28
29 Ok(())
30}Sourcepub fn define_function(
&mut self,
address: u64,
name: &str,
) -> Result<(), DecompError>
pub fn define_function( &mut self, address: u64, name: &str, ) -> Result<(), DecompError>
Examples found in repository?
examples/decompile.rs (line 25)
14fn main() -> Result<(), DecompError> {
15 let ghidra_dir = env::var("GHIDRA_INSTALL_DIR").expect(
16 "Please provide an environment variable \
17 GHIDRA_INSTALL_DIR with the path to the Ghidra root directory. \
18 This is needed to find the SLEIGH specification files",
19 );
20
21 initialize_decompiler(Path::new(&ghidra_dir), true)?;
22 let mut ctx = RawFileContext::from_bytes("x86:LE:64:default", &PROGRAM)?;
23
24 let addr = 0x0;
25 ctx.define_function(addr, "fib")?;
26 let decomp = ctx.decompile_function(addr)?;
27 println!("{}", decomp);
28
29 Ok(())
30}Sourcepub fn decompile_function(
&mut self,
address: u64,
) -> Result<String, DecompError>
pub fn decompile_function( &mut self, address: u64, ) -> Result<String, DecompError>
Examples found in repository?
examples/decompile.rs (line 26)
14fn main() -> Result<(), DecompError> {
15 let ghidra_dir = env::var("GHIDRA_INSTALL_DIR").expect(
16 "Please provide an environment variable \
17 GHIDRA_INSTALL_DIR with the path to the Ghidra root directory. \
18 This is needed to find the SLEIGH specification files",
19 );
20
21 initialize_decompiler(Path::new(&ghidra_dir), true)?;
22 let mut ctx = RawFileContext::from_bytes("x86:LE:64:default", &PROGRAM)?;
23
24 let addr = 0x0;
25 ctx.define_function(addr, "fib")?;
26 let decomp = ctx.decompile_function(addr)?;
27 println!("{}", decomp);
28
29 Ok(())
30}Trait Implementations§
Source§impl<'data> Drop for RawFileContext<'data>
impl<'data> Drop for RawFileContext<'data>
Auto Trait Implementations§
impl<'data> !Send for RawFileContext<'data>
impl<'data> !Sync for RawFileContext<'data>
impl<'data> Freeze for RawFileContext<'data>
impl<'data> RefUnwindSafe for RawFileContext<'data>
impl<'data> Unpin for RawFileContext<'data>
impl<'data> UnsafeUnpin for RawFileContext<'data>
impl<'data> UnwindSafe for RawFileContext<'data>
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