diff --git a/deps/LIEF/LICENSE b/deps/LIEF/LICENSE
index 0c225d7eeb80..f0c1a1afd4c6 100644
--- a/deps/LIEF/LICENSE
+++ b/deps/LIEF/LICENSE
@@ -186,8 +186,8 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2017 - 2025 R. Thomas
- Copyright 2017 - 2025 Quarkslab
+ Copyright 2017 - 2026 R. Thomas
+ Copyright 2017 - 2026 Quarkslab
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/deps/LIEF/README.md b/deps/LIEF/README.md
index 0276c436d973..4e7c41949f3b 100644
--- a/deps/LIEF/README.md
+++ b/deps/LIEF/README.md
@@ -17,28 +17,39 @@ modify and abstract ELF, PE and MachO formats.
**Main features**:
- * **Parsing**: LIEF can parse [ELF](https://lief.re/doc/latest/formats/elf/index.html), [PE](https://lief.re/doc/latest/formats/pe/index.html), [MachO](https://lief.re/doc/latest/formats/macho/index.html), [COFF](https://lief.re/doc/latest/formats/coff/index.html), OAT, DEX, VDEX, ART and provides an user-friendly API to access to internals.
- * **Modify**: LIEF can use to modify some parts of these formats (adding a section, changing a symbol's name, ...)
+ * **Parsing**: LIEF can parse [ELF](https://lief.re/doc/latest/formats/elf/index.html), [PE](https://lief.re/doc/latest/formats/pe/index.html), [MachO](https://lief.re/doc/latest/formats/macho/index.html), [COFF](https://lief.re/doc/latest/formats/coff/index.html), OAT, DEX, VDEX, ART and provides a user-friendly API to access their internals.
+ * **Modify**: LIEF can be used to modify some parts of these formats (adding a section, changing a symbol's name, ...)
* **Abstract**: Three formats have common features like sections, symbols, entry point... LIEF factors them.
- * **API**: LIEF can be used in [C++](https://lief.re/doc/latest/doxygen/), Python, [Rust](https://lief-rs.s3.fr-par.scw.cloud/doc/latest/lief/index.html) and C
+ * **API**: You can use LIEF via [C++](https://lief.re/doc/latest/doxygen/), Python, [Rust](https://lief-rs.s3.fr-par.scw.cloud/doc/latest/lief/index.html), C and
+ [Node.js](https://github.com/Piebald-AI/node-lief) (unofficial, AI-generated)
**Extended features**:
+ * [**Runtime**](https://lief.re/doc/latest/runtime/intro.html)
* [**DWARF/PDB** Support](https://lief.re/doc/latest/extended/debug_info/index.html)
* [**Objective-C** Metadata](https://lief.re/doc/latest/extended/objc/index.html)
* [**Dyld Shared Cache**](https://lief.re/doc/latest/extended/dsc/index.html) with support for extracting Dylib
* [**Disassembler**](https://lief.re/doc/latest/extended/disassembler/index.html): AArch64, x86/x86-64, ARM, RISC-V, Mips, PowerPC, eBPF
- * [**Assembler**](https://lief.re/doc/latest/extended/assembler/index.html): AArch64, x86/x86-64
+ * [**Assembler**](https://lief.re/doc/latest/extended/assembler/index.html): AArch64, x86/x86-64, RISC-V
**Plugins**:
* [**Ghidra**](https://lief.re/doc/latest/plugins/ghidra/index.html)
* [**BinaryNinja**](https://lief.re/doc/latest/plugins/binaryninja/index.html)
+# Sponsors
+
+
+
+
+
+
+
+
# Content
- [About](#about)
-- [Download / Install](#downloads--install)
+- [Downloads / Install](#downloads--install)
- [Getting started](#getting-started)
- [Blog](https://lief.re/blog/)
- [Documentation](#documentation)
@@ -56,21 +67,21 @@ modify and abstract ELF, PE and MachO formats.
- [ELF Coredump](https://lief.re/doc/latest/tutorials/12_elf_coredump.html)
- [PE Authenticode](https://lief.re/doc/latest/tutorials/13_pe_authenticode.html)
- [Contact](#contact)
-- [About](#about)
+- [About](#about-1)
- [Authors](#authors)
- [License](#license)
- [Bibtex](#bibtex)
## Downloads / Install
-## C++
+### C++
```cmake
find_package(LIEF REQUIRED)
target_link_libraries(my-project LIEF::LIEF)
```
-## Rust
+### Rust
```toml
[package]
@@ -79,10 +90,16 @@ version = "0.0.1"
edition = "2021"
[dependencies]
-lief = "0.17.1"
+lief = "1.0.0"
```
-## Python
+### Homebrew
+
+```console
+brew install lief
+```
+
+### Python
To install the latest **version** (release):
@@ -102,7 +119,7 @@ pip install [--user] --force-reinstall --index-url https://lief.s3-website.fr-pa
- **Nightly**:
* SDK: https://lief.s3-website.fr-par.scw.cloud/latest/sdk
* Python Wheels: https://lief.s3-website.fr-par.scw.cloud/latest/lief
-- **v0.17.1**: https://github.com/lief-project/LIEF/releases/tag/0.17.1
+- **v1.0.0**: https://github.com/lief-project/LIEF/releases/tag/1.0.0
Here are guides to install or integrate LIEF:
@@ -124,15 +141,14 @@ for section in binary.sections:
print(section.name, section.virtual_address)
# PE
-binary = lief.parse("C:\\Windows\\explorer.exe")
-
-if rheader := pe.rich_header:
+binary = lief.parse(r"C:\Windows\explorer.exe")
+if (rheader := binary.rich_header) is not None:
print(rheader.key)
# Mach-O
binary = lief.parse("/usr/bin/ls")
-for fixup in binary.dyld_chained_fixups:
- print(fixup)
+if (fixups := binary.dyld_chained_fixups) is not None:
+ print(fixups)
```
### Rust
@@ -153,27 +169,30 @@ if let Some(Binary::PE(pe)) = Binary::parse(path.as_str()) {
### C++
```cpp
+#include
#include
int main(int argc, char** argv) {
// ELF
if (std::unique_ptr elf = LIEF::ELF::Parser::parse("/bin/ls")) {
for (const LIEF::ELF::Section& section : elf->sections()) {
- std::cout << section->name() << ' ' << section->virtual_address() << '\n';
+ std::cout << section.name() << ' ' << section.virtual_address() << '\n';
}
}
// PE
if (std::unique_ptr pe = LIEF::PE::Parser::parse("C:\\Windows\\explorer.exe")) {
- if (const LIEF::PE::RichHeader* rheader : pe->rich_header()) {
+ if (const LIEF::PE::RichHeader* rheader = pe->rich_header()) {
std::cout << rheader->key() << '\n';
}
}
// Mach-O
if (std::unique_ptr macho = LIEF::MachO::Parser::parse("/bin/ls")) {
- for (const LIEF::MachO::DyldChainedFixups& fixup : macho->dyld_chained_fixups()) {
- std::cout << fixup << '\n';
+ for (const LIEF::MachO::Binary& bin : *macho) {
+ if (const LIEF::MachO::DyldChainedFixups* fixups = bin.dyld_chained_fixups()) {
+ std::cout << *fixups << '\n';
+ }
}
}
@@ -182,25 +201,6 @@ int main(int argc, char** argv) {
```
-### C (Limited API)
-
-```cpp
-#include
-
-int main(int argc, char** argv) {
- Elf_Binary_t* elf = elf_parse("/usr/bin/ls");
-
- Elf_Section_t** sections = elf->sections;
-
- for (size_t i = 0; sections[i] != NULL; ++i) {
- printf("%s\n", sections[i]->name);
- }
-
- elf_binary_destroy(elf);
- return 0;
-}
-```
-
## Documentation
* [Main documentation](https://lief.re/doc/latest/index.html)
@@ -220,7 +220,7 @@ Romain Thomas ([@rh0main](https://www.romainthomas.fr/)) - Formerly at [Quarksla
### License
-LIEF is provided under the [Apache 2.0 license](https://github.com/lief-project/LIEF/blob/0.17.1/LICENSE).
+[Apache 2.0](https://github.com/lief-project/LIEF/blob/1.0.0/LICENSE).
### Bibtex
@@ -233,5 +233,3 @@ LIEF is provided under the [Apache 2.0 license](https://github.com/lief-project/
year = "2017"
}
```
-
-
diff --git a/deps/LIEF/config/mbedtls/config.h b/deps/LIEF/config/mbedtls/config.h
index 1007c99aee06..fc29d0b91f82 100644
--- a/deps/LIEF/config/mbedtls/config.h
+++ b/deps/LIEF/config/mbedtls/config.h
@@ -1,5 +1,9 @@
#include "mbedtls/mbedtls_config.h"
-#if defined (MBEDTLS_ARCH_IS_X86)
-#undef MBEDTLS_AESNI_C
+#if defined(MBEDTLS_ARCH_IS_X86)
+ #undef MBEDTLS_AESNI_C
+#endif
+
+#if defined(MBEDTLS_DEBUG_C)
+ #undef MBEDTLS_DEBUG_C
#endif
diff --git a/deps/LIEF/config/mbedtls/psa_config.h b/deps/LIEF/config/mbedtls/psa_config.h
new file mode 100644
index 000000000000..836d9b1461b6
--- /dev/null
+++ b/deps/LIEF/config/mbedtls/psa_config.h
@@ -0,0 +1,14 @@
+// Disable MbedTLS options that are not thread-safe. See
+// `tests/scripts/components-sanitizers.sh` in the MbedTLS tree: both options
+// are unset there when building with MBEDTLS_THREADING_PTHREAD under TSan.
+#if defined(MBEDTLS_THREADING_C)
+ // Self-tests do not currently use multiple threads.
+ #if defined(MBEDTLS_SELF_TEST)
+ #undef MBEDTLS_SELF_TEST
+ #endif
+
+ // Interruptible ECC operations are not thread-safe.
+ #if defined(MBEDTLS_ECP_RESTARTABLE)
+ #undef MBEDTLS_ECP_RESTARTABLE
+ #endif
+#endif
diff --git a/deps/LIEF/include/LIEF/ART.hpp b/deps/LIEF/include/LIEF/ART.hpp
index 7d920b61be47..4695f8f6c42b 100644
--- a/deps/LIEF/include/LIEF/ART.hpp
+++ b/deps/LIEF/include/LIEF/ART.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,10 +19,10 @@
#include "LIEF/config.h"
#if defined(LIEF_ART_SUPPORT)
-#include "LIEF/ART/Parser.hpp"
-#include "LIEF/ART/utils.hpp"
-#include "LIEF/ART/File.hpp"
-#include "LIEF/ART/EnumToString.hpp"
+ #include "LIEF/ART/Parser.hpp"
+ #include "LIEF/ART/utils.hpp"
+ #include "LIEF/ART/File.hpp"
+ #include "LIEF/ART/EnumToString.hpp"
#endif
#endif
diff --git a/deps/LIEF/include/LIEF/ART/EnumToString.hpp b/deps/LIEF/include/LIEF/ART/EnumToString.hpp
index a377b91a3576..82f0b104bcd6 100644
--- a/deps/LIEF/include/LIEF/ART/EnumToString.hpp
+++ b/deps/LIEF/include/LIEF/ART/EnumToString.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,4 +37,3 @@ LIEF_API const char* to_string(ART_44::IMAGE_ROOTS e);
} // namespace LIEF
#endif
-
diff --git a/deps/LIEF/include/LIEF/ART/File.hpp b/deps/LIEF/include/LIEF/ART/File.hpp
index ea00a53ac186..9f1c8ee330c5 100644
--- a/deps/LIEF/include/LIEF/ART/File.hpp
+++ b/deps/LIEF/include/LIEF/ART/File.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,10 +31,10 @@ class LIEF_API File : public Object {
public:
File& operator=(const File& copy) = delete;
- File(const File& copy) = delete;
+ File(const File& copy) = delete;
- const Header& header() const;
- Header& header();
+ const Header& header() const LIEF_LIFETIMEBOUND;
+ Header& header() LIEF_LIFETIMEBOUND;
void accept(Visitor& visitor) const override;
diff --git a/deps/LIEF/include/LIEF/ART/Header.hpp b/deps/LIEF/include/LIEF/ART/Header.hpp
index 3aef2eb4e20a..00eaf63c6a9f 100644
--- a/deps/LIEF/include/LIEF/ART/Header.hpp
+++ b/deps/LIEF/include/LIEF/ART/Header.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -85,43 +85,43 @@ class LIEF_API Header : public Object {
~Header() override;
private:
- magic_t magic_;
- art_version_t version_;
+ magic_t magic_{};
+ art_version_t version_ = 0;
- uint32_t image_begin_;
- uint32_t image_size_;
+ uint32_t image_begin_ = 0;
+ uint32_t image_size_ = 0;
- uint32_t oat_checksum_;
+ uint32_t oat_checksum_ = 0;
- uint32_t oat_file_begin_;
- uint32_t oat_file_end_;
+ uint32_t oat_file_begin_ = 0;
+ uint32_t oat_file_end_ = 0;
- uint32_t oat_data_begin_;
- uint32_t oat_data_end_;
+ uint32_t oat_data_begin_ = 0;
+ uint32_t oat_data_end_ = 0;
- int32_t patch_delta_;
- uint32_t image_roots_;
+ int32_t patch_delta_ = 0;
+ uint32_t image_roots_ = 0;
- uint32_t pointer_size_;
+ uint32_t pointer_size_ = 0;
- bool compile_pic_;
+ bool compile_pic_ = false;
- uint32_t nb_sections_;
- uint32_t nb_methods_;
+ uint32_t nb_sections_ = 0;
+ uint32_t nb_methods_ = 0;
- bool is_pic_;
+ bool is_pic_ = false;
// From ART 29
// ===========
- uint32_t boot_image_begin_;
- uint32_t boot_image_size_;
+ uint32_t boot_image_begin_ = 0;
+ uint32_t boot_image_size_ = 0;
- uint32_t boot_oat_begin_;
- uint32_t boot_oat_size_;
+ uint32_t boot_oat_begin_ = 0;
+ uint32_t boot_oat_size_ = 0;
- STORAGE_MODES storage_mode_;
+ STORAGE_MODES storage_mode_ = STORAGE_MODES::STORAGE_UNCOMPRESSED;
- uint32_t data_size_;
+ uint32_t data_size_ = 0;
};
} // Namespace ART
diff --git a/deps/LIEF/include/LIEF/ART/Parser.hpp b/deps/LIEF/include/LIEF/ART/Parser.hpp
index 21d2250e4e92..5ff6bed37e71 100644
--- a/deps/LIEF/include/LIEF/ART/Parser.hpp
+++ b/deps/LIEF/include/LIEF/ART/Parser.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,14 +28,15 @@ namespace ART {
class File;
-/// Class which parses an ART file and transform into a ART::File object
+/// Class which parses an ART file and transforms it into an ART::File object
class LIEF_API Parser {
public:
static std::unique_ptr parse(const std::string& file);
- static std::unique_ptr parse(std::vector data, const std::string& name = "");
+ static std::unique_ptr parse(std::vector data,
+ const std::string& name = "");
Parser& operator=(const Parser& copy) = delete;
- Parser(const Parser& copy) = delete;
+ Parser(const Parser& copy) = delete;
private:
Parser();
@@ -95,8 +96,8 @@ class LIEF_API Parser {
//// Parse a **Single** java.lang.DexCache object
- //template
- //void parse_class_roots(size_t object_offset);
+ // template
+ // void parse_class_roots(size_t object_offset);
std::unique_ptr file_;
std::unique_ptr stream_;
diff --git a/deps/LIEF/include/LIEF/ART/enums.hpp b/deps/LIEF/include/LIEF/ART/enums.hpp
index 2165ea497bd7..e149609b43e5 100644
--- a/deps/LIEF/include/LIEF/ART/enums.hpp
+++ b/deps/LIEF/include/LIEF/ART/enums.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,32 +21,32 @@ namespace ART {
enum STORAGE_MODES {
STORAGE_UNCOMPRESSED = 0,
- STORAGE_LZ4 = 1,
- STORAGE_LZ4HC = 2,
+ STORAGE_LZ4 = 1,
+ STORAGE_LZ4HC = 2,
};
namespace ART_17 {
enum IMAGE_METHODS {
- RESOLUTION_METHOD = 0,
- IMT_CONFLICT_METHOD = 1,
- IMT_UNIMPLEMENTED_METHOD = 2,
- CALLEE_SAVE_METHOD = 3,
- REFS_ONLY_SAVE_METHOD = 4,
+ RESOLUTION_METHOD = 0,
+ IMT_CONFLICT_METHOD = 1,
+ IMT_UNIMPLEMENTED_METHOD = 2,
+ CALLEE_SAVE_METHOD = 3,
+ REFS_ONLY_SAVE_METHOD = 4,
REFS_AND_ARGS_SAVE_METHOD = 5,
};
enum IMAGE_SECTIONS {
- SECTION_OBJECTS = 0,
- SECTION_ART_FIELDS = 1,
- SECTION_ART_METHODS = 2,
- SECTION_INTERNED_STRINGS = 3,
- SECTION_IMAGE_BITMAP = 4,
+ SECTION_OBJECTS = 0,
+ SECTION_ART_FIELDS = 1,
+ SECTION_ART_METHODS = 2,
+ SECTION_INTERNED_STRINGS = 3,
+ SECTION_IMAGE_BITMAP = 4,
};
enum IMAGE_ROOTS {
- DEX_CACHES = 0,
- CLASS_ROOTS = 1,
+ DEX_CACHES = 0,
+ CLASS_ROOTS = 1,
};
@@ -59,19 +59,18 @@ using ART_17::IMAGE_METHODS;
using ART_17::IMAGE_ROOTS;
enum IMAGE_SECTIONS {
- SECTION_OBJECTS = 0,
- SECTION_ART_FIELDS = 1,
- SECTION_ART_METHODS = 2,
- SECTION_RUNTIME_METHODS = 3, // New in ART 29
- SECTION_IMT_CONFLICT_TABLES = 4, // New in ART 29
- SECTION_DEX_CACHE_ARRAYS = 5, // New in ART 29
- SECTION_INTERNED_STRINGS = 6,
- SECTION_CLASS_TABLE = 7, // New in ART 29
- SECTION_IMAGE_BITMAP = 8,
+ SECTION_OBJECTS = 0,
+ SECTION_ART_FIELDS = 1,
+ SECTION_ART_METHODS = 2,
+ SECTION_RUNTIME_METHODS = 3, // New in ART 29
+ SECTION_IMT_CONFLICT_TABLES = 4, // New in ART 29
+ SECTION_DEX_CACHE_ARRAYS = 5, // New in ART 29
+ SECTION_INTERNED_STRINGS = 6,
+ SECTION_CLASS_TABLE = 7, // New in ART 29
+ SECTION_IMAGE_BITMAP = 8,
};
-
} // Namespace ART_29
@@ -81,16 +80,16 @@ using ART_29::IMAGE_METHODS;
using ART_29::IMAGE_ROOTS;
enum IMAGE_SECTIONS {
- SECTION_OBJECTS = 0,
- SECTION_ART_FIELDS = 1,
- SECTION_ART_METHODS = 2,
- SECTION_RUNTIME_METHODS = 3,
- SECTION_IM_TABLES = 4, // New in ART 30
- SECTION_IMT_CONFLICT_TABLES = 5,
- SECTION_DEX_CACHE_ARRAYS = 6,
- SECTION_INTERNED_STRINGS = 7,
- SECTION_CLASS_TABLE = 8,
- SECTION_IMAGE_BITMAP = 9,
+ SECTION_OBJECTS = 0,
+ SECTION_ART_FIELDS = 1,
+ SECTION_ART_METHODS = 2,
+ SECTION_RUNTIME_METHODS = 3,
+ SECTION_IM_TABLES = 4, // New in ART 30
+ SECTION_IMT_CONFLICT_TABLES = 5,
+ SECTION_DEX_CACHE_ARRAYS = 6,
+ SECTION_INTERNED_STRINGS = 7,
+ SECTION_CLASS_TABLE = 8,
+ SECTION_IMAGE_BITMAP = 9,
};
} // Namespace ART_30
@@ -100,19 +99,19 @@ namespace ART_44 {
using ART_30::IMAGE_SECTIONS;
enum IMAGE_METHODS {
- RESOLUTION_METHOD = 0,
- IMT_CONFLICT_METHOD = 1,
- IMT_UNIMPLEMENTED_METHOD = 2,
+ RESOLUTION_METHOD = 0,
+ IMT_CONFLICT_METHOD = 1,
+ IMT_UNIMPLEMENTED_METHOD = 2,
SAVE_ALL_CALLEE_SAVES_METHOD = 3, // New in ART 44
- SAVE_REFS_ONLY_METHOD = 4, // New in ART 44
- SAVE_REFS_AND_ARGS_METHOD = 5, // New in ART 44
- SAVE_EVERYTHING_METHOD = 6, // New in ART 44
+ SAVE_REFS_ONLY_METHOD = 4, // New in ART 44
+ SAVE_REFS_AND_ARGS_METHOD = 5, // New in ART 44
+ SAVE_EVERYTHING_METHOD = 6, // New in ART 44
};
enum IMAGE_ROOTS {
- DEX_CACHES = 0,
- CLASS_ROOTS = 1,
+ DEX_CACHES = 0,
+ CLASS_ROOTS = 1,
CLASS_LOADER = 2, // New in ART 44
};
diff --git a/deps/LIEF/include/LIEF/ART/hash.hpp b/deps/LIEF/include/LIEF/ART/hash.hpp
index 1aaa7d3acd92..66f0a6a7e11b 100644
--- a/deps/LIEF/include/LIEF/ART/hash.hpp
+++ b/deps/LIEF/include/LIEF/ART/hash.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,8 +35,8 @@ class LIEF_API Hash : public LIEF::Hash {
using LIEF::Hash::visit;
public:
- void visit(const File& file) override;
- void visit(const Header& header) override;
+ void visit(const File& file) override;
+ void visit(const Header& header) override;
~Hash() override;
};
diff --git a/deps/LIEF/include/LIEF/ART/java_structures.hpp b/deps/LIEF/include/LIEF/ART/java_structures.hpp
index da3514aaffe6..5b78d94f9814 100644
--- a/deps/LIEF/include/LIEF/ART/java_structures.hpp
+++ b/deps/LIEF/include/LIEF/ART/java_structures.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,25 +49,25 @@ struct brooks_read_barrier_t {
template
struct jobject_t {
heap_reference_t klass;
- uint32_t monitor;
- T brooks_read_barrier;
+ uint32_t monitor;
+ T brooks_read_barrier;
};
template<>
struct jobject_t {
heap_reference_t klass;
- uint32_t monitor;
+ uint32_t monitor;
};
template
struct ALIGNED_(4) jarray_t {
jobject_t object;
- int32_t length;
+ int32_t length;
uint32_t* elements;
};
template
struct ALIGNED_(4) jclass_t {
- jobject_t object;
+ jobject_t object;
heap_reference_t class_loader;
heap_reference_t component_type;
@@ -86,8 +86,8 @@ struct ALIGNED_(4) jclass_t {
uint64_t virtual_methods;
uint32_t class_size;
uint32_t clinit_thread_id;
- int32_t dex_class_def_idx;
- int32_t dex_type_idx;
+ int32_t dex_class_def_idx;
+ int32_t dex_type_idx;
uint32_t num_direct_methods;
uint32_t num_instance_fields;
uint32_t num_reference_instance_fields;
@@ -97,15 +97,15 @@ struct ALIGNED_(4) jclass_t {
uint32_t object_size;
uint32_t primitive_type;
uint32_t reference_instance_offsets;
- int32_t status;
+ int32_t status;
};
template
struct ALIGNED_(4) jstring_t {
jobject_t object;
- int32_t count;
- uint32_t hash_code;
- uint16_t* value;
+ int32_t count;
+ uint32_t hash_code;
+ uint16_t* value;
};
template
@@ -118,7 +118,7 @@ struct ALIGNED_(4) jdex_cache_t {
heap_reference_t resolved_methods;
heap_reference_t resolved_types;
heap_reference_t strings;
- uint64_t dex_file;
+ uint64_t dex_file;
};
@@ -132,7 +132,7 @@ namespace ART_29 {
/// Namespace related to the Java part of ART 29
namespace Java {
-using heap_reference_t = ART_17::Java::heap_reference_t;
+using heap_reference_t = ART_17::Java::heap_reference_t;
using brooks_read_barrier_t = ART_17::Java::brooks_read_barrier_t;
template
@@ -143,9 +143,9 @@ using jarray_t = ART_17::Java::jarray_t;
template
struct ALIGNED_(4) jclass_t {
- jobject_t object;
+ jobject_t object;
- heap_reference_t annotation_type; // ADDED in ART 29
+ heap_reference_t annotation_type; // ADDED in ART 29
heap_reference_t class_loader;
heap_reference_t component_type;
heap_reference_t dex_cache;
@@ -153,19 +153,19 @@ struct ALIGNED_(4) jclass_t {
heap_reference_t iftable;
heap_reference_t name;
heap_reference_t super_class;
- heap_reference_t verify_error; // Type CHANGED from Class to Object
+ heap_reference_t verify_error; // Type CHANGED from Class to Object
heap_reference_t vtable;
uint32_t access_flags;
- uint64_t dex_cache_strings; // direct_methods REPLACED with dex_cache_string
+ uint64_t dex_cache_strings; // direct_methods REPLACED with dex_cache_string
uint64_t ifields;
- uint64_t methods; // ADDED in ART 29
+ uint64_t methods; // ADDED in ART 29
uint64_t sfields;
- uint32_t class_flags; // virtual_methods REPLACED with class_flags
+ uint32_t class_flags; // virtual_methods REPLACED with class_flags
uint32_t class_size;
uint32_t clinit_thread_id;
- int32_t dex_class_def_idx;
- int32_t dex_type_idx;
+ int32_t dex_class_def_idx;
+ int32_t dex_type_idx;
// uint32_t num_direct_methods; // REMOVED in ART 29
// uint32_t num_instance_fields; // REMOVED in ART 29
uint32_t num_reference_instance_fields;
@@ -175,10 +175,10 @@ struct ALIGNED_(4) jclass_t {
uint32_t object_size;
uint32_t primitive_type;
uint32_t reference_instance_offsets;
- int32_t status;
+ int32_t status;
- uint16_t copied_methods_offset; // ADDED in ART 29
- uint16_t virtual_methods_offset; // ADDED in ART 29
+ uint16_t copied_methods_offset; // ADDED in ART 29
+ uint16_t virtual_methods_offset; // ADDED in ART 29
};
@@ -192,20 +192,18 @@ struct ALIGNED_(4) jdex_cache_t {
heap_reference_t dex;
heap_reference_t location;
- uint64_t dex_file; // LOCATION CHANGED
- uint64_t resolved_fields; // TYPE CHANGED from heap_reference_t to uint64_t
- uint64_t resolved_methods; // TYPE CHANGED from heap_reference_t to uint64_t
- uint64_t resolved_types; // TYPE CHANGED from heap_reference_t to uint64_t
- uint64_t strings; // TYPE CHANGED from heap_reference_t to uint64_t
- uint32_t num_resolved_fields; // ADDED in ART 29
- uint32_t num_resolved_methods; // ADDED in ART 29
- uint32_t num_resolved_types; // ADDED in ART 29
- uint32_t num_strings; // ADDED in ART 29
+ uint64_t dex_file; // LOCATION CHANGED
+ uint64_t resolved_fields; // TYPE CHANGED from heap_reference_t to uint64_t
+ uint64_t resolved_methods; // TYPE CHANGED from heap_reference_t to uint64_t
+ uint64_t resolved_types; // TYPE CHANGED from heap_reference_t to uint64_t
+ uint64_t strings; // TYPE CHANGED from heap_reference_t to uint64_t
+ uint32_t num_resolved_fields; // ADDED in ART 29
+ uint32_t num_resolved_methods; // ADDED in ART 29
+ uint32_t num_resolved_types; // ADDED in ART 29
+ uint32_t num_strings; // ADDED in ART 29
};
-
-
} // Namespace Java
} // Namespace ART_29
@@ -218,7 +216,7 @@ namespace ART_30 {
/// Namespace related to the Java part of ART 30
namespace Java {
-using heap_reference_t = ART_29::Java::heap_reference_t;
+using heap_reference_t = ART_29::Java::heap_reference_t;
using brooks_read_barrier_t = ART_29::Java::brooks_read_barrier_t;
template
@@ -250,7 +248,7 @@ namespace ART_44 {
namespace Java {
-using heap_reference_t = ART_30::Java::heap_reference_t;
+using heap_reference_t = ART_30::Java::heap_reference_t;
using brooks_read_barrier_t = ART_30::Java::brooks_read_barrier_t;
template
@@ -261,13 +259,13 @@ using jarray_t = ART_30::Java::jarray_t;
template
struct ALIGNED_(4) jclass_t {
- jobject_t object;
+ jobject_t object;
// heap_reference_t annotation_type; // REMOVED in ART 44
heap_reference_t class_loader;
heap_reference_t component_type;
heap_reference_t dex_cache;
- heap_reference_t ext_data; // ADDED in ART 44
+ heap_reference_t ext_data; // ADDED in ART 44
heap_reference_t iftable;
heap_reference_t name;
heap_reference_t super_class;
@@ -279,19 +277,19 @@ struct ALIGNED_(4) jclass_t {
uint64_t ifields;
uint64_t methods;
uint64_t sfields;
- uint32_t access_flags; // ADDED in ART 44
+ uint32_t access_flags; // ADDED in ART 44
uint32_t class_flags;
uint32_t class_size;
uint32_t clinit_thread_id;
- int32_t dex_class_def_idx;
- int32_t dex_type_idx;
+ int32_t dex_class_def_idx;
+ int32_t dex_type_idx;
uint32_t num_reference_instance_fields;
uint32_t num_reference_static_fields;
uint32_t object_size;
- uint32_t object_size_alloc_fast_path; // ADDED in ART 44
+ uint32_t object_size_alloc_fast_path; // ADDED in ART 44
uint32_t primitive_type;
uint32_t reference_instance_offsets;
- int32_t status;
+ int32_t status;
uint16_t copied_methods_offset;
uint16_t virtual_methods_offset;
};
@@ -310,19 +308,19 @@ struct ALIGNED_(4) jdex_cache_t {
// heap_reference_t dex; // REMOVED in ART 44
heap_reference_t location;
- uint32_t num_resolved_call_sites; // ADDED in ART 44 (related to DEX38 format)
- uint64_t dex_file;
- uint64_t resolved_call_sites; // ADDED in ART 44 (related to DEX38 format)
- uint64_t resolved_fields;
- uint64_t resolved_method_types; // ADDED in ART 44
- uint64_t resolved_methods;
- uint64_t resolved_types;
- uint64_t strings;
- uint32_t num_resolved_fields;
- uint32_t num_resolved_methods_types; // ADDED in ART 44
- uint32_t num_resolved_methods;
- uint32_t num_resolved_types;
- uint32_t num_strings;
+ uint32_t num_resolved_call_sites; // ADDED in ART 44 (related to DEX38 format)
+ uint64_t dex_file;
+ uint64_t resolved_call_sites; // ADDED in ART 44 (related to DEX38 format)
+ uint64_t resolved_fields;
+ uint64_t resolved_method_types; // ADDED in ART 44
+ uint64_t resolved_methods;
+ uint64_t resolved_types;
+ uint64_t strings;
+ uint32_t num_resolved_fields;
+ uint32_t num_resolved_methods_types; // ADDED in ART 44
+ uint32_t num_resolved_methods;
+ uint32_t num_resolved_types;
+ uint32_t num_strings;
};
@@ -338,7 +336,7 @@ namespace ART_46 {
/// Namespace related to the Java part of ART 46
namespace Java {
-using heap_reference_t = ART_44::Java::heap_reference_t;
+using heap_reference_t = ART_44::Java::heap_reference_t;
using brooks_read_barrier_t = ART_44::Java::brooks_read_barrier_t;
template
@@ -367,7 +365,7 @@ namespace ART_56 {
/// Namespace related to the Java part of ART 46
namespace Java {
-using heap_reference_t = ART_46::Java::heap_reference_t;
+using heap_reference_t = ART_46::Java::heap_reference_t;
using brooks_read_barrier_t = ART_46::Java::brooks_read_barrier_t;
template
@@ -393,5 +391,4 @@ using jdex_cache_t = ART_46::Java::jdex_cache_t;
} // Namespace LIEF
-
#endif
diff --git a/deps/LIEF/include/LIEF/ART/json.hpp b/deps/LIEF/include/LIEF/ART/json.hpp
index 3302272bd8c5..502f5d6f48c9 100644
--- a/deps/LIEF/include/LIEF/ART/json.hpp
+++ b/deps/LIEF/include/LIEF/ART/json.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/deps/LIEF/include/LIEF/ART/types.hpp b/deps/LIEF/include/LIEF/ART/types.hpp
index 706e4143d08f..f88380ba0ca4 100644
--- a/deps/LIEF/include/LIEF/ART/types.hpp
+++ b/deps/LIEF/include/LIEF/ART/types.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/deps/LIEF/include/LIEF/ART/utils.hpp b/deps/LIEF/include/LIEF/ART/utils.hpp
index fc4bcd8e3eed..4e0e47495fee 100644
--- a/deps/LIEF/include/LIEF/ART/utils.hpp
+++ b/deps/LIEF/include/LIEF/ART/utils.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/deps/LIEF/include/LIEF/ASM.hpp b/deps/LIEF/include/LIEF/ASM.hpp
index 5bc1a376b2c5..a09dd1f34b33 100644
--- a/deps/LIEF/include/LIEF/ASM.hpp
+++ b/deps/LIEF/include/LIEF/ASM.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/deps/LIEF/include/LIEF/Abstract.hpp b/deps/LIEF/include/LIEF/Abstract.hpp
index bc10e6694865..ee5162f860f3 100644
--- a/deps/LIEF/include/LIEF/Abstract.hpp
+++ b/deps/LIEF/include/LIEF/Abstract.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/deps/LIEF/include/LIEF/Abstract/Binary.hpp b/deps/LIEF/include/LIEF/Abstract/Binary.hpp
index 8e4f738a76ef..1944a94ad24c 100644
--- a/deps/LIEF/include/LIEF/Abstract/Binary.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/Binary.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
#include
#include
+#include "LIEF/compiler_attributes.hpp"
#include "LIEF/visibility.h"
#include "LIEF/Object.hpp"
#include "LIEF/iterators.hpp"
@@ -58,7 +59,6 @@ class Engine;
/// Subclasses like LIEF::PE::Binary implement format-specific API
class LIEF_API Binary : public Object {
public:
-
/// Enumeration of virtual address types used for patching and memory access.
enum class VA_TYPES {
/// Automatically determine if the address is absolute or relative
@@ -69,7 +69,7 @@ class LIEF_API Binary : public Object {
RVA = 1,
/// Absolute Virtual Address.
- VA = 2
+ VA = 2,
};
enum FORMATS {
@@ -131,13 +131,15 @@ class LIEF_API Binary : public Object {
return get_abstract_header();
}
- /// Return an iterator over the abstracted symbols in which the elements **can** be modified
- it_symbols symbols() {
+ /// Return an iterator over the abstracted symbols in which the elements **can**
+ /// be modified
+ it_symbols symbols() LIEF_LIFETIMEBOUND {
return get_abstract_symbols();
}
- /// Return an iterator over the abstracted symbols in which the elements **can't** be modified
- it_const_symbols symbols() const {
+ /// Return an iterator over the abstracted symbols in which the elements
+ /// **can't** be modified
+ it_const_symbols symbols() const LIEF_LIFETIMEBOUND {
return const_cast(this)->get_abstract_symbols();
}
@@ -148,30 +150,30 @@ class LIEF_API Binary : public Object {
/// Return the Symbol with the given name
/// If the symbol does not exist, return a nullptr
- const Symbol* get_symbol(const std::string& name) const;
+ const Symbol* get_symbol(const std::string& name) const LIEF_LIFETIMEBOUND;
- Symbol* get_symbol(const std::string& name) {
+ Symbol* get_symbol(const std::string& name) LIEF_LIFETIMEBOUND {
return const_cast(static_cast(this)->get_symbol(name));
}
/// Return an iterator over the binary's sections (LIEF::Section)
- it_sections sections() {
+ it_sections sections() LIEF_LIFETIMEBOUND {
return get_abstract_sections();
}
- it_const_sections sections() const {
+ it_const_sections sections() const LIEF_LIFETIMEBOUND {
return const_cast(this)->get_abstract_sections();
}
/// Remove **all** the sections in the underlying binary
virtual void remove_section(const std::string& name, bool clear = false) = 0;
- /// Return an iterator over the binary relocation (LIEF::Relocation)
- it_relocations relocations() {
+ /// Return an iterator over the binary relocations (LIEF::Relocation)
+ it_relocations relocations() LIEF_LIFETIMEBOUND {
return get_abstract_relocations();
}
- it_const_relocations relocations() const {
+ it_const_relocations relocations() const LIEF_LIFETIMEBOUND {
return const_cast(this)->get_abstract_relocations();
}
@@ -199,7 +201,8 @@ class LIEF_API Binary : public Object {
}
/// Return the address of the given function name
- virtual result get_function_address(const std::string& func_name) const;
+ virtual result
+ get_function_address(const std::string& func_name) const;
/// Method so that a ``visitor`` can visit us
void accept(Visitor& visitor) const override;
@@ -212,7 +215,8 @@ class LIEF_API Binary : public Object {
/// @param[in] patch_value Patch to apply
/// @param[in] addr_type Specify if the address should be used as an
/// absolute virtual address or a RVA
- virtual void patch_address(uint64_t address, const std::vector& patch_value,
+ virtual void patch_address(uint64_t address,
+ const std::vector& patch_value,
VA_TYPES addr_type = VA_TYPES::AUTO) = 0;
/// Patch the address with the given value
@@ -220,23 +224,26 @@ class LIEF_API Binary : public Object {
/// @param[in] address Address to patch
/// @param[in] patch_value Patch to apply
/// @param[in] size Size of the value in **bytes** (1, 2, ... 8)
- /// @param[in] addr_type Specify if the address should be used as an absolute virtual address or an RVA
- virtual void patch_address(uint64_t address, uint64_t patch_value, size_t size = sizeof(uint64_t),
+ /// @param[in] addr_type Specify if the address should be used as an absolute
+ /// virtual address or an RVA
+ virtual void patch_address(uint64_t address, uint64_t patch_value,
+ size_t size = sizeof(uint64_t),
VA_TYPES addr_type = VA_TYPES::AUTO) = 0;
/// Return the content located at the given virtual address
- virtual span
- get_content_from_virtual_address(uint64_t virtual_address, uint64_t size,
- VA_TYPES addr_type = VA_TYPES::AUTO) const = 0;
+ virtual span get_content_from_virtual_address(
+ uint64_t virtual_address, uint64_t size, VA_TYPES addr_type = VA_TYPES::AUTO
+ ) const LIEF_LIFETIMEBOUND = 0;
/// Get the integer value at the given virtual address
template
- LIEF::result get_int_from_virtual_address(
- uint64_t va, VA_TYPES addr_type = VA_TYPES::AUTO) const
- {
+ LIEF::result
+ get_int_from_virtual_address(uint64_t va,
+ VA_TYPES addr_type = VA_TYPES::AUTO) const {
T value;
static_assert(std::is_integral::value, "Require an integral type");
- span raw = get_content_from_virtual_address(va, sizeof(T), addr_type);
+ span raw =
+ get_content_from_virtual_address(va, sizeof(T), addr_type);
if (raw.empty() || raw.size() < sizeof(T)) {
return make_error_code(lief_errors::read_error);
}
@@ -270,14 +277,17 @@ class LIEF_API Binary : public Object {
/// Convert the given offset into a virtual address.
///
/// @param[in] offset The offset to convert.
- /// @param[in] slide If not 0, it will replace the default base address (if any)
- virtual result offset_to_virtual_address(uint64_t offset, uint64_t slide = 0) const = 0;
+ /// @param[in] slide If not 0, it will replace the default base address (if
+ /// any)
+ virtual result offset_to_virtual_address(uint64_t offset,
+ uint64_t slide = 0) const = 0;
virtual std::ostream& print(std::ostream& os) const {
return os;
}
- LIEF_API friend std::ostream& operator<<(std::ostream& os, const Binary& binary) {
+ LIEF_API friend std::ostream& operator<<(std::ostream& os,
+ const Binary& binary) {
binary.print(os);
return os;
}
@@ -293,9 +303,9 @@ class LIEF_API Binary : public Object {
/// use LIEF::pdb::load() or LIEF::pdb::DebugInfo::from_file() to get PDB debug
/// info.
///
- /// \warning This function requires LIEF's extended version otherwise it
- /// **always** return a nullptr
- DebugInfo* debug_info() const;
+ /// @warning This function requires LIEF's extended version otherwise it
+ /// **always** returns a nullptr
+ DebugInfo* debug_info() const LIEF_LIFETIMEBOUND;
/// Disassemble code starting at the given virtual address and with the given
/// size.
@@ -307,7 +317,7 @@ class LIEF_API Binary : public Object {
/// }
/// ```
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(uint64_t address, size_t size) const;
/// Disassemble code starting at the given virtual address
@@ -319,7 +329,7 @@ class LIEF_API Binary : public Object {
/// }
/// ```
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(uint64_t address) const;
/// Disassemble code for the given symbol name
@@ -331,13 +341,13 @@ class LIEF_API Binary : public Object {
/// }
/// ```
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(const std::string& function) const;
/// Disassemble code provided by the given buffer at the specified
/// `address` parameter.
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(const uint8_t* buffer, size_t size,
uint64_t address = 0) const;
@@ -345,7 +355,7 @@ class LIEF_API Binary : public Object {
/// Disassemble code provided by the given vector of bytes at the specified
/// `address` parameter.
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(const std::vector& buffer,
uint64_t address = 0) const {
return disassemble(buffer.data(), buffer.size(), address);
@@ -356,7 +366,8 @@ class LIEF_API Binary : public Object {
return disassemble(buffer.data(), buffer.size(), address);
}
- instructions_it disassemble(LIEF::span buffer, uint64_t address = 0) const {
+ instructions_it disassemble(LIEF::span buffer,
+ uint64_t address = 0) const {
return disassemble(buffer.data(), buffer.size(), address);
}
@@ -374,17 +385,18 @@ class LIEF_API Binary : public Object {
/// If you need to configure the assembly engine or to define addresses for
/// symbols, you can provide your own assembly::AssemblerConfig.
std::vector assemble(uint64_t address, const std::string& Asm,
- assembly::AssemblerConfig& config = assembly::AssemblerConfig::default_config());
+ assembly::AssemblerConfig& config =
+ assembly::AssemblerConfig::default_config());
/// Assemble **and patch** the address with the given LLVM MCInst.
///
- /// \warning Because of ABI compatibility, this MCInst can **only be used**
+ /// @warning Because of ABI compatibility, this MCInst can **only be used**
/// with the **same** version of LLVM used by LIEF (see documentation)
std::vector assemble(uint64_t address, const llvm::MCInst& inst);
/// Assemble **and patch** the address with the given LLVM MCInst.
///
- /// \warning Because of ABI compatibility, this MCInst can **only be used**
+ /// @warning Because of ABI compatibility, this MCInst can **only be used**
/// with the **same** version of LLVM used by LIEF (see documentation)
std::vector assemble(uint64_t address,
const std::vector& insts);
@@ -393,23 +405,30 @@ class LIEF_API Binary : public Object {
/// the format of the current binary
virtual uint64_t page_size() const;
- /// Load and associate an external debug file (e.g., DWARF or PDB) with this binary.
+ /// Load and associate an external debug file (e.g., DWARF or PDB) with this
+ /// binary.
///
- /// This method attempts to load the debug information from the file located at the given path,
- /// and binds it to the current binary instance. If successful, it returns a pointer to the
- /// loaded DebugInfo object.
+ /// This method attempts to load the debug information from the file located at
+ /// the given path, and binds it to the current binary instance. If successful,
+ /// it returns a pointer to the loaded DebugInfo object.
///
- /// \param path Path to the external debug file (e.g., `.dwarf`, `.pdb`)
- /// \return Pointer to the loaded DebugInfo object on success, or `nullptr` on failure.
+ /// @param path Path to the external debug file (e.g., `.dwarf`, `.pdb`)
+ /// @return Pointer to the loaded DebugInfo object on success, or `nullptr` on
+ /// failure.
///
- /// \warning It is the caller's responsibility to ensure that the debug file is
+ /// @warning It is the caller's responsibility to ensure that the debug file is
/// compatible with the binary. Incorrect associations may lead to
/// inconsistent or invalid results.
///
- /// \note This function does not verify that the debug file matches the binary's unique
- /// identifier (e.g., build ID, GUID).
+ /// @note This function does not verify that the debug file matches the binary's
+ /// unique identifier (e.g., build ID, GUID).
DebugInfo* load_debug_info(const std::string& path);
+ /// Size of the binary when mapped in memory
+ virtual uint64_t virtual_size() const {
+ return 0;
+ }
+
protected:
FORMATS format_ = FORMATS::UNKNOWN;
mutable std::unique_ptr debug_info_;
@@ -421,14 +440,15 @@ class LIEF_API Binary : public Object {
template
LIEF_LOCAL assembly::Engine* get_cache_engine(uint64_t address, F&& f) const;
- // These functions need to be overloaded by the object that claims to extend this Abstract Binary
+ // These functions need to be overloaded by the object that claims to extend this
+ // Abstract Binary
virtual Header get_abstract_header() const = 0;
virtual symbols_t get_abstract_symbols() = 0;
virtual sections_t get_abstract_sections() = 0;
virtual relocations_t get_abstract_relocations() = 0;
- virtual functions_t get_abstract_exported_functions() const = 0;
- virtual functions_t get_abstract_imported_functions() const = 0;
+ virtual functions_t get_abstract_exported_functions() const = 0;
+ virtual functions_t get_abstract_imported_functions() const = 0;
virtual std::vector get_abstract_imported_libraries() const = 0;
};
diff --git a/deps/LIEF/include/LIEF/Abstract/DebugInfo.hpp b/deps/LIEF/include/LIEF/Abstract/DebugInfo.hpp
index 24961cf79134..5792a14b3b0f 100644
--- a/deps/LIEF/include/LIEF/Abstract/DebugInfo.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/DebugInfo.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2022 - 2025 R. Thomas
+/* Copyright 2022 - 2026 R. Thomas
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,13 +34,14 @@ class DebugInfo;
/// Users can use this interface to access high-level debug features like
/// resolving function addresses.
///
-/// See: LIEF::pdb::DebugInfo, LIEF::dwarf::DebugInfo
+/// @see LIEF::pdb::DebugInfo, LIEF::dwarf::DebugInfo
class LIEF_API DebugInfo {
public:
friend class Binary;
enum class FORMAT {
UNKNOWN = 0,
- DWARF, PDB,
+ DWARF,
+ PDB,
};
DebugInfo(std::unique_ptr impl);
@@ -61,7 +62,7 @@ class LIEF_API DebugInfo {
template
const T* as() const {
static_assert(std::is_base_of::value,
- "Require Instruction inheritance");
+ "Requires DebugInfo inheritance");
if (T::classof(this)) {
return static_cast(this);
}
@@ -69,7 +70,8 @@ class LIEF_API DebugInfo {
}
/// Attempt to resolve the address of the function specified by `name`.
- virtual optional find_function_address(const std::string& name) const = 0;
+ virtual optional
+ find_function_address(const std::string& name) const = 0;
protected:
std::unique_ptr impl_;
diff --git a/deps/LIEF/include/LIEF/Abstract/Function.hpp b/deps/LIEF/include/LIEF/Abstract/Function.hpp
index 66004763d6ec..f41bbc0424a6 100644
--- a/deps/LIEF/include/LIEF/Abstract/Function.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/Function.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,24 +50,21 @@ class LIEF_API Function : public Symbol {
/// returns its virtual address in the binary
EXPORTED = 1 << 3,
- /// The function is **imported** by the binary and the address() should return 0
+ /// The function is **imported** by the binary and the address() should return
+ /// 0
IMPORTED = 1 << 4,
};
public:
Function() = default;
Function(const std::string& name) :
- Symbol(name)
- {}
+ Symbol(name) {}
Function(uint64_t address) :
- Function("", address)
- {}
+ Function("", address) {}
Function(const std::string& name, uint64_t address) :
- Symbol(name, address)
- {}
+ Symbol(name, address) {}
Function(const std::string& name, uint64_t address, FLAGS flags) :
- Function(name, address)
- {
+ Function(name, address) {
flags_ = flags;
}
@@ -94,8 +91,8 @@ class LIEF_API Function : public Symbol {
return ((uint32_t)flags_ & (uint32_t)f) != 0;
}
- /// Address of the current function. For functions that are set with the FLAGS::IMPORTED flag,
- /// this value is likely 0.
+ /// Address of the current function. For functions that are set with the
+ /// FLAGS::IMPORTED flag, this value is likely 0.
uint64_t address() const {
return value_;
}
@@ -106,7 +103,8 @@ class LIEF_API Function : public Symbol {
void accept(Visitor& visitor) const override;
- LIEF_API friend std::ostream& operator<<(std::ostream& os, const Function& entry);
+ LIEF_API friend std::ostream& operator<<(std::ostream& os,
+ const Function& entry);
protected:
FLAGS flags_ = FLAGS::NONE;
@@ -118,4 +116,3 @@ LIEF_API const char* to_string(Function::FLAGS e);
ENABLE_BITMASK_OPERATORS(LIEF::Function::FLAGS);
#endif
-
diff --git a/deps/LIEF/include/LIEF/Abstract/Header.hpp b/deps/LIEF/include/LIEF/Abstract/Header.hpp
index 036e64cf5a54..55ade3dffeee 100644
--- a/deps/LIEF/include/LIEF/Abstract/Header.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/Header.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,9 +67,9 @@ class LIEF_API Header : public Object {
BITS_16 = 1LLU << 0, /// 16-bits architecture
BITS_32 = 1LLU << 1, /// 32-bits architecture
BITS_64 = 1LLU << 2, /// 64-bits architecture
- THUMB = 1LLU << 3, /// Support ARM Thumb mode
+ THUMB = 1LLU << 3, /// Support ARM Thumb mode
- ARM64E = 1LLU << 4, /// ARM64 with extended (security) features
+ ARM64E = 1LLU << 4, /// ARM64 with extended (security) features
};
enum class OBJECT_TYPES {
@@ -130,7 +130,7 @@ class LIEF_API Header : public Object {
protected:
ARCHITECTURES architecture_ = ARCHITECTURES::UNKNOWN;
- OBJECT_TYPES object_type_ = OBJECT_TYPES::UNKNOWN;
+ OBJECT_TYPES object_type_ = OBJECT_TYPES::UNKNOWN;
uint64_t entrypoint_ = 0;
ENDIANNESS endianness_ = ENDIANNESS::UNKNOWN;
MODES modes_ = MODES::NONE;
diff --git a/deps/LIEF/include/LIEF/Abstract/Parser.hpp b/deps/LIEF/include/LIEF/Abstract/Parser.hpp
index 9a3665192bb6..8a252cf68cc3 100644
--- a/deps/LIEF/include/LIEF/Abstract/Parser.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/Parser.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
#include
#include
+#include
#include
#include "LIEF/visibility.h"
@@ -50,7 +51,7 @@ class LIEF_API Parser {
protected:
Parser(const std::string& file);
- uint64_t binary_size_ = 0;
+ uint64_t binary_size_ = 0;
virtual ~Parser();
Parser();
diff --git a/deps/LIEF/include/LIEF/Abstract/Relocation.hpp b/deps/LIEF/include/LIEF/Abstract/Relocation.hpp
index c22f8e7a508c..339a0d3f6097 100644
--- a/deps/LIEF/include/LIEF/Abstract/Relocation.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/Relocation.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,8 +32,7 @@ class LIEF_API Relocation : public Object {
/// Constructor from a relocation's address and size
Relocation(uint64_t address, uint8_t size) :
address_(address),
- size_(size)
- {}
+ size_(size) {}
~Relocation() override = default;
@@ -41,7 +40,7 @@ class LIEF_API Relocation : public Object {
Relocation(const Relocation&) = default;
void swap(Relocation& other) {
std::swap(address_, other.address_);
- std::swap(size_, other.size_);
+ std::swap(size_, other.size_);
}
/// Relocation's address
@@ -66,31 +65,32 @@ class LIEF_API Relocation : public Object {
void accept(Visitor& visitor) const override;
- /// Comparaison based on the Relocation's **address**
+ /// Comparison based on the Relocation's **address**
virtual bool operator<(const Relocation& rhs) const {
return address() < rhs.address();
}
- /// Comparaison based on the Relocation's **address**
+ /// Comparison based on the Relocation's **address**
virtual bool operator<=(const Relocation& rhs) const {
return !(address() > rhs.address());
}
- /// Comparaison based on the Relocation's **address**
+ /// Comparison based on the Relocation's **address**
virtual bool operator>(const Relocation& rhs) const {
return address() > rhs.address();
}
- /// Comparaison based on the Relocation's **address**
+ /// Comparison based on the Relocation's **address**
virtual bool operator>=(const Relocation& rhs) const {
return !(address() < rhs.address());
}
- LIEF_API friend std::ostream& operator<<(std::ostream& os, const Relocation& entry);
+ LIEF_API friend std::ostream& operator<<(std::ostream& os,
+ const Relocation& entry);
protected:
uint64_t address_ = 0;
- uint8_t size_ = 0;
+ uint8_t size_ = 0;
};
diff --git a/deps/LIEF/include/LIEF/Abstract/Section.hpp b/deps/LIEF/include/LIEF/Abstract/Section.hpp
index eb89b42ccc57..8e9129500733 100644
--- a/deps/LIEF/include/LIEF/Abstract/Section.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/Section.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
#include "LIEF/span.hpp"
#include "LIEF/Object.hpp"
+#include "LIEF/compiler_attributes.hpp"
#include "LIEF/visibility.h"
namespace LIEF {
@@ -32,27 +33,26 @@ class LIEF_API Section : public Object {
Section() = default;
Section(std::string name) :
- name_(std::move(name))
- {}
+ name_(std::move(name)) {}
~Section() override = default;
Section& operator=(const Section&) = default;
Section(const Section&) = default;
- /// section's name
+ /// Section's name
virtual std::string name() const {
return name_.c_str();
}
- /// Return the **complete** section's name which might
+ /// Return the **complete** section's name which might include
/// trailing (``0``) bytes
virtual const std::string& fullname() const {
return name_;
}
- /// section's content
- virtual span content() const {
+ /// Section's content
+ virtual span content() const LIEF_LIFETIMEBOUND {
return {};
}
@@ -61,7 +61,7 @@ class LIEF_API Section : public Object {
size_ = size;
}
- /// section's size (size in the binary, not the virtual size)
+ /// Section's size (size in the binary, not the virtual size)
virtual uint64_t size() const {
return size_;
}
@@ -118,9 +118,9 @@ class LIEF_API Section : public Object {
protected:
std::string name_;
- uint64_t virtual_address_ = 0;
- uint64_t size_ = 0;
- uint64_t offset_ = 0;
+ uint64_t virtual_address_ = 0;
+ uint64_t size_ = 0;
+ uint64_t offset_ = 0;
private:
template
diff --git a/deps/LIEF/include/LIEF/Abstract/Symbol.hpp b/deps/LIEF/include/LIEF/Abstract/Symbol.hpp
index 8d9802beec34..ce4ed5d3aebe 100644
--- a/deps/LIEF/include/LIEF/Abstract/Symbol.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/Symbol.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,16 +29,16 @@ class LIEF_API Symbol : public Object {
public:
Symbol() = default;
Symbol(std::string name) :
- name_(std::move(name))
- {}
+ name_(std::move(name)) {}
Symbol(std::string name, uint64_t value) :
- name_(std::move(name)), value_(value)
- {}
+ name_(std::move(name)),
+ value_(value) {}
Symbol(std::string name, uint64_t value, uint64_t size) :
- name_(std::move(name)), value_(value), size_(size)
- {}
+ name_(std::move(name)),
+ value_(value),
+ size_(size) {}
Symbol(const Symbol&) = default;
Symbol& operator=(const Symbol&) = default;
@@ -64,7 +64,7 @@ class LIEF_API Symbol : public Object {
name_ = std::move(name);
}
- // Symbol's value which is usually the **address** of the symbol
+ /// Symbol's value which is usually the **address** of the symbol
virtual uint64_t value() const {
return value_;
}
@@ -72,7 +72,7 @@ class LIEF_API Symbol : public Object {
value_ = value;
}
- /// This size of the symbol (when applicable)
+ /// The size of the symbol (when applicable)
virtual uint64_t size() const {
return size_;
}
@@ -94,4 +94,3 @@ class LIEF_API Symbol : public Object {
}
#endif
-
diff --git a/deps/LIEF/include/LIEF/Abstract/hash.hpp b/deps/LIEF/include/LIEF/Abstract/hash.hpp
index 26f4a375f446..b38537966bff 100644
--- a/deps/LIEF/include/LIEF/Abstract/hash.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/hash.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,12 +34,12 @@ class LIEF_API AbstractHash : public LIEF::Hash {
using LIEF::Hash::visit;
public:
- void visit(const Binary& binary) override;
- void visit(const Header& header) override;
- void visit(const Section& section) override;
- void visit(const Symbol& symbol) override;
+ void visit(const Binary& binary) override;
+ void visit(const Header& header) override;
+ void visit(const Section& section) override;
+ void visit(const Symbol& symbol) override;
void visit(const Relocation& relocation) override;
- void visit(const Function& function) override;
+ void visit(const Function& function) override;
~AbstractHash() override;
};
diff --git a/deps/LIEF/include/LIEF/Abstract/json.hpp b/deps/LIEF/include/LIEF/Abstract/json.hpp
index fa05cec34584..c133c1b54a91 100644
--- a/deps/LIEF/include/LIEF/Abstract/json.hpp
+++ b/deps/LIEF/include/LIEF/Abstract/json.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,5 +26,4 @@ LIEF_API std::string to_json_from_abstract(const Object& v);
}
-#endif // LIEF_JSON_SUPPORT
-
+#endif
diff --git a/deps/LIEF/include/LIEF/BinaryStream/ASN1Reader.hpp b/deps/LIEF/include/LIEF/BinaryStream/ASN1Reader.hpp
index 385bb35dd22c..e0f15ec8d496 100644
--- a/deps/LIEF/include/LIEF/BinaryStream/ASN1Reader.hpp
+++ b/deps/LIEF/include/LIEF/BinaryStream/ASN1Reader.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,8 +34,7 @@ class ASN1Reader {
ASN1Reader() = delete;
ASN1Reader(BinaryStream& stream) :
- stream_(stream)
- {}
+ stream_(stream) {}
ASN1Reader(const ASN1Reader&) = delete;
ASN1Reader& operator=(const ASN1Reader&) = delete;
diff --git a/deps/LIEF/include/LIEF/BinaryStream/BinaryStream.hpp b/deps/LIEF/include/LIEF/BinaryStream/BinaryStream.hpp
index 48c16034e1df..6be76072b0a1 100644
--- a/deps/LIEF/include/LIEF/BinaryStream/BinaryStream.hpp
+++ b/deps/LIEF/include/LIEF/BinaryStream/BinaryStream.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include "LIEF/endianness_support.hpp"
#include "LIEF/errors.hpp"
@@ -28,6 +29,7 @@
namespace LIEF {
class ASN1Reader;
+class Binary;
/// Class that is used to a read stream of data from different sources
class LIEF_API BinaryStream {
@@ -40,13 +42,13 @@ class LIEF_API BinaryStream {
MEMORY,
SPAN,
FILE,
+ DUMP,
ELF_DATA_HANDLER,
};
BinaryStream(STREAM_TYPE type) :
- stype_(type)
- {}
+ stype_(type) {}
virtual ~BinaryStream() = default;
virtual uint64_t size() const = 0;
@@ -54,6 +56,18 @@ class LIEF_API BinaryStream {
return stype_;
}
+ bool is_memory_stream() const {
+ return type() == STREAM_TYPE::MEMORY;
+ }
+
+ bool is_dump_stream() const {
+ return type() == STREAM_TYPE::DUMP;
+ }
+
+ bool is_memory_view() const {
+ return is_memory_stream() || is_dump_stream();
+ }
+
result read_uleb128(size_t* size = nullptr) const;
result read_sleb128(size_t* size = nullptr) const;
@@ -61,7 +75,9 @@ class LIEF_API BinaryStream {
result read_string(size_t maxsize = ~static_cast(0)) const;
result peek_string(size_t maxsize = ~static_cast(0)) const;
- result peek_string_at(size_t offset, size_t maxsize = ~static_cast(0)) const;
+ result
+ peek_string_at(size_t offset,
+ size_t maxsize = ~static_cast(0)) const;
result read_u16string() const;
result peek_u16string() const;
@@ -73,27 +89,31 @@ class LIEF_API BinaryStream {
result peek_u16string_at(size_t offset, size_t length) const;
- virtual ok_error_t peek_data(std::vector& container,
- uint64_t offset, uint64_t size,
- uint64_t virtual_address = 0)
- {
+ virtual ok_error_t peek_data(std::vector& container, uint64_t offset,
+ uint64_t size, uint64_t virtual_address = 0) {
if (size == 0) {
return ok();
}
// Even though offset + size < ... => offset < ...
// the addition could overflow so it's worth checking both
- const bool read_ok = offset <= this->size() && (offset + size) <= this->size()
- /* Check for an overflow */
- && (static_cast(offset) >= 0 && static_cast(size) >= 0)
- && (static_cast(offset + size) >= 0);
+ const bool read_ok = offset <= this->size() &&
+ (offset + size) <= this->size()
+ /* Check for an overflow */
+ && (static_cast(offset) >= 0 &&
+ static_cast(size) >= 0) &&
+ (static_cast(offset + size) >= 0);
if (!read_ok) {
return make_error_code(lief_errors::read_error);
}
- container.resize(size);
- if (peek_in(container.data(), offset, size, virtual_address)) {
- return ok();
+
+ if (container.size() < size) {
+ std::vector buffer(size);
+ const ok_error_t res = peek_in(buffer.data(), offset, size, virtual_address);
+ container = std::move(buffer);
+ return res;
}
- return make_error_code(lief_errors::read_error);
+
+ return peek_in(container.data(), offset, size, virtual_address);
}
virtual ok_error_t read_data(std::vector& container, uint64_t size) {
@@ -130,7 +150,8 @@ class LIEF_API BinaryStream {
}
template
- ok_error_t peek_objects_at(uint64_t offset, std::vector& container, uint64_t count) {
+ ok_error_t peek_objects_at(uint64_t offset, std::vector& container,
+ uint64_t count) {
if (count == 0) {
return ok();
}
@@ -144,22 +165,25 @@ class LIEF_API BinaryStream {
return make_error_code(lief_errors::read_error);
}
- container.resize(count);
+ ok_error_t res = make_error_code(lief_errors::inconsistent);
- if (!peek_in(container.data(), pos(), size)) {
- setpos(current_p);
- return make_error_code(lief_errors::read_error);
+ if (container.size() < count) {
+ std::vector buffer(count);
+ res = peek_in(buffer.data(), pos(), size);
+ container = std::move(buffer);
+ } else {
+ res = peek_in(container.data(), pos(), size);
}
setpos(current_p);
- return ok();
+ return res;
}
void setpos(size_t pos) const {
pos_ = pos;
}
- const BinaryStream& increment_pos(size_t value) const {
+ const BinaryStream& increment_pos(size_t value) const LIEF_LIFETIMEBOUND {
pos_ += value;
return *this;
}
@@ -176,10 +200,14 @@ class LIEF_API BinaryStream {
return pos_;
}
- operator bool() const {
+ bool is_valid() const {
return pos_ < size();
}
+ operator bool() const {
+ return is_valid();
+ }
+
template
const T* read_array(size_t size) const;
@@ -190,10 +218,12 @@ class LIEF_API BinaryStream {
}
// Even though offset + size < ... => offset < ...
// the addition could overflow so it's worth checking both
- const bool read_ok = pos_ <= size() && (pos_ + N) <= size()
- /* Check for an overflow */
- && (static_cast(pos_) >= 0 && static_cast(N) >= 0)
- && (static_cast(pos_ + N) >= 0);
+ const bool read_ok =
+ pos_ <= size() &&
+ (pos_ + N) <= size()
+ /* Check for an overflow */
+ && (static_cast(pos_) >= 0 && static_cast(N) >= 0) &&
+ (static_cast(pos_ + N) >= 0);
if (!read_ok) {
return make_error_code(lief_errors::read_error);
@@ -236,7 +266,8 @@ class LIEF_API BinaryStream {
bool can_read(size_t offset) const;
bool can_read(int64_t offset, int64_t size) const {
- return offset < (int64_t)this->size() && (offset + size) < (int64_t)this->size();
+ return offset < (int64_t)this->size() &&
+ size < ((int64_t)this->size() - offset);
}
size_t align(size_t align_on) const;
@@ -247,16 +278,15 @@ class LIEF_API BinaryStream {
template
static bool is_all_zero(const T& buffer) {
- const auto* ptr = reinterpret_cast(&buffer);
- return std::all_of(ptr, ptr + sizeof(T),
- [] (uint8_t x) { return x == 0; });
+ const auto* ptr = reinterpret_cast(&buffer);
+ return std::all_of(ptr, ptr + sizeof(T), [](uint8_t x) { return x == 0; });
}
bool should_swap() const {
return endian_swap_;
}
- virtual const uint8_t* p() const {
+ virtual const uint8_t* p() const {
return nullptr;
}
@@ -284,11 +314,10 @@ class LIEF_API BinaryStream {
uint64_t virtual_address = 0) const = 0;
virtual ok_error_t peek_in(void* dst, uint64_t offset, uint64_t size,
uint64_t virtual_address = 0) const {
+ if (dst == nullptr) {
+ return make_error_code(lief_errors::read_error);
+ }
if (auto raw = read_at(offset, size, virtual_address)) {
- if (dst == nullptr) {
- return make_error_code(lief_errors::read_error);
- }
-
const void* ptr = *raw;
if (ptr == nullptr) {
@@ -301,6 +330,25 @@ class LIEF_API BinaryStream {
return make_error_code(lief_errors::read_error);
}
+ template
+ const T* cast() const {
+ static_assert(std::is_base_of::value,
+ "Require BinaryStream inheritance");
+ if (T::classof(*this)) {
+ return static_cast(this);
+ }
+ return nullptr;
+ }
+
+ template
+ T* cast() {
+ return const_cast(static_cast(this)->cast());
+ }
+
+ virtual bool bind_binary(Binary& /*bin*/) {
+ return false;
+ }
+
protected:
BinaryStream() = default;
@@ -319,15 +367,13 @@ class ScopedStream {
explicit ScopedStream(BinaryStream& stream, uint64_t pos) :
pos_{stream.pos()},
- stream_{stream}
- {
+ stream_{stream} {
stream_.setpos(pos);
}
explicit ScopedStream(BinaryStream& stream) :
pos_{stream.pos()},
- stream_{stream}
- {}
+ stream_{stream} {}
~ScopedStream() {
stream_.setpos(pos_);
@@ -360,15 +406,13 @@ class ToggleEndianness {
explicit ToggleEndianness(BinaryStream& stream, bool value) :
endian_swap_(stream.should_swap()),
- stream_{stream}
- {
+ stream_{stream} {
stream.set_endian_swap(value);
}
explicit ToggleEndianness(BinaryStream& stream) :
endian_swap_(stream.should_swap()),
- stream_{stream}
- {
+ stream_{stream} {
stream.set_endian_swap(!stream_.should_swap());
}
diff --git a/deps/LIEF/include/LIEF/BinaryStream/DumpStream.hpp b/deps/LIEF/include/LIEF/BinaryStream/DumpStream.hpp
new file mode 100644
index 000000000000..e7d1fec8ddf8
--- /dev/null
+++ b/deps/LIEF/include/LIEF/BinaryStream/DumpStream.hpp
@@ -0,0 +1,97 @@
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef LIEF_DUMP_STREAM_H
+#define LIEF_DUMP_STREAM_H
+
+#include
+#include
+
+#include "LIEF/compiler_attributes.hpp"
+#include "LIEF/errors.hpp"
+#include "LIEF/visibility.h"
+#include "LIEF/BinaryStream/BinaryStream.hpp"
+
+namespace LIEF {
+class Binary;
+
+/// This stream interface provides facilities to parse a dumped binary.
+///
+/// A dump is a contiguous capture of a process memory that starts at a given
+/// base address. This stream owns (or weakly references)
+/// another BinaryStream that holds the raw dump and translates file offsets
+/// into dump offsets according to this base address and the binary layout.
+class LIEF_API DumpStream : public BinaryStream {
+ public:
+ DumpStream() = delete;
+ DumpStream(uintptr_t base_address, BinaryStream& ref) :
+ BinaryStream(BinaryStream::STREAM_TYPE::DUMP),
+ baseaddr_(base_address),
+ ref_(&ref) {}
+
+ DumpStream(uintptr_t base_address, std::unique_ptr owned) :
+ BinaryStream(BinaryStream::STREAM_TYPE::DUMP),
+ baseaddr_(base_address),
+ owned_(std::move(owned)),
+ ref_(owned_.get()) {}
+
+ DumpStream(const DumpStream&) = delete;
+ DumpStream& operator=(const DumpStream&) = delete;
+
+ DumpStream(DumpStream&&) noexcept = default;
+ DumpStream& operator=(DumpStream&&) noexcept = default;
+
+ uintptr_t base_address() const {
+ return baseaddr_;
+ }
+
+ Binary* binary() LIEF_LIFETIMEBOUND {
+ return binary_;
+ }
+
+ uint64_t size() const override {
+ return ref_->size();
+ }
+
+ bool bind_binary(Binary& bin) override {
+ binary_ = &bin;
+ return true;
+ }
+
+ std::vector content() const;
+
+ result read_at(uint64_t /*offset*/, uint64_t /*size*/,
+ uint64_t /*virtual_address*/ = 0) const override {
+ return make_error_code(lief_errors::not_supported);
+ }
+
+ ok_error_t peek_in(void* dst, uint64_t offset, uint64_t size,
+ uint64_t virtual_address = 0) const override;
+
+ ~DumpStream() override = default;
+
+ static bool classof(const BinaryStream& stream) {
+ return stream.type() == BinaryStream::STREAM_TYPE::DUMP;
+ }
+
+ protected:
+ uintptr_t baseaddr_ = 0;
+ Binary* binary_ = nullptr;
+ std::unique_ptr owned_;
+ BinaryStream* ref_ = nullptr;
+};
+}
+
+#endif
diff --git a/deps/LIEF/include/LIEF/BinaryStream/FileStream.hpp b/deps/LIEF/include/LIEF/BinaryStream/FileStream.hpp
index 0e5d3e5cc86d..dc3583e64e9f 100644
--- a/deps/LIEF/include/LIEF/BinaryStream/FileStream.hpp
+++ b/deps/LIEF/include/LIEF/BinaryStream/FileStream.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,8 +33,7 @@ class LIEF_API FileStream : public BinaryStream {
FileStream(std::ifstream fs, uint64_t size) :
BinaryStream(STREAM_TYPE::FILE),
ifs_(std::move(fs)),
- size_(size)
- {}
+ size_(size) {}
FileStream() = delete;
@@ -56,7 +55,7 @@ class LIEF_API FileStream : public BinaryStream {
}
ok_error_t peek_in(void* dst, uint64_t offset, uint64_t size,
- uint64_t /* virtual_address */= 0) const override {
+ uint64_t /* virtual_address */ = 0) const override {
if (offset > size_ || offset + size > size_) {
return make_error_code(lief_errors::read_error);
}
diff --git a/deps/LIEF/include/LIEF/BinaryStream/MemoryStream.hpp b/deps/LIEF/include/LIEF/BinaryStream/MemoryStream.hpp
index 9bce7e764be3..bfa9588365b8 100644
--- a/deps/LIEF/include/LIEF/BinaryStream/MemoryStream.hpp
+++ b/deps/LIEF/include/LIEF/BinaryStream/MemoryStream.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,8 +35,7 @@ class LIEF_API MemoryStream : public BinaryStream {
MemoryStream(uintptr_t base_address, uint64_t size) :
BinaryStream(BinaryStream::STREAM_TYPE::MEMORY),
baseaddr_(base_address),
- size_(size)
- {}
+ size_(size) {}
MemoryStream(const MemoryStream&) = delete;
MemoryStream& operator=(const MemoryStream&) = delete;
@@ -45,7 +44,7 @@ class LIEF_API MemoryStream : public BinaryStream {
MemoryStream& operator=(MemoryStream&&) noexcept = default;
uintptr_t base_address() const {
- return this->baseaddr_;
+ return baseaddr_;
}
const uint8_t* p() const override {
@@ -60,18 +59,19 @@ class LIEF_API MemoryStream : public BinaryStream {
return start() + size_;
}
- void binary(Binary& bin) {
- this->binary_ = &bin;
- }
-
Binary* binary() {
- return this->binary_;
+ return binary_;
}
uint64_t size() const override {
return size_;
}
+ bool bind_binary(Binary& bin) override {
+ binary_ = &bin;
+ return true;
+ }
+
~MemoryStream() override = default;
static bool classof(const BinaryStream& stream) {
@@ -79,7 +79,8 @@ class LIEF_API MemoryStream : public BinaryStream {
}
protected:
- result read_at(uint64_t offset, uint64_t size, uint64_t va) const override;
+ result read_at(uint64_t offset, uint64_t size,
+ uint64_t va) const override;
uintptr_t baseaddr_ = 0;
uint64_t size_ = 0;
Binary* binary_ = nullptr;
diff --git a/deps/LIEF/include/LIEF/BinaryStream/SpanStream.hpp b/deps/LIEF/include/LIEF/BinaryStream/SpanStream.hpp
index ce7e8b4c0033..27ffea72cac2 100644
--- a/deps/LIEF/include/LIEF/BinaryStream/SpanStream.hpp
+++ b/deps/LIEF/include/LIEF/BinaryStream/SpanStream.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,21 +45,17 @@ class LIEF_API SpanStream : public BinaryStream {
}
SpanStream(span data) :
- SpanStream(data.data(), data.size())
- {}
+ SpanStream(data.data(), data.size()) {}
SpanStream(span data) :
- SpanStream(data.data(), data.size())
- {}
+ SpanStream(data.data(), data.size()) {}
SpanStream(const uint8_t* p, size_t size) :
BinaryStream(BinaryStream::STREAM_TYPE::SPAN),
- data_{p, p + size}
- {}
+ data_{p, p + size} {}
SpanStream(const std::vector& data) :
- SpanStream(data.data(), data.size())
- {}
+ SpanStream(data.data(), data.size()) {}
std::unique_ptr clone() const {
return std::unique_ptr(new SpanStream(*this));
@@ -94,7 +90,7 @@ class LIEF_API SpanStream : public BinaryStream {
}
result slice(size_t offset, size_t size) const {
- if (offset > data_.size() || (offset + size) > data_.size()) {
+ if (offset > data_.size() || size > data_.size() - offset) {
return make_error_code(lief_errors::read_out_of_bound);
}
return data_.subspan(offset, size);
@@ -115,9 +111,10 @@ class LIEF_API SpanStream : public BinaryStream {
~SpanStream() override = default;
protected:
- result read_at(uint64_t offset, uint64_t size, uint64_t /*va*/) const override {
+ result read_at(uint64_t offset, uint64_t size,
+ uint64_t /*va*/) const override {
const uint64_t stream_size = this->size();
- if (offset > stream_size || (offset + size) > stream_size) {
+ if (offset > stream_size || size > stream_size - offset) {
return make_error_code(lief_errors::read_error);
}
return data_.data() + offset;
diff --git a/deps/LIEF/include/LIEF/BinaryStream/VectorStream.hpp b/deps/LIEF/include/LIEF/BinaryStream/VectorStream.hpp
index 44293aa8c857..7d17d97a4c52 100644
--- a/deps/LIEF/include/LIEF/BinaryStream/VectorStream.hpp
+++ b/deps/LIEF/include/LIEF/BinaryStream/VectorStream.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,8 +36,7 @@ class LIEF_API VectorStream : public BinaryStream {
VectorStream(std::vector data) :
BinaryStream(BinaryStream::STREAM_TYPE::VECTOR),
binary_(std::move(data)),
- size_(binary_.size())
- {}
+ size_(binary_.size()) {}
VectorStream() = delete;
@@ -82,9 +81,10 @@ class LIEF_API VectorStream : public BinaryStream {
}
protected:
- result read_at(uint64_t offset, uint64_t size, uint64_t /*va*/) const override {
+ result read_at(uint64_t offset, uint64_t size,
+ uint64_t /*va*/) const override {
const uint64_t stream_size = this->size();
- if (offset > stream_size || (offset + size) > stream_size) {
+ if (offset > stream_size || size > stream_size - offset) {
return make_error_code(lief_errors::read_error);
}
return binary_.data() + offset;
diff --git a/deps/LIEF/include/LIEF/COFF.hpp b/deps/LIEF/include/LIEF/COFF.hpp
index dcc13dbde0d3..64775817a3cd 100644
--- a/deps/LIEF/include/LIEF/COFF.hpp
+++ b/deps/LIEF/include/LIEF/COFF.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,30 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef LIEF_COFF_H
-#define LIEF_COFF_H
+#ifndef LIEF_COFF_H
+#define LIEF_COFF_H
#include "LIEF/config.h"
#if defined(LIEF_COFF_SUPPORT)
-#include "LIEF/COFF/Binary.hpp"
-#include "LIEF/COFF/utils.hpp"
-#include "LIEF/COFF/Parser.hpp"
-#include "LIEF/COFF/Header.hpp"
-#include "LIEF/COFF/BigObjHeader.hpp"
-#include "LIEF/COFF/RegularHeader.hpp"
-#include "LIEF/COFF/ParserConfig.hpp"
-#include "LIEF/COFF/Section.hpp"
-#include "LIEF/COFF/Relocation.hpp"
-#include "LIEF/COFF/Symbol.hpp"
-#include "LIEF/COFF/String.hpp"
+ #include "LIEF/COFF/Binary.hpp"
+ #include "LIEF/COFF/utils.hpp"
+ #include "LIEF/COFF/Parser.hpp"
+ #include "LIEF/COFF/Header.hpp"
+ #include "LIEF/COFF/BigObjHeader.hpp"
+ #include "LIEF/COFF/RegularHeader.hpp"
+ #include "LIEF/COFF/ParserConfig.hpp"
+ #include "LIEF/COFF/Section.hpp"
+ #include "LIEF/COFF/Relocation.hpp"
+ #include "LIEF/COFF/Symbol.hpp"
+ #include "LIEF/COFF/String.hpp"
-#include "LIEF/COFF/AuxiliarySymbol.hpp"
-#include "LIEF/COFF/AuxiliarySymbols/AuxiliarybfAndefSymbol.hpp"
-#include "LIEF/COFF/AuxiliarySymbols/AuxiliaryCLRToken.hpp"
-#include "LIEF/COFF/AuxiliarySymbols/AuxiliaryFile.hpp"
-#include "LIEF/COFF/AuxiliarySymbols/AuxiliaryFunctionDefinition.hpp"
-#include "LIEF/COFF/AuxiliarySymbols/AuxiliarySectionDefinition.hpp"
-#include "LIEF/COFF/AuxiliarySymbols/AuxiliaryWeakExternal.hpp"
+ #include "LIEF/COFF/AuxiliarySymbol.hpp"
+ #include "LIEF/COFF/AuxiliarySymbols/AuxiliarybfAndefSymbol.hpp"
+ #include "LIEF/COFF/AuxiliarySymbols/AuxiliaryCLRToken.hpp"
+ #include "LIEF/COFF/AuxiliarySymbols/AuxiliaryFile.hpp"
+ #include "LIEF/COFF/AuxiliarySymbols/AuxiliaryFunctionDefinition.hpp"
+ #include "LIEF/COFF/AuxiliarySymbols/AuxiliarySectionDefinition.hpp"
+ #include "LIEF/COFF/AuxiliarySymbols/AuxiliaryWeakExternal.hpp"
#endif
#endif
diff --git a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbol.hpp b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbol.hpp
index 398776a324d4..9d7970f57880 100644
--- a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbol.hpp
+++ b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbol.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
#include
#include
+#include "LIEF/compiler_attributes.hpp"
#include "LIEF/visibility.h"
#include "LIEF/span.hpp"
@@ -32,14 +33,12 @@ class Symbol;
/// Class that represents an auxiliary symbol.
///
/// An auxiliary symbol has the same size as a regular LIEF::PE::Symbol (18
-/// bytes) but its content depends on the the parent symbol.
+/// bytes) but its content depends on the parent symbol.
class LIEF_API AuxiliarySymbol {
public:
AuxiliarySymbol() = default;
AuxiliarySymbol(std::vector payload) :
- type_(TYPE::UNKNOWN),
- payload_(std::move(payload))
- {}
+ payload_(std::move(payload)) {}
AuxiliarySymbol(const AuxiliarySymbol&) = default;
AuxiliarySymbol& operator=(const AuxiliarySymbol&) = default;
@@ -47,7 +46,7 @@ class LIEF_API AuxiliarySymbol {
AuxiliarySymbol& operator=(AuxiliarySymbol&&) = default;
LIEF_LOCAL static std::unique_ptr
- parse(Symbol& sym, std::vector payload);
+ parse(Symbol& sym, std::vector payload);
virtual std::unique_ptr clone() const {
return std::unique_ptr(new AuxiliarySymbol(*this));
@@ -59,19 +58,22 @@ class LIEF_API AuxiliarySymbol {
CLR_TOKEN,
/// Auxiliary Format 1 from the PE-COFF documentation
FUNC_DEF,
+
/// Auxiliary Format 2: .bf and .ef Symbols from the PE-COFF documentation
BF_AND_EF,
+
/// Auxiliary Format 3: Weak Externals from the PE-COFF documentation
WEAK_EXTERNAL,
+
/// Auxiliary Format 4: Files from the PE-COFF documentation
FILE,
+
/// Auxiliary Format 5: Section Definitions from the PE-COFF documentation
SEC_DEF,
};
AuxiliarySymbol(TYPE ty) :
- type_(ty)
- {}
+ type_(ty) {}
static TYPE get_aux_type(const Symbol& sym);
@@ -80,11 +82,11 @@ class LIEF_API AuxiliarySymbol {
}
/// For unknown type **only**, return the raw representation of this symbol
- span payload() const {
+ span payload() const LIEF_LIFETIMEBOUND {
return payload_;
}
- span payload() {
+ span payload() LIEF_LIFETIMEBOUND {
return payload_;
}
@@ -92,7 +94,7 @@ class LIEF_API AuxiliarySymbol {
virtual ~AuxiliarySymbol() = default;
- /// Helper to **downcast** a AuxiliarySymbol into a concrete implementation
+ /// Helper to **downcast** an AuxiliarySymbol into a concrete implementation
template
const T* as() const {
static_assert(std::is_base_of::value,
@@ -108,9 +110,8 @@ class LIEF_API AuxiliarySymbol {
return const_cast(static_cast(this)->as());
}
- LIEF_API friend
- std::ostream& operator<<(std::ostream& os, const AuxiliarySymbol& aux)
- {
+ LIEF_API friend std::ostream& operator<<(std::ostream& os,
+ const AuxiliarySymbol& aux) {
os << aux.to_string();
return os;
}
diff --git a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryCLRToken.hpp b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryCLRToken.hpp
index cc2ee5feb71f..65059a062499 100644
--- a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryCLRToken.hpp
+++ b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryCLRToken.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
#include
+#include "LIEF/compiler_attributes.hpp"
#include "LIEF/visibility.h"
#include "LIEF/COFF/AuxiliarySymbol.hpp"
@@ -32,11 +33,10 @@ class LIEF_API AuxiliaryCLRToken : public AuxiliarySymbol {
friend class Parser;
LIEF_LOCAL static std::unique_ptr
- parse(const std::vector& payload);
+ parse(const std::vector& payload);
AuxiliaryCLRToken() :
- AuxiliarySymbol(AuxiliarySymbol::TYPE::CLR_TOKEN)
- {}
+ AuxiliarySymbol(AuxiliarySymbol::TYPE::CLR_TOKEN) {}
AuxiliaryCLRToken(uint8_t aux_type, uint8_t reserved, uint32_t symbol_idx,
std::vector rgb_reserved) :
@@ -44,8 +44,7 @@ class LIEF_API AuxiliaryCLRToken : public AuxiliarySymbol {
aux_type_(aux_type),
reserved_(reserved),
symbol_idx_(symbol_idx),
- rgb_reserved_(std::move(rgb_reserved))
- {}
+ rgb_reserved_(std::move(rgb_reserved)) {}
AuxiliaryCLRToken(const AuxiliaryCLRToken&) = default;
AuxiliaryCLRToken& operator=(const AuxiliaryCLRToken&) = default;
@@ -82,7 +81,7 @@ class LIEF_API AuxiliaryCLRToken : public AuxiliarySymbol {
}
/// Reserved (padding) values. Should be 0
- span rgb_reserved() const {
+ span rgb_reserved() const LIEF_LIFETIMEBOUND {
return rgb_reserved_;
}
@@ -93,6 +92,7 @@ class LIEF_API AuxiliaryCLRToken : public AuxiliarySymbol {
}
~AuxiliaryCLRToken() override = default;
+
private:
uint8_t aux_type_ = 0;
uint8_t reserved_ = 0;
diff --git a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryFile.hpp b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryFile.hpp
index 28ed0142d341..102fa70141ce 100644
--- a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryFile.hpp
+++ b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryFile.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,20 +29,19 @@ namespace COFF {
/// The Symbol::name itself should start with `.file`, and this auxiliary record
/// gives the name of a source-code file.
///
-/// Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-4-files
+/// Reference:
+/// https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-4-files
class LIEF_API AuxiliaryFile : public AuxiliarySymbol {
public:
LIEF_LOCAL static std::unique_ptr
- parse(const std::vector& payload);
+ parse(const std::vector& payload);
AuxiliaryFile() :
- AuxiliarySymbol(AuxiliarySymbol::TYPE::FILE)
- {}
+ AuxiliarySymbol(AuxiliarySymbol::TYPE::FILE) {}
AuxiliaryFile(std::string file) :
AuxiliarySymbol(AuxiliarySymbol::TYPE::FILE),
- filename_(std::move(file))
- {}
+ filename_(std::move(file)) {}
AuxiliaryFile(const AuxiliaryFile&) = default;
AuxiliaryFile& operator=(const AuxiliaryFile&) = default;
diff --git a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryFunctionDefinition.hpp b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryFunctionDefinition.hpp
index a3f184ff7610..05e92ea04dd8 100644
--- a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryFunctionDefinition.hpp
+++ b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryFunctionDefinition.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,35 +26,36 @@ namespace COFF {
/// This auxiliary symbols marks the beginning of a function definition.
///
-/// Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-1-function-definitions
+/// Reference:
+/// https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-1-function-definitions
class LIEF_API AuxiliaryFunctionDefinition : public AuxiliarySymbol {
public:
LIEF_LOCAL static std::unique_ptr
- parse(const std::vector& payload);
+ parse(const std::vector& payload);
AuxiliaryFunctionDefinition() :
- AuxiliarySymbol(AuxiliarySymbol::TYPE::FUNC_DEF)
- {}
+ AuxiliarySymbol(AuxiliarySymbol::TYPE::FUNC_DEF) {}
- AuxiliaryFunctionDefinition(uint32_t tagidx, uint32_t totalsz,
- uint32_t ptr_line, uint32_t ptr_next_func,
- uint16_t padding) :
+ AuxiliaryFunctionDefinition(uint32_t tagidx, uint32_t totalsz, uint32_t ptr_line,
+ uint32_t ptr_next_func, uint16_t padding) :
AuxiliarySymbol(AuxiliarySymbol::TYPE::FUNC_DEF),
tag_index_(tagidx),
total_size_(totalsz),
ptr_to_linenb_(ptr_line),
ptr_to_next_func_(ptr_next_func),
- padding_(padding)
- {}
+ padding_(padding) {}
AuxiliaryFunctionDefinition(const AuxiliaryFunctionDefinition&) = default;
- AuxiliaryFunctionDefinition& operator=(const AuxiliaryFunctionDefinition&) = default;
+ AuxiliaryFunctionDefinition&
+ operator=(const AuxiliaryFunctionDefinition&) = default;
AuxiliaryFunctionDefinition(AuxiliaryFunctionDefinition&&) = default;
AuxiliaryFunctionDefinition& operator=(AuxiliaryFunctionDefinition&&) = default;
std::unique_ptr clone() const override {
- return std::unique_ptr(new AuxiliaryFunctionDefinition{*this});
+ return std::unique_ptr(
+ new AuxiliaryFunctionDefinition{*this}
+ );
}
/// The symbol-table index of the corresponding `.bf` (begin function)
diff --git a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliarySectionDefinition.hpp b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliarySectionDefinition.hpp
index 9037b7700af3..bcb36590a3bb 100644
--- a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliarySectionDefinition.hpp
+++ b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliarySectionDefinition.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,11 +30,10 @@ namespace COFF {
class LIEF_API AuxiliarySectionDefinition : public AuxiliarySymbol {
public:
LIEF_LOCAL static std::unique_ptr
- parse(const std::vector& payload);
+ parse(const std::vector& payload);
AuxiliarySectionDefinition() :
- AuxiliarySymbol(AuxiliarySymbol::TYPE::SEC_DEF)
- {}
+ AuxiliarySymbol(AuxiliarySymbol::TYPE::SEC_DEF) {}
AuxiliarySectionDefinition(uint32_t length, uint16_t nb_relocs,
uint16_t nb_lines, uint32_t checksum,
@@ -47,27 +46,30 @@ class LIEF_API AuxiliarySectionDefinition : public AuxiliarySymbol {
checksum_(checksum),
sec_idx_(sec_idx),
selection_((COMDAT_SELECTION)selection),
- reserved_(reserved)
- {}
+ reserved_(reserved) {}
AuxiliarySectionDefinition(const AuxiliarySectionDefinition&) = default;
- AuxiliarySectionDefinition& operator=(const AuxiliarySectionDefinition&) = default;
+ AuxiliarySectionDefinition&
+ operator=(const AuxiliarySectionDefinition&) = default;
AuxiliarySectionDefinition(AuxiliarySectionDefinition&&) = default;
AuxiliarySectionDefinition& operator=(AuxiliarySectionDefinition&&) = default;
std::unique_ptr clone() const override {
- return std::unique_ptr(new AuxiliarySectionDefinition{*this});
+ return std::unique_ptr(
+ new AuxiliarySectionDefinition{*this}
+ );
}
/// Values for the AuxiliarySectionDefinition::selection attribute
///
- /// See: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only
+ /// See:
+ /// https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only
enum class COMDAT_SELECTION : uint8_t {
NONE = 0,
- /// If this symbol is already defined, the linker issues a `multiply defined symbol`
- /// error.
+ /// If this symbol is already defined, the linker issues a `multiply defined
+ /// symbol` error.
NODUPLICATES = 1,
/// Any section that defines the same COMDAT symbol can be linked; the rest
@@ -75,8 +77,8 @@ class LIEF_API AuxiliarySectionDefinition : public AuxiliarySymbol {
ANY,
/// The linker chooses an arbitrary section among the definitions for this
- /// symbol. If all definitions are not the same size, a `multiply defined symbol`
- /// error is issued.
+ /// symbol. If all definitions are not the same size, a `multiply defined
+ /// symbol` error is issued.
SAME_SIZE,
/// The linker chooses an arbitrary section among the definitions for this
@@ -100,7 +102,7 @@ class LIEF_API AuxiliarySectionDefinition : public AuxiliarySymbol {
/// The linker chooses the largest definition from among all of the definitions
/// for this symbol. If multiple definitions have this size, the choice
/// between them is arbitrary.
- LARGEST
+ LARGEST,
};
/// The size of section data. The same as `SizeOfRawData` in the section header.
diff --git a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryWeakExternal.hpp b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryWeakExternal.hpp
index 488f787dec12..7f79aa760fe2 100644
--- a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryWeakExternal.hpp
+++ b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliaryWeakExternal.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
#include
#include
+#include "LIEF/compiler_attributes.hpp"
#include "LIEF/visibility.h"
#include "LIEF/COFF/AuxiliarySymbol.hpp"
@@ -34,37 +35,39 @@ namespace COFF {
///
/// If a definition of `sym1` is linked, then an external reference to the
/// symbol is resolved normally. If a definition of `sym1` is not linked, then all
-/// references to the weak external for `sym1` refer to `sym2` instead. The external
-/// symbol, `sym2`, must always be linked; typically, it is defined in the module
-/// that contains the weak reference to `sym1`.
+/// references to the weak external for `sym1` refer to `sym2` instead. The
+/// external symbol, `sym2`, must always be linked; typically, it is defined in the
+/// module that contains the weak reference to `sym1`.
///
-/// Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-3-weak-externals
+/// Reference:
+/// https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-3-weak-externals
class LIEF_API AuxiliaryWeakExternal : public AuxiliarySymbol {
public:
enum class CHARACTERISTICS : uint32_t {
/// No library search for `sym1` should be performed.
SEARCH_NOLIBRARY = 1,
- ///A library search for `sym1` should be performed.
+
+ /// A library search for `sym1` should be performed.
SEARCH_LIBRARY = 2,
+
/// `sym1` is an alias for sym2
SEARCH_ALIAS = 3,
- ANTI_DEPENDENCY = 4
+
+ ANTI_DEPENDENCY = 4,
};
LIEF_LOCAL static std::unique_ptr
- parse(const std::vector& payload);
+ parse(const std::vector& payload);
AuxiliaryWeakExternal() :
- AuxiliarySymbol(AuxiliarySymbol::TYPE::WEAK_EXTERNAL)
- {}
+ AuxiliarySymbol(AuxiliarySymbol::TYPE::WEAK_EXTERNAL) {}
AuxiliaryWeakExternal(uint32_t sym_idx, uint32_t characteristics,
std::vector padding) :
AuxiliarySymbol(AuxiliarySymbol::TYPE::WEAK_EXTERNAL),
sym_idx_(sym_idx),
characteristics_(characteristics),
- padding_(std::move(padding))
- {
+ padding_(std::move(padding)) {
assert(padding_.size() == 10);
}
@@ -75,7 +78,9 @@ class LIEF_API AuxiliaryWeakExternal : public AuxiliarySymbol {
AuxiliaryWeakExternal& operator=(AuxiliaryWeakExternal&&) = default;
std::unique_ptr clone() const override {
- return std::unique_ptr(new AuxiliaryWeakExternal{*this});
+ return std::unique_ptr(
+ new AuxiliaryWeakExternal{*this}
+ );
}
/// The symbol-table index of `sym2`, the symbol to be linked if `sym1` is not
@@ -88,7 +93,7 @@ class LIEF_API AuxiliaryWeakExternal : public AuxiliarySymbol {
return (CHARACTERISTICS)characteristics_;
}
- span padding() const {
+ span padding() const LIEF_LIFETIMEBOUND {
return padding_;
}
diff --git a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliarybfAndefSymbol.hpp b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliarybfAndefSymbol.hpp
index 53b0666b5888..c76b7de392cf 100644
--- a/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliarybfAndefSymbol.hpp
+++ b/deps/LIEF/include/LIEF/COFF/AuxiliarySymbols/AuxiliarybfAndefSymbol.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,11 +28,10 @@ namespace COFF {
class LIEF_API AuxiliarybfAndefSymbol : public AuxiliarySymbol {
public:
LIEF_LOCAL static std::unique_ptr
- parse(Symbol& sym, const std::vector& payload);
+ parse(Symbol& sym, const std::vector& payload);
AuxiliarybfAndefSymbol() :
- AuxiliarySymbol(AuxiliarySymbol::TYPE::BF_AND_EF)
- {}
+ AuxiliarySymbol(AuxiliarySymbol::TYPE::BF_AND_EF) {}
AuxiliarybfAndefSymbol(const AuxiliarybfAndefSymbol&) = default;
AuxiliarybfAndefSymbol& operator=(const AuxiliarybfAndefSymbol&) = default;
@@ -41,7 +40,9 @@ class LIEF_API AuxiliarybfAndefSymbol : public AuxiliarySymbol {
AuxiliarybfAndefSymbol& operator=(AuxiliarybfAndefSymbol&&) = default;
std::unique_ptr clone() const override {
- return std::unique_ptr(new AuxiliarybfAndefSymbol{*this});
+ return std::unique_ptr(
+ new AuxiliarybfAndefSymbol{*this}
+ );
}
std::string to_string() const override {
diff --git a/deps/LIEF/include/LIEF/COFF/BigObjHeader.hpp b/deps/LIEF/include/LIEF/COFF/BigObjHeader.hpp
index a793092cd648..1ae5597453dd 100644
--- a/deps/LIEF/include/LIEF/COFF/BigObjHeader.hpp
+++ b/deps/LIEF/include/LIEF/COFF/BigObjHeader.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
#include "LIEF/COFF/Header.hpp"
+#include "LIEF/compiler_attributes.hpp"
#include "LIEF/visibility.h"
#include "LIEF/span.hpp"
@@ -35,8 +36,7 @@ class LIEF_API BigObjHeader : public Header {
public:
static constexpr auto UUID_SZ = 16;
BigObjHeader() :
- Header(KIND::BIGOBJ)
- {}
+ Header(KIND::BIGOBJ) {}
static std::unique_ptr create(BinaryStream& stream);
@@ -55,8 +55,9 @@ class LIEF_API BigObjHeader : public Header {
return version_;
}
- /// Originally named `ClassID`, this uuid should match: `{D1BAA1C7-BAEE-4ba9-AF20-FAF66AA4DCB8}`
- span uuid() const {
+ /// Originally named `ClassID`, this uuid should match:
+ /// `{D1BAA1C7-BAEE-4ba9-AF20-FAF66AA4DCB8}`
+ span uuid() const LIEF_LIFETIMEBOUND {
return uuid_;
}
diff --git a/deps/LIEF/include/LIEF/COFF/Binary.hpp b/deps/LIEF/include/LIEF/COFF/Binary.hpp
index 9467836970e7..4b0cb9f5b204 100644
--- a/deps/LIEF/include/LIEF/COFF/Binary.hpp
+++ b/deps/LIEF/include/LIEF/COFF/Binary.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,7 +61,8 @@ class LIEF_API Binary {
using it_relocations = ref_iterator;
/// Iterator that outputs const Relocation& object
- using it_const_relocations = const_ref_iterator;
+ using it_const_relocations =
+ const_ref_iterator;
/// Internal container used to store COFF's strings
using strings_table_t = std::vector;
@@ -100,88 +101,92 @@ class LIEF_API Binary {
}
/// Iterator over the different sections located in this COFF binary
- it_sections sections() {
+ it_sections sections() LIEF_LIFETIMEBOUND {
return sections_;
}
- it_const_sections sections() const {
+ it_const_sections sections() const LIEF_LIFETIMEBOUND {
return sections_;
}
/// Iterator over **all** the relocations used by this COFF binary
- it_relocations relocations() {
+ it_relocations relocations() LIEF_LIFETIMEBOUND {
return relocations_;
}
- it_const_relocations relocations() const {
+ it_const_relocations relocations() const LIEF_LIFETIMEBOUND {
return relocations_;
}
/// Iterator over the COFF's symbols
- it_symbols symbols() {
+ it_symbols symbols() LIEF_LIFETIMEBOUND {
return symbols_;
}
- it_const_symbols symbols() const {
+ it_const_symbols symbols() const LIEF_LIFETIMEBOUND {
return symbols_;
}
/// Iterator over the COFF's strings
- it_const_strings_table string_table() const {
+ it_const_strings_table string_table() const LIEF_LIFETIMEBOUND {
return strings_table_;
}
- it_strings_table string_table() {
+ it_strings_table string_table() LIEF_LIFETIMEBOUND {
return strings_table_;
}
/// Try to find the COFF string at the given offset in the COFF string table.
///
- /// \warning This offset must include the first 4 bytes holding the size of
+ /// @warning This offset must include the first 4 bytes holding the size of
/// the table. Hence, the first string starts a the offset 4.
- String* find_string(uint32_t offset) {
+ String* find_string(uint32_t offset) LIEF_LIFETIMEBOUND {
auto it = std::find_if(strings_table_.begin(), strings_table_.end(),
- [offset] (const String& item) {
- return offset == item.offset();
- }
- );
+ [offset](const String& item) {
+ return offset == item.offset();
+ });
return it == strings_table_.end() ? nullptr : &*it;
}
- const String* find_string(uint32_t offset) const {
+ const String* find_string(uint32_t offset) const LIEF_LIFETIMEBOUND {
return const_cast(this)->find_string(offset);
}
/// Iterator over the functions implemented in this COFF
- it_const_function functions() const;
+ it_const_function functions() const LIEF_LIFETIMEBOUND;
- it_functions functions();
+ it_functions functions() LIEF_LIFETIMEBOUND;
/// Try to find the function (symbol) with the given name
- const Symbol* find_function(const std::string& name) const;
+ const Symbol* find_function(const std::string& name) const LIEF_LIFETIMEBOUND;
- Symbol* find_function(const std::string& name) {
- return const_cast(static_cast(this)->find_function(name));
+ Symbol* find_function(const std::string& name) LIEF_LIFETIMEBOUND {
+ return const_cast(
+ static_cast(this)->find_function(name)
+ );
}
/// Try to find the function (symbol) with the given **demangled** name
- const Symbol* find_demangled_function(const std::string& name) const;
+ const Symbol*
+ find_demangled_function(const std::string& name) const LIEF_LIFETIMEBOUND;
- Symbol* find_demangled_function(const std::string& name) {
- return const_cast(static_cast(this)->find_demangled_function(name));
+ Symbol* find_demangled_function(const std::string& name) LIEF_LIFETIMEBOUND {
+ return const_cast(
+ static_cast(this)->find_demangled_function(name)
+ );
}
/// Disassemble code for the given symbol
///
/// ```cpp
- /// const Symbol* func = binary->find_demangled_function("int __cdecl my_function(int, int)");
- /// auto insts = binary->disassemble(*func);
- /// for (std::unique_ptr inst : insts) {
+ /// const Symbol* func = binary->find_demangled_function("int __cdecl
+ /// my_function(int, int)"); auto insts = binary->disassemble(*func); for
+ /// (std::unique_ptr inst : insts) {
/// std::cout << inst->to_string() << '\n';
/// }
/// ```
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(const Symbol& symbol) const;
/// Disassemble code for the given symbol name
@@ -193,13 +198,13 @@ class LIEF_API Binary {
/// }
/// ```
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(const std::string& symbol) const;
/// Disassemble code provided by the given buffer at the specified
/// `address` parameter.
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(const uint8_t* buffer, size_t size,
uint64_t address = 0) const;
@@ -207,7 +212,7 @@ class LIEF_API Binary {
/// Disassemble code provided by the given vector of bytes at the specified
/// `address` parameter.
///
- /// \see LIEF::assembly::Instruction
+ /// @see LIEF::assembly::Instruction
instructions_it disassemble(const std::vector& buffer,
uint64_t address = 0) const {
return disassemble(buffer.data(), buffer.size(), address);
@@ -218,7 +223,8 @@ class LIEF_API Binary {
return disassemble(buffer.data(), buffer.size(), address);
}
- instructions_it disassemble(LIEF::span buffer, uint64_t address = 0) const {
+ instructions_it disassemble(LIEF::span buffer,
+ uint64_t address = 0) const {
return disassemble(buffer.data(), buffer.size(), address);
}
diff --git a/deps/LIEF/include/LIEF/COFF/Header.hpp b/deps/LIEF/include/LIEF/COFF/Header.hpp
index 5239b73faa49..a2b3038c53c7 100644
--- a/deps/LIEF/include/LIEF/COFF/Header.hpp
+++ b/deps/LIEF/include/LIEF/COFF/Header.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,11 +32,10 @@ namespace COFF {
/// `/bigobj` files
class LIEF_API Header {
public:
-
enum class KIND {
UNKNOWN = 0,
REGULAR,
- BIGOBJ
+ BIGOBJ,
};
/// The different architectures (mirrored from PE)
@@ -48,8 +47,7 @@ class LIEF_API Header {
Header() = default;
Header(KIND kind) :
- kind_(kind)
- {}
+ kind_(kind) {}
Header& operator=(const Header&) = default;
Header(const Header&) = default;
@@ -119,8 +117,7 @@ class LIEF_API Header {
template
const T* as() const {
- static_assert(std::is_base_of::value,
- "Require Header inheritance");
+ static_assert(std::is_base_of::value, "Require Header inheritance");
if (T::classof(this)) {
return static_cast(this);
}
diff --git a/deps/LIEF/include/LIEF/COFF/Parser.hpp b/deps/LIEF/include/LIEF/COFF/Parser.hpp
index fa1a5ff79d7d..206cfa7325c2 100644
--- a/deps/LIEF/include/LIEF/COFF/Parser.hpp
+++ b/deps/LIEF/include/LIEF/COFF/Parser.hpp
@@ -1,5 +1,5 @@
-/* Copyright 2017 - 2025 R. Thomas
- * Copyright 2017 - 2025 Quarkslab
+/* Copyright 2017 - 2026 R. Thomas
+ * Copyright 2017 - 2026 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,10 @@
#ifndef LIEF_COFF_PARSER_H
#define LIEF_COFF_PARSER_H
#include