16#ifndef LIEF_PE_FACTORY_H
17#define LIEF_PE_FACTORY_H
41 sections_.push_back(std::unique_ptr<Section>(
new Section(section)));
46 pe_->header().machine(arch);
51 pe_->optional_header().addressof_entrypoint(ep);
55 std::unique_ptr<Binary>
get() {
68 return pe_->optional_header().section_alignment();
72 return pe_->optional_header().file_alignment();
81 std::unique_ptr<Binary> process();
87 uint32_t sizeof_headers()
const;
89 std::vector<std::unique_ptr<Section>> sections_;
90 std::vector<Import> imports_;
91 std::unique_ptr<Binary> pe_;
Class which represents a PE binary This is the main interface to manage and modify a PE executable.
Definition PE/Binary.hpp:57
Factory & set_arch(Header::MACHINE_TYPES arch)
Definition Factory.hpp:45
Factory & set_entrypoint(uint64_t ep)
Definition Factory.hpp:50
std::unique_ptr< Binary > get()
Definition Factory.hpp:55
bool is_64bit() const
Definition Factory.hpp:63
uint32_t file_align() const
Definition Factory.hpp:71
uint32_t section_align() const
Definition Factory.hpp:67
bool is_32bit() const
Definition Factory.hpp:59
Factory & add_section(const Section §ion)
Definition Factory.hpp:40
Factory & operator=(const Factory &)=delete
Factory(const Factory &)=delete
Factory & operator=(Factory &&)
static std::unique_ptr< Factory > create(PE_TYPE type)
Initiate the factory to construct a PE which the given type.
Class which represents a PE section.
Definition PE/Section.hpp:46
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
PE_TYPE
Definition PE/enums.hpp:22
@ PE32
32bits
Definition PE/enums.hpp:23
@ PE32_PLUS
64 bits
Definition PE/enums.hpp:24
LIEF namespace.
Definition Abstract/Binary.hpp:40
result< ok_t > ok_error_t
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:109
#define LIEF_API
Definition visibility.h:41