Skip to main content

AddressFlags

Struct AddressFlags 

Source
pub struct AddressFlags<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> AddressFlags<'a>

Source

pub fn is_code(&self) -> bool

Examples found in repository?
examples/names_ls.rs (line 33)
3fn main() -> anyhow::Result<()> {
4    println!("Trying to open IDA database...");
5
6    // Open IDA database
7    let idb = IDB::open("./tests/ls")?;
8
9    println!("Testing len(), get_by_index(), and get_address_by_index() (valid indexes)");
10    // len()
11    for i in 0..idb.names().len() {
12        // get_by_index()
13        assert!(idb.names().get_by_index(i).is_some());
14        // get_address_by_index()
15        assert!(idb.names().get_address_by_index(i).is_some());
16    }
17
18    println!("Testing len(), get_by_index(), and get_address_by_index() (invalid index)");
19    // len()
20    let len = idb.names().len();
21    // get_by_index()
22    assert!(idb.names().get_by_index(len).is_none());
23    // get_address_by_index()
24    assert!(idb.names().get_address_by_index(len).is_none());
25
26    println!("\nTesting iterator:");
27    for name in idb.names().iter() {
28        let flags = idb.flags_at(name.address());
29        println!(
30            "\t{:#x}\t{:?}\tcode: {}\tdata: {}",
31            name.address(),
32            name.name(),
33            flags.is_code(),
34            flags.is_data(),
35        );
36    }
37
38    Ok(())
39}
Source

pub fn is_data(&self) -> bool

Examples found in repository?
examples/names_ls.rs (line 34)
3fn main() -> anyhow::Result<()> {
4    println!("Trying to open IDA database...");
5
6    // Open IDA database
7    let idb = IDB::open("./tests/ls")?;
8
9    println!("Testing len(), get_by_index(), and get_address_by_index() (valid indexes)");
10    // len()
11    for i in 0..idb.names().len() {
12        // get_by_index()
13        assert!(idb.names().get_by_index(i).is_some());
14        // get_address_by_index()
15        assert!(idb.names().get_address_by_index(i).is_some());
16    }
17
18    println!("Testing len(), get_by_index(), and get_address_by_index() (invalid index)");
19    // len()
20    let len = idb.names().len();
21    // get_by_index()
22    assert!(idb.names().get_by_index(len).is_none());
23    // get_address_by_index()
24    assert!(idb.names().get_address_by_index(len).is_none());
25
26    println!("\nTesting iterator:");
27    for name in idb.names().iter() {
28        let flags = idb.flags_at(name.address());
29        println!(
30            "\t{:#x}\t{:?}\tcode: {}\tdata: {}",
31            name.address(),
32            name.name(),
33            flags.is_code(),
34            flags.is_data(),
35        );
36    }
37
38    Ok(())
39}

Auto Trait Implementations§

§

impl<'a> Freeze for AddressFlags<'a>

§

impl<'a> RefUnwindSafe for AddressFlags<'a>

§

impl<'a> !Send for AddressFlags<'a>

§

impl<'a> !Sync for AddressFlags<'a>

§

impl<'a> Unpin for AddressFlags<'a>

§

impl<'a> UnsafeUnpin for AddressFlags<'a>

§

impl<'a> UnwindSafe for AddressFlags<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.