pub struct Elf { /* private fields */ }Expand description
These fields contain Linux Executable Linkable Format (ELF) metadata.
Implementations§
Source§impl Elf
impl Elf
Sourcepub fn get_creation_date(&self) -> Option<&Timestamp>
pub fn get_creation_date(&self) -> Option<&Timestamp>
Extracted when possible from the file’s metadata. Indicates when it was built or compiled. It can also be faked by malware creators.
Sourcepub fn set_creation_date(&mut self, creation_date_arg: Timestamp)
pub fn set_creation_date(&mut self, creation_date_arg: Timestamp)
Extracted when possible from the file’s metadata. Indicates when it was built or compiled. It can also be faked by malware creators.
Sourcepub fn get_architecture(&self) -> Option<&String>
pub fn get_architecture(&self) -> Option<&String>
Machine architecture of the ELF file.
Sourcepub fn set_architecture(&mut self, architecture_arg: String)
pub fn set_architecture(&mut self, architecture_arg: String)
Sourcepub fn get_byte_order(&self) -> Option<&String>
pub fn get_byte_order(&self) -> Option<&String>
Byte sequence of ELF file.
Sourcepub fn set_byte_order(&mut self, byte_order_arg: String)
pub fn set_byte_order(&mut self, byte_order_arg: String)
Sourcepub fn get_cpu_type(&self) -> Option<&String>
pub fn get_cpu_type(&self) -> Option<&String>
CPU type of the ELF file.
Sourcepub fn set_cpu_type(&mut self, cpu_type_arg: String)
pub fn set_cpu_type(&mut self, cpu_type_arg: String)
Sourcepub fn get_go_import_hash(&self) -> Option<&String>
pub fn get_go_import_hash(&self) -> Option<&String>
A hash of the Go language imports in an ELF file excluding standard library imports. An import hash can be used to fingerprint binaries even after recompilation or other code-level transformations have occurred, which would change more traditional hash values.
The algorithm used to calculate the Go symbol hash and a reference implementation are available here.
Sourcepub fn set_go_import_hash(&mut self, go_import_hash_arg: String)
pub fn set_go_import_hash(&mut self, go_import_hash_arg: String)
A hash of the Go language imports in an ELF file excluding standard library imports. An import hash can be used to fingerprint binaries even after recompilation or other code-level transformations have occurred, which would change more traditional hash values.
The algorithm used to calculate the Go symbol hash and a reference implementation are available here.
§Example
10bddcb4cee42080f76c88d9ff964491
Sourcepub fn get_go_imports_names_entropy(&self) -> Option<&u64>
pub fn get_go_imports_names_entropy(&self) -> Option<&u64>
Shannon entropy calculation from the list of Go imports.
Sourcepub fn set_go_imports_names_entropy(
&mut self,
go_imports_names_entropy_arg: u64,
)
pub fn set_go_imports_names_entropy( &mut self, go_imports_names_entropy_arg: u64, )
Shannon entropy calculation from the list of Go imports.
Sourcepub fn get_go_imports_names_var_entropy(&self) -> Option<&u64>
pub fn get_go_imports_names_var_entropy(&self) -> Option<&u64>
Variance for Shannon entropy calculation from the list of Go imports.
Sourcepub fn set_go_imports_names_var_entropy(
&mut self,
go_imports_names_var_entropy_arg: u64,
)
pub fn set_go_imports_names_var_entropy( &mut self, go_imports_names_var_entropy_arg: u64, )
Variance for Shannon entropy calculation from the list of Go imports.
Sourcepub fn get_go_imports(&self) -> Option<&String>
pub fn get_go_imports(&self) -> Option<&String>
List of imported Go language element names and types.
Sourcepub fn set_go_imports(&mut self, go_imports_arg: String)
pub fn set_go_imports(&mut self, go_imports_arg: String)
List of imported Go language element names and types.
Sourcepub fn get_go_stripped(&self) -> Option<&bool>
pub fn get_go_stripped(&self) -> Option<&bool>
Set to true if the file is a Go executable that has had its symbols stripped or obfuscated and false if an unobfuscated Go executable.
Sourcepub fn set_go_stripped(&mut self, go_stripped_arg: bool)
pub fn set_go_stripped(&mut self, go_stripped_arg: bool)
Set to true if the file is a Go executable that has had its symbols stripped or obfuscated and false if an unobfuscated Go executable.
Sourcepub fn get_header_class(&self) -> Option<&String>
pub fn get_header_class(&self) -> Option<&String>
Header class of the ELF file.
Sourcepub fn set_header_class(&mut self, header_class_arg: String)
pub fn set_header_class(&mut self, header_class_arg: String)
Header class of the ELF file.
Sourcepub fn get_header_data(&self) -> Option<&String>
pub fn get_header_data(&self) -> Option<&String>
Data table of the ELF header.
Sourcepub fn set_header_data(&mut self, header_data_arg: String)
pub fn set_header_data(&mut self, header_data_arg: String)
Data table of the ELF header.
Sourcepub fn get_header_os_abi(&self) -> Option<&String>
pub fn get_header_os_abi(&self) -> Option<&String>
Application Binary Interface (ABI) of the Linux OS.
Sourcepub fn set_header_os_abi(&mut self, header_os_abi_arg: String)
pub fn set_header_os_abi(&mut self, header_os_abi_arg: String)
Application Binary Interface (ABI) of the Linux OS.
Sourcepub fn get_header_type(&self) -> Option<&String>
pub fn get_header_type(&self) -> Option<&String>
Header type of the ELF file.
Sourcepub fn set_header_type(&mut self, header_type_arg: String)
pub fn set_header_type(&mut self, header_type_arg: String)
Header type of the ELF file.
Sourcepub fn get_header_version(&self) -> Option<&String>
pub fn get_header_version(&self) -> Option<&String>
Version of the ELF header.
Sourcepub fn set_header_version(&mut self, header_version_arg: String)
pub fn set_header_version(&mut self, header_version_arg: String)
Version of the ELF header.
Sourcepub fn get_header_abi_version(&self) -> Option<&String>
pub fn get_header_abi_version(&self) -> Option<&String>
Version of the ELF Application Binary Interface (ABI).
Sourcepub fn set_header_abi_version(&mut self, header_abi_version_arg: String)
pub fn set_header_abi_version(&mut self, header_abi_version_arg: String)
Version of the ELF Application Binary Interface (ABI).
Sourcepub fn get_header_entrypoint(&self) -> Option<&u64>
pub fn get_header_entrypoint(&self) -> Option<&u64>
Header entrypoint of the ELF file.
Sourcepub fn set_header_entrypoint(&mut self, header_entrypoint_arg: u64)
pub fn set_header_entrypoint(&mut self, header_entrypoint_arg: u64)
Header entrypoint of the ELF file.
Sourcepub fn get_header_object_version(&self) -> Option<&String>
pub fn get_header_object_version(&self) -> Option<&String>
“0x1” for original ELF files.
Sourcepub fn set_header_object_version(&mut self, header_object_version_arg: String)
pub fn set_header_object_version(&mut self, header_object_version_arg: String)
“0x1” for original ELF files.
Sourcepub fn get_import_hash(&self) -> Option<&String>
pub fn get_import_hash(&self) -> Option<&String>
A hash of the imports in an ELF file. An import hash can be used to fingerprint binaries even after recompilation or other code-level transformations have occurred, which would change more traditional hash values.
This is an ELF implementation of the Windows PE imphash.
Sourcepub fn set_import_hash(&mut self, import_hash_arg: String)
pub fn set_import_hash(&mut self, import_hash_arg: String)
A hash of the imports in an ELF file. An import hash can be used to fingerprint binaries even after recompilation or other code-level transformations have occurred, which would change more traditional hash values.
This is an ELF implementation of the Windows PE imphash.
§Example
d41d8cd98f00b204e9800998ecf8427e
Sourcepub fn get_imports_names_entropy(&self) -> Option<&u64>
pub fn get_imports_names_entropy(&self) -> Option<&u64>
Shannon entropy calculation from the list of imported element names and types.
Sourcepub fn set_imports_names_entropy(&mut self, imports_names_entropy_arg: u64)
pub fn set_imports_names_entropy(&mut self, imports_names_entropy_arg: u64)
Shannon entropy calculation from the list of imported element names and types.
Sourcepub fn get_imports_names_var_entropy(&self) -> Option<&u64>
pub fn get_imports_names_var_entropy(&self) -> Option<&u64>
Variance for Shannon entropy calculation from the list of imported element names and types.
Sourcepub fn set_imports_names_var_entropy(
&mut self,
imports_names_var_entropy_arg: u64,
)
pub fn set_imports_names_var_entropy( &mut self, imports_names_var_entropy_arg: u64, )
Variance for Shannon entropy calculation from the list of imported element names and types.
Sourcepub fn get_sections(&self) -> &Vec<String>
pub fn get_sections(&self) -> &Vec<String>
An array containing an object for each section of the ELF file.
The keys that should be present in these objects are defined by sub-fields underneath elf.sections.*.
Sourcepub fn add_section(&mut self, section_arg: String)
pub fn add_section(&mut self, section_arg: String)
An array containing an object for each section of the ELF file.
The keys that should be present in these objects are defined by sub-fields underneath elf.sections.*.
Sourcepub fn get_sections_flags(&self) -> Option<&String>
pub fn get_sections_flags(&self) -> Option<&String>
ELF Section List flags.
Sourcepub fn set_sections_flags(&mut self, sections_flags_arg: String)
pub fn set_sections_flags(&mut self, sections_flags_arg: String)
ELF Section List flags.
Sourcepub fn get_sections_name(&self) -> Option<&String>
pub fn get_sections_name(&self) -> Option<&String>
ELF Section List name.
Sourcepub fn set_sections_name(&mut self, sections_name_arg: String)
pub fn set_sections_name(&mut self, sections_name_arg: String)
ELF Section List name.
Sourcepub fn get_sections_physical_offset(&self) -> Option<&String>
pub fn get_sections_physical_offset(&self) -> Option<&String>
ELF Section List offset.
Sourcepub fn set_sections_physical_offset(
&mut self,
sections_physical_offset_arg: String,
)
pub fn set_sections_physical_offset( &mut self, sections_physical_offset_arg: String, )
ELF Section List offset.
Sourcepub fn get_sections_type(&self) -> Option<&String>
pub fn get_sections_type(&self) -> Option<&String>
ELF Section List type.
Sourcepub fn set_sections_type(&mut self, sections_type_arg: String)
pub fn set_sections_type(&mut self, sections_type_arg: String)
ELF Section List type.
Sourcepub fn get_sections_physical_size(&self) -> Option<&u64>
pub fn get_sections_physical_size(&self) -> Option<&u64>
ELF Section List physical size.
Sourcepub fn set_sections_physical_size(&mut self, sections_physical_size_arg: u64)
pub fn set_sections_physical_size(&mut self, sections_physical_size_arg: u64)
ELF Section List physical size.
Sourcepub fn get_sections_var_entropy(&self) -> Option<&u64>
pub fn get_sections_var_entropy(&self) -> Option<&u64>
Variance for Shannon entropy calculation from the section.
Sourcepub fn set_sections_var_entropy(&mut self, sections_var_entropy_arg: u64)
pub fn set_sections_var_entropy(&mut self, sections_var_entropy_arg: u64)
Variance for Shannon entropy calculation from the section.
Sourcepub fn get_sections_virtual_address(&self) -> Option<&u64>
pub fn get_sections_virtual_address(&self) -> Option<&u64>
ELF Section List virtual address.
Sourcepub fn set_sections_virtual_address(
&mut self,
sections_virtual_address_arg: u64,
)
pub fn set_sections_virtual_address( &mut self, sections_virtual_address_arg: u64, )
ELF Section List virtual address.
Sourcepub fn get_sections_virtual_size(&self) -> Option<&u64>
pub fn get_sections_virtual_size(&self) -> Option<&u64>
ELF Section List virtual size.
Sourcepub fn set_sections_virtual_size(&mut self, sections_virtual_size_arg: u64)
pub fn set_sections_virtual_size(&mut self, sections_virtual_size_arg: u64)
ELF Section List virtual size.
Sourcepub fn get_sections_entropy(&self) -> Option<&u64>
pub fn get_sections_entropy(&self) -> Option<&u64>
Shannon entropy calculation from the section.
Sourcepub fn set_sections_entropy(&mut self, sections_entropy_arg: u64)
pub fn set_sections_entropy(&mut self, sections_entropy_arg: u64)
Shannon entropy calculation from the section.
Sourcepub fn get_sections_chi2(&self) -> Option<&u64>
pub fn get_sections_chi2(&self) -> Option<&u64>
Chi-square probability distribution of the section.
Sourcepub fn set_sections_chi2(&mut self, sections_chi2_arg: u64)
pub fn set_sections_chi2(&mut self, sections_chi2_arg: u64)
Chi-square probability distribution of the section.
Sourcepub fn get_exports(&self) -> &Vec<String>
pub fn get_exports(&self) -> &Vec<String>
List of exported element names and types.
Sourcepub fn add_export(&mut self, export_arg: String)
pub fn add_export(&mut self, export_arg: String)
List of exported element names and types.
Sourcepub fn get_imports(&self) -> &Vec<String>
pub fn get_imports(&self) -> &Vec<String>
List of imported element names and types.
Sourcepub fn add_import(&mut self, import_arg: String)
pub fn add_import(&mut self, import_arg: String)
List of imported element names and types.
List of shared libraries used by this ELF object.
List of shared libraries used by this ELF object.
Sourcepub fn get_telfhash(&self) -> Option<&String>
pub fn get_telfhash(&self) -> Option<&String>
telfhash symbol hash for ELF file.
Sourcepub fn set_telfhash(&mut self, telfhash_arg: String)
pub fn set_telfhash(&mut self, telfhash_arg: String)
telfhash symbol hash for ELF file.
Sourcepub fn get_segments(&self) -> &Vec<String>
pub fn get_segments(&self) -> &Vec<String>
An array containing an object for each segment of the ELF file.
The keys that should be present in these objects are defined by sub-fields underneath elf.segments.*.
Sourcepub fn add_segment(&mut self, segment_arg: String)
pub fn add_segment(&mut self, segment_arg: String)
An array containing an object for each segment of the ELF file.
The keys that should be present in these objects are defined by sub-fields underneath elf.segments.*.
Sourcepub fn get_segments_type(&self) -> Option<&String>
pub fn get_segments_type(&self) -> Option<&String>
ELF object segment type.
Sourcepub fn set_segments_type(&mut self, segments_type_arg: String)
pub fn set_segments_type(&mut self, segments_type_arg: String)
ELF object segment type.
Sourcepub fn get_segments_sections(&self) -> Option<&String>
pub fn get_segments_sections(&self) -> Option<&String>
ELF object segment sections.
Sourcepub fn set_segments_sections(&mut self, segments_sections_arg: String)
pub fn set_segments_sections(&mut self, segments_sections_arg: String)
ELF object segment sections.