Skip to content

Commit

Permalink
Resolve #1138
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Dec 10, 2024
1 parent 3fcdbdc commit 6ce389c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Abstract/Header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "frozen.hpp"
#include "fmt_formatter.hpp"
#include "logging.hpp"
#include "LIEF/config.h"

FMT_FORMATTER(LIEF::Header::MODES, LIEF::to_string);

Expand All @@ -37,6 +38,10 @@ static constexpr auto ARRAY_MODES = {
};

Header Header::from(const ELF::Binary& elf) {
if constexpr (!lief_elf_support) {
return {};
}

Header hdr;
hdr.entrypoint_ = elf.entrypoint();

Expand Down Expand Up @@ -124,6 +129,10 @@ Header Header::from(const ELF::Binary& elf) {
}

Header Header::from(const PE::Binary& pe) {
if constexpr (!lief_pe_support) {
return {};
}

Header hdr;
hdr.entrypoint_ = pe.entrypoint();
const PE::Header& pe_header = pe.header();
Expand Down Expand Up @@ -184,6 +193,10 @@ Header Header::from(const PE::Binary& pe) {
}

Header Header::from(const MachO::Binary& macho) {
if constexpr (!lief_macho_support) {
return {};
}

Header hdr;
{
logging::Scoped scope(logging::LEVEL::OFF);
Expand Down

0 comments on commit 6ce389c

Please sign in to comment.