Trait lief::generic::Section

pub trait Section {
    // Provided methods
    fn name(&self) -> String { ... }
    fn size(&self) -> u64 { ... }
    fn offset(&self) -> u64 { ... }
    fn virtual_address(&self) -> u64 { ... }
    fn content(&self) -> &[u8]  { ... }
    fn set_name(&mut self, name: &str) { ... }
    fn set_content(&mut self, data: &[u8]) { ... }
    fn set_size(&mut self, size: u64) { ... }
}
Expand description

Trait shared by all the sections in executable formats

Provided Methods§

fn name(&self) -> String

Name of the section

fn size(&self) -> u64

Size of the section in the file

fn offset(&self) -> u64

Offset of the section in the file

fn virtual_address(&self) -> u64

Address of the section in memory

fn content(&self) -> &[u8]

Content of the section

fn set_name(&mut self, name: &str)

Change the section’s name

fn set_content(&mut self, data: &[u8])

Change section content

fn set_size(&mut self, size: u64)

Change section size

Trait Implementations§

§

impl Debug for &dyn Section

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§

§

impl Section for lief::coff::Section<'_>

§

impl Section for lief::elf::Section<'_>

§

impl Section for lief::macho::Section<'_>

§

impl Section for lief::pe::Section<'_>