17#ifndef LIEF_ELF_BUIDLER_H
18#define LIEF_ELF_BUIDLER_H
40class ObjectFileLayout;
102 void write(
const std::string& filename)
const;
108 template<
typename ELF_T>
111 template<
typename ELF_T>
114 template<
typename ELF_T>
117 template<
typename ELF_T>
120 template<
typename ELF_T>
123 template<
typename ELF_T>
126 template<
typename ELF_T>
129 template<
typename ELF_T>
132 template<
typename ELF_T>
135 template<
typename ELF_T>
138 template<
typename ELF_T>
141 template<
typename ELF_T>
144 template<
typename ELF_T>
147 template<
typename ELF_T>
150 template<
typename ELF_T>
153 template<
typename ELF_T>
158 template<
typename ELF_T>
161 template<
typename ELF_T>
166 template<
typename ELF_T>
169 template<
typename ELF_T>
172 template<
typename ELF_T>
175 template<
typename ELF_T>
178 template<
typename ELF_T>
183 template<
typename ELF_T>
188 template<
class ELF_T>
195 Binary* binary_ =
nullptr;
196 std::unique_ptr<Layout> layout_;
Class which represents an ELF binary.
Definition ELF/Binary.hpp:59
friend class ObjectFileLayout
Definition ELF/Builder.hpp:49
friend class ExeLayout
Definition ELF/Builder.hpp:51
void build()
Perform the build of the provided ELF binary.
Builder(Binary &binary, const config_t &config)
void write(const std::string &filename) const
Write the built ELF binary in the filename given in parameter.
void write(std::ostream &os) const
Write the built ELF binary in the stream os given in parameter.
friend class Layout
Definition ELF/Builder.hpp:50
config_t & config()
Definition ELF/Builder.hpp:94
Builder(Binary &binary)
Definition ELF/Builder.hpp:84
const std::vector< uint8_t > & get_build()
Return the built ELF binary as a byte vector.
Class that represent an Array in the dynamic table. This entry is associated with constructors:
Definition DynamicEntryArray.hpp:35
Class which represents an entry in the dynamic table These entries are located in the ....
Definition DynamicEntry.hpp:36
Class which represents an ELF note. This class can be instantiated using the static Note::create func...
Definition Note.hpp:39
Class that represents an ELF relocation.
Definition ELF/Relocation.hpp:40
Class which represents an ELF Section.
Definition ELF/Section.hpp:48
Definition iostream.hpp:31
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
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
Configuration options to tweak the building process.
Definition ELF/Builder.hpp:55
bool keep_empty_version_requirement
Skip relocating the PT_DYNAMIC segment (only relevant if force_relocate is set).
Definition ELF/Builder.hpp:80
bool force_relocate
Rebuild the Coredump notes.
Definition ELF/Builder.hpp:75
bool dynamic_section
Rebuild DT_STRTAB.
Definition ELF/Builder.hpp:58
bool dyn_str
Rebuild DT_HASH.
Definition ELF/Builder.hpp:57
bool static_symtab
Rebuild DT_REL[A].
Definition ELF/Builder.hpp:69
bool relr
Rebuild DT_PREINIT_ARRAY.
Definition ELF/Builder.hpp:66
bool init_array
Rebuild DT_GNU_HASH.
Definition ELF/Builder.hpp:61
bool symtab
Rebuild DT_VERSYM.
Definition ELF/Builder.hpp:73
bool android_rela
Rebuild DT_RELR.
Definition ELF/Builder.hpp:67
bool sym_versym
Rebuild DT_VERNEED.
Definition ELF/Builder.hpp:72
bool gnu_hash
Rebuild DT_FINI_ARRAY.
Definition ELF/Builder.hpp:60
bool rela
Rebuild DT_ANDROID_REL[A].
Definition ELF/Builder.hpp:68
bool preinit_array
Disable note building since it can break the default layout.
Definition ELF/Builder.hpp:65
bool sym_verneed
Rebuild DT_VERDEF.
Definition ELF/Builder.hpp:71
bool coredump_notes
Rebuild DT_SYMTAB.
Definition ELF/Builder.hpp:74
bool fini_array
Rebuild PT_DYNAMIC segment.
Definition ELF/Builder.hpp:59
bool dt_hash
Definition ELF/Builder.hpp:56
bool interpreter
Rebuild DT_INIT_ARRAY.
Definition ELF/Builder.hpp:62
bool skip_dynamic
Force to relocating all the ELF structures that are supported by LIEF (mostly for testing).
Definition ELF/Builder.hpp:76
bool notes
Rebuild DT_JMPREL.
Definition ELF/Builder.hpp:64
bool jmprel
Rebuild PT_INTERPRETER.
Definition ELF/Builder.hpp:63
bool sym_verdef
Rebuild .symtab.
Definition ELF/Builder.hpp:70
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42