16#ifndef LIEF_ELF_BUIDLER_H
17#define LIEF_ELF_BUIDLER_H
39class ObjectFileLayout;
143 void write(const std::
string& filename) const;
149 template<typename ELF_T>
152 template<typename ELF_T>
155 template<typename ELF_T>
158 template<typename ELF_T>
161 template<typename ELF_T>
164 template<typename ELF_T>
167 template<typename ELF_T>
170 template<typename ELF_T>
173 template<typename ELF_T>
176 template<typename ELF_T>
179 template<typename ELF_T>
182 template<typename ELF_T>
185 template<typename ELF_T>
188 template<typename ELF_T>
191 template<typename ELF_T>
194 template<typename ELF_T>
199 template<typename ELF_T>
202 template<typename ELF_T>
207 template<typename ELF_T>
210 template<typename ELF_T>
213 template<typename ELF_T>
216 template<typename ELF_T>
219 template<typename ELF_T>
223 std::set<const
Note*>& notes);
225 template<typename ELF_T>
230 template<class ELF_T>
237 Binary* binary_ =
nullptr;
238 std::unique_ptr<
Layout> layout_;
Class which represents an ELF binary.
Definition ELF/Binary.hpp:64
friend class ObjectFileLayout
Definition ELF/Builder.hpp:48
friend class ExeLayout
Definition ELF/Builder.hpp:50
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.
friend class Layout
Definition ELF/Builder.hpp:49
config_t & config()
Definition ELF/Builder.hpp:135
Builder(Binary &binary)
Definition ELF/Builder.hpp:126
ok_error_t build()
Perform the build of the provided ELF binary.
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:40
Class that represents an ELF relocation.
Definition ELF/Relocation.hpp:42
Class which represents an ELF Section.
Definition ELF/Section.hpp:49
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:118
Definition iostream.hpp:33
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:27
Configuration options to tweak the building process.
Definition ELF/Builder.hpp:54
bool keep_empty_version_requirement
Remove entries in .gnu.version_r if they are not associated with at least one version.
Definition ELF/Builder.hpp:122
bool force_relocate
Force to relocating all the ELF structures that are supported by LIEF (mostly for testing).
Definition ELF/Builder.hpp:114
bool dynamic_section
Rebuild PT_DYNAMIC segment.
Definition ELF/Builder.hpp:62
bool dyn_str
Rebuild DT_STRTAB.
Definition ELF/Builder.hpp:59
bool static_symtab
Rebuild .symtab.
Definition ELF/Builder.hpp:95
bool relr
Rebuild DT_RELR.
Definition ELF/Builder.hpp:86
bool init_array
Rebuild DT_INIT_ARRAY.
Definition ELF/Builder.hpp:71
bool symtab
Rebuild DT_SYMTAB.
Definition ELF/Builder.hpp:107
bool android_rela
Rebuild DT_ANDROID_REL[A].
Definition ELF/Builder.hpp:89
bool sym_versym
Rebuild DT_VERSYM.
Definition ELF/Builder.hpp:104
bool gnu_hash
Rebuild DT_GNU_HASH.
Definition ELF/Builder.hpp:68
bool rela
Rebuild DT_REL[A].
Definition ELF/Builder.hpp:92
bool preinit_array
Rebuild DT_PREINIT_ARRAY.
Definition ELF/Builder.hpp:83
bool sym_verneed
Rebuild DT_VERNEED.
Definition ELF/Builder.hpp:101
bool coredump_notes
Rebuild the Coredump notes.
Definition ELF/Builder.hpp:110
bool fini_array
Rebuild DT_FINI_ARRAY.
Definition ELF/Builder.hpp:65
bool dt_hash
Rebuild DT_HASH.
Definition ELF/Builder.hpp:56
bool interpreter
Rebuild PT_INTERPRETER.
Definition ELF/Builder.hpp:74
bool skip_dynamic
Skip relocating the PT_DYNAMIC segment (only relevant if force_relocate is set.
Definition ELF/Builder.hpp:118
bool notes
Disable note building since it can break the default layout.
Definition ELF/Builder.hpp:80
bool jmprel
Rebuild DT_JMPREL.
Definition ELF/Builder.hpp:77
bool sym_verdef
Rebuild DT_VERDEF.
Definition ELF/Builder.hpp:98
#define LIEF_API
Definition visibility.h:44
#define LIEF_LOCAL
Definition visibility.h:45