diff --git a/.configurations/configuration.dsc.yaml b/.configurations/configuration.dsc.yaml
index f428817fea4ddb..9e38aaba78a412 100644
--- a/.configurations/configuration.dsc.yaml
+++ b/.configurations/configuration.dsc.yaml
@@ -5,11 +5,11 @@ properties:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: pythonPackage
directives:
- description: Install Python 3.12
+ description: Install Python 3.14
module: Microsoft.WinGet.DSC
allowPrerelease: true
settings:
- id: Python.Python.3.12
+ id: Python.Python.3.14
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
@@ -51,4 +51,4 @@ properties:
settings:
id: Nasm.Nasm
source: winget
- configurationVersion: 0.1.0
+ configurationVersion: 0.1.1
diff --git a/.configurations/configuration.vsEnterprise.dsc.yaml b/.configurations/configuration.vsEnterprise.dsc.yaml
index 48ba6bb0354669..4faf7d77d371d6 100644
--- a/.configurations/configuration.vsEnterprise.dsc.yaml
+++ b/.configurations/configuration.vsEnterprise.dsc.yaml
@@ -5,11 +5,11 @@ properties:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: pythonPackage
directives:
- description: Install Python 3.12
+ description: Install Python 3.14
module: Microsoft.WinGet.DSC
allowPrerelease: true
settings:
- id: Python.Python.3.12
+ id: Python.Python.3.14
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
@@ -51,4 +51,4 @@ properties:
settings:
id: Nasm.Nasm
source: winget
- configurationVersion: 0.1.0
+ configurationVersion: 0.1.1
diff --git a/.configurations/configuration.vsProfessional.dsc.yaml b/.configurations/configuration.vsProfessional.dsc.yaml
index 7c2c58bc0155e2..e094059e826c0e 100644
--- a/.configurations/configuration.vsProfessional.dsc.yaml
+++ b/.configurations/configuration.vsProfessional.dsc.yaml
@@ -5,11 +5,11 @@ properties:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: pythonPackage
directives:
- description: Install Python 3.12
+ description: Install Python 3.14
module: Microsoft.WinGet.DSC
allowPrerelease: true
settings:
- id: Python.Python.3.12
+ id: Python.Python.3.14
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
@@ -51,4 +51,4 @@ properties:
settings:
id: Nasm.Nasm
source: winget
- configurationVersion: 0.1.0
+ configurationVersion: 0.1.1
diff --git a/.devcontainer/base/devcontainer.json b/.devcontainer/base/devcontainer.json
index 9d14ab87572bea..083123eccacaa4 100644
--- a/.devcontainer/base/devcontainer.json
+++ b/.devcontainer/base/devcontainer.json
@@ -7,5 +7,6 @@
"mounts": [
"source=node-devcontainer-cache,target=/home/developer/nodejs/node/out,type=volume"
],
- "postCreateCommand": "git restore-mtime"
+ "postCreateCommand": "git restore-mtime",
+ "postStartCommand": "cp /home/developer/envrc/static-libs.envrc /home/developer/nodejs/node/.envrc && direnv allow /home/developer/nodejs/node"
}
diff --git a/.gitattributes b/.gitattributes
index bbfe62e6a034fd..36b6c2b11d095b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,5 +1,7 @@
test/fixtures/* -text
vcbuild.bat text eol=crlf
+# disable eol conversion in vendored files.
+deps/crates/vendor/**/* -text
deps/npm/bin/npm text eol=lf
deps/npm/bin/npx text eol=lf
deps/corepack/shims/corepack text eol=lf
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 0164937307a770..6f2749a758891e 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -153,6 +153,7 @@
/test/parallel/test-runner-* @nodejs/test_runner
# Single Executable Applications
+/deps/LIEF @nodejs/single-executable
/deps/postject @nodejs/single-executable
/doc/api/single-executable-applications.md @nodejs/single-executable
/doc/contributing/maintaining/maintaining-single-executable-application-support.md @nodejs/single-executable
@@ -160,6 +161,7 @@
/test/fixtures/postject-copy @nodejs/single-executable
/test/sea @nodejs/single-executable
/tools/dep_updaters/update-postject.sh @nodejs/single-executable
+/tools/dep_updaters/update-lief.sh @nodejs/single-executable
# Permission Model
/doc/api/permissions.md @nodejs/security-wg
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index 0ec17d486e7712..dc01fd3fdac591 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -5,10 +5,10 @@ contact_links:
about: Please file an issue in our help repo.
- name: 📦 Have an issue with npm?
url: https://github.com/npm/cli/issues
- about: npm has a seperate issue tracker.
+ about: npm has a separate issue tracker.
- name: 📡 Have an issue with undici? (`WebSocket`, `fetch`, etc.)
url: https://github.com/nodejs/undici/issues
- about: Undici has a seperate issue tracker.
+ about: Undici has a separate issue tracker.
- name: 🌐 Found a problem with nodejs.org beyond the API reference docs?
url: https://github.com/nodejs/nodejs.org/issues/new/choose
about: Please file an issue in the Node.js website repo.
diff --git a/.github/label-pr-config.yml b/.github/label-pr-config.yml
index 0b94dd5755d7d6..4ff8bee4c56d64 100644
--- a/.github/label-pr-config.yml
+++ b/.github/label-pr-config.yml
@@ -80,7 +80,7 @@ subSystemLabels:
/^deps\/v8\/tools\/gen-postmortem-metadata\.py/: v8 engine, python, post-mortem
/^deps\/v8\//: v8 engine
/^deps\/uvwasi\//: wasi
- /^deps\/npm\//: npm, fast-track
+ /^deps\/npm\//: npm
/^deps\/nghttp2\/nghttp2\.gyp/: build, http2
/^deps\/nghttp2\//: http2
/^deps\/ngtcp2\//: quic
@@ -100,11 +100,13 @@ subSystemLabels:
/^lib\/.*http2/: http2
/^lib\/worker_threads.js$/: worker
/^lib\/test.js$/: test_runner
+ /^lib\/v8.js$/: v8 module
/^lib\/internal\/url\.js$/: whatwg-url
/^lib\/internal\/modules\/esm/: esm
/^lib\/internal\/modules/: module
/^lib\/internal\/webstreams/: web streams
/^lib\/internal\/test_runner/: test_runner
+ /^lib\/internal\/v8\//: v8 module
# All other lib/ files map directly
/^lib\/_(\w+)_\w+\.js?$/: $1 # e.g. _(stream)_wrap
diff --git a/.github/workflows/lint-release-proposal.yml b/.github/workflows/lint-release-proposal.yml
index dbd8232fa40280..3ca5c5ce4f5ea5 100644
--- a/.github/workflows/lint-release-proposal.yml
+++ b/.github/workflows/lint-release-proposal.yml
@@ -26,6 +26,7 @@ jobs:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
+ fetch-depth: 2
- name: Lint release commit title format
run: |
EXPECTED_TITLE='^[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}, Version [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ (\(Current|'.+' \(LTS)\)$'
@@ -51,6 +52,29 @@ jobs:
- name: Verify it's release-ready
run: |
SKIP_XZ=1 make release-only
+ - name: Lint release commit content
+ run: |
+ MAJOR="$(awk '/^#define NODE_MAJOR_VERSION / { print $3 }' src/node_version.h)"
+
+ echo "Checking for expected files in the release commit:"
+ missing_expected=
+ for expected in CHANGELOG.md src/node_version.h doc/changelogs/; do
+ if git diff --exit-code --quiet --diff-filter=M HEAD^ -- "$expected"; then
+ echo "Missing expected file in diff: $expected"
+ missing_expected=1
+ fi
+ done
+ [ -z "$missing_expected" ] || exit 1
+
+ echo "Checking for unexpected files in the release commit:"
+ set -ex
+ [ -z "$(git diff-tree --no-commit-id --name-only -r HEAD --\
+ . \
+ ':(exclude)CHANGELOG.md' \
+ ':(exclude)src/node_version.h' \
+ ':(exclude)test/parallel/test-process-release.js' \
+ ':(exclude)doc/api/' \
+ ":(exclude)doc/changelogs/CHANGELOG_V$MAJOR.md")" ]
- name: Validate CHANGELOG
id: releaser-info
run: |
diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
index ea8805083d4d83..2d0c8b4ff39ef1 100644
--- a/.github/workflows/linters.yml
+++ b/.github/workflows/linters.yml
@@ -153,7 +153,7 @@ jobs:
- name: Lint Nix files
run: |
nix-shell -I nixpkgs=./tools/nix/pkgs.nix -p 'nixfmt-tree' --run '
- treefmt --quiet --fail-on-change
+ treefmt --quiet --ci
' || git --no-pager diff --exit-code
lint-py:
diff --git a/.github/workflows/test-shared.yml b/.github/workflows/test-shared.yml
index 9ac028af6e6fa2..310640538414ab 100644
--- a/.github/workflows/test-shared.yml
+++ b/.github/workflows/test-shared.yml
@@ -23,6 +23,7 @@ on:
- deps/icu-small/**
- deps/icu-tmp/**
- deps/llhttp/**
+ - deps/nbytes/**
- deps/nghttp2/**
- deps/ngtcp2/**
- deps/openssl/*/**
@@ -71,6 +72,7 @@ on:
- deps/icu-small/**
- deps/icu-tmp/**
- deps/llhttp/**
+ - deps/nbytes/**
- deps/nghttp2/**
- deps/ngtcp2/**
- deps/openssl/*/**
diff --git a/.gitignore b/.gitignore
index bf839aa91c86e1..d283bce868da6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -144,6 +144,9 @@ tools/*/*.i.tmp
/deps/**/.github/
# Ignore dependencies fetched by tools/v8/fetch_deps.py
/deps/.cipd
+!deps/LIEF/**
+deps/LIEF/*.vcxproj*
+deps/LIEF/*.sln
# === Rules for Windows vcbuild.bat ===
/temp-vcbuild
diff --git a/BUILDING.md b/BUILDING.md
index 5428449b453127..8d0d7807e24090 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -222,9 +222,9 @@ Supported platforms and toolchains change with each major version of Node.js.
This document is only valid for the current major version of Node.js.
Consult previous versions of this document for older versions of Node.js:
-* [Node.js 21](https://github.com/nodejs/node/blob/v21.x/BUILDING.md)
+* [Node.js 24](https://github.com/nodejs/node/blob/v24.x/BUILDING.md)
+* [Node.js 22](https://github.com/nodejs/node/blob/v22.x/BUILDING.md)
* [Node.js 20](https://github.com/nodejs/node/blob/v20.x/BUILDING.md)
-* [Node.js 18](https://github.com/nodejs/node/blob/v18.x/BUILDING.md)
## Building Node.js on supported platforms
@@ -735,13 +735,13 @@ Refs:
##### Option 1: Manual install
-* The current [version of Python][Python versions] from the
- [Microsoft Store](https://apps.microsoft.com/store/search?publisher=Python+Software+Foundation)
+* The current [version of Python][Python downloads] by following the instructions in
+ [Using Python on Windows][].
* The "Desktop development with C++" workload from
[Visual Studio 2022 (17.13 or newer)](https://visualstudio.microsoft.com/downloads/)
or the "C++ build tools" workload from the
[Build Tools](https://aka.ms/vs/17/release/vs_buildtools.exe),
- with the default optional components. Starting with Node.js v24, ClangCL is required to compile
+ with the default optional components. As of Node.js 24.0.0, ClangCL is required to compile
on Windows. To enable it, two additional components are needed:
* C++ Clang Compiler for Windows (Microsoft.VisualStudio.Component.VC.Llvm.Clang)
* MSBuild support for LLVM toolset (Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset)
@@ -780,25 +780,17 @@ easily. These files will install the following
[WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/) packages:
* Git for Windows with the `git` and Unix tools added to the `PATH`
-* `Python 3.12`
+* `Python 3.14`
* `Visual Studio 2022` (Community, Enterprise or Professional)
* `Visual Studio 2022 Build Tools` with Visual C++ workload, Clang and ClangToolset
* `NetWide Assembler`
-To install Node.js prerequisites from Powershell Terminal:
+To install Node.js prerequisites from PowerShell Terminal:
```powershell
winget configure .\.configurations\configuration.dsc.yaml
```
-Alternatively, you can use [Dev Home](https://learn.microsoft.com/en-us/windows/dev-home/)
-to install the prerequisites:
-
-* Switch to `Machine Configuration` tab
-* Click on `Configuration File`
-* Choose the corresponding WinGet configuration file
-* Click on `Set up as admin`
-
##### Option 3: Automated install with Boxstarter
A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of
@@ -1136,4 +1128,6 @@ by opening a pull request against the registry available at
[AIX toolbox]: https://www.ibm.com/support/pages/aix-toolbox-open-source-software-overview
[Developer Mode]: https://learn.microsoft.com/en-us/windows/advanced-settings/developer-mode
+[Python downloads]: https://www.python.org/downloads/
[Python versions]: https://devguide.python.org/versions/
+[Using Python on Windows]: https://docs.python.org/3/using/windows.html
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 508885ce927086..d3de0845b3d39b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,7 +41,8 @@ release.
-25.4.0
+25.5.0
+25.4.0
25.3.0
25.2.1
25.2.0
diff --git a/LICENSE b/LICENSE
index 8090eacac19436..9901165e6892ce 100644
--- a/LICENSE
+++ b/LICENSE
@@ -899,6 +899,32 @@ The externally maintained libraries used by Node.js are:
written prior permission. M.I.T. makes no representations about the
suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
+
+ ----------------------------------------------------------------------
+
+ File: sorttable.js (only for ICU4J)
+
+ The MIT Licence, for code from kryogenix.org
+
+ Code downloaded from the Browser Experiments section of kryogenix.org is
+ licenced under the so-called MIT licence. The licence is below.
+
+ Copyright (c) 1997-date Stuart Langridge
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
"""
- libuv, located at deps/uv, is licensed as follows:
@@ -960,6 +986,212 @@ The externally maintained libraries used by Node.js are:
license.
"""
+- LIEF, located at deps/LIEF, is licensed as follows:
+ """
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2017 - 2025 R. Thomas
+ Copyright 2017 - 2025 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.
+ """
+
- llhttp, located at deps/llhttp, is licensed as follows:
"""
This software is licensed under the MIT License.
@@ -1022,7 +1254,8 @@ The externally maintained libraries used by Node.js are:
SOFTWARE.
"""
-- postject, located at test/fixtures/postject-copy, is licensed as follows:
+- postject, located at test/fixtures/postject-copy and used as a basis for
+ src/node_sea_bin.cc, is licensed as follows:
"""
Postject is licensed for use as follows:
diff --git a/Makefile b/Makefile
index 5afee2318c9bca..71f12062dd92e9 100644
--- a/Makefile
+++ b/Makefile
@@ -301,7 +301,6 @@ coverage-report-js: ## Report JavaScript coverage results.
cctest: all ## Run the C++ tests using the built `cctest` executable.
@out/$(BUILDTYPE)/$@ --gtest_filter=$(GTEST_FILTER)
- '$(OUT_NODE)' ./test/embedding/test-embedding.js
.PHONY: list-gtests
list-gtests: ## List all available C++ gtests.
@@ -571,7 +570,7 @@ test-all-suites: | clear-stalled test-build bench-addons-build doc-only ## Run a
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) test/*
JS_SUITES ?= default
-NATIVE_SUITES ?= addons js-native-api node-api
+NATIVE_SUITES ?= addons js-native-api node-api embedding
# CI_* variables should be kept synchronized with the ones in vcbuild.bat
CI_NATIVE_SUITES ?= $(NATIVE_SUITES) benchmark
CI_JS_SUITES ?= $(JS_SUITES) pummel
@@ -613,7 +612,6 @@ test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tes
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES) $(CI_DOC)
- '$(OUT_NODE)' ./test/embedding/test-embedding.js
$(info Clean up any leftover processes, error if found.)
ps awwx | grep Release/node | grep -v grep | cat
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
@@ -1242,6 +1240,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
$(RM) -r $(TARNAME)/deps/icu-small
$(RM) -r $(TARNAME)/deps/icu-tmp
$(RM) -r $(TARNAME)/deps/llhttp
+ $(RM) -r $(TARNAME)/deps/nbytes
$(RM) -r $(TARNAME)/deps/nghttp2
$(RM) -r $(TARNAME)/deps/ngtcp2
find $(TARNAME)/deps/openssl -maxdepth 1 -type f ! -name 'nodejs-openssl.cnf' -exec $(RM) {} +
diff --git a/README.md b/README.md
index a7ea15defe7152..b3c620e91ce14b 100644
--- a/README.md
+++ b/README.md
@@ -453,6 +453,8 @@ For information about the governance of the Node.js project, see
**Vladimir Morozov** <> (he/him)
* [VoltrexKeyva](https://github.com/VoltrexKeyva) -
**Mohammed Keyvanzadeh** <> (he/him)
+* [watilde](https://github.com/watilde) -
+ **Daijiro Wachi** <> (he/him)
* [zcbenz](https://github.com/zcbenz) -
**Cheng Zhao** <> (he/him)
* [ZYSzys](https://github.com/ZYSzys) -
@@ -717,8 +719,6 @@ For information about the governance of the Node.js project, see
**Vladimir Kurchatkin** <>
* [vsemozhetbyt](https://github.com/vsemozhetbyt) -
**Vse Mozhet Byt** <> (he/him)
-* [watilde](https://github.com/watilde) -
- **Daijiro Wachi** <> (he/him)
* [watson](https://github.com/watson) -
**Thomas Watson** <>
* [whitlockjc](https://github.com/whitlockjc) -
@@ -889,15 +889,15 @@ releases on a rotation basis as outlined in the
* [bengl](https://github.com/bengl) -
**Bryan English** <> (he/him)
* [HeroDevs](https://www.herodevs.com/)
- * [marco-ippolito](https://github.com/marco-ippolito) -
+ * [marco-ippolito](https://github.com/marco-ippolito) - OpenJSF handle: `Marco Ippolito`
**Marco Ippolito** <> (he/him)
* [NodeSource](https://nodesource.com/)
* [juanarbol](https://github.com/juanarbol) -
**Juan José Arboleda** <> (he/him)
- * [RafaelGSS](https://github.com/RafaelGSS) -
+ * [RafaelGSS](https://github.com/RafaelGSS) - OpenJSF handle: `RafaelGSS`
**Rafael Gonzaga** <> (he/him)
* [Platformatic](https://platformatic.dev/)
- * [mcollina](https://github.com/mcollina) -
+ * [mcollina](https://github.com/mcollina) - OpenJSF handle: `mcollina`
**Matteo Collina** <> (he/him)
* [Red Hat](https://redhat.com) / [IBM](https://ibm.com)
* [joesepi](https://github.com/joesepi) -
diff --git a/SECURITY.md b/SECURITY.md
index 2270a0161feb89..5a90b8ff41d072 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -348,6 +348,21 @@ Security notifications will be distributed via the following methods.
*
*
+### CVE publication timeline
+
+When security releases are published, there is a built-in delay before the
+corresponding CVEs are publicly disclosed. This delay occurs because:
+
+1. After the security release, we request the vulnerability reporter to disclose
+ the details on HackerOne.
+2. If the reporter does not disclose within one day, we proceed with forced
+ disclosure to publish the CVEs.
+3. The disclosure then goes through HackerOne's approval process before the CVEs
+ become publicly available.
+
+As a result, CVEs may not be immediately available when security releases are
+published, but will typically be disclosed within a few days of the release.
+
## Comments on this policy
If you have suggestions on how this process could be improved, please visit
diff --git a/android-patches/trap-handler.h.patch b/android-patches/trap-handler.h.patch
index f4f151f65261f1..6974259ffb8d7e 100644
--- a/android-patches/trap-handler.h.patch
+++ b/android-patches/trap-handler.h.patch
@@ -1,26 +1,47 @@
---- trap-handler.h 2022-08-11 09:01:23.384000000 +0800
-+++ fixed-trap-handler.h 2022-08-11 09:09:15.352000000 +0800
-@@ -17,23 +17,7 @@
- namespace internal {
- namespace trap_handler {
-
+--- trap-handler.h
++++ fixed-trap-handler.h
+@@ -18,43 +18,1 @@
-// X64 on Linux, Windows, MacOS, FreeBSD.
-#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN || \
- V8_OS_FREEBSD)
-#define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 (non-simulator) on Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_DARWIN
+-// Arm64 native on Linux, Windows, MacOS.
+-#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && \
+- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN)
-#define V8_TRAP_HANDLER_SUPPORTED true
+-// For Linux and Mac, enable the simulator when it's been requested.
+-#if USE_SIMULATOR && ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_DARWIN)
+-#define V8_TRAP_HANDLER_VIA_SIMULATOR
+-#endif
-// Arm64 simulator on x64 on Linux, Mac, or Windows.
+-//
+-// The simulator case uses some inline assembly code, which cannot be
+-// compiled with MSVC, so don't enable the trap handler in that case.
+-// (MSVC #defines _MSC_VER, but so does Clang when targeting Windows, hence
+-// the check for __clang__.)
-#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && \
-- (V8_OS_LINUX || V8_OS_DARWIN)
+- (V8_OS_LINUX || V8_OS_DARWIN || V8_OS_WIN) && \
+- (!defined(_MSC_VER) || defined(__clang__))
+-#define V8_TRAP_HANDLER_VIA_SIMULATOR
+-#define V8_TRAP_HANDLER_SUPPORTED true
+-// Loong64 (non-simulator) on Linux.
+-#elif V8_TARGET_ARCH_LOONG64 && V8_HOST_ARCH_LOONG64 && V8_OS_LINUX
+-#define V8_TRAP_HANDLER_SUPPORTED true
+-// Loong64 simulator on x64 on Linux
+-#elif V8_TARGET_ARCH_LOONG64 && V8_HOST_ARCH_X64 && V8_OS_LINUX
+-#define V8_TRAP_HANDLER_VIA_SIMULATOR
+-#define V8_TRAP_HANDLER_SUPPORTED true
+-// RISCV64 (non-simulator) on Linux.
+-#elif V8_TARGET_ARCH_RISCV64 && V8_HOST_ARCH_RISCV64 && V8_OS_LINUX && \
+- !V8_OS_ANDROID
+-#define V8_TRAP_HANDLER_SUPPORTED true
+-// RISCV64 simulator on x64 on Linux
+-#elif V8_TARGET_ARCH_RISCV64 && V8_HOST_ARCH_X64 && V8_OS_LINUX
-#define V8_TRAP_HANDLER_VIA_SIMULATOR
-#define V8_TRAP_HANDLER_SUPPORTED true
-// Everything else is unsupported.
-#else
- #define V8_TRAP_HANDLER_SUPPORTED false
+-#define V8_TRAP_HANDLER_SUPPORTED false
-#endif
-
- // Setup for shared library export.
- #if defined(BUILDING_V8_SHARED) && defined(V8_OS_WIN)
\ No newline at end of file
++#define V8_TRAP_HANDLER_SUPPORTED false
diff --git a/benchmark/napi/create_object_with_properties/binding.cc b/benchmark/napi/create_object_with_properties/binding.cc
index d7fae01d1659f9..fda692395b7488 100644
--- a/benchmark/napi/create_object_with_properties/binding.cc
+++ b/benchmark/napi/create_object_with_properties/binding.cc
@@ -58,7 +58,7 @@ static napi_value CreateObjectWithPropertiesNew(napi_env env,
for (uint32_t i = 0; i < params.count; i++) {
napi_value obj;
- napi_create_object_with_properties(
+ node_api_create_object_with_properties(
env, null_prototype, global_names, global_values, 20, &obj);
}
diff --git a/benchmark/napi/function_args/index.js b/benchmark/napi/function_args/index.js
index 8ce9fa9d528f5c..2cf91650f4e77a 100644
--- a/benchmark/napi/function_args/index.js
+++ b/benchmark/napi/function_args/index.js
@@ -1,5 +1,5 @@
// Show the difference between calling a V8 binding C++ function
-// relative to a comparable N-API C++ function,
+// relative to a comparable Node-API C++ function,
// in various types/numbers of arguments.
// Reports n of calls per second.
'use strict';
@@ -19,7 +19,7 @@ try {
try {
napi = require(`./build/${common.buildType}/napi_binding`);
} catch {
- console.error(`${__filename}: NAPI-Binding failed to load`);
+ console.error(`${__filename}: Node-API binding failed to load`);
process.exit(0);
}
diff --git a/benchmark/napi/function_call/index.js b/benchmark/napi/function_call/index.js
index cde4c7ae223945..b22b5ac8b2151f 100644
--- a/benchmark/napi/function_call/index.js
+++ b/benchmark/napi/function_call/index.js
@@ -24,7 +24,7 @@ let napi_binding;
try {
napi_binding = require(`./build/${common.buildType}/napi_binding`);
} catch {
- console.error('misc/function_call/index.js NAPI-Binding failed to load');
+ console.error('misc/function_call/index.js Node-API binding failed to load');
process.exit(0);
}
const napi = napi_binding.hello;
diff --git a/benchmark/sqlite/sqlite-prepare-select-all-options.js b/benchmark/sqlite/sqlite-prepare-select-all-options.js
new file mode 100644
index 00000000000000..336a6b176b0d87
--- /dev/null
+++ b/benchmark/sqlite/sqlite-prepare-select-all-options.js
@@ -0,0 +1,51 @@
+'use strict';
+const common = require('../common.js');
+const sqlite = require('node:sqlite');
+const assert = require('assert');
+
+const bench = common.createBenchmark(main, {
+ n: [1e5],
+ tableSeedSize: [1e5],
+ statement: [
+ 'SELECT * FROM foo LIMIT 1',
+ 'SELECT * FROM foo LIMIT 100',
+ ],
+ options: ['none', 'readBigInts', 'returnArrays', 'readBigInts|returnArrays'],
+});
+
+function main(conf) {
+ const optionsObj = conf.options === 'none' ? {} : conf.options.split('|').reduce((acc, key) => {
+ acc[key] = true;
+ return acc;
+ }, {});
+
+ const db = new sqlite.DatabaseSync(':memory:', optionsObj);
+
+ db.exec(
+ 'CREATE TABLE foo (text_column TEXT, integer_column INTEGER, real_column REAL, blob_column BLOB)',
+ );
+
+ const fooInsertStatement = db.prepare(
+ 'INSERT INTO foo (text_column, integer_column, real_column, blob_column) VALUES (?, ?, ?, ?)',
+ );
+
+ for (let i = 0; i < conf.tableSeedSize; i++) {
+ fooInsertStatement.run(
+ crypto.randomUUID(),
+ Math.floor(Math.random() * 100),
+ Math.random(),
+ Buffer.from('example blob data'),
+ );
+ }
+
+ let i;
+ let deadCodeElimination;
+
+ const stmt = db.prepare(conf.statement);
+
+ bench.start();
+ for (i = 0; i < conf.n; i += 1) deadCodeElimination = stmt.all();
+ bench.end(conf.n);
+
+ assert.ok(deadCodeElimination !== undefined);
+}
diff --git a/benchmark/sqlite/sqlite-prepare-select-get-options.js b/benchmark/sqlite/sqlite-prepare-select-get-options.js
new file mode 100644
index 00000000000000..eb2e5074151af2
--- /dev/null
+++ b/benchmark/sqlite/sqlite-prepare-select-get-options.js
@@ -0,0 +1,50 @@
+'use strict';
+const common = require('../common.js');
+const sqlite = require('node:sqlite');
+const assert = require('assert');
+
+const bench = common.createBenchmark(main, {
+ n: [1e5],
+ tableSeedSize: [1e5],
+ statement: [
+ 'SELECT * FROM foo LIMIT 1',
+ ],
+ options: ['none', 'readBigInts', 'returnArrays', 'readBigInts|returnArrays'],
+});
+
+function main(conf) {
+ const optionsObj = conf.options === 'none' ? {} : conf.options.split('|').reduce((acc, key) => {
+ acc[key] = true;
+ return acc;
+ }, {});
+
+ const db = new sqlite.DatabaseSync(':memory:', optionsObj);
+
+ db.exec(
+ 'CREATE TABLE foo (text_column TEXT, integer_column INTEGER, real_column REAL, blob_column BLOB)',
+ );
+
+ const fooInsertStatement = db.prepare(
+ 'INSERT INTO foo (text_column, integer_column, real_column, blob_column) VALUES (?, ?, ?, ?)',
+ );
+
+ for (let i = 0; i < conf.tableSeedSize; i++) {
+ fooInsertStatement.run(
+ crypto.randomUUID(),
+ Math.floor(Math.random() * 100),
+ Math.random(),
+ Buffer.from('example blob data'),
+ );
+ }
+
+ let i;
+ let deadCodeElimination;
+
+ const stmt = db.prepare(conf.statement);
+
+ bench.start();
+ for (i = 0; i < conf.n; i += 1) deadCodeElimination = stmt.get();
+ bench.end(conf.n);
+
+ assert.ok(deadCodeElimination !== undefined);
+}
diff --git a/common.gypi b/common.gypi
index cefbc4318b7f7e..5e1d6d8b695f2f 100644
--- a/common.gypi
+++ b/common.gypi
@@ -38,7 +38,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
- 'v8_embedder_string': '-node.15',
+ 'v8_embedder_string': '-node.18',
##### V8 defaults for Node.js #####
@@ -598,7 +598,7 @@
],
}, { # else it's `AIX`
'variables': {
- 'gcc_major': '
+
+
+
+
+
+ Blog •
+ Documentation •
+ About
+
+
+
+# About
+
+The purpose of this project is to provide a cross-platform library to parse,
+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, ...)
+ * **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
+
+**Extended features**:
+
+ * [**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
+
+**Plugins**:
+
+ * [**Ghidra**](https://lief.re/doc/latest/plugins/ghidra/index.html)
+ * [**BinaryNinja**](https://lief.re/doc/latest/plugins/binaryninja/index.html)
+
+# Content
+
+- [About](#about)
+- [Download / Install](#downloads--install)
+- [Getting started](#getting-started)
+- [Blog](https://lief.re/blog/)
+- [Documentation](#documentation)
+ - [Rust](https://lief.re/doc/stable/rust/lief/)
+ - [Sphinx](https://lief.re/doc/latest/index.html)
+ - [Doxygen](https://lief.re/doc/latest/doxygen/index.html)
+ - Tutorials:
+ - [Parse and manipulate formats](https://lief.re/doc/latest/tutorials/01_play_with_formats.html)
+ - [Play with ELF symbols](https://lief.re/doc/latest/tutorials/03_elf_change_symbols.html)
+ - [PE Resources](https://lief.re/doc/latest/tutorials/07_pe_resource.html)
+ - [Transforming an ELF executable into a library](https://lief.re/doc/latest/tutorials/08_elf_bin2lib.html)
+ - [How to use frida on a non-rooted device](https://lief.re/doc/latest/tutorials/09_frida_lief.html)
+ - [Android formats](https://lief.re/doc/latest/tutorials/10_android_formats.html)
+ - [Mach-O modification](https://lief.re/doc/latest/tutorials/11_macho_modification.html)
+ - [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)
+ - [Authors](#authors)
+ - [License](#license)
+ - [Bibtex](#bibtex)
+
+## Downloads / Install
+
+## C++
+
+```cmake
+find_package(LIEF REQUIRED)
+target_link_libraries(my-project LIEF::LIEF)
+```
+
+## Rust
+
+```toml
+[package]
+name = "my-awesome-project"
+version = "0.0.1"
+edition = "2021"
+
+[dependencies]
+lief = "0.17.1"
+```
+
+## Python
+
+To install the latest **version** (release):
+
+```console
+pip install lief
+```
+
+To install nightly build:
+
+```console
+pip install [--user] --force-reinstall --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief==1.0.0.dev0
+```
+
+### Packages
+
+- LIEF Extended: https://extended.lief.re (GitHub OAuth)
+- **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
+
+Here are guides to install or integrate LIEF:
+
+ * [Python](https://lief.re/doc/latest/installation.html#python)
+ * [Visual Studio](https://lief.re/doc/latest/installation.html#visual-studio-integration)
+ * [XCode](https://lief.re/doc/latest/installation.html#xcode-integration)
+ * [CMake](https://lief.re/doc/latest/installation.html#cmake-integration)
+
+## Getting started
+
+### Python
+
+```python
+import lief
+
+# ELF
+binary = lief.parse("/usr/bin/ls")
+for section in binary.sections:
+ print(section.name, section.virtual_address)
+
+# PE
+binary = lief.parse("C:\\Windows\\explorer.exe")
+
+if rheader := pe.rich_header:
+ print(rheader.key)
+
+# Mach-O
+binary = lief.parse("/usr/bin/ls")
+for fixup in binary.dyld_chained_fixups:
+ print(fixup)
+```
+
+### Rust
+
+```rust
+use lief::Binary;
+use lief::pe::debug::Entries::CodeViewPDB;
+
+if let Some(Binary::PE(pe)) = Binary::parse(path.as_str()) {
+ for entry in pe.debug() {
+ if let CodeViewPDB(pdb_view) = entry {
+ println!("{}", pdb_view.filename());
+ }
+ }
+}
+```
+
+### C++
+
+```cpp
+#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';
+ }
+ }
+
+ // PE
+ if (std::unique_ptr pe = LIEF::PE::Parser::parse("C:\\Windows\\explorer.exe")) {
+ 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';
+ }
+ }
+
+ return 0;
+}
+
+```
+
+### 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)
+* [Doxygen](https://lief.re/doc/latest/doxygen/index.html)
+* [Rust](https://lief.re/doc/stable/rust/lief/)
+
+## Contact
+
+* **Mail**: contact at lief re
+* **Discord**: [LIEF](https://discord.gg/7hRFGWYedu)
+
+## About
+
+### Authors
+
+Romain Thomas ([@rh0main](https://www.romainthomas.fr/)) - Formerly at [Quarkslab](https://www.quarkslab.com)
+
+### License
+
+LIEF is provided under the [Apache 2.0 license](https://github.com/lief-project/LIEF/blob/0.17.1/LICENSE).
+
+### Bibtex
+
+```bibtex
+@MISC {LIEF,
+ author = "Romain Thomas",
+ title = "LIEF - Library to Instrument Executable Formats",
+ howpublished = "https://lief.quarkslab.com/",
+ month = "apr",
+ year = "2017"
+}
+```
+
+
diff --git a/deps/LIEF/config/mbedtls/config.h b/deps/LIEF/config/mbedtls/config.h
new file mode 100644
index 00000000000000..1007c99aee06ab
--- /dev/null
+++ b/deps/LIEF/config/mbedtls/config.h
@@ -0,0 +1,5 @@
+#include "mbedtls/mbedtls_config.h"
+
+#if defined (MBEDTLS_ARCH_IS_X86)
+#undef MBEDTLS_AESNI_C
+#endif
diff --git a/deps/LIEF/include/LIEF/ART.hpp b/deps/LIEF/include/LIEF/ART.hpp
new file mode 100644
index 00000000000000..7d920b61be47c4
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART.hpp
@@ -0,0 +1,28 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_H
+#define LIEF_ART_H
+
+#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"
+#endif
+
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/EnumToString.hpp b/deps/LIEF/include/LIEF/ART/EnumToString.hpp
new file mode 100644
index 00000000000000..a377b91a35764b
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/EnumToString.hpp
@@ -0,0 +1,40 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_ENUM_TO_STRING_H
+#define LIEF_ART_ENUM_TO_STRING_H
+#include "LIEF/visibility.h"
+#include "LIEF/ART/enums.hpp"
+
+namespace LIEF {
+namespace ART {
+
+LIEF_API const char* to_string(STORAGE_MODES e);
+
+LIEF_API const char* to_string(ART_17::IMAGE_SECTIONS e);
+LIEF_API const char* to_string(ART_29::IMAGE_SECTIONS e);
+LIEF_API const char* to_string(ART_30::IMAGE_SECTIONS e);
+
+LIEF_API const char* to_string(ART_17::IMAGE_METHODS e);
+LIEF_API const char* to_string(ART_44::IMAGE_METHODS e);
+
+LIEF_API const char* to_string(ART_17::IMAGE_ROOTS e);
+LIEF_API const char* to_string(ART_44::IMAGE_ROOTS e);
+
+} // namespace ART
+} // namespace LIEF
+
+#endif
+
diff --git a/deps/LIEF/include/LIEF/ART/File.hpp b/deps/LIEF/include/LIEF/ART/File.hpp
new file mode 100644
index 00000000000000..ea00a53ac186da
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/File.hpp
@@ -0,0 +1,55 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_FILE_H
+#define LIEF_ART_FILE_H
+#include
+
+#include "LIEF/ART/Header.hpp"
+
+#include "LIEF/visibility.h"
+#include "LIEF/Object.hpp"
+
+namespace LIEF {
+namespace ART {
+class Parser;
+
+class LIEF_API File : public Object {
+ friend class Parser;
+
+ public:
+ File& operator=(const File& copy) = delete;
+ File(const File& copy) = delete;
+
+ const Header& header() const;
+ Header& header();
+
+ void accept(Visitor& visitor) const override;
+
+
+ ~File() override;
+
+ LIEF_API friend std::ostream& operator<<(std::ostream& os, const File& art_file);
+
+ private:
+ File();
+
+ Header header_;
+};
+
+}
+}
+
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/Header.hpp b/deps/LIEF/include/LIEF/ART/Header.hpp
new file mode 100644
index 00000000000000..3aef2eb4e20a9a
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/Header.hpp
@@ -0,0 +1,130 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_HEADER_H
+#define LIEF_ART_HEADER_H
+
+#include
+#include
+
+#include "LIEF/ART/types.hpp"
+#include "LIEF/ART/enums.hpp"
+
+#include "LIEF/visibility.h"
+#include "LIEF/Object.hpp"
+
+namespace LIEF {
+namespace ART {
+class Parser;
+
+class LIEF_API Header : public Object {
+ friend class Parser;
+
+ public:
+ using magic_t = std::array;
+
+ Header();
+
+ template
+ LIEF_LOCAL Header(const T* header);
+
+ Header(const Header&);
+ Header& operator=(const Header&);
+
+ magic_t magic() const;
+ art_version_t version() const;
+
+ uint32_t image_begin() const;
+ uint32_t image_size() const;
+
+ uint32_t oat_checksum() const;
+
+ uint32_t oat_file_begin() const;
+ uint32_t oat_file_end() const;
+
+ uint32_t oat_data_begin() const;
+ uint32_t oat_data_end() const;
+
+ int32_t patch_delta() const;
+
+ uint32_t image_roots() const;
+
+ uint32_t pointer_size() const;
+ bool compile_pic() const;
+
+ uint32_t nb_sections() const;
+ uint32_t nb_methods() const;
+
+ uint32_t boot_image_begin() const;
+ uint32_t boot_image_size() const;
+
+ uint32_t boot_oat_begin() const;
+ uint32_t boot_oat_size() const;
+
+ STORAGE_MODES storage_mode() const;
+
+ uint32_t data_size() const;
+
+ void accept(Visitor& visitor) const override;
+
+
+ LIEF_API friend std::ostream& operator<<(std::ostream& os, const Header& hdr);
+
+ ~Header() override;
+
+ private:
+ magic_t magic_;
+ art_version_t version_;
+
+ uint32_t image_begin_;
+ uint32_t image_size_;
+
+ uint32_t oat_checksum_;
+
+ uint32_t oat_file_begin_;
+ uint32_t oat_file_end_;
+
+ uint32_t oat_data_begin_;
+ uint32_t oat_data_end_;
+
+ int32_t patch_delta_;
+ uint32_t image_roots_;
+
+ uint32_t pointer_size_;
+
+ bool compile_pic_;
+
+ uint32_t nb_sections_;
+ uint32_t nb_methods_;
+
+ bool is_pic_;
+
+ // From ART 29
+ // ===========
+ uint32_t boot_image_begin_;
+ uint32_t boot_image_size_;
+
+ uint32_t boot_oat_begin_;
+ uint32_t boot_oat_size_;
+
+ STORAGE_MODES storage_mode_;
+
+ uint32_t data_size_;
+};
+
+} // Namespace ART
+} // Namespace LIEF
+
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/Parser.hpp b/deps/LIEF/include/LIEF/ART/Parser.hpp
new file mode 100644
index 00000000000000..21d2250e4e92fa
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/Parser.hpp
@@ -0,0 +1,107 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_PARSER_H
+#define LIEF_ART_PARSER_H
+#include
+#include
+#include
+
+#include "LIEF/ART/types.hpp"
+#include "LIEF/visibility.h"
+
+namespace LIEF {
+class BinaryStream;
+namespace ART {
+class File;
+
+
+/// Class which parses an ART file and transform into a 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 = "");
+
+ Parser& operator=(const Parser& copy) = delete;
+ Parser(const Parser& copy) = delete;
+
+ private:
+ Parser();
+ Parser(const std::string& file);
+ Parser(std::vector data);
+ virtual ~Parser();
+
+ void init(const std::string& name, art_version_t version);
+
+ template
+ void parse_file();
+
+ template
+ size_t parse_header();
+
+ template
+ void parse_sections();
+
+ template
+ void parse_roots();
+
+ template
+ void parse_methods();
+
+ // Section parsing
+ template
+ void parse_objects(size_t offset, size_t size);
+
+ template
+ void parse_art_fields(size_t offset, size_t size);
+
+ template
+ void parse_art_methods(size_t offset, size_t size);
+
+ template
+ void parse_interned_strings(size_t offset, size_t size);
+
+ // Parse an **Array** of java.lang.DexCache objects
+ template
+ void parse_dex_caches(size_t offset, size_t size);
+
+ // Parse a **Single** java.lang.DexCache object
+ template
+ void parse_dex_cache(size_t object_offset);
+
+ // Parse an **Array** of java.lang.Class objects
+ template
+ void parse_class_roots(size_t offset, size_t size);
+
+ // Parse java.lang.Class objects
+ template
+ void parse_class(size_t offset);
+
+ // Parse java.lang.String objects
+ template
+ void parse_jstring(size_t offset);
+
+
+ //// Parse a **Single** java.lang.DexCache object
+ //template
+ //void parse_class_roots(size_t object_offset);
+
+ std::unique_ptr file_;
+ std::unique_ptr stream_;
+ uint32_t imagebase_ = 0;
+};
+} // namespace ART
+} // namespace LIEF
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/enums.hpp b/deps/LIEF/include/LIEF/ART/enums.hpp
new file mode 100644
index 00000000000000..2165ea497bd7ce
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/enums.hpp
@@ -0,0 +1,133 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_ENUMS_H
+#define LIEF_ART_ENUMS_H
+
+namespace LIEF {
+namespace ART {
+
+enum STORAGE_MODES {
+ STORAGE_UNCOMPRESSED = 0,
+ 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,
+ 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,
+};
+
+enum IMAGE_ROOTS {
+ DEX_CACHES = 0,
+ CLASS_ROOTS = 1,
+};
+
+
+} // Namespace ART_17
+
+
+namespace ART_29 {
+
+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,
+};
+
+
+
+} // Namespace ART_29
+
+
+namespace ART_30 {
+
+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,
+};
+
+} // Namespace ART_30
+
+namespace ART_44 {
+
+using ART_30::IMAGE_SECTIONS;
+
+enum IMAGE_METHODS {
+ 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
+};
+
+
+enum IMAGE_ROOTS {
+ DEX_CACHES = 0,
+ CLASS_ROOTS = 1,
+ CLASS_LOADER = 2, // New in ART 44
+};
+
+} // Namespace ART_44
+
+
+namespace ART_46 {
+
+using ART_30::IMAGE_SECTIONS;
+using ART_30::IMAGE_METHODS;
+using ART_30::IMAGE_ROOTS;
+
+
+} // Namespace ART_46
+
+}
+}
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/hash.hpp b/deps/LIEF/include/LIEF/ART/hash.hpp
new file mode 100644
index 00000000000000..1aaa7d3acd9211
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/hash.hpp
@@ -0,0 +1,47 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_HASH_H
+#define LIEF_ART_HASH_H
+
+#include "LIEF/visibility.h"
+#include "LIEF/hash.hpp"
+
+namespace LIEF {
+class Object;
+
+namespace ART {
+class File;
+class Header;
+
+class LIEF_API Hash : public LIEF::Hash {
+ public:
+ static LIEF::Hash::value_type hash(const Object& obj);
+
+ public:
+ using LIEF::Hash::Hash;
+ using LIEF::Hash::visit;
+
+ public:
+ void visit(const File& file) override;
+ void visit(const Header& header) override;
+
+ ~Hash() override;
+};
+
+}
+}
+
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/java_structures.hpp b/deps/LIEF/include/LIEF/ART/java_structures.hpp
new file mode 100644
index 00000000000000..da3514aaffe6dc
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/java_structures.hpp
@@ -0,0 +1,397 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_JAVA_STRUCTURES_H
+#define LIEF_ART_JAVA_STRUCTURES_H
+
+#include
+#include
+
+#include "LIEF/types.hpp"
+#include "LIEF/ART/enums.hpp"
+#include "LIEF/ART/types.hpp"
+
+namespace LIEF {
+/// Namespace related to the LIEF's ART module
+namespace ART {
+
+namespace details {
+
+struct no_brooks_read_barrier_t {};
+
+// ======================
+// Android 6.0.1 - ART 17
+// ======================
+namespace ART_17 {
+
+/// Namespace related to the Java part of ART 17
+namespace Java {
+
+using heap_reference_t = uint32_t;
+
+struct brooks_read_barrier_t {
+ uint32_t x_rb_ptr;
+ uint32_t x_xpadding;
+};
+
+template
+struct jobject_t {
+ heap_reference_t klass;
+ uint32_t monitor;
+ T brooks_read_barrier;
+};
+
+template<>
+struct jobject_t {
+ heap_reference_t klass;
+ uint32_t monitor;
+};
+template
+struct ALIGNED_(4) jarray_t {
+ jobject_t object;
+ int32_t length;
+ uint32_t* elements;
+};
+
+template
+struct ALIGNED_(4) jclass_t {
+ jobject_t object;
+
+ heap_reference_t class_loader;
+ heap_reference_t component_type;
+ heap_reference_t dex_cache;
+ heap_reference_t dex_cache_strings;
+ heap_reference_t iftable;
+ heap_reference_t name;
+ heap_reference_t super_class;
+ heap_reference_t verify_error_class;
+ heap_reference_t vtable;
+
+ uint32_t access_flags;
+ uint64_t direct_methods;
+ uint64_t ifields;
+ uint64_t sfields;
+ uint64_t virtual_methods;
+ uint32_t class_size;
+ uint32_t clinit_thread_id;
+ 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;
+ uint32_t num_reference_static_fields;
+ uint32_t num_static_fields;
+ uint32_t num_virtual_methods;
+ uint32_t object_size;
+ uint32_t primitive_type;
+ uint32_t reference_instance_offsets;
+ int32_t status;
+};
+
+template
+struct ALIGNED_(4) jstring_t {
+ jobject_t object;
+ int32_t count;
+ uint32_t hash_code;
+ uint16_t* value;
+};
+
+template
+struct ALIGNED_(4) jdex_cache_t {
+ jobject_t object;
+
+ heap_reference_t dex;
+ heap_reference_t location;
+ heap_reference_t resolved_fields;
+ heap_reference_t resolved_methods;
+ heap_reference_t resolved_types;
+ heap_reference_t strings;
+ uint64_t dex_file;
+};
+
+
+} // Namespace Java
+} // Namespace ART_17
+
+// ======================
+// Android 7.0.0 - ART 29
+// ======================
+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 brooks_read_barrier_t = ART_17::Java::brooks_read_barrier_t;
+
+template
+using jobject_t = ART_17::Java::jobject_t;
+
+template
+using jarray_t = ART_17::Java::jarray_t;
+
+template
+struct ALIGNED_(4) jclass_t {
+ jobject_t object;
+
+ heap_reference_t annotation_type; // ADDED in ART 29
+ heap_reference_t class_loader;
+ heap_reference_t component_type;
+ heap_reference_t dex_cache;
+ // heap_reference_t dex_cache_strings; // REMOVED in ART 29
+ 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 vtable;
+
+ uint32_t access_flags;
+ uint64_t dex_cache_strings; // direct_methods REPLACED with dex_cache_string
+ uint64_t ifields;
+ uint64_t methods; // ADDED in ART 29
+ uint64_t sfields;
+ 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;
+ // uint32_t num_direct_methods; // REMOVED in ART 29
+ // uint32_t num_instance_fields; // REMOVED in ART 29
+ uint32_t num_reference_instance_fields;
+ uint32_t num_reference_static_fields;
+ // uint32_t num_static_fields; // REMOVED in ART 29
+ // uint32_t num_virtual_methods; // REMOVED in ART 29
+ uint32_t object_size;
+ uint32_t primitive_type;
+ uint32_t reference_instance_offsets;
+ int32_t status;
+
+ uint16_t copied_methods_offset; // ADDED in ART 29
+ uint16_t virtual_methods_offset; // ADDED in ART 29
+};
+
+
+// No changes in jstring structure
+template
+using jstring_t = ART_17::Java::jstring_t;
+
+template
+struct ALIGNED_(4) jdex_cache_t {
+ jobject_t object;
+
+ 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
+};
+
+
+
+
+} // Namespace Java
+} // Namespace ART_29
+
+
+// ======================
+// Android 7.1.X - ART 30
+// ======================
+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 brooks_read_barrier_t = ART_29::Java::brooks_read_barrier_t;
+
+template
+using jobject_t = ART_29::Java::jobject_t;
+
+template
+using jarray_t = ART_29::Java::jarray_t;
+
+template
+using jclass_t = ART_29::Java::jclass_t;
+
+// No changes in jstring structure
+template
+using jstring_t = ART_29::Java::jstring_t;
+
+// No changes in jdex_cache structure
+template
+using jdex_cache_t = ART_29::Java::jdex_cache_t;
+
+} // Namespace Java
+} // Namespace ART_30
+
+// ======================
+// Android 8.0.0 - ART 44
+// ======================
+namespace ART_44 {
+
+/// Namespace related to the Java part of ART 44
+namespace Java {
+
+
+using heap_reference_t = ART_30::Java::heap_reference_t;
+using brooks_read_barrier_t = ART_30::Java::brooks_read_barrier_t;
+
+template
+using jobject_t = ART_30::Java::jobject_t;
+
+template
+using jarray_t = ART_30::Java::jarray_t;
+
+template
+struct ALIGNED_(4) jclass_t {
+ 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 iftable;
+ heap_reference_t name;
+ heap_reference_t super_class;
+ // heap_reference_t verify_error; // REMOVED in ART 44
+ heap_reference_t vtable;
+
+ // uint32_t access_flags; // REMOVED in ART 44
+ // uint64_t dex_cache_strings; // REMOVED in ART 44
+ uint64_t ifields;
+ uint64_t methods;
+ uint64_t sfields;
+ 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;
+ 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 primitive_type;
+ uint32_t reference_instance_offsets;
+ int32_t status;
+ uint16_t copied_methods_offset;
+ uint16_t virtual_methods_offset;
+};
+
+
+// No changes in jstring structure but string can be
+// encoded as as char16_t or char (compressed)
+// count[0] (LSB) == 1 ----> compressed
+// count[0] (LSB) == 0 ----> chat16_t
+template
+using jstring_t = ART_30::Java::jstring_t;
+
+template
+struct ALIGNED_(4) jdex_cache_t {
+ jobject_t object;
+
+ // 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;
+};
+
+
+} // Namespace Java
+} // Namespace ART_44
+
+
+// ======================
+// Android 8.1.X - ART 46
+// ======================
+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 brooks_read_barrier_t = ART_44::Java::brooks_read_barrier_t;
+
+template
+using jobject_t = ART_44::Java::jobject_t;
+
+template
+using jarray_t = ART_44::Java::jarray_t;
+
+template
+using jclass_t = ART_44::Java::jclass_t;
+
+template
+using jstring_t = ART_44::Java::jstring_t;
+
+template
+using jdex_cache_t = ART_44::Java::jdex_cache_t;
+
+} // Namespace Java
+} // Namespace ART_46
+
+// ======================
+// Android 9.0.0 - ART 66
+// ======================
+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 brooks_read_barrier_t = ART_46::Java::brooks_read_barrier_t;
+
+template
+using jobject_t = ART_46::Java::jobject_t;
+
+template
+using jarray_t = ART_46::Java::jarray_t;
+
+template
+using jclass_t = ART_46::Java::jclass_t;
+
+template
+using jstring_t = ART_46::Java::jstring_t;
+
+template
+using jdex_cache_t = ART_46::Java::jdex_cache_t;
+
+} // Namespace Java
+} // Namespace ART_56
+
+} // namespace details
+} // Namespace ART
+} // Namespace LIEF
+
+
+
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/json.hpp b/deps/LIEF/include/LIEF/ART/json.hpp
new file mode 100644
index 00000000000000..3302272bd8c51a
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/json.hpp
@@ -0,0 +1,31 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_PUBLIC_JSON_H
+#define LIEF_ART_PUBLIC_JSON_H
+
+#include "LIEF/visibility.h"
+#include
+
+namespace LIEF {
+class Object;
+namespace ART {
+
+LIEF_API std::string to_json(const Object& v);
+
+}
+}
+
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/types.hpp b/deps/LIEF/include/LIEF/ART/types.hpp
new file mode 100644
index 00000000000000..706e4143d08fbc
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/types.hpp
@@ -0,0 +1,31 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_TYPE_TRAITS_H
+#define LIEF_ART_TYPE_TRAITS_H
+
+#include
+#include
+#include "LIEF/iterators.hpp"
+
+namespace LIEF {
+namespace ART {
+
+using art_version_t = uint32_t;
+
+} // Namesapce ART
+} // Namespace LIEF
+
+#endif
diff --git a/deps/LIEF/include/LIEF/ART/utils.hpp b/deps/LIEF/include/LIEF/ART/utils.hpp
new file mode 100644
index 00000000000000..fc4bcd8e3eede0
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ART/utils.hpp
@@ -0,0 +1,51 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ART_UTILS_H
+#define LIEF_ART_UTILS_H
+
+#include
+#include
+
+#include "LIEF/ART/types.hpp"
+
+#include "LIEF/platforms/android.hpp"
+
+#include "LIEF/types.hpp"
+#include "LIEF/visibility.h"
+
+namespace LIEF {
+namespace ART {
+
+/// Check if the given file is an ART one.
+LIEF_API bool is_art(const std::string& file);
+
+/// Check if the given raw data is an ART one.
+LIEF_API bool is_art(const std::vector& raw);
+
+/// Return the ART version of the given file
+LIEF_API art_version_t version(const std::string& file);
+
+/// Return the ART version of the raw data
+LIEF_API art_version_t version(const std::vector& raw);
+
+/// Return the ANDROID_VERSIONS associated with the given ART version
+LIEF_API LIEF::Android::ANDROID_VERSIONS android_version(art_version_t version);
+
+}
+}
+
+
+#endif
diff --git a/deps/LIEF/include/LIEF/ASM.hpp b/deps/LIEF/include/LIEF/ASM.hpp
new file mode 100644
index 00000000000000..5bc1a376b2c5ba
--- /dev/null
+++ b/deps/LIEF/include/LIEF/ASM.hpp
@@ -0,0 +1,28 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ASM_H
+#define LIEF_ASM_H
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract.hpp b/deps/LIEF/include/LIEF/Abstract.hpp
new file mode 100644
index 00000000000000..bc10e669486524
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract.hpp
@@ -0,0 +1,26 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_H
+#define LIEF_ABSTRACT_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract/Binary.hpp b/deps/LIEF/include/LIEF/Abstract/Binary.hpp
new file mode 100644
index 00000000000000..8e4f738a76efdb
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/Binary.hpp
@@ -0,0 +1,441 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_BINARY_H
+#define LIEF_ABSTRACT_BINARY_H
+
+#include
+#include
+#include
+
+#include "LIEF/visibility.h"
+#include "LIEF/Object.hpp"
+#include "LIEF/iterators.hpp"
+#include "LIEF/errors.hpp"
+#include "LIEF/span.hpp"
+
+#include "LIEF/Abstract/Header.hpp"
+#include "LIEF/Abstract/Function.hpp"
+
+#include "LIEF/asm/Instruction.hpp"
+#include "LIEF/asm/AssemblerConfig.hpp"
+
+namespace llvm {
+class MCInst;
+}
+
+/// LIEF namespace
+namespace LIEF {
+class Section;
+class Relocation;
+class Symbol;
+
+class DebugInfo;
+
+namespace assembly {
+class Engine;
+}
+
+/// Generic interface representing a binary executable.
+///
+/// This class provides a unified interface across multiple binary formats
+/// such as ELF, PE, Mach-O, and others. It enables users to access binary
+/// components like headers, sections, symbols, relocations,
+/// and functions in a format-agnostic way.
+///
+/// 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
+ /// (default behavior).
+ AUTO = 0,
+
+ /// Relative Virtual Address (RVA), offset from image base.
+ RVA = 1,
+
+ /// Absolute Virtual Address.
+ VA = 2
+ };
+
+ enum FORMATS {
+ UNKNOWN = 0,
+ ELF,
+ PE,
+ MACHO,
+ OAT,
+ };
+
+ using functions_t = std::vector;
+
+ /// Internal container
+ using sections_t = std::vector;
+
+ /// Iterator that outputs LIEF::Section&
+ using it_sections = ref_iterator;
+
+ /// Iterator that outputs const LIEF::Section&
+ using it_const_sections = const_ref_iterator;
+
+ /// Internal container
+ using symbols_t = std::vector;
+
+ /// Iterator that outputs LIEF::Symbol&
+ using it_symbols = ref_iterator;
+
+ /// Iterator that outputs const LIEF::Symbol&
+ using it_const_symbols = const_ref_iterator;
+
+ /// Internal container
+ using relocations_t = std::vector;
+
+ /// Iterator that outputs LIEF::Relocation&
+ using it_relocations = ref_iterator;
+
+ /// Iterator that outputs const LIEF::Relocation&
+ using it_const_relocations = const_ref_iterator;
+
+ /// Instruction iterator
+ using instructions_it = iterator_range;
+
+ public:
+ Binary();
+ Binary(FORMATS fmt);
+
+ ~Binary() override;
+
+ Binary& operator=(const Binary&) = delete;
+ Binary(const Binary&) = delete;
+
+ /// Executable format (ELF, PE, Mach-O) of the underlying binary
+ FORMATS format() const {
+ return format_;
+ }
+
+ /// Return the abstract header of the binary
+ Header header() const {
+ return get_abstract_header();
+ }
+
+ /// Return an iterator over the abstracted symbols in which the elements **can** be modified
+ it_symbols symbols() {
+ 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 const_cast(this)->get_abstract_symbols();
+ }
+
+ /// Check if a Symbol with the given name exists
+ bool has_symbol(const std::string& name) const {
+ return get_symbol(name) != nullptr;
+ }
+
+ /// 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;
+
+ Symbol* get_symbol(const std::string& name) {
+ return const_cast(static_cast(this)->get_symbol(name));
+ }
+
+ /// Return an iterator over the binary's sections (LIEF::Section)
+ it_sections sections() {
+ return get_abstract_sections();
+ }
+
+ it_const_sections sections() const {
+ 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 get_abstract_relocations();
+ }
+
+ it_const_relocations relocations() const {
+ return const_cast(this)->get_abstract_relocations();
+ }
+
+ /// Binary's entrypoint (if any)
+ virtual uint64_t entrypoint() const = 0;
+
+ /// Binary's original size
+ uint64_t original_size() const {
+ return original_size_;
+ }
+
+ /// Return the functions exported by the binary
+ functions_t exported_functions() const {
+ return get_abstract_exported_functions();
+ }
+
+ /// Return libraries which are imported by the binary
+ std::vector imported_libraries() const {
+ return get_abstract_imported_libraries();
+ }
+
+ /// Return functions imported by the binary
+ functions_t imported_functions() const {
+ return get_abstract_imported_functions();
+ }
+
+ /// Return the address of the given function name
+ 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;
+
+ std::vector xref(uint64_t address) const;
+
+ /// Patch the content at virtual address @p address with @p patch_value
+ ///
+ /// @param[in] address Address to patch
+ /// @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,
+ VA_TYPES addr_type = VA_TYPES::AUTO) = 0;
+
+ /// Patch the address with the given value
+ ///
+ /// @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),
+ 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;
+
+ /// 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
+ {
+ T value;
+ static_assert(std::is_integral::value, "Require an integral 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);
+ }
+
+ std::copy(raw.data(), raw.data() + sizeof(T),
+ reinterpret_cast(&value));
+ return value;
+ }
+
+ /// Change binary's original size.
+ ///
+ /// @warning
+ /// This function should be used carefully as some optimizations
+ /// can be performed with this value
+ void original_size(uint64_t size) {
+ original_size_ = size;
+ }
+
+ /// Check if the binary is position independent
+ virtual bool is_pie() const = 0;
+
+ /// Check if the binary uses ``NX`` protection
+ virtual bool has_nx() const = 0;
+
+ /// Default image base address if the ASLR is not enabled.
+ virtual uint64_t imagebase() const = 0;
+
+ /// Constructor functions that are called prior any other functions
+ virtual functions_t ctor_functions() const = 0;
+
+ /// 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;
+
+ virtual std::ostream& print(std::ostream& os) const {
+ return os;
+ }
+
+ LIEF_API friend std::ostream& operator<<(std::ostream& os, const Binary& binary) {
+ binary.print(os);
+ return os;
+ }
+
+ /// Return the debug info if present. It can be either a
+ /// LIEF::dwarf::DebugInfo or a LIEF::pdb::DebugInfo
+ ///
+ /// For ELF and Mach-O binaries, it returns the given DebugInfo object **only**
+ /// if the binary embeds the DWARF debug info in the binary itself.
+ ///
+ /// For PE file, this function tries to find the **external** PDB using
+ /// the LIEF::PE::CodeViewPDB::filename() output (if present). One can also
+ /// 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;
+
+ /// Disassemble code starting at the given virtual address and with the given
+ /// size.
+ ///
+ /// ```cpp
+ /// auto insts = binary->disassemble(0xacde, 100);
+ /// for (std::unique_ptr inst : insts) {
+ /// std::cout << inst->to_string() << '\n';
+ /// }
+ /// ```
+ ///
+ /// \see LIEF::assembly::Instruction
+ instructions_it disassemble(uint64_t address, size_t size) const;
+
+ /// Disassemble code starting at the given virtual address
+ ///
+ /// ```cpp
+ /// auto insts = binary->disassemble(0xacde);
+ /// for (std::unique_ptr inst : insts) {
+ /// std::cout << inst->to_string() << '\n';
+ /// }
+ /// ```
+ ///
+ /// \see LIEF::assembly::Instruction
+ instructions_it disassemble(uint64_t address) const;
+
+ /// Disassemble code for the given symbol name
+ ///
+ /// ```cpp
+ /// auto insts = binary->disassemble("__libc_start_main");
+ /// for (std::unique_ptr inst : insts) {
+ /// std::cout << inst->to_string() << '\n';
+ /// }
+ /// ```
+ ///
+ /// \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
+ instructions_it disassemble(const uint8_t* buffer, size_t size,
+ uint64_t address = 0) const;
+
+
+ /// Disassemble code provided by the given vector of bytes at the specified
+ /// `address` parameter.
+ ///
+ /// \see LIEF::assembly::Instruction
+ instructions_it disassemble(const std::vector& buffer,
+ uint64_t address = 0) const {
+ return disassemble(buffer.data(), buffer.size(), address);
+ }
+
+ instructions_it disassemble(LIEF::span buffer,
+ uint64_t address = 0) const {
+ return disassemble(buffer.data(), buffer.size(), address);
+ }
+
+ instructions_it disassemble(LIEF::span buffer, uint64_t address = 0) const {
+ return disassemble(buffer.data(), buffer.size(), address);
+ }
+
+ /// Assemble **and patch** the provided assembly code at the specified address.
+ ///
+ /// The function returns the generated assembly bytes
+ ///
+ /// ```cpp
+ /// bin->assemble(0x12000440, R"asm(
+ /// xor rax, rbx;
+ /// mov rcx, rax;
+ /// )asm");
+ /// ```
+ ///
+ /// 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());
+
+ /// Assemble **and patch** the address with the given LLVM MCInst.
+ ///
+ /// \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**
+ /// with the **same** version of LLVM used by LIEF (see documentation)
+ std::vector assemble(uint64_t address,
+ const std::vector& insts);
+
+ /// Get the default memory page size according to the architecture and
+ /// 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.
+ ///
+ /// 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.
+ ///
+ /// \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).
+ DebugInfo* load_debug_info(const std::string& path);
+
+ protected:
+ FORMATS format_ = FORMATS::UNKNOWN;
+ mutable std::unique_ptr debug_info_;
+ mutable std::unordered_map> engines_;
+ uint64_t original_size_ = 0;
+
+ assembly::Engine* get_engine(uint64_t address) const;
+
+ 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
+ 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 std::vector get_abstract_imported_libraries() const = 0;
+};
+
+LIEF_API const char* to_string(Binary::VA_TYPES e);
+LIEF_API const char* to_string(Binary::FORMATS e);
+
+}
+
+
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract/DebugInfo.hpp b/deps/LIEF/include/LIEF/Abstract/DebugInfo.hpp
new file mode 100644
index 00000000000000..24961cf791341b
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/DebugInfo.hpp
@@ -0,0 +1,79 @@
+/* Copyright 2022 - 2025 R. Thomas
+ *
+ * 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_DEBUGINFO_H
+#define LIEF_DEBUGINFO_H
+#include
+#include
+#include
+
+#include "LIEF/visibility.h"
+#include "LIEF/optional.hpp"
+namespace LIEF {
+
+class Binary;
+
+namespace details {
+class DebugInfo;
+}
+
+/// This class provides a generic interface for accessing debug information
+/// from different formats such as DWARF and PDB.
+///
+/// Users can use this interface to access high-level debug features like
+/// resolving function addresses.
+///
+/// See: LIEF::pdb::DebugInfo, LIEF::dwarf::DebugInfo
+class LIEF_API DebugInfo {
+ public:
+ friend class Binary;
+ enum class FORMAT {
+ UNKNOWN = 0,
+ DWARF, PDB,
+ };
+ DebugInfo(std::unique_ptr impl);
+
+ virtual ~DebugInfo();
+
+ virtual FORMAT format() const {
+ return FORMAT::UNKNOWN;
+ }
+
+ /// This function can be used to **down cast** a DebugInfo instance:
+ ///
+ /// ```cpp
+ /// std::unique_ptr dbg = bin->debug_info();
+ /// if (const auto* dwarf = inst->as()) {
+ /// dwarf->find_function("main");
+ /// }
+ /// ```
+ template
+ const T* as() const {
+ static_assert(std::is_base_of::value,
+ "Require Instruction inheritance");
+ if (T::classof(this)) {
+ return static_cast(this);
+ }
+ return nullptr;
+ }
+
+ /// Attempt to resolve the address of the function specified by `name`.
+ virtual optional find_function_address(const std::string& name) const = 0;
+
+ protected:
+ std::unique_ptr impl_;
+};
+
+}
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract/Function.hpp b/deps/LIEF/include/LIEF/Abstract/Function.hpp
new file mode 100644
index 00000000000000..66004763d6eca7
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/Function.hpp
@@ -0,0 +1,121 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_FUNCTION_H
+#define LIEF_ABSTRACT_FUNCTION_H
+
+#include
+#include
+
+#include "LIEF/Abstract/Symbol.hpp"
+#include "LIEF/visibility.h"
+#include "LIEF/enums.hpp"
+
+namespace LIEF {
+
+/// Class that represents a function in the binary
+class LIEF_API Function : public Symbol {
+ public:
+ /// Flags used to characterize the semantics of the function
+ enum class FLAGS : uint32_t {
+ NONE = 0,
+ /// The function acts as a constructor.
+ ///
+ /// Usually this flag is associated with functions
+ /// that are located in the `.init_array`, `__mod_init_func` or `.tls` sections
+ CONSTRUCTOR = 1 << 0,
+
+ /// The function acts as a destructor.
+ ///
+ /// Usually this flag is associated with functions
+ /// that are located in the `.fini_array` or `__mod_term_func` sections
+ DESTRUCTOR = 1 << 1,
+
+ /// The function is associated with Debug information
+ DEBUG_INFO = 1 << 2,
+
+ /// The function is exported by the binary and the address() method
+ /// returns its virtual address in the binary
+ EXPORTED = 1 << 3,
+
+ /// 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)
+ {}
+ Function(uint64_t address) :
+ Function("", address)
+ {}
+ Function(const std::string& name, uint64_t address) :
+ Symbol(name, address)
+ {}
+ Function(const std::string& name, uint64_t address, FLAGS flags) :
+ Function(name, address)
+ {
+ flags_ = flags;
+ }
+
+ Function(const Function&) = default;
+ Function& operator=(const Function&) = default;
+
+ ~Function() override = default;
+
+ /// List of FLAGS
+ std::vector flags_list() const;
+
+ FLAGS flags() const {
+ return flags_;
+ }
+
+ /// Add a flag to the current function
+ Function& add(FLAGS f) {
+ flags_ = (FLAGS)((uint32_t)flags_ | (uint32_t)f);
+ return *this;
+ }
+
+ /// Check if the function has the given flag
+ bool has(FLAGS f) const {
+ 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.
+ uint64_t address() const {
+ return value_;
+ }
+
+ void address(uint64_t address) {
+ value_ = address;
+ }
+
+ void accept(Visitor& visitor) const override;
+
+ LIEF_API friend std::ostream& operator<<(std::ostream& os, const Function& entry);
+
+ protected:
+ FLAGS flags_ = FLAGS::NONE;
+};
+
+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
new file mode 100644
index 00000000000000..036e64cf5a5459
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/Header.hpp
@@ -0,0 +1,147 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_HEADER_H
+#define LIEF_ABSTRACT_HEADER_H
+
+#include
+#include
+#include
+
+#include "LIEF/Object.hpp"
+#include "LIEF/visibility.h"
+#include "LIEF/enums.hpp"
+
+namespace LIEF {
+namespace ELF {
+class Binary;
+}
+
+namespace PE {
+class Binary;
+}
+
+namespace MachO {
+class Binary;
+}
+
+class LIEF_API Header : public Object {
+ public:
+ enum class ARCHITECTURES {
+ UNKNOWN = 0,
+ ARM,
+ ARM64,
+ MIPS,
+ X86,
+ X86_64,
+ PPC,
+ SPARC,
+ SYSZ,
+ XCORE,
+ RISCV,
+ LOONGARCH,
+ PPC64,
+ };
+
+ enum class ENDIANNESS {
+ UNKNOWN = 0,
+ BIG,
+ LITTLE,
+ };
+
+ enum MODES : uint64_t {
+ NONE = 0,
+
+ 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
+
+ ARM64E = 1LLU << 4, /// ARM64 with extended (security) features
+ };
+
+ enum class OBJECT_TYPES {
+ UNKNOWN = 0,
+ EXECUTABLE,
+ LIBRARY,
+ OBJECT,
+ };
+
+ static Header from(const LIEF::ELF::Binary& elf);
+ static Header from(const LIEF::PE::Binary& pe);
+ static Header from(const LIEF::MachO::Binary& macho);
+
+ Header() = default;
+ Header(const Header&) = default;
+ Header& operator=(const Header&) = default;
+ ~Header() override = default;
+
+ /// Target architecture
+ ARCHITECTURES architecture() const {
+ return architecture_;
+ }
+
+ /// Optional features for the given architecture
+ MODES modes() const {
+ return modes_;
+ }
+
+ /// MODES as a vector
+ std::vector modes_list() const;
+
+ bool is(MODES m) const {
+ return ((uint64_t)m & (uint64_t)modes_) != 0;
+ }
+
+ OBJECT_TYPES object_type() const {
+ return object_type_;
+ }
+ uint64_t entrypoint() const {
+ return entrypoint_;
+ }
+
+ ENDIANNESS endianness() const {
+ return endianness_;
+ }
+
+ bool is_32() const {
+ return ((uint64_t)modes_ & (uint64_t)MODES::BITS_32) != 0;
+ }
+
+ bool is_64() const {
+ return ((uint64_t)modes_ & (uint64_t)MODES::BITS_64) != 0;
+ }
+
+ void accept(Visitor& visitor) const override;
+
+ LIEF_API friend std::ostream& operator<<(std::ostream& os, const Header& hdr);
+
+ protected:
+ ARCHITECTURES architecture_ = ARCHITECTURES::UNKNOWN;
+ OBJECT_TYPES object_type_ = OBJECT_TYPES::UNKNOWN;
+ uint64_t entrypoint_ = 0;
+ ENDIANNESS endianness_ = ENDIANNESS::UNKNOWN;
+ MODES modes_ = MODES::NONE;
+};
+
+LIEF_API const char* to_string(Header::ARCHITECTURES e);
+LIEF_API const char* to_string(Header::OBJECT_TYPES e);
+LIEF_API const char* to_string(Header::MODES e);
+LIEF_API const char* to_string(Header::ENDIANNESS e);
+}
+
+ENABLE_BITMASK_OPERATORS(LIEF::Header::MODES);
+
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract/Parser.hpp b/deps/LIEF/include/LIEF/Abstract/Parser.hpp
new file mode 100644
index 00000000000000..9a3665192bb635
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/Parser.hpp
@@ -0,0 +1,60 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_PARSER_H
+#define LIEF_ABSTRACT_PARSER_H
+
+#include
+#include
+#include
+
+#include "LIEF/visibility.h"
+
+namespace LIEF {
+class BinaryStream;
+class Binary;
+
+/// Main interface to parse an executable regardless of its format
+class LIEF_API Parser {
+ public:
+ /// Construct an LIEF::Binary from the given filename
+ ///
+ /// @warning If the target file is a FAT Mach-O, it will return the **last** one
+ /// @see LIEF::MachO::Parser::parse
+ static std::unique_ptr parse(const std::string& filename);
+
+
+ /// Construct an LIEF::Binary from the given raw data
+ ///
+ /// @warning If the target file is a FAT Mach-O, it will return the **last** one
+ /// @see LIEF::MachO::Parser::parse
+ static std::unique_ptr parse(const std::vector& raw);
+
+ /// Construct an LIEF::Binary from the given stream
+ ///
+ /// @warning If the target file is a FAT Mach-O, it will return the **last** one
+ /// @see LIEF::MachO::Parser::parse
+ static std::unique_ptr parse(std::unique_ptr stream);
+
+ protected:
+ Parser(const std::string& file);
+ uint64_t binary_size_ = 0;
+
+ virtual ~Parser();
+ Parser();
+};
+}
+
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract/Relocation.hpp b/deps/LIEF/include/LIEF/Abstract/Relocation.hpp
new file mode 100644
index 00000000000000..c22f8e7a508cf6
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/Relocation.hpp
@@ -0,0 +1,98 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_RELOCATION_H
+#define LIEF_ABSTRACT_RELOCATION_H
+
+#include
+#include
+
+#include "LIEF/Object.hpp"
+#include "LIEF/visibility.h"
+
+namespace LIEF {
+/// Class which represents an abstracted Relocation
+class LIEF_API Relocation : public Object {
+
+ public:
+ Relocation() = default;
+
+ /// Constructor from a relocation's address and size
+ Relocation(uint64_t address, uint8_t size) :
+ address_(address),
+ size_(size)
+ {}
+
+ ~Relocation() override = default;
+
+ Relocation& operator=(const Relocation&) = default;
+ Relocation(const Relocation&) = default;
+ void swap(Relocation& other) {
+ std::swap(address_, other.address_);
+ std::swap(size_, other.size_);
+ }
+
+ /// Relocation's address
+ virtual uint64_t address() const {
+ return address_;
+ }
+
+ /// Relocation size in **bits**
+ virtual size_t size() const {
+ return size_;
+ }
+
+ virtual void address(uint64_t address) {
+ address_ = address;
+ }
+
+ virtual void size(size_t size) {
+ size_ = (uint8_t)size;
+ }
+
+ /// Method so that the ``visitor`` can visit us
+ void accept(Visitor& visitor) const override;
+
+
+ /// Comparaison based on the Relocation's **address**
+ virtual bool operator<(const Relocation& rhs) const {
+ return address() < rhs.address();
+ }
+
+ /// Comparaison based on the Relocation's **address**
+ virtual bool operator<=(const Relocation& rhs) const {
+ return !(address() > rhs.address());
+ }
+
+ /// Comparaison based on the Relocation's **address**
+ virtual bool operator>(const Relocation& rhs) const {
+ return address() > rhs.address();
+ }
+
+ /// Comparaison 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);
+
+ protected:
+ uint64_t address_ = 0;
+ uint8_t size_ = 0;
+};
+
+
+}
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract/Section.hpp b/deps/LIEF/include/LIEF/Abstract/Section.hpp
new file mode 100644
index 00000000000000..eb89b42ccc57a4
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/Section.hpp
@@ -0,0 +1,131 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_SECTION_H
+#define LIEF_ABSTRACT_SECTION_H
+
+#include
+#include
+#include
+
+#include "LIEF/span.hpp"
+#include "LIEF/Object.hpp"
+#include "LIEF/visibility.h"
+
+namespace LIEF {
+/// Class which represents an abstracted section
+class LIEF_API Section : public Object {
+ public:
+ static constexpr size_t npos = -1;
+
+ Section() = default;
+ Section(std::string name) :
+ name_(std::move(name))
+ {}
+
+ ~Section() override = default;
+
+ Section& operator=(const Section&) = default;
+ Section(const Section&) = default;
+
+ /// section's name
+ virtual std::string name() const {
+ return name_.c_str();
+ }
+
+ /// Return the **complete** section's name which might
+ /// trailing (``0``) bytes
+ virtual const std::string& fullname() const {
+ return name_;
+ }
+
+ /// section's content
+ virtual span content() const {
+ return {};
+ }
+
+ /// Change the section size
+ virtual void size(uint64_t size) {
+ size_ = size;
+ }
+
+ /// section's size (size in the binary, not the virtual size)
+ virtual uint64_t size() const {
+ return size_;
+ }
+
+ /// Offset in the binary
+ virtual uint64_t offset() const {
+ return offset_;
+ }
+
+ /// Address where the section should be mapped
+ virtual uint64_t virtual_address() const {
+ return virtual_address_;
+ }
+
+ virtual void virtual_address(uint64_t virtual_address) {
+ virtual_address_ = virtual_address;
+ }
+
+ /// Change the section's name
+ virtual void name(std::string name) {
+ name_ = std::move(name);
+ }
+
+ /// Change section content
+ virtual void content(const std::vector&) {}
+
+ virtual void offset(uint64_t offset) {
+ offset_ = offset;
+ }
+
+ /// Section's entropy
+ double entropy() const;
+
+ // Search functions
+ // ================
+ size_t search(uint64_t integer, size_t pos, size_t size) const;
+ size_t search(const std::vector& pattern, size_t pos = 0) const;
+ size_t search(const std::string& pattern, size_t pos = 0) const;
+ size_t search(uint64_t integer, size_t pos = 0) const;
+
+ // Search all functions
+ // ====================
+ std::vector search_all(uint64_t v, size_t size) const;
+
+ std::vector search_all(uint64_t v) const;
+
+ std::vector search_all(const std::string& v) const;
+
+ /// Method so that the ``visitor`` can visit us
+ void accept(Visitor& visitor) const override;
+
+
+ LIEF_API friend std::ostream& operator<<(std::ostream& os, const Section& entry);
+
+ protected:
+ std::string name_;
+ uint64_t virtual_address_ = 0;
+ uint64_t size_ = 0;
+ uint64_t offset_ = 0;
+
+ private:
+ template
+ std::vector search_all_(const T& v) const;
+};
+}
+
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract/Symbol.hpp b/deps/LIEF/include/LIEF/Abstract/Symbol.hpp
new file mode 100644
index 00000000000000..8d9802beec346c
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/Symbol.hpp
@@ -0,0 +1,97 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_SYMBOLS_H
+#define LIEF_ABSTRACT_SYMBOLS_H
+
+#include
+#include
+
+#include "LIEF/Object.hpp"
+#include "LIEF/visibility.h"
+
+namespace LIEF {
+
+/// This class represents a symbol in an executable format.
+class LIEF_API Symbol : public Object {
+ public:
+ Symbol() = default;
+ Symbol(std::string name) :
+ name_(std::move(name))
+ {}
+
+ Symbol(std::string name, uint64_t 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)
+ {}
+
+ Symbol(const Symbol&) = default;
+ Symbol& operator=(const Symbol&) = default;
+
+ Symbol(Symbol&&) = default;
+ Symbol& operator=(Symbol&&) = default;
+
+ ~Symbol() override = default;
+
+ void swap(Symbol& other) noexcept;
+
+ /// Return the symbol's name
+ virtual const std::string& name() const {
+ return name_;
+ }
+
+ virtual std::string& name() {
+ return name_;
+ }
+
+ /// Set symbol name
+ virtual void name(std::string name) {
+ name_ = std::move(name);
+ }
+
+ // Symbol's value which is usually the **address** of the symbol
+ virtual uint64_t value() const {
+ return value_;
+ }
+ virtual void value(uint64_t value) {
+ value_ = value;
+ }
+
+ /// This size of the symbol (when applicable)
+ virtual uint64_t size() const {
+ return size_;
+ }
+
+ virtual void size(uint64_t value) {
+ size_ = value;
+ }
+
+ /// Method so that the ``visitor`` can visit us
+ void accept(Visitor& visitor) const override;
+
+ LIEF_API friend std::ostream& operator<<(std::ostream& os, const Symbol& entry);
+
+ protected:
+ std::string name_;
+ uint64_t value_ = 0;
+ uint64_t size_ = 0;
+};
+}
+
+#endif
+
diff --git a/deps/LIEF/include/LIEF/Abstract/hash.hpp b/deps/LIEF/include/LIEF/Abstract/hash.hpp
new file mode 100644
index 00000000000000..26f4a375f446e6
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/hash.hpp
@@ -0,0 +1,49 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_HASH_H
+#define LIEF_ABSTRACT_HASH_H
+
+#include "LIEF/visibility.h"
+#include "LIEF/hash.hpp"
+
+namespace LIEF {
+class Binary;
+class Header;
+class Relocation;
+class Object;
+
+class LIEF_API AbstractHash : public LIEF::Hash {
+ public:
+ static LIEF::Hash::value_type hash(const Object& obj);
+
+ public:
+ using LIEF::Hash::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 Relocation& relocation) override;
+ void visit(const Function& function) override;
+
+ ~AbstractHash() override;
+};
+
+}
+
+#endif
diff --git a/deps/LIEF/include/LIEF/Abstract/json.hpp b/deps/LIEF/include/LIEF/Abstract/json.hpp
new file mode 100644
index 00000000000000..fa05cec3458482
--- /dev/null
+++ b/deps/LIEF/include/LIEF/Abstract/json.hpp
@@ -0,0 +1,30 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ABSTRACT_JSON_H
+#define LIEF_ABSTRACT_JSON_H
+
+#include "LIEF/visibility.h"
+#include
+
+namespace LIEF {
+class Object;
+
+LIEF_API std::string to_json_from_abstract(const Object& v);
+
+}
+
+#endif // LIEF_JSON_SUPPORT
+
diff --git a/deps/LIEF/include/LIEF/BinaryStream/ASN1Reader.hpp b/deps/LIEF/include/LIEF/BinaryStream/ASN1Reader.hpp
new file mode 100644
index 00000000000000..385bb35dd22c08
--- /dev/null
+++ b/deps/LIEF/include/LIEF/BinaryStream/ASN1Reader.hpp
@@ -0,0 +1,72 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_ASN1_READER_H
+#define LIEF_ASN1_READER_H
+
+#include
+#include
+#include
+#include
+
+#include "LIEF/errors.hpp"
+
+struct mbedtls_x509_crt;
+struct mbedtls_x509_time;
+
+namespace LIEF {
+class BinaryStream;
+
+class ASN1Reader {
+ public:
+ ASN1Reader() = delete;
+
+ ASN1Reader(BinaryStream& stream) :
+ stream_(stream)
+ {}
+
+ ASN1Reader(const ASN1Reader&) = delete;
+ ASN1Reader& operator=(const ASN1Reader&) = delete;
+
+
+ result is_tag(int tag);
+
+ result read_tag(int tag);
+ result read_len();
+ result read_alg();
+ result read_oid();
+ result read_bool();
+ result read_int();
+ result read_int64();
+ result> read_large_int();
+
+ result> read_bitstring();
+ result> read_octet_string();
+ result read_utf8_string();
+ result> read_cert();
+ result x509_read_names();
+ result> x509_read_serial();
+ result> x509_read_time();
+
+ std::string get_str_tag();
+
+ static std::string tag2str(int tag);
+
+ private:
+ BinaryStream& stream_;
+};
+
+}
+#endif
diff --git a/deps/LIEF/include/LIEF/BinaryStream/BinaryStream.hpp b/deps/LIEF/include/LIEF/BinaryStream/BinaryStream.hpp
new file mode 100644
index 00000000000000..48c16034e1df4f
--- /dev/null
+++ b/deps/LIEF/include/LIEF/BinaryStream/BinaryStream.hpp
@@ -0,0 +1,476 @@
+/* Copyright 2017 - 2025 R. Thomas
+ * Copyright 2017 - 2025 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_BINARY_STREAM_H
+#define LIEF_BINARY_STREAM_H
+
+#include
+#include
+#include
+#include
+#include
+
+#include "LIEF/endianness_support.hpp"
+#include "LIEF/errors.hpp"
+#include "LIEF/visibility.h"
+
+namespace LIEF {
+class ASN1Reader;
+
+/// Class that is used to a read stream of data from different sources
+class LIEF_API BinaryStream {
+ public:
+ friend class ASN1Reader;
+
+ enum class STREAM_TYPE {
+ UNKNOWN = 0,
+ VECTOR,
+ MEMORY,
+ SPAN,
+ FILE,
+
+ ELF_DATA_HANDLER,
+ };
+
+ BinaryStream(STREAM_TYPE type) :
+ stype_(type)
+ {}
+ virtual ~BinaryStream() = default;
+ virtual uint64_t size() const = 0;
+
+ STREAM_TYPE type() const {
+ return stype_;
+ }
+
+ result read_uleb128(size_t* size = nullptr) const;
+ result read_sleb128(size_t* size = nullptr) const;
+
+ result read_dwarf_encoded(uint8_t encoding) const;
+
+ 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 |