Skip to content

Commit

Permalink
Make PE::clr_data optional
Browse files Browse the repository at this point in the history
  • Loading branch information
kkent030315 committed Nov 10, 2024
1 parent 1e7be31 commit b201354
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub struct PE<'a> {
/// Certificates present, if any, described by the Certificate Table
pub certificates: certificate_table::CertificateDirectoryTable<'a>,
/// CLR managed data if present
pub clr_data: clr::ClrData<'a>,
pub clr_data: Option<clr::ClrData<'a>>,
}

impl<'a> PE<'a> {
Expand Down Expand Up @@ -265,14 +265,15 @@ impl<'a> PE<'a> {

if let Some(com_descriptor) = optional_header.data_directories.get_clr_runtime_header()
{
clr_data = clr::ClrData::parse_with_opts(
let data = clr::ClrData::parse_with_opts(
bytes,
&com_descriptor,
&sections,
file_alignment,
opts,
)?;
debug!("CLR data: {:#?}", clr_data);
clr_data = Some(data);
debug!("CLR data: {:#?}", data);
}

// Parse attribute certificates unless opted out of
Expand Down

0 comments on commit b201354

Please sign in to comment.