From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- vendor/object/src/pe.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'vendor/object/src/pe.rs') diff --git a/vendor/object/src/pe.rs b/vendor/object/src/pe.rs index c89b86caa..00105adac 100644 --- a/vendor/object/src/pe.rs +++ b/vendor/object/src/pe.rs @@ -1977,6 +1977,21 @@ pub struct ImageDelayloadDescriptor { pub time_date_stamp: U32, } +impl ImageDelayloadDescriptor { + /// Tell whether this delay-load import descriptor is the null descriptor + /// (used to mark the end of the iterator array in a PE) + pub fn is_null(&self) -> bool { + self.attributes.get(LE) == 0 + && self.dll_name_rva.get(LE) == 0 + && self.module_handle_rva.get(LE) == 0 + && self.import_address_table_rva.get(LE) == 0 + && self.import_name_table_rva.get(LE) == 0 + && self.bound_import_address_table_rva.get(LE) == 0 + && self.unload_information_table_rva.get(LE) == 0 + && self.time_date_stamp.get(LE) == 0 + } +} + /// Delay load version 2 flag for `ImageDelayloadDescriptor::attributes`. pub const IMAGE_DELAYLOAD_RVA_BASED: u32 = 0x8000_0000; -- cgit v1.2.3