/// An iterator for the COMDAT section groups in a [`CoffBigFile`](super::CoffBigFile). pubtype CoffBigComdatIterator<'data, 'file, R = &'data [u8]> =
CoffComdatIterator<'data, 'file, R, pe::AnonObjectHeaderBigobj>;
/// An iterator for the COMDAT section groups in a [`CoffFile`]. #[derive(Debug)] pubstruct CoffComdatIterator< 'data, 'file,
R: ReadRef<'data> = &'data [u8],
Coff: CoffHeader = pe::ImageFileHeader,
> {
file: &'file CoffFile<'data, R, Coff>,
index: SymbolIndex,
}
impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> Iterator for CoffComdatIterator<'data, 'file, R, Coff>
{ type Item = CoffComdat<'data, 'file, R, Coff>;
fn next(&mutself) -> Option<Self::Item> { loop { let index = self.index; let symbol = self.file.common.symbols.symbol(index).ok()?; self.index.0 += 1 + symbol.number_of_aux_symbols() as usize; iflet Some(comdat) = CoffComdat::parse(self.file, symbol, index) { return Some(comdat);
}
}
}
}
/// A COMDAT section group in a [`CoffBigFile`](super::CoffBigFile). /// /// Most functionality is provided by the [`ObjectComdat`] trait implementation. pubtype CoffBigComdat<'data, 'file, R = &'data [u8]> =
CoffComdat<'data, 'file, R, pe::AnonObjectHeaderBigobj>;
/// A COMDAT section group in a [`CoffFile`]. /// /// Most functionality is provided by the [`ObjectComdat`] trait implementation. #[derive(Debug)] pubstruct CoffComdat< 'data, 'file,
R: ReadRef<'data> = &'data [u8],
Coff: CoffHeader = pe::ImageFileHeader,
> {
file: &'file CoffFile<'data, R, Coff>,
symbol_index: SymbolIndex,
symbol: &'data Coff::ImageSymbol,
selection: u8,
}
// Auxiliary record must have a non-associative selection. let aux = file.common.symbols.aux_section(index).ok()?; let selection = aux.selection; if selection == 0 || selection == pe::IMAGE_COMDAT_SELECT_ASSOCIATIVE { return None;
}
// Find the COMDAT symbol. letmut symbol_index = index; letmut symbol = section_symbol; let section_number = section_symbol.section_number(); loop {
symbol_index.0 += 1 + symbol.number_of_aux_symbols() as usize;
symbol = file.common.symbols.symbol(symbol_index).ok()?; if section_number == symbol.section_number() { break;
}
}
#[inline] fn name_bytes(&self) -> Result<&'data [u8]> { // Find the name of first symbol referring to the section. self.symbol.name(self.file.common.symbols.strings())
}
/// An iterator for the sections in a COMDAT section group in a [`CoffBigFile`](super::CoffBigFile). pubtype CoffBigComdatSectionIterator<'data, 'file, R = &'data [u8]> =
CoffComdatSectionIterator<'data, 'file, R, pe::AnonObjectHeaderBigobj>;
/// An iterator for the sections in a COMDAT section group in a [`CoffFile`]. #[derive(Debug)] pubstruct CoffComdatSectionIterator< 'data, 'file,
R: ReadRef<'data> = &'data [u8],
Coff: CoffHeader = pe::ImageFileHeader,
> {
file: &'file CoffFile<'data, R, Coff>,
section_number: i32,
index: SymbolIndex,
}
impl<'data, 'file, R: ReadRef<'data>, Coff: CoffHeader> Iterator for CoffComdatSectionIterator<'data, 'file, R, Coff>
{ type Item = SectionIndex;
fn next(&mutself) -> Option<Self::Item> { // Find associated COMDAT symbols. // TODO: it seems gcc doesn't use associated symbols for this loop { let index = self.index; let symbol = self.file.common.symbols.symbol(index).ok()?; self.index.0 += 1 + symbol.number_of_aux_symbols() as usize;
// Must be a section symbol. if !symbol.has_aux_section() { continue;
}
let section_number = symbol.section_number();
let aux = self.file.common.symbols.aux_section(index).ok()?; if aux.selection == pe::IMAGE_COMDAT_SELECT_ASSOCIATIVE { let number = if Coff::is_type_bigobj() {
u32::from(aux.number.get(LE)) | (u32::from(aux.high_number.get(LE)) << 16)
} else {
u32::from(aux.number.get(LE))
}; if number as i32 == self.section_number { return Some(SectionIndex(section_number as usize));
}
} elseif aux.selection != 0 { if section_number == self.section_number { return Some(SectionIndex(section_number as usize));
}
}
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.