Struct lief::pe::ResourcesManager

pub struct ResourcesManager<'a> { /* private fields */ }
Expand description

This manager abstracts the tree representation to provide a comprehensive API over the information wrapped by the resources tree.

Implementations§

§

impl Manager<'_>

pub fn manifest(&self) -> String

Return the manifest as a string. This manifest matches the node associated with the type: Types::MANIFEST.

pub fn set_manifest(&mut self, content: &str)

Change or set the manifest. If the manifest node path does not exist, all required nodes are created.

pub fn find_by_type(&self, res_type: Types) -> Option<Node<'_>>

Try to find the node associated with the given Types

This type corresponds to the Node::id at the level 1 of the resource tree.

pub fn types(&self) -> Vec<Types>

Return the list of Types exposed by the resource tree.

pub fn print_tree(&self) -> String

Print the current resources a tree in a pretty representation.

│  ├── Directory ID: 0016 (0x0010) type: VERSION
│  │  └── Directory ID: 0001 (0x0001)
│  │      └── Data ID: 1033 (0x0409) [...]
│  │          ├── Hex: c0:03:34:00:00:00:[...]
│  │          └── Str: ..4...V.S._.V.E.R.S.
│  └── Directory ID: 0024 (0x0018) type: MANIFEST
│      └── Directory ID: 0001 (0x0001)
│          └── Data ID: 1033 (0x0409) [...]
│              ├── Hex: 3c:3f:78:6d:6c:20:[...]
│              └── Str: <?xml version="1.0"

pub fn print_tree_with_depth(&self, depth: u32) -> String

Same as Manager::print_tree but with a maximal depth provided in the first parameter.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Manager<'a>

§

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

§

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

§

impl<'a> Unpin for Manager<'a>

§

impl<'a> !UnwindSafe for Manager<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.