linkstore/embed/embedder/formats/
coff.rs

1use super::*;
2
3const IMAGE_FILE_32BIT_MACHINE: u16 = 0x0100;
4
5pub(super) fn discover_linkstores<'a, IO: BinaryHandle<'a> + 'a>(
6	embeds: &mut Linkstores,
7	handle: &mut BufReader<Cursor<&[u8]>>,
8	coff: &goblin::pe::Coff,
9	ar_offset: u64,
10) -> Result<(), Error> {
11	for header in coff
12		.sections
13		.iter()
14		.filter_map(|section| filter_map_linkstore_section(&section.name, section))
15	{
16		Embedder::<IO>::decode_section(
17			embeds,
18			handle,
19			header.pointer_to_raw_data as _,
20			header.size_of_raw_data as _,
21			coff.header.characteristics & IMAGE_FILE_32BIT_MACHINE == 0,
22			true,
23			ar_offset,
24		)?;
25	}
26	Ok(())
27}