diff --git a/.github/workflows/auto-start-ci.yml b/.github/workflows/auto-start-ci.yml
index c89d289e95a9bf..4aa8e4b4b4665f 100644
--- a/.github/workflows/auto-start-ci.yml
+++ b/.github/workflows/auto-start-ci.yml
@@ -21,7 +21,7 @@ jobs:
permissions:
pull-requests: read
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
outputs:
numbers: ${{ steps.get_prs_for_ci.outputs.numbers }}
steps:
@@ -43,14 +43,14 @@ jobs:
pull-requests: write
needs: get-prs-for-ci
if: needs.get-prs-for-ci.outputs.numbers != ''
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Node.js
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml
index eec24f78eb1c13..f93167822e88ef 100644
--- a/.github/workflows/build-tarball.yml
+++ b/.github/workflows/build-tarball.yml
@@ -39,13 +39,13 @@ permissions:
jobs:
build-tarball:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-24.04
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Environment Information
@@ -57,7 +57,7 @@ jobs:
export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
./configure && make tar -j4 SKIP_XZ=1
- name: Upload tarball artifact
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: tarballs
path: '*.tar.gz'
@@ -66,27 +66,29 @@ jobs:
needs: build-tarball
runs-on: ubuntu-24.04
env:
- CC: sccache clang
- CXX: sccache clang++
- SCCACHE_GHA_ENABLED: 'true'
+ CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
+ CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
+ SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
+ SCCACHE_IDLE_TIMEOUT: '0'
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: .github/actions/install-clang
sparse-checkout-cone-mode: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up sccache
+ if: github.base_ref == 'main' || github.ref_name == 'main'
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
with:
version: v0.12.0
- name: Environment Information
run: npx envinfo
- name: Download tarball
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: tarballs
path: tarballs
diff --git a/.github/workflows/close-stale-feature-requests.yml b/.github/workflows/close-stale-feature-requests.yml
index a35ea1f9d0fc14..b6556a72ed790a 100644
--- a/.github/workflows/close-stale-feature-requests.yml
+++ b/.github/workflows/close-stale-feature-requests.yml
@@ -39,9 +39,9 @@ jobs:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
+ - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 180
diff --git a/.github/workflows/close-stale-pull-requests.yml b/.github/workflows/close-stale-pull-requests.yml
index b18cd5c37e69c4..de565c9051328d 100644
--- a/.github/workflows/close-stale-pull-requests.yml
+++ b/.github/workflows/close-stale-pull-requests.yml
@@ -33,7 +33,7 @@ jobs:
permissions:
pull-requests: write # for actions/stale to close stale PRs
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- name: Set default end date which is 1 year ago
run: echo "END_DATE=$(date --date='525600 minutes ago' --rfc-2822)" >> "$GITHUB_ENV"
diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml
index 1a6bce644c4f2d..0665796700976c 100644
--- a/.github/workflows/close-stalled.yml
+++ b/.github/workflows/close-stalled.yml
@@ -18,9 +18,9 @@ jobs:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
+ - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-close: 30
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 7a94ebe76f0621..d29e734a82fd8c 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -10,7 +10,7 @@ permissions:
jobs:
analyze:
name: Analyze
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
permissions:
actions: read
contents: read
@@ -23,19 +23,19 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
+ uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql-config.yml
- name: Autobuild
- uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
+ uses: github/codeql-action/autobuild@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
+ uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
with:
category: /language:${{matrix.language}}
diff --git a/.github/workflows/comment-labeled.yml b/.github/workflows/comment-labeled.yml
index 7e3a19c6afd13c..e6652507484154 100644
--- a/.github/workflows/comment-labeled.yml
+++ b/.github/workflows/comment-labeled.yml
@@ -24,7 +24,7 @@ jobs:
issues: write
pull-requests: write
if: github.repository == 'nodejs/node' && github.event.label.name == 'stalled'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- name: Post stalled comment
env:
@@ -36,7 +36,7 @@ jobs:
permissions:
pull-requests: write
if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'fast-track'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- name: Request Fast-Track
env:
@@ -47,7 +47,7 @@ jobs:
permissions:
pull-requests: write
if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'notable-change'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- name: Add notable change description
env:
diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml
index 100725b9913740..cb40dd731ccdee 100644
--- a/.github/workflows/commit-lint.yml
+++ b/.github/workflows/commit-lint.yml
@@ -10,20 +10,20 @@ permissions:
jobs:
lint-commit-message:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- name: Compute number of commits in the PR
id: nb-of-commits
run: |
echo "plusOne=$((${{ github.event.pull_request.commits }} + 1))" >> $GITHUB_OUTPUT
echo "minusOne=$((${{ github.event.pull_request.commits }} - 1))" >> $GITHUB_OUTPUT
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: ${{ steps.nb-of-commits.outputs.plusOne }}
persist-credentials: false
- run: git reset HEAD^2
- name: Install Node.js
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Validate commit message
diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml
index fdce1e8ddbaef9..85f4b1fd5e1f38 100644
--- a/.github/workflows/commit-queue.yml
+++ b/.github/workflows/commit-queue.yml
@@ -26,7 +26,7 @@ jobs:
permissions:
pull-requests: read
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
outputs:
numbers: ${{ steps.get_mergeable_prs.outputs.numbers }}
steps:
@@ -57,9 +57,9 @@ jobs:
commitQueue:
needs: get_mergeable_prs
if: needs.get_mergeable_prs.outputs.numbers != ''
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# A personal token is required because pushing with GITHUB_TOKEN will
# prevent commits from running CI after they land. It needs
@@ -69,7 +69,7 @@ jobs:
# Install dependencies
- name: Install Node.js
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install @node-core/utils
diff --git a/.github/workflows/coverage-linux-without-intl.yml b/.github/workflows/coverage-linux-without-intl.yml
index daca9165fdc7d2..a282b242efea4e 100644
--- a/.github/workflows/coverage-linux-without-intl.yml
+++ b/.github/workflows/coverage-linux-without-intl.yml
@@ -36,9 +36,10 @@ concurrency:
env:
PYTHON_VERSION: '3.14'
FLAKY_TESTS: keep_retrying
- CC: sccache clang
- CXX: sccache clang++
- SCCACHE_GHA_ENABLED: 'true'
+ CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
+ CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
+ SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
+ SCCACHE_IDLE_TIMEOUT: '0'
permissions:
contents: read
@@ -48,14 +49,15 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-24.04
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up sccache
+ if: github.base_ref == 'main' || github.ref_name == 'main'
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
with:
version: v0.12.0
diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml
index 52eb3b72917cd7..6d8a87003ca628 100644
--- a/.github/workflows/coverage-linux.yml
+++ b/.github/workflows/coverage-linux.yml
@@ -36,9 +36,10 @@ concurrency:
env:
PYTHON_VERSION: '3.14'
FLAKY_TESTS: keep_retrying
- CC: sccache clang
- CXX: sccache clang++
- SCCACHE_GHA_ENABLED: 'true'
+ CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
+ CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
+ SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
+ SCCACHE_IDLE_TIMEOUT: '0'
permissions:
contents: read
@@ -48,14 +49,15 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-24.04
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up sccache
+ if: github.base_ref == 'main' || github.ref_name == 'main'
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
with:
version: v0.12.0
diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml
index eace33d7a0fb10..17c1dc1e20e88a 100644
--- a/.github/workflows/coverage-windows.yml
+++ b/.github/workflows/coverage-windows.yml
@@ -45,11 +45,11 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: windows-2025
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install deps
diff --git a/.github/workflows/create-release-proposal.yml b/.github/workflows/create-release-proposal.yml
index c9b1ff34d1452a..c2161d6a8f5e2a 100644
--- a/.github/workflows/create-release-proposal.yml
+++ b/.github/workflows/create-release-proposal.yml
@@ -31,16 +31,16 @@ jobs:
RELEASE_BRANCH: v${{ inputs.release-line }}.x
RELEASE_DATE: ${{ inputs.release-date }}
RELEASE_LINE: ${{ inputs.release-line }}
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ env.STAGING_BRANCH }}
persist-credentials: false
# Install dependencies
- name: Install Node.js
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
diff --git a/.github/workflows/daily-wpt-fyi.yml b/.github/workflows/daily-wpt-fyi.yml
index c941e6945ac534..a83fb4e74917ad 100644
--- a/.github/workflows/daily-wpt-fyi.yml
+++ b/.github/workflows/daily-wpt-fyi.yml
@@ -21,7 +21,7 @@ permissions:
jobs:
collect-versions:
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
outputs:
matrix: ${{ steps.query.outputs.matrix }}
steps:
@@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Environment Information
@@ -51,7 +51,7 @@ jobs:
run: echo "NIGHTLY=$(curl -s https://nodejs.org/download/nightly/index.json | jq -r '[.[] | select(.files[] | contains("linux-x64"))][0].version')" >> $GITHUB_ENV
- name: Install Node.js
id: setup-node
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NIGHTLY || matrix.node-version }}
check-latest: true
@@ -63,7 +63,7 @@ jobs:
SHORT_SHA=$(node -p 'process.version.split(/-nightly\d{8}/)[1]')
echo "NIGHTLY_REF=$(gh api /repos/nodejs/node/commits/$SHORT_SHA --jq '.sha')" >> $GITHUB_ENV
- name: Checkout ${{ steps.setup-node.outputs.node-version }}
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
ref: ${{ env.NIGHTLY_REF || steps.setup-node.outputs.node-version }}
@@ -79,7 +79,7 @@ jobs:
run: rm -rf wpt
working-directory: test/fixtures
- name: Checkout epochs/daily WPT
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: web-platform-tests/wpt
persist-credentials: false
@@ -102,7 +102,7 @@ jobs:
run: cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json
- name: Upload GitHub Actions artifact
if: ${{ env.WPT_REPORT != '' }}
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
path: out/wpt/wptreport-*.json
name: WPT Report for ${{ steps.setup-node.outputs.node-version }}
diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml
index ea29a9835b33f0..a254f2f35fa6e7 100644
--- a/.github/workflows/daily.yml
+++ b/.github/workflows/daily.yml
@@ -15,11 +15,11 @@ jobs:
build-lto:
runs-on: ubuntu-24.04
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Environment Information
diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml
index 57e30eb7f0c83a..51268b3c475da4 100644
--- a/.github/workflows/doc.yml
+++ b/.github/workflows/doc.yml
@@ -22,20 +22,20 @@ permissions:
jobs:
build-docs:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Environment Information
run: npx envinfo
- name: Build
run: NODE=$(command -v node) make doc-only
- - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
+ - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: docs
path: out/doc
diff --git a/.github/workflows/find-inactive-collaborators.yml b/.github/workflows/find-inactive-collaborators.yml
index d45712fc749413..6633143c6c1ac8 100644
--- a/.github/workflows/find-inactive-collaborators.yml
+++ b/.github/workflows/find-inactive-collaborators.yml
@@ -16,16 +16,16 @@ permissions:
jobs:
find:
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
diff --git a/.github/workflows/find-inactive-tsc.yml b/.github/workflows/find-inactive-tsc.yml
index 91146e6290245f..42c3a95c4ecc5a 100644
--- a/.github/workflows/find-inactive-tsc.yml
+++ b/.github/workflows/find-inactive-tsc.yml
@@ -16,17 +16,17 @@ permissions:
jobs:
find:
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- name: Checkout the repo
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Clone nodejs/TSC repository
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
path: .tmp
@@ -34,7 +34,7 @@ jobs:
repository: nodejs/TSC
- name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
diff --git a/.github/workflows/label-flaky-test-issue.yml b/.github/workflows/label-flaky-test-issue.yml
index f56c4f0673e9dd..9f37f3b3efc8b6 100644
--- a/.github/workflows/label-flaky-test-issue.yml
+++ b/.github/workflows/label-flaky-test-issue.yml
@@ -10,7 +10,7 @@ permissions:
jobs:
label:
if: github.event.label.name == 'flaky-test'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
permissions:
issues: write
steps:
diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml
index 95fdd42a4c700a..03aa1fa9a8d0e6 100644
--- a/.github/workflows/label-pr.yml
+++ b/.github/workflows/label-pr.yml
@@ -9,7 +9,7 @@ permissions:
jobs:
label:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- uses: nodejs/node-pr-labeler@d4cf1b8b9f23189c37917000e5e17e796c770a6b # v1
diff --git a/.github/workflows/license-builder.yml b/.github/workflows/license-builder.yml
index 6c7dc8721d382b..08ff3c7b014af0 100644
--- a/.github/workflows/license-builder.yml
+++ b/.github/workflows/license-builder.yml
@@ -15,9 +15,9 @@ jobs:
contents: write # for gr2m/create-or-update-pull-request-action to push local changes
pull-requests: write # for gr2m/create-or-update-pull-request-action to create a PR
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: ./tools/license-builder.sh # Run the license builder tool
diff --git a/.github/workflows/lint-release-proposal.yml b/.github/workflows/lint-release-proposal.yml
index 479f1f79cb4798..4ebeff30019b34 100644
--- a/.github/workflows/lint-release-proposal.yml
+++ b/.github/workflows/lint-release-proposal.yml
@@ -18,12 +18,12 @@ permissions:
jobs:
lint-release-commit:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
permissions:
contents: read
pull-requests: read
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 2
@@ -92,9 +92,15 @@ jobs:
"/repos/${GITHUB_REPOSITORY}/compare/v${MAJOR}.x...$GITHUB_SHA" --paginate \
| node tools/actions/lint-release-proposal-commit-list.mjs "$CHANGELOG_PATH" "$GITHUB_SHA" \
| while IFS= read -r PR_URL; do
- LABEL="dont-land-on-v${MAJOR}.x" gh pr view \
+ DONT_LAND_LABEL="dont-land-on-v${MAJOR}.x" LTS_WATCH_LABEL="lts-watch-v${MAJOR}.x" gh pr view \
--json labels,url \
- --jq 'if (.labels|map(.name==env.LABEL)|any) then error("\(.url) has the \(env.LABEL) label, forbidding it to be in this release proposal") end' \
+ --jq '
+ if (.labels|any(.name==env.DONT_LAND_LABEL)) then
+ error("\(.url) has the \(env.DONT_LAND_LABEL) label, forbidding it to be in this release proposal")
+ elif (.labels|any(.name==env.LTS_WATCH_LABEL)) then
+ error("\(.url) has the \(env.LTS_WATCH_LABEL) label, please remove the label now that the PR is included in a release proposal")
+ end
+ ' \
"$PR_URL" > /dev/null
done
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
index 052f05734a69ee..fffb02940844cb 100644
--- a/.github/workflows/linters.yml
+++ b/.github/workflows/linters.yml
@@ -23,13 +23,13 @@ permissions:
jobs:
lint-addon-docs:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Environment Information
@@ -38,13 +38,13 @@ jobs:
run: NODE=$(command -v node) make lint-addon-docs
lint-cpp:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Environment Information
@@ -53,18 +53,18 @@ jobs:
run: make lint-cpp
format-cpp:
if: ${{ github.event.pull_request && github.event.pull_request.draft == false && github.base_ref == github.event.repository.default_branch }}
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Environment Information
@@ -91,13 +91,13 @@ jobs:
fi
lint-js-and-md:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Environment Information
@@ -140,9 +140,9 @@ jobs:
NODE_RELEASED_VERSIONS: ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }}
lint-py:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: |
@@ -156,7 +156,7 @@ jobs:
*.py
sparse-checkout-cone-mode: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Environment Information
@@ -167,9 +167,9 @@ jobs:
make lint-py
lint-yaml:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: |
@@ -179,7 +179,7 @@ jobs:
*.yaml
sparse-checkout-cone-mode: false
- name: Use Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Environment Information
@@ -191,9 +191,9 @@ jobs:
lint-sh:
if: github.event.pull_request.draft == false
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: |
@@ -205,9 +205,10 @@ jobs:
run: tools/lint-sh.mjs .
lint-codeowners:
if: github.event.pull_request.draft == false
+ # cannot use ubuntu-slim here because mszostok/codeowners-validator is dockerized
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: mszostok/codeowners-validator@7f3f5e28c6d7b8dfae5731e54ce2272ca384592f
@@ -215,9 +216,9 @@ jobs:
checks: files,duppatterns
lint-pr-url:
if: ${{ github.event.pull_request }}
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 2
persist-credentials: false
@@ -228,9 +229,9 @@ jobs:
# GH Actions squashes all PR commits, HEAD^ refers to the base branch.
- run: git diff HEAD^ HEAD -G"pr-url:" -- "*.md" | ./tools/lint-pr-url.mjs ${{ github.event.pull_request.html_url }}
lint-readme:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: |
diff --git a/.github/workflows/major-release.yml b/.github/workflows/major-release.yml
index dfe49605429583..b65917f89e74b2 100644
--- a/.github/workflows/major-release.yml
+++ b/.github/workflows/major-release.yml
@@ -10,7 +10,7 @@ permissions:
jobs:
create-issue:
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
permissions:
issues: write
steps:
diff --git a/.github/workflows/notify-on-push.yml b/.github/workflows/notify-on-push.yml
index 67bd1b1e2e69b6..92d7438bf94b1d 100644
--- a/.github/workflows/notify-on-push.yml
+++ b/.github/workflows/notify-on-push.yml
@@ -11,6 +11,7 @@ jobs:
notifyOnForcePush:
name: Notify on Force Push on `main`
if: github.repository == 'nodejs/node' && github.event.forced
+ # cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
runs-on: ubuntu-latest
steps:
- name: Slack Notification
@@ -30,9 +31,10 @@ jobs:
validateCommitMessage:
name: Notify on Push on `main` with invalid message
if: github.repository == 'nodejs/node'
+ # cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Check commit message
diff --git a/.github/workflows/notify-on-review-wanted.yml b/.github/workflows/notify-on-review-wanted.yml
index 96eee3096d8b69..b6c9fe6e7f5d5b 100644
--- a/.github/workflows/notify-on-review-wanted.yml
+++ b/.github/workflows/notify-on-review-wanted.yml
@@ -12,6 +12,7 @@ jobs:
notifyOnReviewWanted:
name: Notify on Review Wanted
if: github.repository == 'nodejs/node' && github.event.label.name == 'review wanted'
+ # cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
runs-on: ubuntu-latest
steps:
- name: Determine PR or Issue
diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml
index 0f877b3c639bed..87320f3f51da45 100644
--- a/.github/workflows/post-release.yml
+++ b/.github/workflows/post-release.yml
@@ -16,7 +16,7 @@ permissions:
jobs:
post-release-actions:
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- name: Trigger update-links workflow on nodejs/release-cloudflare-worker
run: |
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
index 02480c5c7ffd56..d3c673d0a860a1 100644
--- a/.github/workflows/scorecard.yml
+++ b/.github/workflows/scorecard.yml
@@ -21,6 +21,7 @@ permissions: read-all
jobs:
analysis:
name: Scorecard analysis
+ # cannot use ubuntu-slim here because ossf/scorecard-action is dockerized
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
@@ -33,12 +34,12 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
+ uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Checkout code
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
@@ -65,7 +66,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: Upload artifact
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: SARIF file
path: results.sarif
@@ -73,6 +74,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
- uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
+ uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
with:
sarif_file: results.sarif
diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml
index a7f17dd6d9e2da..0a50bbb9b518be 100644
--- a/.github/workflows/test-internet.yml
+++ b/.github/workflows/test-internet.yml
@@ -33,9 +33,10 @@ concurrency:
env:
PYTHON_VERSION: '3.14'
FLAKY_TESTS: keep_retrying
- CC: sccache clang
- CXX: sccache clang++
- SCCACHE_GHA_ENABLED: 'true'
+ CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
+ CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
+ SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
+ SCCACHE_IDLE_TIMEOUT: '0'
permissions:
contents: read
@@ -45,14 +46,15 @@ jobs:
if: github.event_name == 'schedule' && github.repository == 'nodejs/node' || github.event.pull_request.draft == false
runs-on: ubuntu-24.04
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up sccache
+ if: github.base_ref == 'main' || github.ref_name == 'main'
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
with:
version: v0.12.0
diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml
index 9605dae7a6e15e..be7fe55e20acc9 100644
--- a/.github/workflows/test-linux.yml
+++ b/.github/workflows/test-linux.yml
@@ -31,9 +31,10 @@ concurrency:
env:
PYTHON_VERSION: '3.14'
FLAKY_TESTS: keep_retrying
- CC: sccache clang
- CXX: sccache clang++
- SCCACHE_GHA_ENABLED: 'true'
+ CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang
+ CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} clang++
+ SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
+ SCCACHE_IDLE_TIMEOUT: '0'
permissions:
contents: read
@@ -47,15 +48,16 @@ jobs:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: node
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up sccache
+ if: github.base_ref == 'main' || github.ref_name == 'main'
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
with:
version: v0.12.0
diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml
index eabe54e2fab44e..d5577a3dcbe296 100644
--- a/.github/workflows/test-macos.yml
+++ b/.github/workflows/test-macos.yml
@@ -45,21 +45,23 @@ jobs:
fail-fast: false
runs-on: macos-14
env:
- CC: sccache gcc
- CXX: sccache g++
- SCCACHE_GHA_ENABLED: 'true'
+ CC: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} gcc
+ CXX: ${{ (github.base_ref == 'main' || github.ref_name == 'main') && 'sccache' || '' }} g++
+ SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
+ SCCACHE_IDLE_TIMEOUT: '0'
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: node
- name: Set up Python ${{ env.PYTHON_VERSION }}
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up Xcode ${{ env.XCODE_VERSION }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: Set up sccache
+ if: github.base_ref == 'main' || github.ref_name == 'main'
uses: Mozilla-Actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
with:
version: v0.12.0
diff --git a/.github/workflows/timezone-update.yml b/.github/workflows/timezone-update.yml
index 51dd8f155b89fa..83e411ac6040fc 100644
--- a/.github/workflows/timezone-update.yml
+++ b/.github/workflows/timezone-update.yml
@@ -16,16 +16,16 @@ jobs:
pull-requests: write # to create a PR (gr2m/create-or-update-pull-request-action)
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- name: Checkout nodejs/node
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Checkout unicode-org/icu-data
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: icu-data
persist-credentials: false
diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml
index 9df140078318d3..140dc66797825c 100644
--- a/.github/workflows/tools.yml
+++ b/.github/workflows/tools.yml
@@ -19,7 +19,7 @@ on:
- amaro
- brotli
- c-ares
- - cjs-module-lexer
+ - merve
- corepack
- googletest
- gyp-next
@@ -51,7 +51,7 @@ permissions:
jobs:
tools-deps-update:
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
strategy:
fail-fast: false # Prevent other jobs from aborting if one fails
matrix:
@@ -104,11 +104,11 @@ jobs:
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- - id: cjs-module-lexer
+ - id: merve
subsystem: deps
label: dependencies
run: |
- ./tools/dep_updaters/update-cjs-module-lexer.sh > temp-output
+ ./tools/dep_updaters/update-merve.sh > temp-output
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
@@ -280,7 +280,7 @@ jobs:
run: |
git config --global user.name "Node.js GitHub Bot"
git config --global user.email "github-bot@iojs.org"
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id
with:
persist-credentials: false
@@ -288,7 +288,7 @@ jobs:
if: |
(matrix.id == 'icu' || matrix.id == 'inspector_protocol') &&
(github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id)
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- run: ${{ matrix.run }}
@@ -299,7 +299,7 @@ jobs:
if: env.COMMIT_MSG == '' && (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id)
run: |
echo "COMMIT_MSG=${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}" >> "$GITHUB_ENV"
- - uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
+ - uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id
# Creates a PR or update the Action's existing PR, or
# no-op if the base branch is already up-to-date.
diff --git a/.github/workflows/update-openssl.yml b/.github/workflows/update-openssl.yml
index ee9a3e0fa11c03..162af042e6d7ad 100644
--- a/.github/workflows/update-openssl.yml
+++ b/.github/workflows/update-openssl.yml
@@ -12,9 +12,9 @@ permissions:
jobs:
openssl-update:
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Check and download new OpenSSL version
diff --git a/.github/workflows/update-v8.yml b/.github/workflows/update-v8.yml
index 1db258a6020d42..326362de1a49b7 100644
--- a/.github/workflows/update-v8.yml
+++ b/.github/workflows/update-v8.yml
@@ -14,13 +14,13 @@ permissions:
jobs:
v8-update:
if: github.repository == 'nodejs/node'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Cache node modules and update-v8
- uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
+ uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
id: cache-v8-npm
env:
cache-name: cache-v8-npm
@@ -30,7 +30,7 @@ jobs:
~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install Node.js
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install @node-core/utils
@@ -45,7 +45,7 @@ jobs:
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- - uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
+ - uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
# Creates a PR or update the Action's existing PR, or
# no-op if the base branch is already up-to-date.
with:
diff --git a/.github/workflows/update-wpt.yml b/.github/workflows/update-wpt.yml
index edf4aaeba35c7a..b9287b11cf7eea 100644
--- a/.github/workflows/update-wpt.yml
+++ b/.github/workflows/update-wpt.yml
@@ -20,19 +20,19 @@ env:
jobs:
wpt-subsystem-update:
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
- runs-on: ubuntu-latest
+ runs-on: ubuntu-slim
strategy:
fail-fast: false
matrix:
subsystem: ${{ fromJSON(github.event.inputs.subsystems || '["url", "urlpattern", "WebCryptoAPI"]') }}
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Node.js
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ env.NODE_VERSION }}
diff --git a/.gitignore b/.gitignore
index bf839aa91c86e1..221e4f4062486a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -144,6 +144,7 @@ tools/*/*.i.tmp
/deps/**/.github/
# Ignore dependencies fetched by tools/v8/fetch_deps.py
/deps/.cipd
+!deps/LIEF/**
# === Rules for Windows vcbuild.bat ===
/temp-vcbuild
diff --git a/CHANGELOG.md b/CHANGELOG.md
index eb8f7c8b48a853..f2a2d7748563b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,7 +40,8 @@ release.
-24.13.1
+24.14.0
+24.13.1
24.13.0
24.12.0
24.11.1
diff --git a/LICENSE b/LICENSE
index df0947155c7e57..403ea3c5717087 100644
--- a/LICENSE
+++ b/LICENSE
@@ -104,18 +104,26 @@ The externally maintained libraries used by Node.js are:
SOFTWARE.
"""
-- cjs-module-lexer, located at deps/cjs-module-lexer, is licensed as follows:
+- merve, located at deps/merve, is licensed as follows:
"""
- MIT License
- -----------
-
- Copyright (C) 2018-2020 Guy Bedford
+ Copyright 2026 Yagiz Nizipli
- 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:
+ 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 above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
- 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.
+ 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.
"""
- ittapi, located at deps/v8/third_party/ittapi, is licensed as follows:
@@ -986,6 +994,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.
diff --git a/README.md b/README.md
index 3ac5fba3d77ab2..537b4776ca92a1 100644
--- a/README.md
+++ b/README.md
@@ -105,7 +105,7 @@ curl -fsLo "/path/to/nodejs-keyring.kbx" "https://github.com/nodejs/release-keys
```
Alternatively, you can import the releaser keys in your default keyring, see
-[Release keys](#release-keys) for commands to how to do that.
+[Release keys](#release-keys) for commands on how to do that.
Then, you can verify the files you've downloaded locally
(if you're using your default keyring, pass `--keyring="${GNUPGHOME:-~/.gnupg}/pubring.kbx"`):
diff --git a/SECURITY.md b/SECURITY.md
index 34d8633cf1f27d..6213ca3d43a704 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -335,6 +335,18 @@ the community they pose.
proper security boundaries between trusted application logic and untrusted
user input.
+#### Unhandled 'error' Events on EventEmitters (CWE-248)
+
+* EventEmitters that can emit `'error'` events require the application to
+ attach an `'error'` event handler. This includes HTTP streams and other
+ Node.js core streams. If the application fails to attach an `'error'`
+ handler, the EventEmitter will throw an uncaught exception, which may
+ crash the process.
+* Crashes resulting from missing `'error'` handlers are not considered
+ denial-of-service vulnerabilities in Node.js. It is the application's
+ responsibility to properly handle errors by attaching appropriate
+ `'error'` event listeners to EventEmitters that may emit errors.
+
## Assessing experimental features reports
Experimental features are eligible for security reports just like any other
diff --git a/benchmark/http/bench-parser-fragmented.js b/benchmark/http/bench-parser-fragmented.js
new file mode 100644
index 00000000000000..6dd8f332a7ffad
--- /dev/null
+++ b/benchmark/http/bench-parser-fragmented.js
@@ -0,0 +1,67 @@
+'use strict';
+
+const common = require('../common');
+
+const bench = common.createBenchmark(main, {
+ len: [8, 16],
+ frags: [2, 4, 8],
+ n: [1e5],
+}, {
+ flags: ['--expose-internals', '--no-warnings'],
+});
+
+function main({ len, frags, n }) {
+ const { HTTPParser } = common.binding('http_parser');
+ const REQUEST = HTTPParser.REQUEST;
+ const kOnHeaders = HTTPParser.kOnHeaders | 0;
+ const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
+ const kOnBody = HTTPParser.kOnBody | 0;
+ const kOnMessageComplete = HTTPParser.kOnMessageComplete | 0;
+
+ function processHeaderFragmented(fragments, n) {
+ const parser = newParser(REQUEST);
+
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ // Send header in fragments
+ for (const frag of fragments) {
+ parser.execute(frag, 0, frag.length);
+ }
+ parser.initialize(REQUEST, {});
+ }
+ bench.end(n);
+ }
+
+ function newParser(type) {
+ const parser = new HTTPParser();
+ parser.initialize(type, {});
+
+ parser.headers = [];
+
+ parser[kOnHeaders] = function() { };
+ parser[kOnHeadersComplete] = function() { };
+ parser[kOnBody] = function() { };
+ parser[kOnMessageComplete] = function() { };
+
+ return parser;
+ }
+
+ // Build the header
+ let header = `GET /hello HTTP/1.1\r\nContent-Type: text/plain\r\n`;
+
+ for (let i = 0; i < len; i++) {
+ header += `X-Filler${i}: ${Math.random().toString(36).substring(2)}\r\n`;
+ }
+ header += '\r\n';
+
+ // Split header into fragments
+ const headerBuf = Buffer.from(header);
+ const fragSize = Math.ceil(headerBuf.length / frags);
+ const fragments = [];
+
+ for (let i = 0; i < headerBuf.length; i += fragSize) {
+ fragments.push(headerBuf.slice(i, Math.min(i + fragSize, headerBuf.length)));
+ }
+
+ processHeaderFragmented(fragments, n);
+}
diff --git a/benchmark/util/text-decoder-stream.js b/benchmark/util/text-decoder-stream.js
new file mode 100644
index 00000000000000..16293b5b1375de
--- /dev/null
+++ b/benchmark/util/text-decoder-stream.js
@@ -0,0 +1,55 @@
+'use strict';
+
+const common = require('../common.js');
+
+const bench = common.createBenchmark(main, {
+ encoding: ['utf-8', 'utf-16le'],
+ ignoreBOM: [0, 1],
+ fatal: [0, 1],
+ unicode: [0, 1],
+ len: [256, 1024 * 16, 1024 * 128],
+ chunks: [10],
+ n: [1e3],
+ type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer'],
+});
+
+const UNICODE_ALPHA = 'Blåbærsyltetøy';
+const ASCII_ALPHA = 'Blueberry jam';
+
+function main({ encoding, len, unicode, chunks, n, ignoreBOM, type, fatal }) {
+ const decoder = new TextDecoder(encoding, { ignoreBOM, fatal });
+ let buf;
+
+ const fill = Buffer.from(unicode ? UNICODE_ALPHA : ASCII_ALPHA, encoding);
+
+ switch (type) {
+ case 'SharedArrayBuffer': {
+ buf = new SharedArrayBuffer(len);
+ Buffer.from(buf).fill(fill);
+ break;
+ }
+ case 'ArrayBuffer': {
+ buf = new ArrayBuffer(len);
+ Buffer.from(buf).fill(fill);
+ break;
+ }
+ case 'Buffer': {
+ buf = Buffer.alloc(len, fill);
+ break;
+ }
+ }
+
+ const chunk = Math.ceil(len / chunks);
+ const max = len - chunk;
+ bench.start();
+ for (let i = 0; i < n; i++) {
+ let pos = 0;
+ while (pos < max) {
+ decoder.decode(buf.slice(pos, pos + chunk), { stream: true });
+ pos += chunk;
+ }
+
+ decoder.decode(buf.slice(pos));
+ }
+ bench.end(n);
+}
diff --git a/common.gypi b/common.gypi
index 5adfd888711ae4..c5a7dc9cacf8b9 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.40',
+ 'v8_embedder_string': '-node.41',
##### V8 defaults for Node.js #####
diff --git a/configure.py b/configure.py
index f31d460038db2f..98a8b147e4cbfd 100755
--- a/configure.py
+++ b/configure.py
@@ -58,9 +58,7 @@
maglev_enabled_architectures = ('x64', 'arm', 'arm64')
# builtins may be removed later if they have been disabled by options
-shareable_builtins = {'cjs_module_lexer/lexer': 'deps/cjs-module-lexer/lexer.js',
- 'cjs_module_lexer/dist/lexer': 'deps/cjs-module-lexer/dist/lexer.js',
- 'undici/undici': 'deps/undici/undici.js',
+shareable_builtins = {'undici/undici': 'deps/undici/undici.js',
'amaro/dist/index': 'deps/amaro/dist/index.js'
}
@@ -257,6 +255,50 @@
help='Use the specified path to system CA (PEM format) in addition to '
'the OpenSSL supplied CA store or compiled-in Mozilla CA copy.')
+shared_optgroup.add_argument('--shared-gtest',
+ action='store_true',
+ dest='shared_gtest',
+ default=None,
+ help='link to a shared googletest DLL instead of static linking')
+
+shared_optgroup.add_argument('--shared-gtest-includes',
+ action='store',
+ dest='shared_gtest_includes',
+ help='directory containing googletest header files')
+
+shared_optgroup.add_argument('--shared-gtest-libname',
+ action='store',
+ dest='shared_gtest_libname',
+ default='gtest',
+ help='alternative lib name to link to [default: %(default)s]')
+
+shared_optgroup.add_argument('--shared-gtest-libpath',
+ action='store',
+ dest='shared_gtest_libpath',
+ help='a directory to search for the shared googletest DLL')
+
+shared_optgroup.add_argument('--shared-hdr-histogram',
+ action='store_true',
+ dest='shared_hdr_histogram',
+ default=None,
+ help='link to a shared HdrHistogram DLL instead of static linking')
+
+shared_optgroup.add_argument('--shared-hdr-histogram-includes',
+ action='store',
+ dest='shared_hdr_histogram_includes',
+ help='directory containing HdrHistogram header files')
+
+shared_optgroup.add_argument('--shared-hdr-histogram-libname',
+ action='store',
+ dest='shared_hdr_histogram_libname',
+ default='hdr_histogram',
+ help='alternative lib name to link to [default: %(default)s]')
+
+shared_optgroup.add_argument('--shared-hdr-histogram-libpath',
+ action='store',
+ dest='shared_hdr_histogram_libpath',
+ help='a directory to search for the shared HdrHistogram DLL')
+
parser.add_argument('--experimental-http-parser',
action='store_true',
dest='experimental_http_parser',
@@ -307,6 +349,28 @@
dest='shared_libuv_libpath',
help='a directory to search for the shared libuv DLL')
+shared_optgroup.add_argument('--shared-nbytes',
+ action='store_true',
+ dest='shared_nbytes',
+ default=None,
+ help='link to a shared nbytes DLL instead of static linking')
+
+shared_optgroup.add_argument('--shared-nbytes-includes',
+ action='store',
+ dest='shared_nbytes_includes',
+ help='directory containing nbytes header files')
+
+shared_optgroup.add_argument('--shared-nbytes-libname',
+ action='store',
+ dest='shared_nbytes_libname',
+ default='nbytes',
+ help='alternative lib name to link to [default: %(default)s]')
+
+shared_optgroup.add_argument('--shared-nbytes-libpath',
+ action='store',
+ dest='shared_nbytes_libpath',
+ help='a directory to search for the shared nbytes DLL')
+
shared_optgroup.add_argument('--shared-nghttp2',
action='store_true',
dest='shared_nghttp2',
@@ -484,7 +548,6 @@
dest='shared_simdutf_libpath',
help='a directory to search for the shared simdutf DLL')
-
shared_optgroup.add_argument('--shared-ada',
action='store_true',
dest='shared_ada',
@@ -507,6 +570,28 @@
dest='shared_ada_libpath',
help='a directory to search for the shared ada DLL')
+shared_optgroup.add_argument('--shared-merve',
+ action='store_true',
+ dest='shared_merve',
+ default=None,
+ help='link to a shared merve DLL instead of static linking')
+
+shared_optgroup.add_argument('--shared-merve-includes',
+ action='store',
+ dest='shared_merve_includes',
+ help='directory containing merve header files')
+
+shared_optgroup.add_argument('--shared-merve-libname',
+ action='store',
+ dest='shared_merve_libname',
+ default='merve',
+ help='alternative lib name to link to [default: %(default)s]')
+
+shared_optgroup.add_argument('--shared-merve-libpath',
+ action='store',
+ dest='shared_merve_libpath',
+ help='a directory to search for the shared merve DLL')
+
shared_optgroup.add_argument('--shared-brotli',
action='store_true',
dest='shared_brotli',
@@ -2298,6 +2383,10 @@ def make_bin_override():
configure_library('simdutf', output)
configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc'])
configure_library('cares', output, pkgname='libcares')
+configure_library('gtest', output)
+configure_library('hdr_histogram', output)
+configure_library('merve', output)
+configure_library('nbytes', output)
configure_library('nghttp2', output, pkgname='libnghttp2')
configure_library('nghttp3', output, pkgname='libnghttp3')
configure_library('ngtcp2', output, pkgname='libngtcp2')
diff --git a/deps/LIEF/LICENSE b/deps/LIEF/LICENSE
new file mode 100644
index 00000000000000..0c225d7eeb8036
--- /dev/null
+++ b/deps/LIEF/LICENSE
@@ -0,0 +1,202 @@
+ 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.
diff --git a/deps/LIEF/README.md b/deps/LIEF/README.md
new file mode 100644
index 00000000000000..0276c436d973d3
--- /dev/null
+++ b/deps/LIEF/README.md
@@ -0,0 +1,237 @@
+
+
+
+
+
+
+ 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(0)) const;
+
+ result read_u16string() const;
+ result peek_u16string() const;
+
+ result read_mutf8(size_t maxsize = ~static_cast(0)) const;
+
+ result read_u16string(size_t length) const;
+ result peek_u16string(size_t length) const;
+ result peek_u16string_at(size_t offset, size_t length) const;
+
+
+ virtual ok_error_t peek_data(std::vector& container,
+ uint64_t offset, uint64_t size,
+ uint64_t virtual_address = 0)
+ {
+ if (size == 0) {
+ return ok();
+ }
+ // Even though offset + size < ... => offset < ...
+ // the addition could overflow so it's worth checking both
+ const bool read_ok = offset <= this->size() && (offset + size) <= this->size()
+ /* Check for an overflow */
+ && (static_cast(offset) >= 0 && static_cast(size) >= 0)
+ && (static_cast(offset + size) >= 0);
+ if (!read_ok) {
+ return make_error_code(lief_errors::read_error);
+ }
+ container.resize(size);
+ if (peek_in(container.data(), offset, size, virtual_address)) {
+ return ok();
+ }
+ return make_error_code(lief_errors::read_error);
+ }
+
+ virtual ok_error_t read_data(std::vector& container, uint64_t size) {
+ if (!peek_data(container, pos(), size)) {
+ return make_error_code(lief_errors::read_error);
+ }
+
+ increment_pos(size);
+ return ok();
+ }
+
+ ok_error_t read_data(std::vector& container) {
+ const size_t size = this->size() - this->pos();
+ return read_data(container, size);
+ }
+
+ template
+ ok_error_t read_objects(std::vector |