diff --git a/vendor/lief/.circleci/config.yml b/vendor/lief/.circleci/config.yml
deleted file mode 100644
index 48a9c0d..0000000
--- a/vendor/lief/.circleci/config.yml
+++ /dev/null
@@ -1,62 +0,0 @@
-version: 2.1
-jobs:
- build:
- macos:
- xcode: 12.3.0
- steps:
- - checkout:
- path: ~/LIEF
- - restore_cache:
- keys:
- - ccache-{{ arch }}-{{ .Branch }}
- - ccache-{{ arch }}-master
- - ccache-{{ arch }}
- - pyenv
- - run:
- name: Install pyenv
- command: |
- brew install pyenv
- pyenv root
- pyenv install --list
- - run:
- name: Install ccache
- command: brew install ccache
- - run:
- name: Install ninja
- command: brew install ninja
- - run:
- name: CCache initialization
- command: |
- ccache --show-stats
- ccache --zero-stats
- ccache --max-size=10.0G
- ccache --set-config=compiler_check=content
- - run:
- name: LIEF build setup
- command: |
- export PYTHON_CONFIGURE_OPTS="--enable-shared --enable-unicode=ucs2"
- pyenv install --skip-existing 3.9.0
- export PYTHON_BINARY=$(pyenv root)/versions/3.9.0/bin/python3.9
- $PYTHON_BINARY -m pip install --upgrade pip setuptools wheel
- $PYTHON_BINARY ./setup.py --ninja --lief-test build bdist_wheel
- bash scripts/osx/package_sdk.sh
- - run:
- name: LIEF deploy
- command: |
- export PYTHON_BINARY=$(pyenv root)/versions/3.9.0/bin/python3.9
- $PYTHON_BINARY -m pip install --upgrade requests mako
- $PYTHON_BINARY .github/deploy.py
- - run:
- name: ccache stats
- when: always
- command: |
- ccache --show-stats
- - save_cache:
- key: 'ccache-{{ arch }}-{{ .Branch }}'
- paths: [ "/home/circleci/.ccache" ]
- - save_cache:
- key: 'pyenv'
- paths: [ "/home/circleci/.pyenv" ]
-
-
-
diff --git a/vendor/lief/.clang-format b/vendor/lief/.clang-format
new file mode 100644
index 0000000..66f096a
--- /dev/null
+++ b/vendor/lief/.clang-format
@@ -0,0 +1,118 @@
+---
+Language: Cpp
+BasedOnStyle: LLVM
+Standard: c++17
+
+# Column limit
+ColumnLimit: 83
+
+# Indentation
+IndentWidth: 2
+TabWidth: 2
+UseTab: Never
+ContinuationIndentWidth: 4
+ConstructorInitializerIndentWidth: 2
+IndentCaseLabels: true
+IndentCaseBlocks: false
+IndentPPDirectives: BeforeHash
+NamespaceIndentation: None
+IndentWrappedFunctionNames: true
+IndentAccessModifiers: false
+
+# Access modifiers at same level as class members
+AccessModifierOffset: 0
+
+# Constructor initializers: colon at end of line, each initializer on new line
+BreakConstructorInitializers: AfterColon
+PackConstructorInitializers: Never
+
+# Inheritance
+BreakInheritanceList: BeforeColon
+
+# Pointer/Reference alignment: attached to type
+PointerAlignment: Left
+ReferenceAlignment: Pointer
+DerivePointerAlignment: false
+
+# Spacing
+SpaceBeforeParens: ControlStatements
+SpaceBeforeCpp11BracedList: false
+SpaceInEmptyBlock: false
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeRangeBasedForLoopColon: true
+
+# Alignment
+AlignAfterOpenBracket: Align
+AlignOperands: Align
+AlignTrailingComments: true
+AlignConsecutiveAssignments: None
+AlignConsecutiveDeclarations: false
+
+# Short forms
+AllowShortFunctionsOnASingleLine: Empty
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLoopsOnASingleLine: false
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: true
+AllowShortLambdasOnASingleLine: All
+AllowShortEnumsOnASingleLine: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortCaseExpressionOnASingleLine: true
+
+# Packing
+BinPackArguments: true
+BinPackParameters: true
+
+# Namespaces
+CompactNamespaces: false
+FixNamespaceComments: false
+
+# Empty lines
+EmptyLineAfterAccessModifier: Never
+EmptyLineBeforeAccessModifier: LogicalBlock
+MaxEmptyLinesToKeep: 2
+
+# Ternary operators stay at end of line
+BreakBeforeTernaryOperators: false
+
+# Misc
+Cpp11BracedListStyle: true
+ReflowComments: true
+InsertBraces: true
+InsertNewlineAtEOF: true
+
+BreakTemplateDeclarations: Yes
+BreakBeforeCloseBracketBracedList: true
+BreakBeforeCloseBracketFunction: true
+BreakBeforeTemplateCloser: true
+
+EnumTrailingComma: Insert
+AlignConsecutiveMacros:
+ Enabled: true
+ AcrossEmptyLines: true
+ AcrossComments: true
+BreakAfterReturnType: ExceptShortType
+BreakBeforeBraces: Custom
+BraceWrapping:
+ AfterCaseLabel: true
+ AfterControlStatement: MultiLine
+
+RemoveEmptyLinesInUnwrappedLines: true
+RemoveSemicolon: true
+QualifierAlignment: Left
+
+
+# Includes - preserve existing order
+SortIncludes: true
+SortUsingDeclarations: LexicographicNumeric
+
+IncludeCategories:
+ - Regex: '^((<|")(spdlog|nanobind|catch2|utf8)/)'
+ Priority: 3
+ - Regex: '<[[:alnum:].]+>'
+ Priority: 4
+ - Regex: '.*'
+ Priority: 1
+ SortPriority: 0
diff --git a/vendor/lief/.clang-format-ignore b/vendor/lief/.clang-format-ignore
new file mode 100644
index 0000000..45c7af0
--- /dev/null
+++ b/vendor/lief/.clang-format-ignore
@@ -0,0 +1,4 @@
+api/python/**
+third-party/**
+src/runtime/osx/utils.h
+tests/test_define_conflicts.cpp
diff --git a/vendor/lief/.clang-tidy b/vendor/lief/.clang-tidy
deleted file mode 100644
index ef58d54..0000000
--- a/vendor/lief/.clang-tidy
+++ /dev/null
@@ -1,35 +0,0 @@
-Checks: >
- -*,
- bugprone-*,
- google-*,
- misc-*,
- modernize-*,
- performance-*,
- portability-*,
- readability-*,
- cppcoreguidelines-*,
- -bugprone-easily-swappable-parameters,
- -bugprone-narrowing-conversions,
- -google-readability-namespace-comments,
- -google-readability-todo,
- -google-runtime-int,
- -google-default-arguments
- -google-runtime-references,
- -misc-non-private-member-variables-in-classes,
- -modernize-use-trailing-return-type,
- -performance-noexcept-move-constructor,
- -readability-function-cognitive-complexity,
- -readability-inconsistent-declaration-parameter-name,
- -readability-magic-numbers,
- -readability-named-parameter,
- -readability-redundant-string-cstr
- -readability-uppercase-literal-suffix,
-
-# Turn all the warnings from the checks above into errors.
-#WarningsAsErrors: "*"
-UseColor: false
-
-CheckOptions:
- - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
- - { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
- - { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
diff --git a/vendor/lief/.clang-tidy-core.yaml b/vendor/lief/.clang-tidy-core.yaml
new file mode 100644
index 0000000..5d473ad
--- /dev/null
+++ b/vendor/lief/.clang-tidy-core.yaml
@@ -0,0 +1,76 @@
+Checks: [
+ -*,
+ bugprone-*,
+ performance-*,
+ portability-*,
+ cppcoreguidelines-*,
+ misc-*,
+ clang-taidy-*,
+ modernize-*,
+
+ -clang-taidy-avoid-implicit-enum-to-integer-conversion,
+ -clang-taidy-avoid-high-cyclomatic-complexity,
+
+ -modernize-use-trailing-return-type,
+ -modernize-use-nodiscard,
+ -modernize-avoid-c-arrays,
+
+ # `modernize-avoid-c-style-cast` also rejects the functional-style suggested by
+ # `clang-taidy-avoid-static-integer-cast` (caught by -Wold-style-cast though)
+ -modernize-avoid-c-style-cast,
+
+ -modernize-use-ranges,
+ -modernize-use-constraints,
+ -modernize-use-designated-initializers,
+ -modernize-use-integer-sign-comparison,
+ -modernize-use-string-view,
+
+ -bugprone-derived-method-shadowing-base-method,
+ -bugprone-easily-swappable-parameters,
+ -bugprone-macro-parentheses,
+ -bugprone-narrowing-conversions,
+ -bugprone-reserved-identifier,
+ -bugprone-signed-bitwise,
+ -bugprone-signed-char-misuse,
+ -cppcoreguidelines-avoid-c-arrays,
+ -cppcoreguidelines-avoid-const-or-ref-data-members,
+ -cppcoreguidelines-avoid-do-while,
+ -cppcoreguidelines-avoid-magic-numbers,
+ -cppcoreguidelines-explicit-constructor,
+ -cppcoreguidelines-macro-to-enum,
+ -cppcoreguidelines-macro-usage,
+ -cppcoreguidelines-missing-std-forward,
+ -cppcoreguidelines-narrowing-conversions,
+ -cppcoreguidelines-non-private-member-variables-in-classes,
+ -cppcoreguidelines-owning-memory,
+ -cppcoreguidelines-pro-bounds-array-to-pointer-decay,
+ -cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,
+ -cppcoreguidelines-pro-bounds-constant-array-index,
+ -cppcoreguidelines-pro-bounds-pointer-arithmetic,
+ -cppcoreguidelines-pro-type-const-cast,
+ -cppcoreguidelines-pro-type-reinterpret-cast,
+ -cppcoreguidelines-pro-type-static-cast-downcast,
+ -cppcoreguidelines-pro-type-union-access,
+ -cppcoreguidelines-special-member-functions,
+ -cppcoreguidelines-use-enum-class,
+ -misc-const-correctness,
+ -misc-explicit-constructor,
+ -misc-include-cleaner,
+ -misc-misplaced-const,
+ -misc-no-recursion,
+ -misc-non-private-member-variables-in-classes,
+ -misc-override-with-different-visibility,
+ -misc-static-assert,
+ -misc-use-anonymous-namespace,
+ -misc-use-internal-linkage,
+ -performance-enum-size,
+ -performance-no-int-to-ptr,
+ -portability-avoid-pragma-once,
+]
+
+CheckOptions:
+ bugprone-unused-return-value.CheckedReturnTypes: '^::std::error_code$;^::std::error_condition$;^::std::errc$;^::std::expected$;^::LIEF::result$'
+ bugprone-unused-return-value.AllowCastToVoid: true
+
+HeaderFilterRegex: '.*'
+ExcludeHeaderFilterRegex: '(builds|build|api/rust/include|utils/ordinals_lookup_tables_std|utils/ordinals_lookup_tables)/*'
diff --git a/vendor/lief/.clangd b/vendor/lief/.clangd
new file mode 100644
index 0000000..7533689
--- /dev/null
+++ b/vendor/lief/.clangd
@@ -0,0 +1,70 @@
+Documentation:
+ CommentFormat: Doxygen
+Diagnostics:
+ Includes:
+ IgnoreHeader:
+ - spdlog/fmt/.*
+ - nanobind/stl/.*
+ - third-party/.*
+ ClangTidy:
+ FastCheckFilter: Strict
+ Add: [
+ bugprone-*,
+ performance-*,
+ portability-*,
+ cppcoreguidelines-*,
+ modernize-*,
+ misc-*,
+ clang-taidy-*,
+ ]
+ Remove: [
+ bugprone-easily-swappable-parameters,
+ bugprone-narrowing-conversions,
+ bugprone-reserved-identifier,
+ bugprone-signed-char-misuse,
+ cppcoreguidelines-avoid-c-arrays,
+ cppcoreguidelines-avoid-const-or-ref-data-members,
+ cppcoreguidelines-avoid-do-while,
+ cppcoreguidelines-avoid-magic-numbers,
+ cppcoreguidelines-explicit-constructor,
+ cppcoreguidelines-missing-std-forward,
+ cppcoreguidelines-narrowing-conversions,
+ cppcoreguidelines-non-private-member-variables-in-classes,
+ cppcoreguidelines-owning-memory,
+ cppcoreguidelines-pro-bounds-array-to-pointer-decay,
+ cppcoreguidelines-pro-bounds-constant-array-index,
+ cppcoreguidelines-pro-bounds-pointer-arithmetic,
+ cppcoreguidelines-pro-type-const-cast,
+ cppcoreguidelines-pro-type-reinterpret-cast,
+ cppcoreguidelines-pro-type-static-cast-downcast,
+ cppcoreguidelines-pro-type-union-access,
+ misc-explicit-constructor,
+ misc-misplaced-const,
+ misc-no-recursion,
+ misc-non-private-member-variables-in-classes,
+ misc-use-anonymous-namespace,
+ misc-use-internal-linkage,
+ misc-static-assert,
+ modernize-avoid-c-arrays,
+ modernize-concat-nested-namespaces,
+ modernize-make-unique,
+ modernize-use-nodiscard,
+ modernize-use-noexcept,
+ modernize-use-trailing-return-type,
+ performance-enum-size,
+ performance-no-int-to-ptr,
+ ]
+---
+If:
+ PathMatch:
+ - api/rust/include/LIEF/.*
+CompileFlags:
+ Remove: [-std=gnu++17]
+ Add: [-std=gnu++20]
+
+---
+If:
+ PathMatch:
+ - include/LIEF/.*
+ PathExclude:
+ - api/rust/.*
diff --git a/vendor/lief/.coveragerc b/vendor/lief/.coveragerc
new file mode 100644
index 0000000..828d7cd
--- /dev/null
+++ b/vendor/lief/.coveragerc
@@ -0,0 +1,43 @@
+[paths]
+source =
+ tests/
+
+[run]
+branch = True
+relative_files = True
+omit =
+ */api/python/*
+ */tests/utils.py
+ */tests/conftest.py
+ */tests/run_pytest.py
+ ; Require LIEF extended
+ */tests/coff/test_disassembler.py
+ */tests/api/test_demangle.py
+ */tests/dwarf/*
+ */tests/objc/*
+ */tests/assembly/*
+ */tests/pdb/*
+ */tests/dyld-shared-cache/*
+
+[report]
+; Regexes for lines to exclude from consideration
+exclude_also =
+ ; Don't complain about missing debug-only code:
+ def __repr__
+ if self\.debug
+
+ ; Don't complain if tests don't hit defensive assertion code:
+ raise AssertionError
+ raise NotImplementedError
+ raise RuntimeError
+
+ ; Don't complain if non-runnable code isn't run:
+ if 0:
+ if __name__ == .__main__.:
+ if lief.__extended__:
+ if stderr:
+ if not file.exists():
+
+ ; Don't complain about these markers
+ @pytest\.mark\.lief_extended
+ @pytest\.mark\.slow
diff --git a/vendor/lief/.dockerignore b/vendor/lief/.dockerignore
deleted file mode 100644
index 378eac2..0000000
--- a/vendor/lief/.dockerignore
+++ /dev/null
@@ -1 +0,0 @@
-build
diff --git a/vendor/lief/.github/FUNDING.yml b/vendor/lief/.github/FUNDING.yml
new file mode 100644
index 0000000..2bd6368
--- /dev/null
+++ b/vendor/lief/.github/FUNDING.yml
@@ -0,0 +1 @@
+github: [lief-project]
diff --git a/vendor/lief/.github/ISSUE_TEMPLATE/feature-request.md b/vendor/lief/.github/ISSUE_TEMPLATE/feature-request.md
new file mode 100644
index 0000000..d092471
--- /dev/null
+++ b/vendor/lief/.github/ISSUE_TEMPLATE/feature-request.md
@@ -0,0 +1,12 @@
+---
+name: Feature Request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+*Please describe what you would like to have in LIEF*.
+
+**Note: If the feature is not precise or if you want to have feedback first, you can open a [discussion](https://github.com/lief-project/LIEF/discussions).**
diff --git a/vendor/lief/.github/ISSUE_TEMPLATE/premium-issue.md b/vendor/lief/.github/ISSUE_TEMPLATE/premium-issue.md
new file mode 100644
index 0000000..a35a96b
--- /dev/null
+++ b/vendor/lief/.github/ISSUE_TEMPLATE/premium-issue.md
@@ -0,0 +1,33 @@
+---
+name: Premium Issue
+about: You need a fix for the issue with a high priority
+title: ''
+labels: Premium
+assignees: romainthomas
+
+---
+
+*Premium issues can be used to get a higher priority resolution for users and companies.*
+*In return, you need to contribute to the project with an action:*
+
+- Writing a guest blog post here: https://lief-project.github.io/blog/
+- Fixing another issue
+- Sponsoring the issue
+
+*Premium issues will be highlighted in the changelog and the release blog post with your name/logo*
+
+----------------------------------
+
+**Description**
+
+*Please describe the issue/request that needs to be addressed*
+
+**Context**
+
+*Please provide the version of LIEF, the operating system as well as the binaries associated with the issue
+(it can be sent by email as well)*
+
+----------------------------------
+
+
+**Reach out to `issue@lief.re` to discuss about the timeline/contribution.**
diff --git a/vendor/lief/.github/ISSUE_TEMPLATE/regular-issue.md b/vendor/lief/.github/ISSUE_TEMPLATE/regular-issue.md
new file mode 100644
index 0000000..df692a7
--- /dev/null
+++ b/vendor/lief/.github/ISSUE_TEMPLATE/regular-issue.md
@@ -0,0 +1,33 @@
+---
+name: Regular Issue
+about: You identified a bug or a problem in LIEF
+title: ''
+labels: ''
+assignees: romainthomas
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+
+**Expected behavior**
+A clear and concise description of what you expected to happen (if applicable)
+
+**Environment (please complete the following information):**
+ - System and Version : [e.g. Ubuntu 16.04]
+ - Target format (PE, ELF, Mach-O)
+ - LIEF commit version: ``python -c "import lief;print(lief.__version__)"`` or the one from ``LIEF/config.h``
+
+**Additional context**
+Add any other context about the problem here.
+
+
+**NOTICE**
+
+If the issue does not contain enough information to be reproduced,
+it will be flagged as [incomplete](https://github.com/lief-project/LIEF/issues?q=is%3Aissue+is%3Aclosed+label%3AIncomplete)
+and closed.
+
+**/NOTICE**
diff --git a/vendor/lief/.github/assets/index.j2 b/vendor/lief/.github/assets/index.j2
new file mode 100644
index 0000000..362bfcf
--- /dev/null
+++ b/vendor/lief/.github/assets/index.j2
@@ -0,0 +1,10 @@
+
+
+
Links for lief
+
+Links for lief
+% for path, filename in files:
+ ${filename}
+% endfor
+
+
diff --git a/vendor/lief/.github/config/gh-ci.toml b/vendor/lief/.github/config/gh-ci.toml
new file mode 100644
index 0000000..1416865
--- /dev/null
+++ b/vendor/lief/.github/config/gh-ci.toml
@@ -0,0 +1,9 @@
+[lief.s3]
+region = "fr-par"
+bucket = "lief"
+endpoint = "https://s3.fr-par.scw.cloud"
+
+[lief.deploy]
+branches = ["main", "master", "deploy", "devel"]
+main-branches = ["main", "master"]
+default-dir = "latest"
diff --git a/vendor/lief/.github/deploy-key.enc b/vendor/lief/.github/deploy-key.enc
new file mode 100644
index 0000000..761db54
Binary files /dev/null and b/vendor/lief/.github/deploy-key.enc differ
diff --git a/vendor/lief/.github/deploy.py b/vendor/lief/.github/deploy.py
new file mode 100644
index 0000000..44d3ed5
--- /dev/null
+++ b/vendor/lief/.github/deploy.py
@@ -0,0 +1,309 @@
+#!/usr/bin/env python3
+from botocore.exceptions import ClientError
+from mako.template import Template
+from pathlib import Path
+from typing import Any, Optional
+
+import argparse
+import boto3
+import functools
+import logging
+import os
+import sys
+import tempfile
+import tomli
+import re
+
+LOG_LEVEL = logging.INFO
+
+CURRENTDIR = Path(__file__).resolve().parent
+REPODIR = CURRENTDIR.parent
+ASSET_DIR = CURRENTDIR / "assets"
+CONFIG_DIR = CURRENTDIR / "config"
+LIEF_S3_KEY = os.getenv("LIEF_S3_KEY", None)
+LIEF_S3_SECRET = os.getenv("LIEF_S3_SECRET", None)
+OWNED_ORGS = ["lief-project/", "romainthomas/"]
+RELEASE_KEYWORD = ["release-", "release/"]
+
+DEFAULT_CONFIG = CONFIG_DIR / "gh-ci.toml"
+DEFAULT_TEMPLATE = (ASSET_DIR / "index.j2").read_text()
+
+logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
+logging.getLogger().setLevel(LOG_LEVEL)
+logger = logging.getLogger(__name__)
+
+if LIEF_S3_KEY is None or len(LIEF_S3_KEY) == 0:
+ logger.error("LIEF_S3_KEY is not set!")
+
+if LIEF_S3_SECRET is None or len(LIEF_S3_SECRET) == 0:
+ logger.error("LIEF_S3_SECRET is not set!")
+
+class S3Manager:
+ def __init__(self, dirname: str, bucket: str,
+ region: str, endpoint: str,
+ dry_run: bool = False):
+ self._s3_dirname: str = dirname
+ self._s3_bucket: str = bucket
+ self._s3_region: str = region
+ self._s3_endpoint: str = endpoint
+ self._dry_run: bool = dry_run
+
+ logger.info("[S3] Bucket : %s", self._s3_bucket)
+ logger.info("[S3] Region : %s", self._s3_region)
+ logger.info("[S3] Endpoint: %s", self._s3_endpoint)
+ logger.info("[S3] Dir : %s", self._s3_dirname)
+
+ def change_dir(self, dirname: str):
+ self._s3_dirname = dirname
+
+ @property
+ def s3_lief_sdk(self) -> str:
+ return f"{self._s3_dirname}/sdk"
+
+ @property
+ def s3_lief_wheel(self) -> str:
+ return f"{self._s3_dirname}/lief"
+
+ @property
+ def url(self):
+ return f"https://{self._s3_bucket}.s3-website.{self._s3_region}.scw.cloud/{self._s3_dirname}"
+
+ @functools.lru_cache(maxsize=1)
+ def s3(self) -> boto3.Session:
+ s3_res = boto3.resource(
+ 's3',
+ region_name=self._s3_region,
+ use_ssl=True,
+ endpoint_url=self._s3_endpoint,
+ aws_access_key_id=LIEF_S3_KEY,
+ aws_secret_access_key=LIEF_S3_SECRET
+ )
+ return s3_res
+
+ @classmethod
+ def from_config(cls, config):
+ pass
+
+ def _s3_push(self, file: Path, dst: str):
+ logger.info("Uploading %s to %s", file, dst)
+ try:
+ obj = self.s3().Object(self._s3_bucket, dst)
+ if not self._dry_run:
+ obj.put(Body=file.read_bytes())
+ else:
+ logger.info("[--] put: %s/%s - %s", self._s3_bucket, dst, file.as_posix())
+ return 0
+ except ClientError as e:
+ logger.error("S3 push failed: %s", e)
+ return 1
+
+ def push_wheel(self, file: str):
+ wheel_file = Path(file)
+ if not wheel_file.is_file():
+ logger.error("'%s' is not a valid file!", wheel_file)
+ return
+
+ dst = f"{self.s3_lief_wheel}/{wheel_file.name}"
+ self._s3_push(wheel_file, dst)
+
+ def push_sdk(self, file: str):
+ sdk_path = Path(file)
+ if not sdk_path.is_file():
+ logger.error("'%s' is not a valid file!", sdk_path)
+ return
+
+ dst = f"{self.s3_lief_sdk}/{sdk_path.name}"
+ self._s3_push(sdk_path, dst)
+
+ def push_content(self, content: str, dst: str):
+ with tempfile.TemporaryDirectory() as tmp:
+ tmp_path = Path(tmp)
+ index = tmp_path / "index.html"
+ index.write_text(content)
+ self._s3_push(index, dst)
+
+ def process_sdk_wheels(self, directory: Path, maxdepth: int = 0,
+ depth: int = 0, recurse: bool = True,
+ skip_sdk: bool = False):
+ logger.info("Processing directory: %s", directory)
+ for item in directory.iterdir():
+ if item.is_dir() and recurse:
+ if 0 < maxdepth < depth:
+ logger.debug("Maximum iteration depth reached")
+ else:
+ self.process_sdk_wheels(item, maxdepth, depth + 1, recurse)
+ elif item.is_file():
+ extension = item.suffix
+ if extension in (".zip", ".gz") and not skip_sdk:
+ logger.info("[SDK ] Uploading '%s'", item.as_posix())
+ self.push_sdk(item.as_posix())
+ elif extension in (".whl", ):
+ logger.info("[WHEEL] Uploading '%s'", item.as_posix())
+ self.push_wheel(item.as_posix())
+
+
+ def upload_wheels_sdk(self, src_dir: Path, maxdepth: int, skip_sdk: bool):
+ logger.info("Looking for wheels and sdk from: %s", src_dir)
+ self.process_sdk_wheels(src_dir, maxdepth=maxdepth, recurse=True,
+ skip_sdk=skip_sdk)
+
+ wheels_index = self.generate_index(self.s3_lief_wheel,
+ DEFAULT_TEMPLATE,
+ skiplist=("index.html", ))
+
+ sdk_index = self.generate_index(self.s3_lief_sdk, DEFAULT_TEMPLATE,
+ skiplist=("index.html", ))
+
+ self.push_content(wheels_index, f"{self.s3_lief_wheel}/index.html")
+ self.push_content(sdk_index, f"{self.s3_lief_sdk}/index.html")
+
+ logger.info("Done!")
+ logger.info("URL: %s/%s", self.url, "sdk")
+ logger.info("URL: %s/%s", self.url, "lief")
+
+ def s3_list(self, dirname: str) -> list[Any]:
+ if self._dry_run:
+ return []
+ return self.s3().Bucket(self._s3_bucket).objects.filter(Prefix=dirname)
+
+ def generate_index(self, dirname: str, template: str, skiplist=None):
+ files = self.s3_list(dirname)
+ selected_files = []
+ for s3_object in files:
+ filename = Path(s3_object.key).name
+ if skiplist is not None and filename in skiplist:
+ continue
+ selected_files.append((s3_object.key, filename))
+ return Template(template).render(files=selected_files)
+
+class GithubDeploy:
+ def __init__(self, branches: list[str],
+ main_branches: list[str],
+ default_dir: str,
+ s3_manager: S3Manager):
+ self.s3_manager: S3Manager = s3_manager
+
+ self._branches: list[str] = branches
+ self._main_branches: list[str] = main_branches
+ self._default_dir: str = default_dir
+
+
+ @classmethod
+ def from_config(cls, config_file: Path):
+ with open(config_file, "rb") as f:
+ toml_config = tomli.load(f)
+
+ if "lief" not in toml_config:
+ logger.warning("Missing lief entries in '%s'", config_file)
+ return None
+ lief_conf = toml_config["lief"]
+
+ if "s3" not in lief_conf:
+ logger.warning("Missing lief.s3 entries in '%s'", config_file)
+ return None
+
+ if "deploy" not in lief_conf:
+ logger.warning("Missing lief.deploy entries in '%s'", config_file)
+ return None
+
+ branches = lief_conf["deploy"]["branches"]
+ main_branches = lief_conf["deploy"]["main-branches"]
+ default_dir = lief_conf["deploy"]["default-dir"]
+ s3_config = lief_conf["s3"]
+ s3_region = s3_config["region"]
+ s3_bucket = s3_config["bucket"]
+ s3_endpoint = s3_config["endpoint"]
+
+ s3_manager = S3Manager(default_dir, s3_bucket, s3_region, s3_endpoint)
+ return cls(branches, main_branches, default_dir, s3_manager)
+
+ @staticmethod
+ def branch() -> Optional[str]:
+ ref = os.getenv("GITHUB_REF")
+ if ref is None:
+ return None
+ return ref.replace("refs/heads/", "")
+
+ @staticmethod
+ def is_pr() -> bool:
+ head_ref = os.getenv("GITHUB_HEAD_REF", "")
+ repo_path = os.getenv("GITHUB_REPOSITORY", "")
+ is_owned_repo = any(repo_path.startswith(org) for org in OWNED_ORGS)
+ return head_ref != "" or not is_owned_repo
+
+ @staticmethod
+ def is_tagged() -> bool:
+ tag = GithubDeploy.tag_name()
+ return tag is not None and len(tag) > 0
+
+ @staticmethod
+ def tag_name() -> Optional[str]:
+ ref = os.getenv("GITHUB_REF", "")
+ logger.info("Github Action tag: %s", ref)
+ if ref.startswith("refs/tags/"):
+ return ref.replace("refs/tags/", "")
+ return ""
+
+ @staticmethod
+ def workspace() -> str:
+ return os.getenv("GITHUB_WORKSPACE", "")
+
+ def is_main_branch(self, name: str) -> bool:
+ return name in self._main_branches
+
+ def should_be_deployed(self, branch: str) -> bool:
+ if any(re.match(s, branch) for s in self._branches):
+ return True
+
+ return False
+
+ def deploy(self, directories: list[str], skip_sdk: bool = False):
+ s3dir = None
+
+ branch = GithubDeploy.branch()
+
+ if branch is None:
+ logger.warning("Can't resolve the branch name")
+ sys.exit(1)
+
+ s3dir = self._default_dir
+
+ if not self.should_be_deployed(branch):
+ logger.info("Skipping deployment for branch: %s", branch)
+ return
+
+ if s3dir is None:
+ logger.error("Target directory is not set")
+ sys.exit(1)
+
+ logger.info("s3dir: %s", s3dir)
+ self.s3_manager.change_dir(s3dir)
+ for dirname in directories:
+ dirpath = Path(dirname).resolve().absolute().expanduser()
+ self.s3_manager.upload_wheels_sdk(dirpath, maxdepth=1,
+ skip_sdk=skip_sdk)
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--config", "-c")
+ parser.add_argument("--dry-run", "-n", action="store_true", default=False)
+ parser.add_argument("--skip-sdk", action="store_true", default=False)
+ parser.add_argument("directories", nargs="+")
+
+ args = parser.parse_args()
+ config_path = None
+ if args.config is not None:
+ config_path = Path(args.config)
+ else:
+ config_path = DEFAULT_CONFIG
+
+ if not config_path.is_file():
+ logger.error("'%s' is not a valid config path")
+ sys.exit(1)
+
+ gh_deploy = GithubDeploy.from_config(config_path)
+ gh_deploy.deploy(args.directories, args.skip_sdk)
+
+if __name__ == "__main__":
+ main()
+ sys.exit(0)
diff --git a/vendor/lief/.github/images/architecture.png b/vendor/lief/.github/images/architecture.png
new file mode 100644
index 0000000..b842c06
Binary files /dev/null and b/vendor/lief/.github/images/architecture.png differ
diff --git a/vendor/lief/.github/make_index.py b/vendor/lief/.github/make_index.py
new file mode 100644
index 0000000..3867101
--- /dev/null
+++ b/vendor/lief/.github/make_index.py
@@ -0,0 +1,42 @@
+""" Build index from directory listing
+From: https://stackoverflow.com/questions/39048654/how-to-enable-directory-indexing-on-github-pages
+
+make_index.py
+"""
+
+INDEX_TEMPLATE = r"""
+
+Links for lief
+
+Links for lief
+% for name in names:
+ ${name}
+% endfor
+
+
+"""
+
+EXCLUDED = ['index.html', '.gitkeep']
+BASE_URL = "https://lief-project.github.io"
+
+import os
+import argparse
+
+# May need to do "pip install mako"
+from mako.template import Template
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("directory")
+ parser.add_argument("--base")
+ parser.add_argument("--output")
+ args = parser.parse_args()
+ fnames = [fname for fname in sorted(os.listdir(args.directory))
+ if fname not in EXCLUDED]
+ html = Template(INDEX_TEMPLATE).render(names=fnames, base_url=BASE_URL, base=args.base)
+ with open(args.output, "w") as f:
+ f.write(html)
+
+if __name__ == '__main__':
+ main()
diff --git a/vendor/lief/.github/requirements.txt b/vendor/lief/.github/requirements.txt
new file mode 100644
index 0000000..00c8e8b
--- /dev/null
+++ b/vendor/lief/.github/requirements.txt
@@ -0,0 +1,7 @@
+setuptools
+boto3
+requests
+twine
+tomli
+mako
+wheel
diff --git a/vendor/lief/.github/workflows/android.yml b/vendor/lief/.github/workflows/android.yml
new file mode 100644
index 0000000..2274350
--- /dev/null
+++ b/vendor/lief/.github/workflows/android.yml
@@ -0,0 +1,84 @@
+name: 'Android'
+on:
+ push:
+ branches:
+ - 'main'
+ tags-ignore:
+ - '**'
+
+jobs:
+ build-sdk:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ arch: ['arm', 'arm64']
+ fail-fast: false
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: ~/.ccache
+ key: android-${{ runner.os }}-${{ matrix.arch }}-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ android-${{ runner.os }}-${{ matrix.arch }}
+ - name: Build SDK [${{ matrix.arch }}]
+ shell: bash
+ env:
+ ARCH: ${{ matrix.arch }}
+ run: |
+ docker run \
+ -e CCACHE_COMPRESS=1 \
+ -e CCACHE_MAXSIZE=10.0G \
+ -e CCACHE_CPP2=1 \
+ -e CCACHE_DIR=/ccache \
+ -v $GITHUB_WORKSPACE:/work \
+ -v $HOME/.ccache:/ccache \
+ --rm liefproject/android-${ARCH} bash /work/scripts/docker/android-sdk-${ARCH}
+ - name: 'Upload Artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: android-sdk-${{ matrix.arch }}
+ path: build/*.tar.gz
+ retention-days: 3
+ deploy:
+ if: ${{ always() }}
+ runs-on: ubuntu-latest
+ needs: build-sdk
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ fetch-depth: 0
+ - name: Download artifacts
+ uses: actions/download-artifact@v8
+ with:
+ path: ${{ runner.temp }}/artifacts
+ - name: Display artifacts
+ run: ls -R
+ working-directory: ${{ runner.temp }}/artifacts
+ - name: Deploy
+ env:
+ LIEF_S3_KEY: ${{ secrets.LIEF_S3_KEY }}
+ LIEF_S3_SECRET: ${{ secrets.LIEF_S3_SECRET }}
+ shell: bash
+ run: |
+ docker run --rm \
+ -v $GITHUB_WORKSPACE:/src \
+ -v $RUNNER_TEMP:/runner_tmp \
+ -e GITHUB_ACTIONS="true" \
+ -e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
+ -e GITHUB_REF=$GITHUB_REF \
+ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
+ -e LIEF_S3_KEY=$LIEF_S3_KEY \
+ -e LIEF_S3_SECRET=$LIEF_S3_SECRET \
+ liefproject/deploy python3 /src/.github/deploy.py /runner_tmp/artifacts
+
+
+
diff --git a/vendor/lief/.github/workflows/linux-s390x.yml b/vendor/lief/.github/workflows/linux-s390x.yml
new file mode 100644
index 0000000..16def51
--- /dev/null
+++ b/vendor/lief/.github/workflows/linux-s390x.yml
@@ -0,0 +1,252 @@
+name: 'Linux s390x'
+on:
+ push:
+ branches:
+ - 'main'
+ tags-ignore:
+ - '**'
+
+jobs:
+ linux-sdk:
+ runs-on: [self-hosted, linux, s390x]
+ container:
+ image: liefproject/manylinux_2_28_s390x
+ env:
+ CCACHE_DIR: "/home/pylief/.ccache"
+ CXXFLAGS: "-ffunction-sections -fdata-sections -fvisibility-inlines-hidden -static-libstdc++ -static-libgcc"
+ CFLAGS: "-ffunction-sections -fdata-sections -static-libstdc++ -static-libgcc"
+ LDFLAGS: "-Wl,--gc-sections -Wl,--exclude-libs,ALL"
+ BUILD_DIR_STATIC: "/tmp/build/linux-s390x/static-release"
+ BUILD_DIR_SHARED: "/tmp/build/linux-s390x/shared-release"
+ CLICOLOR_FORCE: "1"
+ ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}"
+ ACTIONS_RUNTIME_TOKEN: "${{ env.ACTIONS_RUNTIME_TOKEN }}"
+ ACTIONS_CACHE_URL: "${{ env.ACTIONS_CACHE_URL }}"
+ options: --user 1001:1001
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Prepare ccache
+ shell: bash
+ run: |
+ mkdir -p /home/pylief/.ccache/tmp
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: /home/pylief/.ccache
+ key: linux-s390x-${{ runner.os }}-sdk-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ linux-s390x-${{ runner.os }}-sdk
+ - name: CMake - Static
+ shell: bash
+ run: |
+ mkdir -p ${BUILD_DIR_STATIC}
+ cmake -S $GITHUB_WORKSPACE -B ${BUILD_DIR_STATIC} -GNinja \
+ -DCMAKE_INSTALL_LIBDIR="lib" \
+ -DCMAKE_LINK_WHAT_YOU_USE=on \
+ -DBUILD_SHARED_LIBS=off \
+ -DLIEF_INSTALL_COMPILED_EXAMPLES=on \
+ -DCMAKE_INSTALL_PREFIX=/install \
+ -DCMAKE_BUILD_TYPE=Release
+ - name: Compile - Static
+ shell: bash
+ run: |
+ cmake --build ${BUILD_DIR_STATIC} --target install
+ - name: CMake - Shared
+ shell: bash
+ run: |
+ mkdir -p ${BUILD_DIR_SHARED}
+ cmake -S $GITHUB_WORKSPACE -B ${BUILD_DIR_SHARED} -GNinja \
+ -DCMAKE_INSTALL_LIBDIR="lib" \
+ -DCMAKE_LINK_WHAT_YOU_USE=on \
+ -DBUILD_SHARED_LIBS=on \
+ -DLIEF_INSTALL_COMPILED_EXAMPLES=off \
+ -DCMAKE_BUILD_TYPE=Release
+ - name: Compile - Shared
+ run: |
+ cmake --build ${BUILD_DIR_SHARED} --target all
+ - name: Package
+ run: |
+ cd /tmp/build/linux-s390x
+ cpack --config $GITHUB_WORKSPACE/cmake/cpack.config.cmake
+ - name: 'Upload SDK Artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: linux-s390x-sdk
+ path: /tmp/build/linux-s390x/*.tar.gz
+ retention-days: 3
+ - name: 'Upload Install Artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: linux-s390x-install
+ path: /install
+ retention-days: 1
+
+ testing:
+ if: "!contains(github.event.commits[0].message, '[skip-test]')"
+ runs-on: [self-hosted, linux, s390x]
+ container:
+ image: liefproject/manylinux_2_28_s390x
+ env:
+ PYTHON_BINARY: "/opt/python/cp312-cp312/bin/python3.12"
+ LIEF_SAMPLES_DIR: "/tmp/samples"
+ LIEF_BUILD_DIR: "/tmp/lief-build"
+ LIEF_VENV: "/tmp/venv"
+ CLICOLOR_FORCE: "1"
+ PYTEST_ADDOPTS: "--color=yes"
+ options: --user 1001:1001
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: ~/.ccache
+ key: linux-s390x-${{ runner.os }}-test-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ linux-s390x-${{ runner.os }}-test
+ - name: Prepare Python virtual env
+ shell: bash
+ run: |
+ $PYTHON_BINARY -m venv ${LIEF_VENV}
+ source ${LIEF_VENV}/bin/activate
+ python -m pip install \
+ -r tests/requirements.txt \
+ -r api/python/build-requirements.txt
+ - name: Build & install LIEF
+ shell: bash
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ export PYLIEF_CONF="${GITHUB_WORKSPACE}/scripts/docker/config/pylinux-test-s390x.toml"
+ python -m pip -vvv install api/python
+ - name: Prepare test samples
+ shell: bash
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ mkdir -p ${LIEF_SAMPLES_DIR}
+ python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
+ - name: Run tests
+ timeout-minutes: 5
+ shell: bash
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ python tests/run_pytest.py
+ python tests/run_tools_check.py ${LIEF_BUILD_DIR}/
+ ctest --output-on-failure --test-dir ${LIEF_BUILD_DIR}/
+
+ pywheels:
+ runs-on: [self-hosted, linux, s390x]
+ needs: linux-sdk
+ container:
+ image: liefproject/manylinux_2_28_s390x
+ env:
+ CCACHE_DIR: "/home/pylief/.ccache"
+ CXXFLAGS: "-ffunction-sections -fdata-sections -fvisibility-inlines-hidden -static-libgcc"
+ CFLAGS: "-ffunction-sections -fdata-sections -static-libgcc"
+ LDFLAGS: "-Wl,--gc-sections -Wl,--exclude-libs,ALL"
+ CLICOLOR_FORCE: "1"
+ FORCE_COLOR: "1"
+ LIEF_BUILD_DIR: "/tmp/lief-build"
+ ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}"
+ ACTIONS_RUNTIME_TOKEN: "${{ env.ACTIONS_RUNTIME_TOKEN }}"
+ ACTIONS_CACHE_URL: "${{ env.ACTIONS_CACHE_URL }}"
+ options: --user 1001:1001
+ strategy:
+ matrix:
+ python-version: ['3.12', '3.13', '3.14']
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Prepare ccache
+ shell: bash
+ run: |
+ mkdir -p /home/pylief/.ccache/tmp
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: /home/pylief/.ccache
+ key: linux-s390x-${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ linux-s390x-${{ runner.os }}-${{ matrix.python-version }}
+ - name: Download LIEF install dir
+ uses: actions/download-artifact@v8
+ with:
+ name: linux-s390x-install
+ path: /install
+ - name: Generate wheel
+ env:
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ shell: bash
+ run: |
+ export PYLIEF_CONF=$GITHUB_WORKSPACE/scripts/docker/config/pylinux-s390x.toml
+ PYTHON_VERSION_ALT=$(echo "${PYTHON_VERSION}" | sed 's/\.//') # Transform 3.12 -> 312
+ PYTHON_BINARY=/opt/python/cp${PYTHON_VERSION_ALT}-cp${PYTHON_VERSION_ALT}/bin/python${PYTHON_VERSION}
+ $PYTHON_BINARY -m pip -vvv wheel --disable-pip-version-check \
+ --wheel-dir=$GITHUB_WORKSPACE/wheel_stage \
+ $GITHUB_WORKSPACE/api/python
+ - name: Run auditwheel
+ shell: bash
+ run: |
+ ls -alh $GITHUB_WORKSPACE/wheel_stage
+ find $GITHUB_WORKSPACE/wheel_stage -exec \
+ auditwheel repair -w $GITHUB_WORKSPACE/dist {} \;
+ ls -alh $GITHUB_WORKSPACE/dist
+ - name: 'Artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: linux-s390x-python${{ matrix.python-version }}-wheel
+ path: dist/*.whl
+ retention-days: 3
+
+ deploy:
+ runs-on: ubuntu-latest
+ if: ${{ always() }}
+ needs: [pywheels]
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Download artifacts
+ uses: actions/download-artifact@v8
+ with:
+ pattern: linux-s390x-*
+ merge-multiple: true
+ path: ${{ runner.temp }}/artifacts
+ - name: Display artifacts
+ run: ls -R
+ working-directory: ${{ runner.temp }}/artifacts
+ - name: Deploy
+ env:
+ LIEF_S3_KEY: ${{ secrets.LIEF_S3_KEY }}
+ LIEF_S3_SECRET: ${{ secrets.LIEF_S3_SECRET }}
+ shell: bash
+ run: |
+ docker run --rm \
+ -v $GITHUB_WORKSPACE:/src \
+ -v $RUNNER_TEMP:/runner_tmp \
+ -e GITHUB_ACTIONS="true" \
+ -e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
+ -e GITHUB_REF=$GITHUB_REF \
+ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
+ -e LIEF_S3_KEY=$LIEF_S3_KEY \
+ -e LIEF_S3_SECRET=$LIEF_S3_SECRET \
+ liefproject/deploy \
+ python3 /src/.github/deploy.py --skip-sdk /runner_tmp/artifacts
diff --git a/vendor/lief/.github/workflows/linux-x86-64.yml b/vendor/lief/.github/workflows/linux-x86-64.yml
new file mode 100644
index 0000000..f353b65
--- /dev/null
+++ b/vendor/lief/.github/workflows/linux-x86-64.yml
@@ -0,0 +1,277 @@
+name: 'Linux x86-64'
+on:
+ push:
+ branches:
+ - 'main'
+ tags-ignore:
+ - '**'
+
+jobs:
+ linux-sdk:
+ runs-on: ubuntu-latest
+ container:
+ image: liefproject/manylinux_2_28_x86_64
+ env:
+ CCACHE_DIR: "/home/pylief/.ccache"
+ CXXFLAGS: "-ffunction-sections -fdata-sections -fvisibility-inlines-hidden -static-libstdc++ -static-libgcc"
+ CFLAGS: "-ffunction-sections -fdata-sections -static-libstdc++ -static-libgcc"
+ LDFLAGS: "-Wl,--gc-sections -Wl,--exclude-libs,ALL"
+ BUILD_DIR_STATIC: "/tmp/build/linux-x86-64/static-release"
+ BUILD_DIR_SHARED: "/tmp/build/linux-x86-64/shared-release"
+ CLICOLOR_FORCE: "1"
+ ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}"
+ ACTIONS_RUNTIME_TOKEN: "${{ env.ACTIONS_RUNTIME_TOKEN }}"
+ ACTIONS_CACHE_URL: "${{ env.ACTIONS_CACHE_URL }}"
+ options: --user 1001:1001
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Prepare ccache
+ shell: bash
+ run: |
+ mkdir -p /home/pylief/.ccache/tmp
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: /home/pylief/.ccache
+ key: linux-x86-64-${{ runner.os }}-sdk-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ linux-x86-64-${{ runner.os }}-sdk
+ - name: CMake - Static
+ shell: bash
+ run: |
+ mkdir -p ${BUILD_DIR_STATIC}
+ cmake -S $GITHUB_WORKSPACE -B ${BUILD_DIR_STATIC} -GNinja \
+ -DCMAKE_INSTALL_LIBDIR="lib" \
+ -DCMAKE_LINK_WHAT_YOU_USE=on \
+ -DBUILD_SHARED_LIBS=off \
+ -DLIEF_INSTALL_COMPILED_EXAMPLES=on \
+ -DCMAKE_INSTALL_PREFIX=/install \
+ -DCMAKE_BUILD_TYPE=Release
+ - name: Compile - Static
+ shell: bash
+ run: |
+ cmake --build ${BUILD_DIR_STATIC} --target install
+ - name: CMake - Shared
+ shell: bash
+ run: |
+ mkdir -p ${BUILD_DIR_SHARED}
+ cmake -S $GITHUB_WORKSPACE -B ${BUILD_DIR_SHARED} -GNinja \
+ -DCMAKE_INSTALL_LIBDIR="lib" \
+ -DCMAKE_LINK_WHAT_YOU_USE=on \
+ -DBUILD_SHARED_LIBS=on \
+ -DLIEF_INSTALL_COMPILED_EXAMPLES=off \
+ -DCMAKE_BUILD_TYPE=Release
+ - name: Compile - Shared
+ run: |
+ cmake --build ${BUILD_DIR_SHARED} --target all
+ - name: Package
+ run: |
+ cd /tmp/build/linux-x86-64
+ cpack --config $GITHUB_WORKSPACE/cmake/cpack.config.cmake
+ - name: 'Upload SDK Artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: linux-x86-64-sdk
+ path: /tmp/build/linux-x86-64/*.tar.gz
+ retention-days: 3
+ - name: 'Upload Install Artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: linux-x86-64-install
+ path: /install
+ retention-days: 1
+ testing:
+ if: "!contains(github.event.commits[0].message, '[skip-test]')"
+ runs-on: ubuntu-latest
+ container:
+ image: liefproject/manylinux_2_28_x86_64
+ env:
+ PYTHON_BINARY: "/opt/python/cp312-cp312/bin/python3.12"
+ LIEF_SAMPLES_DIR: "/tmp/samples"
+ LIEF_BUILD_DIR: "/tmp/lief-build"
+ LIEF_VENV: "/tmp/venv"
+ CLICOLOR_FORCE: "1"
+ PYTEST_ADDOPTS: "--color=yes"
+ options: --user 1001:1001
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: ~/.ccache
+ key: linux-x86-64-${{ runner.os }}-test-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ linux-x86-64-${{ runner.os }}-test
+ - name: Prepare Python virtual env
+ shell: bash
+ run: |
+ $PYTHON_BINARY -m venv ${LIEF_VENV}
+ source ${LIEF_VENV}/bin/activate
+ python -m pip install \
+ -r tests/requirements.txt \
+ -r api/python/build-requirements.txt
+ - name: Build & install LIEF
+ shell: bash
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ export PYLIEF_CONF="${GITHUB_WORKSPACE}/scripts/docker/config/pylinux-test-x64.toml"
+ python -m pip -vvv install api/python
+ - name: Prepare test samples
+ shell: bash
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ mkdir -p ${LIEF_SAMPLES_DIR}
+ python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
+ - name: Run tests
+ timeout-minutes: 5
+ shell: bash
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ python tests/run_pytest.py
+ python tests/run_tools_check.py ${LIEF_BUILD_DIR}/
+ ctest --output-on-failure --test-dir ${LIEF_BUILD_DIR}/
+ - name: Fuzzing [ls x86-64]
+ shell: bash
+ timeout-minutes: 20
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ export PYTHONPATH="${GITHUB_WORKSPACE}/tests:$PYTHONPATH"
+ python tests/elf/fuzzing.py \
+ ${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \
+ --input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_ls.bin -n 100
+ - name: Fuzzing [openssl x86-64]
+ shell: bash
+ timeout-minutes: 20
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ export PYTHONPATH="${GITHUB_WORKSPACE}/tests:$PYTHONPATH"
+ python tests/elf/fuzzing.py \
+ ${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \
+ --input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_openssl.bin -n 100
+ - name: Fuzzing [nm x86-64]
+ shell: bash
+ timeout-minutes: 20
+ run: |
+ source ${LIEF_VENV}/bin/activate
+ export PYTHONPATH="${GITHUB_WORKSPACE}/tests:$PYTHONPATH"
+ python tests/elf/fuzzing.py \
+ ${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \
+ --input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_nm.bin -n 100
+
+ pywheels:
+ runs-on: ubuntu-latest
+ needs: linux-sdk
+ container:
+ image: liefproject/manylinux_2_28_x86_64
+ env:
+ CCACHE_DIR: "/home/pylief/.ccache"
+ CXXFLAGS: "-ffunction-sections -fdata-sections -fvisibility-inlines-hidden -static-libgcc"
+ CFLAGS: "-ffunction-sections -fdata-sections -static-libgcc"
+ LDFLAGS: "-Wl,--gc-sections -Wl,--exclude-libs,ALL"
+ CLICOLOR_FORCE: "1"
+ FORCE_COLOR: "1"
+ LIEF_BUILD_DIR: "/tmp/lief-build"
+ ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}"
+ ACTIONS_RUNTIME_TOKEN: "${{ env.ACTIONS_RUNTIME_TOKEN }}"
+ ACTIONS_CACHE_URL: "${{ env.ACTIONS_CACHE_URL }}"
+ options: --user 1001:1001
+ strategy:
+ matrix:
+ python-version: ['3.12', '3.13', '3.14']
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Prepare ccache
+ shell: bash
+ run: |
+ mkdir -p /home/pylief/.ccache/tmp
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: /home/pylief/.ccache
+ key: linux-x86-64-${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ linux-x86-64-${{ runner.os }}-${{ matrix.python-version }}
+ - name: Download LIEF install dir
+ uses: actions/download-artifact@v8
+ with:
+ name: linux-x86-64-install
+ path: /install
+ - name: Generate wheel
+ env:
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ shell: bash
+ run: |
+ export PYLIEF_CONF=$GITHUB_WORKSPACE/scripts/docker/config/pylinux-x64.toml
+ PYTHON_VERSION_ALT=$(echo "${PYTHON_VERSION}" | sed 's/\.//') # Transform 3.8 -> 38
+ PYTHON_BINARY=/opt/python/cp${PYTHON_VERSION_ALT}-cp${PYTHON_VERSION_ALT}/bin/python${PYTHON_VERSION}
+ $PYTHON_BINARY -m pip -vvv wheel --disable-pip-version-check \
+ --wheel-dir=$GITHUB_WORKSPACE/wheel_stage \
+ $GITHUB_WORKSPACE/api/python
+ - name: Run auditwheel
+ shell: bash
+ run: |
+ ls -alh $GITHUB_WORKSPACE/wheel_stage
+ find $GITHUB_WORKSPACE/wheel_stage -exec \
+ auditwheel repair -w $GITHUB_WORKSPACE/dist {} \;
+ ls -alh $GITHUB_WORKSPACE/dist
+ - name: 'Artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: linux-x86-64-python${{ matrix.python-version }}-wheel
+ path: dist/*.whl
+ retention-days: 3
+ deploy:
+ runs-on: ubuntu-latest
+ if: ${{ always() }}
+ needs: [pywheels]
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Download artifacts
+ uses: actions/download-artifact@v8
+ with:
+ pattern: linux-x86-64-*
+ merge-multiple: true
+ path: ${{ runner.temp }}/artifacts
+ - name: Display artifacts
+ run: ls -R
+ working-directory: ${{ runner.temp }}/artifacts
+ - name: Deploy
+ env:
+ LIEF_S3_KEY: ${{ secrets.LIEF_S3_KEY }}
+ LIEF_S3_SECRET: ${{ secrets.LIEF_S3_SECRET }}
+ shell: bash
+ run: |
+ docker run --rm \
+ -v $GITHUB_WORKSPACE:/src \
+ -v $RUNNER_TEMP:/runner_tmp \
+ -e GITHUB_ACTIONS="true" \
+ -e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
+ -e GITHUB_REF=$GITHUB_REF \
+ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
+ -e LIEF_S3_KEY=$LIEF_S3_KEY \
+ -e LIEF_S3_SECRET=$LIEF_S3_SECRET \
+ liefproject/deploy \
+ python3 /src/.github/deploy.py --skip-sdk /runner_tmp/artifacts
diff --git a/vendor/lief/.github/workflows/osx.yml b/vendor/lief/.github/workflows/osx.yml
new file mode 100644
index 0000000..6c7326d
--- /dev/null
+++ b/vendor/lief/.github/workflows/osx.yml
@@ -0,0 +1,224 @@
+name: 'macOS'
+on:
+ push:
+ branches:
+ - 'main'
+ tags-ignore:
+ - '**'
+
+env:
+ python-test-version: '3.13'
+
+jobs:
+ osx-sdk:
+ runs-on: macos-14
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Install system dependencies
+ run: |
+ brew install cmake ninja ccache
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Setup cache dir
+ shell: bash
+ run: |
+ mkdir -p $RUNNER_TEMP/.ccache
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: ${{ runner.temp }}/.ccache
+ key: osx-${{ runner.os }}-sdk-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ osx-${{ runner.os }}-sdk
+ - name: Build SDK
+ shell: bash
+ env:
+ CLICOLOR_FORCE: "1"
+ MACOSX_DEPLOYMENT_TARGET: "11.0"
+ CCACHE_DIR: ${{ runner.temp }}/.ccache
+ CCACHE_MAXSIZE: 10.0G
+ CCACHE_CPP2: 1
+ CCACHE_COMPRESS: 1
+ run: |
+ bash scripts/osx/package_sdk.sh
+ - name: 'Upload SDK Artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: osx-sdk
+ path: build/*.tar.gz
+ retention-days: 3
+ - name: 'Upload install artifact [arm64]'
+ uses: actions/upload-artifact@v7
+ with:
+ name: osx-arm64-install
+ path: install/arm64
+ retention-days: 1
+ - name: 'Upload install artifact [x64]'
+ uses: actions/upload-artifact@v7
+ with:
+ name: osx-x64-install
+ path: install/x64
+ retention-days: 1
+ osx-testing:
+ runs-on: macos-14
+ if: "!contains(github.event.commits[0].message, '[skip-test]')"
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ fetch-depth: 0
+ - name: Set up Python ${{ env.python-test-version }}
+ uses: actions/setup-python@v6
+ with:
+ python-version: ${{ env.python-test-version }}
+ - name: Install system dependencies
+ run: |
+ brew install cmake ninja ccache
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Setup cache dir
+ shell: bash
+ run: |
+ mkdir -p $RUNNER_TEMP/.ccache
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: ${{ runner.temp }}/.ccache
+ key: osx-${{ runner.os }}-test-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ osx-${{ runner.os }}-test
+ - name: Upgrade pip
+ shell: bash
+ run: |
+ python -m pip install --upgrade pip
+ - name: Build Python 3.13 with tests
+ shell: bash
+ env:
+ LIEF_SAMPLES_DIR: "/tmp/samples"
+ LIEF_BUILD_DIR: "/tmp/lief-build"
+ PYLIEF_CONF: "${{ github.workspace }}/scripts/osx/osx-testing-x64.toml"
+ CLICOLOR_FORCE: "1"
+ PYTEST_ADDOPTS: "--color=yes"
+ FORCE_COLOR: "1"
+ MACOSX_TARGET: "11.7"
+ MACOSX_DEPLOYMENT_TARGET: "11.0"
+ CCACHE_DIR: ${{ runner.temp }}/.ccache
+ CCACHE_MAXSIZE: 10.0G
+ CCACHE_CPP2: 1
+ CCACHE_COMPRESS: 1
+ run: |
+ python -m pip install -r tests/requirements.txt
+ python -m pip -vvv install api/python
+ python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
+ - name: Run tests
+ shell: bash
+ timeout-minutes: 20
+ env:
+ LIEF_SAMPLES_DIR: "/tmp/samples"
+ LIEF_BUILD_DIR: "/tmp/lief-build"
+ PYTEST_ADDOPTS: "--color=yes"
+ run: |
+ python tests/run_pytest.py
+ python tests/run_tools_check.py ${LIEF_BUILD_DIR}/
+ ctest --output-on-failure --test-dir ${LIEF_BUILD_DIR}/
+ wheels:
+ runs-on: macos-14
+ needs: osx-sdk
+ strategy:
+ matrix:
+ python-version: ['3.12', '3.13', '3.14']
+ arch: ['x64', 'arm64']
+ fail-fast: false
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ fetch-depth: 0
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v6
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install system dependencies
+ run: |
+ brew install cmake ninja ccache
+ python -m pip install --upgrade pip
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Setup cache dir
+ shell: bash
+ run: |
+ mkdir -p $RUNNER_TEMP/.ccache
+ - name: ccache cache files
+ uses: actions/cache@v5
+ with:
+ path: ${{ runner.temp }}/.ccache
+ key: osx-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ osx-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}
+ - name: Download LIEF install dir
+ uses: actions/download-artifact@v8
+ with:
+ name: osx-${{ matrix.arch }}-install
+ path: ~/lief-${{ matrix.arch }}-install
+ - name: Build Python ${{ matrix.python-version }} [${{ matrix.arch }}]
+ shell: bash
+ env:
+ MACOSX_DEPLOYMENT_TARGET: "11.0"
+ FORCE_COLOR: "1"
+ CLICOLOR_FORCE: "1"
+ CCACHE_DIR: ${{ runner.temp }}/.ccache
+ CCACHE_MAXSIZE: 10.0G
+ CCACHE_CPP2: 1
+ CCACHE_COMPRESS: 1
+ PYLIEF_CONF: "${{ github.workspace }}/scripts/osx/py-${{ matrix.arch }}.toml"
+ run: |
+ python -m pip -vv wheel --wheel-dir=dist/ api/python
+ - name: 'Upload Python wheel artifact - ${{ matrix.python-version }}'
+ uses: actions/upload-artifact@v7
+ with:
+ name: osx-wheel-${{ matrix.arch }}-${{ matrix.python-version }}
+ path: dist/*.whl
+ retention-days: 3
+ deploy:
+ runs-on: ubuntu-latest
+ if: ${{ always() }}
+ needs: [wheels]
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Download artifacts
+ uses: actions/download-artifact@v8
+ with:
+ pattern: osx-*
+ merge-multiple: true
+ path: ${{ runner.temp }}/artifacts
+ - name: Display artifacts
+ run: ls -R
+ working-directory: ${{ runner.temp }}/artifacts
+ - name: Deploy
+ env:
+ LIEF_S3_KEY: ${{ secrets.LIEF_S3_KEY }}
+ LIEF_S3_SECRET: ${{ secrets.LIEF_S3_SECRET }}
+ shell: bash
+ run: |
+ docker run --rm \
+ -v $GITHUB_WORKSPACE:/src \
+ -v $RUNNER_TEMP:/runner_tmp \
+ -e GITHUB_ACTIONS="true" \
+ -e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
+ -e GITHUB_REF=$GITHUB_REF \
+ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
+ -e LIEF_S3_KEY=$LIEF_S3_KEY \
+ -e LIEF_S3_SECRET=$LIEF_S3_SECRET \
+ liefproject/deploy \
+ python3 /src/.github/deploy.py --skip-sdk /runner_tmp/artifacts
diff --git a/vendor/lief/.github/workflows/pr.yml b/vendor/lief/.github/workflows/pr.yml
new file mode 100644
index 0000000..6711597
--- /dev/null
+++ b/vendor/lief/.github/workflows/pr.yml
@@ -0,0 +1,92 @@
+name: LIEF PR
+on: [pull_request, workflow_dispatch]
+
+env:
+ python-osx-version: '3.12'
+ python-win-version: '3.12'
+
+jobs:
+ osx:
+ runs-on: macos-14
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v6
+ with:
+ python-version: ${{ env.python-osx-version }}
+ - name: Install system dependencies
+ run: |
+ brew install cmake ninja ccache
+ python -m pip install --upgrade pip
+ - name: Build with Python ${{ env.python-osx-version }} & Test
+ shell: bash
+ env:
+ LIEF_SAMPLES_DIR: "/tmp/samples"
+ LIEF_BUILD_DIR: "/tmp/lief-build"
+ PYLIEF_CONF: "${{ github.workspace }}/scripts/osx/osx-testing-x64.toml"
+ run: |
+ python -m pip install -r tests/requirements.txt
+ python -m pip install -e api/python
+ python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
+ python tests/run_pytest.py
+ python tests/run_tools_check.py ${LIEF_BUILD_DIR}
+ ctest --output-on-failure --test-dir ${LIEF_BUILD_DIR}
+ linux:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Build & Test
+ shell: bash
+ env:
+ PYTHON_VERSION: 312
+ run: |
+ docker run --rm \
+ -e PYTHON_VERSION=$PYTHON_VERSION \
+ -e PYTHON_BINARY=/opt/python/cp312-cp312/bin/python3.12 \
+ -v $GITHUB_WORKSPACE:/src \
+ liefproject/manylinux_2_28_x86_64 \
+ bash /src/scripts/docker/test-linux-x64
+ windows:
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v6
+ - name: Set up Python ${{ env.python-win-version }}
+ uses: actions/setup-python@v6
+ with:
+ python-version: ${{ env.python-win-version }}
+ architecture: x64
+ - name: Install system dependencies
+ run: |
+ choco install ninja
+ python -m pip install --upgrade pip
+ - uses: ilammy/msvc-dev-cmd@v1
+ with:
+ vsversion: "2022"
+ - name: Set env variables
+ run: |
+ chcp 65001 #set code page to utf-8
+ echo ("LIEF_SAMPLES_DIR=" + $env:RUNNER_TEMP + "/samples") >> $env:GITHUB_ENV
+ echo ("LIEF_BUILD_DIR=" + $env:RUNNER_TEMP + "/lief-build") >> $env:GITHUB_ENV
+ echo ("PYLIEF_CONF=" + $env:GITHUB_WORKSPACE + "/scripts/windows/py-x64-test.toml") >> $env:GITHUB_ENV
+ - name: Build Python ${{ env.python-win-version }}
+ shell: pwsh
+ run: |
+ python -m pip install -r tests/requirements.txt
+ python -m pip install api/python
+ python tests/dl_samples.py $env:LIEF_SAMPLES_DIR
+ - name: Run tests - unittests
+ shell: pwsh
+ run: |
+ cd $env:GITHUB_WORKSPACE
+ ctest --output-on-failure --test-dir $env:LIEF_BUILD_DIR
+ Exit $LASTEXITCODE
+ - name: Run tests - python
+ shell: pwsh
+ run: |
+ cd $env:GITHUB_WORKSPACE
+ python tests/run_pytest.py
+ Exit $LASTEXITCODE
diff --git a/vendor/lief/.github/workflows/windows-all.yml b/vendor/lief/.github/workflows/windows-all.yml
new file mode 100644
index 0000000..a2759c5
--- /dev/null
+++ b/vendor/lief/.github/workflows/windows-all.yml
@@ -0,0 +1,268 @@
+name: LIEF Windows
+on:
+ push:
+ branches:
+ - 'main'
+ tags-ignore:
+ - '**'
+
+env:
+ python-test-version: '3.13'
+ python-version: '3.13'
+ CLICOLOR_FORCE: "1"
+ FORCE_COLOR: "1"
+ GCC_COLORS: "yes"
+ COLORTERM: "truecolor"
+ TERM: "screen-256color"
+ CLICOLOR: "1"
+
+jobs:
+ build-sdk:
+ runs-on: windows-2022
+ strategy:
+ matrix:
+ arch: ['x64', 'x86']
+ fail-fast: false
+ env:
+ SCCACHE_CACHE_SIZE: 2G
+ SCCACHE_DIR: ${{ vars.SCCACHE_DIR }}
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Set up Python
+ uses: actions/setup-python@v6
+ with:
+ python-version: ${{ env.python-version }}
+ architecture: ${{ matrix.arch }}
+ - run: python -m pip install setuptools
+ - name: Install system dependencies
+ run: |
+ choco install ninja
+ choco install sccache
+ - uses: ilammy/msvc-dev-cmd@v1
+ with:
+ vsversion: "2022"
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Setup sccache
+ uses: actions/cache@v5
+ continue-on-error: false
+ with:
+ path: ${{ vars.SCCACHE_DIR }}
+ key: ${{ runner.os }}-${{ matrix.arch }}-sccache-sdk-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.arch }}-sccache-sdk
+ - name: Start sccache server
+ run: sccache --start-server
+ - name: Build SDK
+ run: |
+ python ./scripts/windows/package_sdk.py
+ - name: 'Upload SDK artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: windows-${{ matrix.arch }}-sdk
+ path: build/*.zip
+ retention-days: 3
+ - name: 'Upload install artifact'
+ uses: actions/upload-artifact@v7
+ with:
+ name: windows-${{ matrix.arch }}-install
+ path: ${{ runner.temp }}/lief-install
+ retention-days: 1
+ - name: sccache stats
+ run: sccache --show-stats
+ - name: stop sccache server
+ run: sccache --stop-server || true
+ tests:
+ runs-on: windows-2022
+ if: "!contains(github.event.commits[0].message, '[skip-test]')"
+ strategy:
+ matrix:
+ arch: ['x64']
+ fail-fast: false
+ env:
+ SCCACHE_CACHE_SIZE: 2G
+ SCCACHE_DIR: ${{ vars.SCCACHE_DIR }}
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Set up Python ${{ env.python-test-version }}
+ uses: actions/setup-python@v6
+ with:
+ python-version: ${{ env.python-test-version }}
+ architecture: ${{ matrix.arch }}
+ - name: Install system dependencies
+ run: |
+ choco install ninja
+ choco install sccache
+ - uses: ilammy/msvc-dev-cmd@v1
+ with:
+ vsversion: "2022"
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Setup sccache
+ uses: actions/cache@v5
+ continue-on-error: false
+ with:
+ path: ${{ vars.SCCACHE_DIR }}
+ key: ${{ runner.os }}-${{ matrix.arch }}-sccache-test-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.arch }}-sccache-test
+ - name: Start sccache server
+ run: sccache --start-server
+ - name: Set arch specific env
+ if: matrix.arch == 'x64'
+ run: |
+ echo "ARCH=x64" >> $env:GITHUB_ENV
+ - name: Set arch specific env
+ if: matrix.arch == 'x86'
+ run: |
+ echo "ARCH=x86" >> $env:GITHUB_ENV
+ - name: Set Python config (${{ matrix.arch }})
+ run: |
+ echo ("PYLIEF_CONF=" + $env:GITHUB_WORKSPACE + "/scripts/windows/py-" + $env:ARCH + "-test.toml") >> $env:GITHUB_ENV
+ - name: Set env variables
+ run: |
+ chcp 65001 #set code page to utf-8
+ echo ("LIEF_SAMPLES_DIR=" + $env:RUNNER_TEMP + "/samples") >> $env:GITHUB_ENV
+ echo ("LIEF_BUILD_DIR=" + $env:RUNNER_TEMP + "/lief-build") >> $env:GITHUB_ENV
+ - name: Build Python ${{ env.python-test-version }}
+ shell: pwsh
+ run: |
+ python -m pip install -r tests/requirements.txt
+ python tests/dl_samples.py $env:LIEF_SAMPLES_DIR
+ python -m pip -vvv install --user api/python
+ Exit $LASTEXITCODE
+ - name: Download samples
+ shell: pwsh
+ run: |
+ python -m pip install -r tests/requirements.txt
+ python tests/dl_samples.py $env:LIEF_SAMPLES_DIR
+ - name: Run unittests
+ shell: pwsh
+ run: |
+ cd $env:GITHUB_WORKSPACE
+ ctest --output-on-failure --test-dir $env:LIEF_BUILD_DIR
+ Exit $LASTEXITCODE
+ - name: Run Python tests
+ timeout-minutes: 20
+ shell: pwsh
+ run: |
+ cd $env:GITHUB_WORKSPACE
+ python tests/run_pytest.py
+ Exit $LASTEXITCODE
+ - name: sccache stats
+ run: sccache --show-stats
+ - name: stop sccache server
+ run: sccache --stop-server || true
+ wheels:
+ runs-on: windows-2022
+ needs: build-sdk
+ strategy:
+ matrix:
+ python-version: ['3.12', '3.13', '3.14']
+ arch: ['x86', 'x64']
+ fail-fast: false
+ env:
+ SCCACHE_CACHE_SIZE: 2G
+ SCCACHE_DIR: ${{ vars.SCCACHE_DIR }}
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v6
+ with:
+ python-version: ${{ matrix.python-version }}
+ architecture: ${{ matrix.arch }}
+ - name: Install system dependencies
+ run: |
+ choco install ninja
+ choco install sccache
+ python -m pip install --upgrade pip
+ - uses: ilammy/msvc-dev-cmd@v1
+ with:
+ vsversion: "2022"
+ - name: Get Date
+ id: get-date
+ run: |
+ echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Save sccache
+ uses: actions/cache@v5
+ continue-on-error: false
+ with:
+ path: ${{ vars.SCCACHE_DIR }}
+ key: ${{ runner.os }}-${{ matrix.arch }}-sccache-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.arch }}-sccache-${{ matrix.python-version }}
+ - name: Download LIEF install dir
+ uses: actions/download-artifact@v8
+ with:
+ name: windows-${{ matrix.arch }}-install
+ path: ~/lief-${{ matrix.arch }}-install
+ - name: Start sccache server
+ run: sccache --start-server
+ - name: Set arch specific env
+ if: matrix.arch == 'x64'
+ run: |
+ echo "ARCH=x64" >> $env:GITHUB_ENV
+ - name: Set arch specific env
+ if: matrix.arch == 'x86'
+ run: |
+ echo "ARCH=x86" >> $env:GITHUB_ENV
+ - name: Set Python config (${{ matrix.arch }})
+ run: |
+ echo ("PYLIEF_CONF=" + $env:GITHUB_WORKSPACE + "/scripts/windows/py-" + $env:ARCH + ".toml") >> $env:GITHUB_ENV
+ - name: Set env variables
+ run: |
+ chcp 65001 #set code page to utf-8
+ - name: Build Python ${{ matrix.python-version }}
+ shell: pwsh
+ run: |
+ python -m pip -vvv wheel --wheel-dir=dist/ ./api/python
+ - name: 'Upload Python artifacts [${{ matrix.python-version }}]'
+ uses: actions/upload-artifact@v7
+ with:
+ name: windows-${{ matrix.arch }}-wheel-${{ matrix.python-version }}
+ path: dist/*.whl
+ retention-days: 3
+ deploy:
+ if: ${{ always() }}
+ runs-on: ubuntu-latest
+ #needs: [build-sdk, wheels]
+ needs: [wheels]
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Download artifacts
+ uses: actions/download-artifact@v8
+ with:
+ pattern: windows-*
+ merge-multiple: true
+ path: ${{ runner.temp }}/artifacts
+ - name: Deploy
+ env:
+ LIEF_S3_KEY: ${{ secrets.LIEF_S3_KEY }}
+ LIEF_S3_SECRET: ${{ secrets.LIEF_S3_SECRET }}
+ shell: bash
+ run: |
+ docker run --rm \
+ -v $GITHUB_WORKSPACE:/src \
+ -v $RUNNER_TEMP:/runner_tmp \
+ -e GITHUB_ACTIONS="true" \
+ -e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
+ -e GITHUB_REF=$GITHUB_REF \
+ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
+ -e LIEF_S3_KEY=$LIEF_S3_KEY \
+ -e LIEF_S3_SECRET=$LIEF_S3_SECRET \
+ liefproject/deploy python3 /src/.github/deploy.py --skip-sdk /runner_tmp/artifacts
diff --git a/vendor/lief/.gitignore b/vendor/lief/.gitignore
new file mode 100644
index 0000000..eb9ba92
--- /dev/null
+++ b/vendor/lief/.gitignore
@@ -0,0 +1,15 @@
+build/
+*.so
+*.whl
+*.dll
+*.dylib
+*.lib
+lief.egg-info/
+dist/
+**/target/*
+api/rust/cargo/target/*
+api/rust/examples/target/*
+tools/target/*
+plugins/ghidra/bin/
+api/python/tests/lib/
+dev-scripts/
diff --git a/vendor/lief/.gitlab-ci.yml b/vendor/lief/.gitlab-ci.yml
new file mode 100644
index 0000000..6b93cd1
--- /dev/null
+++ b/vendor/lief/.gitlab-ci.yml
@@ -0,0 +1,4 @@
+include:
+ - project: 'LIEF/ci'
+ ref: main
+ file: 'main.yml'
diff --git a/vendor/lief/AUTHORS b/vendor/lief/AUTHORS
index c5bf864..5909eb5 100644
--- a/vendor/lief/AUTHORS
+++ b/vendor/lief/AUTHORS
@@ -1,3 +1,3 @@
Authors:
- Romain Thomas - Quarkslab
+ Romain Thomas
diff --git a/vendor/lief/Acknowledgements b/vendor/lief/Acknowledgements
index faed973..9c55299 100644
--- a/vendor/lief/Acknowledgements
+++ b/vendor/lief/Acknowledgements
@@ -4,13 +4,10 @@ Acknowledgements
LIEF makes use of the following open source projects:
- mbedTLS - https://tls.mbed.org/
- - pybind11 - https://github.com/pybind/pybind11
+ - nanobind - https://github.com/wjakob/nanobind
- json - https://nlohmann.github.io/json/
- - rang - https://agauniyal.github.io/rang/
- - easyloggingpp - https://github.com/muflihun/easyloggingpp
- - Catch - https://github.com/philsquared/Catch
- - yamlcpp - https://github.com/jbeder/yaml-cpp
- - filesystem - https://github.com/wjakob/filesystem
+ - spdlog - https://github.com/gabime/spdlog
+ - Catch2 - https://github.com/catchorg/Catch2
- utf8-cpp - https://sourceforge.net/projects/utfcpp/
- llvm - http://llvm.org/ - For the formats enums and structures
- virtualbox - https://www.virtualbox.org/ - For the PE 'LoadConfiguration' structures
diff --git a/vendor/lief/CHANGELOG b/vendor/lief/CHANGELOG
index 3598f2b..21202a7 100644
--- a/vendor/lief/CHANGELOG
+++ b/vendor/lief/CHANGELOG
@@ -1,5 +1,4 @@
Changelog
=========
-see doc/sphinx/changelog.rst
-
+see doc/sphinx/changelog.md
diff --git a/vendor/lief/CMakeLists.txt b/vendor/lief/CMakeLists.txt
index 551e8f7..9598f3c 100644
--- a/vendor/lief/CMakeLists.txt
+++ b/vendor/lief/CMakeLists.txt
@@ -1,47 +1,45 @@
-cmake_minimum_required(VERSION 3.5)
-
-# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
-if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
- cmake_policy(SET CMP0135 NEW)
-endif()
+cmake_minimum_required(VERSION 3.24)
+project(LIEF LANGUAGES C CXX)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
-set(IS_WIN_CROSS_COMPILE 0)
-if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING)
- set(IS_WIN_CROSS_COMPILE 1)
-endif()
-
-
-if(WIN32 OR ${IS_WIN_CROSS_COMPILE})
- include(ChooseMSVCCRT)
-endif()
include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)
-include(ExternalProject)
include(CMakePackageConfigHelpers)
-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git"
- AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
- find_package(Git REQUIRED)
-
- # Information from git
- # ====================
+find_package(Git)
+if (DEFINED ENV{LIEF_VERSION_ENV})
+ string(REGEX MATCHALL "([0-9]+)" VERSION_STRING "$ENV{LIEF_VERSION_ENV}")
+ if (NOT VERSION_STRING)
+ message(FATAL_ERROR "Invalid version")
+ endif()
+ list(GET VERSION_STRING 0 LIEF_VERSION_MAJOR)
+ list(GET VERSION_STRING 1 LIEF_VERSION_MINOR)
+ list(GET VERSION_STRING 2 LIEF_VERSION_PATCH)
+elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git"
+ AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND Git_FOUND)
include(LIEFGit)
else()
- set(LIEF_VERSION_MAJOR "0")
- set(LIEF_VERSION_MINOR "13")
- set(LIEF_VERSION_PATCH "0")
+ set(LIEF_VERSION_MAJOR 2)
+ set(LIEF_VERSION_MINOR 0)
+ set(LIEF_VERSION_PATCH 0)
+endif()
+
+if (DEFINED ENV{LIEF_COMMIT})
+ set(LIEF_COMMIT_HASH "$ENV{LIEF_COMMIT}")
+endif()
+
+if (DEFINED ENV{LIEF_BRANCH})
+ set(LIEF_GIT_BRANCH "$ENV{LIEF_BRANCH}")
endif()
# LIEF Project
# ============
-project(
- LIEF
- VERSION ${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH})
+project(LIEF VERSION
+ ${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH})
message(STATUS "${PROJECT_NAME} ${PROJECT_VERSION}")
# LIEF options
@@ -57,8 +55,8 @@ message(STATUS "Caching: ${LIEF_USE_CCACHE}")
if(LIEF_USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
+ set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_FOUND})
+ set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_FOUND})
message(STATUS "Found ccache: ${CCACHE_FOUND}")
else()
find_program(SCCACHE_FOUND sccache)
@@ -86,7 +84,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
endif()
+set(LIEF_EXTRA_FLAGS)
+
+message(STATUS "LIEF_EXTRA_FLAGS: ${LIEF_EXTRA_FLAGS}")
message(STATUS "CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
+message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message(STATUS "CMAKE_CXX_LINK_EXECUTABLE: ${CMAKE_CXX_LINK_EXECUTABLE}")
message(STATUS "CMAKE_CXX_LINK_FLAGS: ${CMAKE_CXX_LINK_FLAGS}")
@@ -99,133 +102,77 @@ message(STATUS "CMAKE_LINK_LIBRARY_FILE_FLAG: ${CMAKE_LINK_LIBRARY_FILE_FLA
message(STATUS "CMAKE_LINK_INTERFACE_LIBRARIES: ${CMAKE_LINK_INTERFACE_LIBRARIES}")
message(STATUS "CMAKE_CXX_IMPLICIT_LINK_LIBRARIES: ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}")
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
+message(STATUS "CMAKE_MSVC_RUNTIME_LIBRARY: ${CMAKE_MSVC_RUNTIME_LIBRARY}")
+
+include(GNUInstallDirs)
# LIEF Source definition
# ======================
+add_library(LIB_LIEF src/Object.cpp)
+add_subdirectory(src)
-set(LIEF_PRIVATE_INCLUDE_DIR)
-set(LIEF_PUBLIC_INCLUDE_DIR)
-
-set(LIEF_PUBLIC_INCLUDE_FILES)
-set(LIEF_PRIVATE_INCLUDE_FILES)
-
-set(LIBLIEF_SOURCE_FILES
- "${CMAKE_CURRENT_SOURCE_DIR}/src/errors.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/hash_stream.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/logging.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/exception.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/iostream.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/utils.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/internal_utils.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/Object.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/Object.tcc"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/Visitor.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/BinaryStream.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/VectorStream.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/FileStream.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/MemoryStream.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/SpanStream.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/Convert.cpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/visitors/hash.cpp")
-
-# Grouping basic headers together
-# ===============================
-set(LIEF_INC_FILES
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/errors.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/span.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/ELF.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/Abstract.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/exception.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/iostream.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/iterators.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/LIEF.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/logging.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/MachO.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/PE.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/types.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/utils.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/visibility.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/Object.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/Visitor.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/visitor_macros.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/BinaryStream.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/VectorStream.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/FileStream.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/MemoryStream.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/SpanStream.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/Convert.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/internal_utils.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/hash_stream.hpp"
- "${CMAKE_CURRENT_SOURCE_DIR}/src/frozen.hpp"
-)
-
-set(LIEF_VISITOR_INCLUDE_FILES
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/hash.hpp")
-
-set(LIEF_INCLUDE_FILES ${LIEF_INC_FILES} ${LIEF_VISITOR_INCLUDE_FILES})
-
-set(LIEF_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/visitors/json.cpp")
-set(LIEF_JSON_HDR "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/json.hpp")
-
-list(APPEND LIEF_INC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/json.hpp")
-list(APPEND LIBLIEF_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/json_api.cpp")
-
-if(LIEF_ENABLE_JSON)
- list(APPEND LIBLIEF_SOURCE_FILES "${LIEF_JSON_SRC}")
- list(APPEND LIEF_INC_FILES "${LIEF_JSON_HDR}")
+if (LIEF_EXTRA_FLAGS)
+ target_compile_options(LIB_LIEF PRIVATE ${LIEF_EXTRA_FLAGS})
endif()
-source_group("Header Files" FILES ${LIEF_INC_FILES})
-source_group("Source Files" FILES ${LIBLIEF_SOURCE_FILES})
-
-source_group("Header Files\\visitors" FILES ${LIEF_VISITOR_INCLUDE_FILES})
+if(LIEF_PRECOMPILED)
+ find_package(lief-extended QUIET)
+ if (NOT lief-extended_FOUND)
+ find_package(LIEF REQUIRED)
+ endif()
+else()
+ add_library(LIEF::LIEF ALIAS LIB_LIEF)
+endif()
-add_library(LIB_LIEF ${LIBLIEF_SOURCE_FILES} ${LIEF_INCLUDE_FILES})
-add_library(LIEF::LIEF ALIAS LIB_LIEF)
if(NOT LIEF_OPT_MBEDTLS_EXTERNAL)
- set_source_files_properties(${mbedtls_src_crypto} PROPERTIES GENERATED TRUE)
- set_source_files_properties(${mbedtls_src_x509} PROPERTIES GENERATED TRUE)
- set_source_files_properties(${mbedtls_src_tls} PROPERTIES GENERATED TRUE)
- target_sources(LIB_LIEF PRIVATE
- "${mbedtls_src_crypto}"
- "${mbedtls_src_x509}"
- "${mbedtls_src_tls}")
-
- source_group("mbedtls\\crypto" FILES ${mbedtls_src_crypto})
- source_group("mbedtls\\x509" FILES ${mbedtls_src_x509})
- source_group("mbedtls\\tls" FILES ${mbedtls_src_tls})
-
- target_include_directories(
- LIB_LIEF SYSTEM PRIVATE
- "${MBEDTLS_INCLUDE_DIRS}"
- "${MBEDTLS_SOURCE_DIR}/library"
+ target_sources(LIB_LIEF PRIVATE ${mbedtls_src_files})
+
+ target_include_directories(LIB_LIEF SYSTEM PRIVATE
+ ${MBEDTLS_INCLUDE_DIRS}
+ "${MBEDTLS_SOURCE_DIR}/library"
)
+ if (LIEF_PYTHON_FREE_THREADED)
+ target_compile_definitions(LIB_LIEF PRIVATE
+ # these must be set at LIB_LIEF compile time to be forwarded to MbedTLS
+ -DMBEDTLS_THREADING_C
+ -DMBEDTLS_THREADING_ALT
+ )
+ endif()
- add_dependencies(LIB_LIEF lief_mbed_tls)
+ target_compile_definitions(LIB_LIEF PRIVATE
+ -DTF_PSA_CRYPTO_USER_CONFIG_FILE="${CMAKE_CURRENT_SOURCE_DIR}/config/mbedtls/psa_config.h"
+ )
else()
- find_package(MbedTLS REQUIRED)
+ find_package(MbedTLS 4.0.0 EXACT REQUIRED)
target_link_libraries(LIB_LIEF PRIVATE
- MbedTLS::mbedcrypto
- MbedTLS::mbedx509)
+ MbedTLS::tfpsacrypto MbedTLS::mbedx509)
+ if (LIEF_PYTHON_FREE_THREADED)
+ message(WARNING "Python free-threading requires the external MbedTLS to have \
+ been built with threading support. LIEF cannot enforce this.")
+ endif()
endif()
-if(WINDOWS AND BUILD_SHARED_LIBS)
- target_link_libraries(LIB_LIEF ws2_32)
-endif()
+target_compile_definitions(LIB_LIEF PRIVATE
+ -DMBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_SOURCE_DIR}/config/mbedtls/config.h"
+ -DMBEDTLS_X509_USE_C
+ -DMBEDTLS_PK_PARSE_C
+)
-if(MSVC OR ${IS_WIN_CROSS_COMPILE})
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
+if (WIN32)
+ target_link_libraries(LIB_LIEF PRIVATE bcrypt)
endif()
-if(CMAKE_BUILD_TYPE MATCHES Debug AND WINDOWS)
- add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_SECURE_SCL=0
- -D_HAS_ITERATOR_DEBUGGING=0)
+if(WIN32 AND BUILD_SHARED_LIBS)
+ target_link_libraries(LIB_LIEF PRIVATE ws2_32)
+ if (LIEF_IMPORT_SUFFIX)
+ set_target_properties(LIB_LIEF PROPERTIES IMPORT_SUFFIX "${LIEF_IMPORT_SUFFIX}")
+ endif()
endif()
-if(CMAKE_BUILD_TYPE MATCHES Debug AND UNIX)
- target_compile_options(LIB_LIEF PRIVATE -g -O0)
+if(MSVC)
+ target_compile_options(LIB_LIEF PRIVATE /bigobj)
+ target_compile_options(LIB_LIEF PUBLIC /Zc:__cplusplus)
endif()
if(BUILD_SHARED_LIBS OR LIEF_FORCE_API_EXPORTS)
@@ -233,95 +180,31 @@ if(BUILD_SHARED_LIBS OR LIEF_FORCE_API_EXPORTS)
else()
target_compile_definitions(LIB_LIEF PRIVATE -DLIEF_STATIC)
endif()
-if(LIEF_SUPPORT_CXX14)
- target_compile_features(LIB_LIEF PRIVATE cxx_std_14)
-endif()
-# Abstract part
-include("${CMAKE_CURRENT_SOURCE_DIR}/src/Abstract/CMakeLists.txt")
-# ELF Part
-# ========
-include("${CMAKE_CURRENT_SOURCE_DIR}/src/ELF/CMakeLists.txt")
-if(LIEF_ELF)
- set(ENABLE_ELF_SUPPORT 1)
-else()
- set(ENABLE_ELF_SUPPORT 0)
-endif()
-
-# PE Part
-# =======
-include("${CMAKE_CURRENT_SOURCE_DIR}/src/PE/CMakeLists.txt")
-if(LIEF_PE)
- set(ENABLE_PE_SUPPORT 1)
-else()
- set(ENABLE_PE_SUPPORT 0)
-endif()
-
-# MachO part
-# ==========
-include("${CMAKE_CURRENT_SOURCE_DIR}/src/MachO/CMakeLists.txt")
-if(LIEF_MACHO)
- set(ENABLE_MACHO_SUPPORT 1)
-else()
- set(ENABLE_MACHO_SUPPORT 0)
+if(LIEF_ENABLE_JSON)
+ # Make nlohmann/json is only using C++11 API.
+ # Especially, MSVC[14.37.32822] is buggy with (no)rtti & std::any
+ # Ref:
+ # - https://github.com/nlohmann/json/issues/3900
+ # - https://github.com/microsoft/STL/issues/4349#issuecomment-1920093172
+ target_compile_definitions(LIB_LIEF PRIVATE JSON_HAS_CPP_11)
endif()
# Logging Configuration
# =====================
-
target_compile_definitions(LIB_LIEF PRIVATE SPDLOG_DISABLE_DEFAULT_LOGGER
+ SPDLOG_NO_EXCEPTIONS
SPDLOG_FUNCTION=)
-if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
- target_compile_definitions(LIB_LIEF PRIVATE SPDLOG_NO_EXCEPTIONS SPDLOG_NO_THREAD_ID)
-endif()
-
-# Frozen Configuration
-# ====================
-if(LIEF_FROZEN_ENABLED)
-endif()
-
-# OAT part
-# ========
-if(LIEF_OAT)
- include(${CMAKE_CURRENT_SOURCE_DIR}/src/OAT/CMakeLists.txt)
- set(ENABLE_OAT_SUPPORT 1)
-else()
- set(ENABLE_OAT_SUPPORT 0)
-endif()
-
-# DEX part
-# ========
-if(LIEF_DEX)
- include(${CMAKE_CURRENT_SOURCE_DIR}/src/DEX/CMakeLists.txt)
- set(ENABLE_DEX_SUPPORT 1)
-else()
- set(ENABLE_DEX_SUPPORT 0)
+if (MSVC AND NOT CLANG_CL AND NOT LIEF_EXTERNAL_SPDLOG)
+ target_compile_definitions(LIB_LIEF PRIVATE FMT_UNICODE=0)
endif()
-# VDEX part
-# =========
-if(LIEF_VDEX)
- include(${CMAKE_CURRENT_SOURCE_DIR}/src/VDEX/CMakeLists.txt)
- set(ENABLE_VDEX_SUPPORT 1)
-else()
- set(ENABLE_VDEX_SUPPORT 0)
-endif()
-
-# ART part
-# ========
-if(LIEF_ART)
- include(${CMAKE_CURRENT_SOURCE_DIR}/src/ART/CMakeLists.txt)
- set(ENABLE_ART_SUPPORT 1)
-else()
- set(ENABLE_ART_SUPPORT 0)
+if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
+ target_compile_definitions(LIB_LIEF PRIVATE SPDLOG_NO_THREAD_ID)
endif()
-# Platforms
-# =========
-include(${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/CMakeLists.txt)
-
# LIEF includes
# =============
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/version.h.in"
@@ -330,40 +213,39 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/version.h.in"
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/config.h" @ONLY)
-list(APPEND LIEF_PUBLIC_INCLUDE_DIR
- "${CMAKE_CURRENT_SOURCE_DIR}/include/"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/"
- "${CMAKE_CURRENT_BINARY_DIR}/include/")
+set(LIEF_PUBLIC_INCLUDE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/
+ ${CMAKE_CURRENT_BINARY_DIR}/include/)
-list(APPEND LIEF_PRIVATE_INCLUDE_DIR "${LIEF_PUBLIC_INCLUDE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}")
+set(LIEF_PRIVATE_INCLUDE_DIR
+ ${LIEF_PUBLIC_INCLUDE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_BINARY_DIR})
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR}/LIEF.pc
- @ONLY)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/LIEF.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/LIEF.pc @ONLY)
target_include_directories(LIB_LIEF
PUBLIC "$"
PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}")
+target_precompile_headers(LIB_LIEF PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/lief-pch.hpp
+)
+
if(LIEF_ENABLE_JSON)
if(LIEF_OPT_NLOHMANN_JSON_EXTERNAL)
find_package(nlohmann_json REQUIRED)
target_link_libraries(LIB_LIEF PRIVATE nlohmann_json::nlohmann_json)
else()
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/internal/nlohmann/json.hpp
- COMMAND
- ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/internal/nlohmann
- COMMAND
- ${CMAKE_COMMAND} -E copy_directory ${LIBJSON_SOURCE_DIR}/
- ${CMAKE_CURRENT_BINARY_DIR}/internal/nlohmann/
- DEPENDS lief_libjson)
-
- target_sources(LIB_LIEF PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}/internal/nlohmann/json.hpp)
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/internal/nlohmann)
+ file(COPY ${LIBJSON_SOURCE_DIR}/
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/internal/nlohmann/)
target_include_directories(LIB_LIEF PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/)
endif()
+ target_compile_definitions(LIB_LIEF PRIVATE JSON_NOEXCEPTION)
endif()
if(LIEF_FROZEN_ENABLED)
@@ -371,53 +253,36 @@ if(LIEF_FROZEN_ENABLED)
find_package(frozen REQUIRED)
target_link_libraries(LIB_LIEF PRIVATE frozen::frozen)
else()
- add_dependencies(LIB_LIEF lief_frozen)
target_include_directories(LIB_LIEF
PRIVATE "${FROZEN_INCLUDE_DIR}")
endif()
endif()
+
# =======================================
-# Leaf
+# Expected
# =======================================
-if(LIEF_EXTERNAL_LEAF)
- message(STATUS "Using external LEAF version")
- if(LIEF_EXTERNAL_LEAF_DIR)
- message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}")
- target_include_directories(LIB_LIEF SYSTEM PUBLIC
- "$")
- endif()
+if(LIEF_EXTERNAL_EXPECTED)
+ message(STATUS "Using external Expected version")
+ find_package(tl-expected REQUIRED)
+ target_link_libraries(LIB_LIEF PUBLIC tl::expected)
else()
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp
- COMMAND
- ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/
- COMMAND
- ${CMAKE_COMMAND} -E copy_directory ${LEAF_SRC_DIR}/
- ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/
- DEPENDS lief_leaf)
-
- target_sources(LIB_LIEF PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp)
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/)
+ file(COPY ${EXPECTED_SRC_DIR}/include/tl/
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/)
endif()
+
# =======================================
# utfcpp
# =======================================
-
if(LIEF_OPT_UTFCPP_EXTERNAL)
find_package(utf8cpp REQUIRED)
- target_link_libraries(LIB_LIEF PRIVATE utf8cpp)
+ target_link_libraries(LIB_LIEF PRIVATE utf8cpp::utf8cpp)
else()
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/internal/utfcpp/utf8.h
- COMMAND
- ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/internal/
- COMMAND
- ${CMAKE_COMMAND} -E copy_directory ${UTFCPP_INCLUDE_DIR}/
- ${CMAKE_CURRENT_BINARY_DIR}/internal/utfcpp
- DEPENDS lief_utfcpp)
-
- target_sources(LIB_LIEF PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}/internal/utfcpp/utf8.h)
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/internal/)
+ file(COPY ${UTFCPP_INCLUDE_DIR}/
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/internal/utfcpp)
endif()
# =======================================
@@ -431,40 +296,52 @@ if(LIEF_EXTERNAL_SPAN)
"$")
endif()
else()
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/span.hpp
- COMMAND
- ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/
- COMMAND
- ${CMAKE_COMMAND} -E copy_directory ${TCB_SPAN_SRC_DIR}/
- ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/
- DEPENDS lief_span)
-
- target_sources(LIB_LIEF PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/span.hpp)
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/)
+ file(COPY ${TCB_SPAN_SRC_DIR}/
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/)
endif()
-
-
target_link_libraries(LIB_LIEF PRIVATE lief_spdlog)
+if(ANDROID AND LIEF_LOGGING)
+ target_link_libraries(LIB_LIEF PUBLIC log)
+endif()
+
# Flags definition
# ----------------
-
-# cmake-format: off
-set_target_properties(
- LIB_LIEF
+set_target_properties(LIB_LIEF
PROPERTIES POSITION_INDEPENDENT_CODE ON
- CXX_STANDARD 11
+ CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
+ VISIBILITY_INLINES_HIDDEN ON
CXX_VISIBILITY_PRESET hidden
C_VISIBILITY_PRESET hidden)
-# cmake-format: on
+
+if (LIEF_CLANG_TIDY)
+ find_program(CLANG_TIDY_EXE NAMES "clang-tidy" REQUIRED)
+ cmake_path(GET CLANG_TIDY_EXE PARENT_PATH CLANG_TIDY_DIR)
+
+ set(CLANG_TIDY_COMMAND
+ "${CLANG_TIDY_EXE}"
+ "--use-color"
+ "--load=${CLANG_TIDY_DIR}/clang-taidy.so"
+ "--config-file=${CMAKE_CURRENT_SOURCE_DIR}/.clang-tidy-core.yaml"
+ )
+ if (LIEF_CLANG_TIDY_WARN_ERR)
+ list(APPEND CLANG_TIDY_COMMAND "--warnings-as-errors=*")
+ endif()
+
+ set_target_properties(LIB_LIEF PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
+
+ if (TARGET LIB_LIEF_RUNTIME)
+ set_target_properties(LIB_LIEF_RUNTIME
+ PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
+ endif()
+endif()
+
if(UNIX AND NOT APPLE)
- set_property(
- TARGET LIB_LIEF
- APPEND
- PROPERTY LINK_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL")
+ target_link_options(LIB_LIEF PRIVATE -Wl,--gc-sections -Wl,--exclude-libs,ALL)
endif()
target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1)
@@ -474,19 +351,20 @@ target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1)
set(SANITIZER_FLAGS -fno-omit-frame-pointer -g -O1)
if(LIEF_ASAN)
message(STATUS "Address sanitizer enabled")
- list(APPEND SANITIZER_FLAGS -fsanitize=address)
+ list(APPEND SANITIZER_FLAGS
+ -fsanitize=address
+ -fsanitize-address-use-after-scope
+ -fsanitize-address-use-after-return=runtime
+ )
- set_property(TARGET LIB_LIEF
- APPEND PROPERTY LINK_FLAGS -fsanitize=address)
- target_link_libraries(LIB_LIEF INTERFACE asan)
+ target_link_options(LIB_LIEF PUBLIC -fsanitize=address)
endif()
if(LIEF_LSAN)
message(STATUS "Leak sanitizer enabled")
list(APPEND SANITIZER_FLAGS -fsanitize=leak)
- set_property(TARGET LIB_LIEF
- APPEND PROPERTY LINK_FLAGS -fsanitize=leak)
+ target_link_options(LIB_LIEF PUBLIC -fsanitize=leak)
target_link_libraries(LIB_LIEF INTERFACE lsan)
endif()
@@ -495,21 +373,16 @@ if(LIEF_TSAN)
message(STATUS "Thread sanitizer enabled")
list(APPEND SANITIZER_FLAGS -fsanitize=thread)
- set_property(TARGET LIB_LIEF
- APPEND PROPERTY LINK_FLAGS -fsanitize=thread)
-
- target_link_libraries(LIB_LIEF INTERFACE tsan)
+ target_link_options(LIB_LIEF PUBLIC -fsanitize=thread)
endif()
if(LIEF_USAN)
message(STATUS "Undefined sanitizer enabled")
list(APPEND SANITIZER_FLAGS -fsanitize=undefined,null,alignment)
- set_property(TARGET LIB_LIEF
- APPEND PROPERTY LINK_FLAGS -fsanitize=undefined,null,alignment)
target_link_options(LIB_LIEF PUBLIC -fsanitize=undefined,null,alignment)
- target_link_libraries(LIB_LIEF PUBLIC ubsan -fsanitize=undefined,null,alignment)
+ target_link_libraries(LIB_LIEF PUBLIC ubsan)
endif()
set(LIEF_SANITIZER OFF)
@@ -520,54 +393,37 @@ endif()
if(LIEF_SANITIZER)
message("LIEF Sanitizer enabled: ${SANITIZER_FLAGS}")
target_compile_options(LIB_LIEF PUBLIC ${SANITIZER_FLAGS})
- add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/tests/sanitizer")
+ add_subdirectory(tests/sanitizer)
endif()
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Fuzzing options
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if(LIEF_FUZZING)
- set(FUZZING_FLAGS -fno-omit-frame-pointer -g -O2 -fsanitize=address,fuzzer-no-link)
- set(FUZZING_LINKER_FLAGS -fsanitize=address,fuzzer-no-link)
- set_property(TARGET LIB_LIEF
- APPEND PROPERTY LINK_FLAGS ${FUZZING_LINKER_FLAGS})
+ set(FUZZING_FLAGS -fno-omit-frame-pointer -g -O2 -fsanitize=fuzzer-no-link)
+ target_link_options(LIB_LIEF PUBLIC -fsanitize=fuzzer-no-link)
target_compile_options(LIB_LIEF PRIVATE ${FUZZING_FLAGS})
- target_link_libraries(LIB_LIEF PUBLIC asan pthread)
- add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/fuzzing")
+ target_link_libraries(LIB_LIEF PUBLIC pthread)
+ add_subdirectory(fuzzing)
endif()
-# Compile Flags
-# =============
include(LIEFCompilerFlags)
-# Profiling flags
-# ---------------
if(LIEF_PROFILING)
- set(PROFILING_FLAGS
- -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc
- -fno-builtin-free -fno-omit-frame-pointer -g)
- target_compile_options(LIB_LIEF PUBLIC ${PROFILING_FLAGS})
-
- add_executable(elf_profiler profiling/elf_profiler.cpp)
- target_compile_options(elf_profiler PUBLIC ${PROFILING_FLAGS})
- target_link_libraries(elf_profiler PRIVATE LIB_LIEF)
-
- add_executable(macho_profiler profiling/macho_profiler.cpp)
- target_compile_options(macho_profiler PUBLIC ${PROFILING_FLAGS})
- target_link_libraries(macho_profiler PRIVATE LIB_LIEF)
+ add_subdirectory(profiling)
endif()
-# Coverage flags
-# --------------
-if(LIEF_COVERAGE)
- target_compile_options(LIB_LIEF PRIVATE -g -O0 --coverage -fprofile-arcs
- -ftest-coverage)
- target_link_libraries(LIB_LIEF gcov)
-endif()
-
-set_target_properties(LIB_LIEF PROPERTIES OUTPUT_NAME LIEF EXPORT_NAME LIEF CLEAN_DIRECT_OUTPUT 1)
+set_target_properties(LIB_LIEF PROPERTIES
+ OUTPUT_NAME LIEF
+ EXPORT_NAME LIEF
+ CLEAN_DIRECT_OUTPUT 1)
+if (LIEF_SO_VERSION)
+ set_target_properties(LIB_LIEF PROPERTIES
+ VERSION "${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH}"
+ SOVERSION "${LIEF_VERSION_MAJOR}"
+ )
+endif()
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@@ -587,42 +443,21 @@ if(APPLE)
set_target_properties(LIB_LIEF PROPERTIES MACOSX_RPATH ON)
endif()
-# API
-# ======================
-include(LIEFApi)
+add_subdirectory(api)
-# Examples
-# ======================
if(LIEF_EXAMPLES)
- add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/examples")
+ add_subdirectory(examples)
endif()
-# Tests
-# ======================
-
if(LIEF_TESTS)
enable_testing()
- add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/tests")
+ add_subdirectory(tests)
endif()
-# Documentation
-# ======================
-if(LIEF_DOC)
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/doc)
+if(LIEF_COMPILE_DOC_EXAMPLES)
+ add_subdirectory(doc/code/cpp)
endif()
-# Find Package Config
-# ======================
-configure_file(
- LIEFConfig.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake
- @ONLY)
-
-write_basic_package_version_file(
- ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake
- VERSION ${PROJECT_VERSION}
- COMPATIBILITY AnyNewerVersion)
-
# Post-build operations
# ======================
if(BUILD_SHARED_LIBS AND CMAKE_BUILD_TYPE MATCHES "Release")
@@ -645,84 +480,78 @@ if(BUILD_SHARED_LIBS AND CMAKE_BUILD_TYPE MATCHES "Release")
endif()
endif()
-# Install Prefix
-# ======================
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND UNIX)
- if(UNIX AND NOT APPLE)
- set(CMAKE_INSTALL_PREFIX
- "/usr"
- CACHE PATH "Install path prefix prepended on to install directories."
- FORCE)
- elseif(APPLE)
- set(CMAKE_INSTALL_PREFIX
- "/usr/local"
- CACHE PATH "" FORCE)
- endif()
-endif()
-
-# Installation
-# ======================
-
-if(UNIX)
- include(GNUInstallDirs)
- set(CMAKE_INSTALL_LIBDIR "lib")
-else()
- if(WIN32)
- set(CMAKE_INSTALL_LIBDIR "lib")
- set(CMAKE_INSTALL_DATADIR "share")
- set(CMAKE_INSTALL_INCLUDEDIR "include")
- set(CMAKE_INSTALL_BINDIR "bin")
- set(CMAKE_INSTALL_DATAROOTDIR "share")
- message(STATUS "Setting installation destination on Windows to: ${CMAKE_INSTALL_PREFIX}")
- else()
- message(FATAL_ERROR "System not UNIX nor WIN32 - not implemented yet")
+# Generate install target and package
+# =======================================
+if(LIEF_INSTALL)
+
+ # Find Package Config
+ # ======================
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/LIEFConfig.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake @ONLY)
+
+ write_basic_package_version_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake
+ VERSION ${PROJECT_VERSION}
+ COMPATIBILITY AnyNewerVersion)
+
+ # Install Prefix
+ # ======================
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND UNIX)
+ if(UNIX AND NOT APPLE)
+ set(CMAKE_INSTALL_PREFIX
+ "/usr"
+ CACHE PATH "Install path prefix prepended on to install directories."
+ FORCE)
+ elseif(APPLE)
+ set(CMAKE_INSTALL_PREFIX
+ "/usr/local"
+ CACHE PATH "" FORCE)
endif()
-endif()
+ endif()
-install(
- TARGETS LIB_LIEF lief_spdlog
- EXPORT LIEFExport
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-
-install(
- DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR}
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
- COMPONENT headers
- FILES_MATCHING
- REGEX "(.*).(hpp|h|def|inc)$")
-
-install(
- FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake
- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake
- COMPONENT config)
-
-install(
- FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEF.pc
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
- COMPONENT libraries)
-
-if(BUILD_SHARED_LIBS)
- set(lib_type shared)
-else()
- set(lib_type static)
-endif()
+ install(
+ TARGETS LIB_LIEF lief_spdlog
+ EXPORT LIEFExport
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+ install(
+ DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ COMPONENT headers
+ FILES_MATCHING
+ REGEX "(.*).(hpp|h|def|inc)$")
+
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LIEF
+ COMPONENT config)
+
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEF.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+ COMPONENT libraries)
+
+ if(BUILD_SHARED_LIBS)
+ set(lib_type shared)
+ else()
+ set(lib_type static)
+ endif()
-install(
- EXPORT LIEFExport
- NAMESPACE LIEF::
- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake
- FILE LIEFExport-${lib_type}.cmake
- COMPONENT config)
+ install(
+ EXPORT LIEFExport
+ NAMESPACE LIEF::
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LIEF
+ FILE LIEFExport-${lib_type}.cmake
+ COMPONENT config)
-export(
- EXPORT LIEFExport
- NAMESPACE LIEF::
- FILE LIEFExport-${lib_type}.cmake)
+ export(
+ EXPORT LIEFExport
+ NAMESPACE LIEF::
+ FILE LIEFExport-${lib_type}.cmake)
-# Package
-# ======================
-add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/package")
+ add_subdirectory(package)
+endif()
diff --git a/vendor/lief/Dockerfile b/vendor/lief/Dockerfile
deleted file mode 100644
index aa72698..0000000
--- a/vendor/lief/Dockerfile
+++ /dev/null
@@ -1,21 +0,0 @@
-# Docker file used to compile LIEF on Linux x86-64 compliant with Python tag: manylinux1
-# docker build -t liefproject/manylinux1_x86_64:latest -f ./Dockerfile .
-FROM quay.io/pypa/manylinux1_x86_64:2020-12-30-e2b3664
-
-RUN yum update -y \
- && yum install -y ccache \
- && yum clean all
-
-RUN /opt/python/cp37-cp37m/bin/pip install cmake==3.13.3 ninja==1.10.0.post2
-ENV PATH=$PATH:/opt/python/cp37-cp37m/bin/
-
-RUN curl --output /tmp/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2 -L https://github.com/squeaky-pl/centos-devtools/releases/download/6.3/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2 && \
- echo "ca3e9f92411507018c839c8cc2b496f14956a49fcf6df0cdcb356de7161bcbc5 /tmp/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2" | sha256sum --check --status && \
- tar -C / -xj -f /tmp/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2 && \
- rm -rf /tmp/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2
-
-ENV CC=/opt/devtools-6.3/bin/gcc
-ENV CXX=/opt/devtools-6.3/bin/g++
-ENV CXXFLAGS="-static-libstdc++ -static-libgcc"
-
-WORKDIR /src
diff --git a/vendor/lief/LICENSE b/vendor/lief/LICENSE
index 0ee7c92..f0c1a1a 100644
--- a/vendor/lief/LICENSE
+++ b/vendor/lief/LICENSE
@@ -186,8 +186,8 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2017 - 2022 R. Thomas
- Copyright 2017 - 2022 Quarkslab
+ Copyright 2017 - 2026 R. Thomas
+ Copyright 2017 - 2026 Quarkslab
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/vendor/lief/LIEFConfig.cmake.in b/vendor/lief/LIEFConfig.cmake.in
deleted file mode 100644
index 8c35eea..0000000
--- a/vendor/lief/LIEFConfig.cmake.in
+++ /dev/null
@@ -1,179 +0,0 @@
-#.rst:
-# LIEFConfig
-# --------
-#
-# Populate the native LIEF targets.
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``LIEF::LIEF``
-#
-# Hints
-# ^^^^^
-#
-# A user may set ``LIEF_DIR`` to the directory where ``LIEFConfig.cmake`` file
-# resides to tell CMake where to find this file.
-#
-# To choose between STATIC and SHARED version of LIEF library, one can use
-# ``COMPONENTS STATIC`` of ``COMPONENTS SHARED``. If no components are
-# specified, then a user may set ``LIEF_SHARED_LIBS`` to a true value to
-# request shared libraries. By default, if no variables or components are set,
-# the static library is preferred if present, else shared library will be used.
-#
-# .. code-block:: cmake
-#
-# find_package(LIEF 0.11.0 REQUIRED COMPONENTS STATIC)
-
-
-# CMake component support for static and shared libraries based on
-# https://alexreinking.com/blog/building-a-dual-shared-and-static-library-with-cmake.html
-
-# Process known components
-set(LIEF_known_comps STATIC SHARED)
-set(LIEF_comp_STATIC NO)
-set(LIEF_comp_SHARED NO)
-foreach(_comp ${LIEF_FIND_COMPONENTS})
- if(";${LIEF_known_comps};" MATCHES ";${_comp};")
- set(LIEF_comp_${_comp} YES)
- else()
- set(LIEF_NOT_FOUND_MESSAGE
- "LIEF does not recognize component `${_comp}`.")
- set(LIEF_FOUND FALSE)
- return()
- endif()
-endforeach()
-
-
-# Validate component selection makes sense
-if(LIEF_comp_STATIC AND LIEF_comp_SHARED)
- set(LIEF_NOT_FOUND_MESSAGE
- "LIEF `STATIC` and `SHARED` components are mutually exclusive.")
- set(LIEF_FOUND FALSE)
- return()
-endif()
-
-
-# These files are generated by CMake and hold the LIEF library target(s).
-set(LIEF_static_export "${CMAKE_CURRENT_LIST_DIR}/LIEFExport-static.cmake")
-set(LIEF_shared_export "${CMAKE_CURRENT_LIST_DIR}/LIEFExport-shared.cmake")
-
-
-# Helper macro to load the requested targets, where `lib_type` is `static` or
-# `shared`
-macro(LIEF_load_targets lib_type)
- if(NOT EXISTS "${LIEF_${lib_type}_export}")
- set(LIEF_NOT_FOUND_MESSAGE
- "LIEF `${lib_type}` libraries were requested but not found.")
- set(LIEF_FOUND FALSE)
- return()
- endif ()
-
- if("${lib_type}" STREQUAL "static")
- # Need to find all dependencies even if they're private when LIEF is
- # compiled statically
- include(CMakeFindDependencyMacro)
-
- if(@LIEF_EXTERNAL_MBEDTLS@)
- find_dependency(MbedTLS)
- endif()
-
- if(@LIEF_EXTERNAL_UTF8CPP@)
- find_dependency(utf8cpp)
- endif()
-
- if(@LIEF_EXTERNAL_SPDLOG@)
- find_dependency(spdlog)
- endif()
-
- if(@LIEF_ENABLE_JSON@ AND @LIEF_NLOHMANN_JSON_EXTERNAL@)
- find_dependency(nlohmann_json)
- endif()
-
- if(NOT @LIEF_DISABLE_FROZEN@ AND @LIEF_OPT_FROZEN_EXTERNAL@)
- find_dependency(frozen)
- endif()
- endif()
-
- # Include the respective targets file
- include("${LIEF_${lib_type}_export}")
-endmacro()
-
-# Run the logic to choose static or shared libraries
-# 1. Check components
-if(LIEF_comp_STATIC)
- LIEF_load_targets("static")
-elseif(LIEF_comp_SHARED)
- LIEF_load_targets("shared")
-# 2. Check LIEF-only library selection
-elseif(DEFINED LIEF_SHARED_LIBS AND LIEF_SHARED_LIBS)
- LIEF_load_targets("shared")
-elseif(DEFINED LIEF_SHARED_LIBS AND NOT LIEF_SHARED_LIBS)
- LIEF_load_targets("static")
-# 3. Check CMake build type and choose what's available
-elseif(BUILD_SHARED_LIBS)
- if(EXISTS "${LIEF_shared_export}")
- LIEF_load_targets("shared")
- else()
- LIEF_load_targets("static")
- endif()
-else()
- if(EXISTS "${LIEF_static_export}")
- LIEF_load_targets("static")
- else()
- LIEF_load_targets("shared")
- endif()
-endif()
-
-
-# Attach location of public interface libraries that don't have
-# their own CMake config that would otherwise be found using `find_dependency`
-
-# Header-only library can be found relatively easily
-if(@LIEF_EXTERNAL_LEAF@)
- find_path(BOOST_LEAF_INCLUDE_DIR boost/leaf.hpp)
- if(NOT BOOST_LEAF_INCLUDE_DIR)
- set(LIEF_NOT_FOUND_MESSAGE "Could not find include directory with 'boost/leaf.hpp'. Consider setting `BOOST_LEAF_INCLUDE_DIR` during CMake configuration")
- set(LIEF_FOUND FALSE)
- return()
- endif()
- set_property(TARGET LIEF::LIEF APPEND PROPERTY
- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${BOOST_LEAF_INCLUDE_DIR}"
- )
-endif()
-
-# Header-only library can be found relatively easily
-if(@LIEF_EXTERNAL_SPAN@)
- find_path(TCB_SPAN_INCLUDE_DIR tcb/span.hpp)
- if(NOT TCB_SPAN_INCLUDE_DIR)
- set(LIEF_NOT_FOUND_MESSAGE "Could not find include directory with 'tcb/span.hpp'. Consider setting `TCB_SPAN_INCLUDE_DIR` during CMake configuration")
- set(LIEF_FOUND FALSE)
- return()
- endif()
- set_property(TARGET LIEF::LIEF APPEND PROPERTY
- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${TCB_SPAN_INCLUDE_DIR}"
- )
-endif()
-
-
-# Set this for backwards compatibility. This isn't quite the path to the
-# actual library file, but using the target is strictly better because it
-# includes all other information needed to correctly link and use LIEF
-set(LIEF_LIBRARIES LIEF::LIEF)
-
-# Set this for backwards compatibility
-get_target_property(LIEF_INCLUDE_DIRS LIEF::LIEF INTERFACE_INCLUDE_DIRECTORIES)
-
-# Set the following for backwards compatibility
-if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h")
- file(STRINGS "${LIEF_INCLUDE_DIR}/LIEF/version.h" LIEF_H REGEX "^#define LIEF_VERSION \"[^\"]*\"$")
-
- string(REGEX REPLACE "^.*LIEF_VERSION \"([0-9]+).*$" "\\1" LIEF_VERSION_MAJOR "${LIEF_H}")
- string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_MINOR "${LIEF_H}")
- string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_PATCH "${LIEF_H}")
- set(LIEF_VERSION_STRING "${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH}")
-
- set(LIEF_MAJOR_VERSION "${LIEF_VERSION_MAJOR}")
- set(LIEF_MINOR_VERSION "${LIEF_VERSION_MINOR}")
- set(LIEF_PATCH_VERSION "${LIEF_VERSION_PATCH}")
-endif()
diff --git a/vendor/lief/MANIFEST.in b/vendor/lief/MANIFEST.in
deleted file mode 100644
index 9105b32..0000000
--- a/vendor/lief/MANIFEST.in
+++ /dev/null
@@ -1,26 +0,0 @@
-include README.md LICENSE setup.cfg CMakeLists.txt LIEF.pc.in LIEFConfig.cmake.in
-
-# Examples
-recursive-include examples *
-
-# LIEF Sources
-recursive-include src *
-recursive-include include *
-
-recursive-include third-party *
-recursive-include cmake *
-recursive-include scripts *
-
-# Bindings
-recursive-include api *
-prune api/python/build
-
-# Global exclude
-recursive-exclude *.egg-info *.so
-
-# Install script
-recursive-include package *
-
-# Documentation
-recursive-include doc *
-
diff --git a/vendor/lief/README.md b/vendor/lief/README.md
index 9e45399..b4fb91f 100644
--- a/vendor/lief/README.md
+++ b/vendor/lief/README.md
@@ -1,101 +1,106 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
- Blog •
- Documentation •
- About
+ Blog •
+ Documentation •
+ About
# About
-The purpose of this project is to provide a cross platform library which can parse,
+The purpose of this project is to provide a cross-platform library to parse,
modify and abstract ELF, PE and MachO formats.
-Main features:
+**Main features**:
- * **Parsing**: LIEF can parse ELF, PE, MachO, OAT, DEX, VDEX, ART and provides an user-friendly API to access to format internals.
- * **Modify**: LIEF enables to modify some parts of these formats
+ * **Parsing**: LIEF can parse [ELF](https://lief.re/doc/latest/formats/elf/index.html), [PE](https://lief.re/doc/latest/formats/pe/index.html), [MachO](https://lief.re/doc/latest/formats/macho/index.html), [COFF](https://lief.re/doc/latest/formats/coff/index.html), OAT, DEX, VDEX, ART and provides a user-friendly API to access their internals.
+ * **Modify**: LIEF can be used to modify some parts of these formats (adding a section, changing a symbol's name, ...)
* **Abstract**: Three formats have common features like sections, symbols, entry point... LIEF factors them.
- * **API**: LIEF can be used in C, C++ and Python
+ * **API**: You can use LIEF via [C++](https://lief.re/doc/latest/doxygen/), Python, [Rust](https://lief-rs.s3.fr-par.scw.cloud/doc/latest/lief/index.html), and
+ [Node.js](https://github.com/Piebald-AI/node-lief) (unofficial, AI-generated)
+
+**Extended features**:
+
+ * [**Runtime**](https://lief.re/doc/latest/runtime/intro.html)
+ * [**DWARF/PDB** Support](https://lief.re/doc/latest/extended/debug_info/index.html)
+ * [**Objective-C** Metadata](https://lief.re/doc/latest/extended/objc/index.html)
+ * [**Dyld Shared Cache**](https://lief.re/doc/latest/extended/dsc/index.html) with support for extracting Dylib
+ * [**Disassembler**](https://lief.re/doc/latest/extended/disassembler/index.html): AArch64, x86/x86-64, ARM, RISC-V, Mips, PowerPC, eBPF
+ * [**Assembler**](https://lief.re/doc/latest/extended/assembler/index.html): AArch64, x86/x86-64, RISC-V
+
+**Plugins**:
+
+ * [**Ghidra**](https://lief.re/doc/latest/plugins/ghidra/index.html)
+ * [**BinaryNinja**](https://lief.re/doc/latest/plugins/binaryninja/index.html)
+
+# Sponsors
+
+
+
+
+
+
+
# Content
- [About](#about)
-- [Download / Install](#downloads--install)
+- [Downloads / Install](#downloads--install)
- [Getting started](#getting-started)
+- [Blog](https://lief.re/blog/)
- [Documentation](#documentation)
- - [Sphinx](https://lief-project.github.io/doc/stable/index.html)
- - [Doxygen](https://lief-project.github.io/doc/latest/doxygen/index.html)
+ - [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-project.github.io/doc/latest/tutorials/01_play_with_formats.html)
- - [Create a PE from scratch](https://lief-project.github.io/doc/latest/tutorials/02_pe_from_scratch.html)
- - [Play with ELF symbols](https://lief-project.github.io/doc/latest/tutorials/03_elf_change_symbols.html)
- - [ELF Hooking](https://lief-project.github.io/doc/latest/tutorials/04_elf_hooking.html)
- - [Infecting the plt/got](https://lief-project.github.io/doc/latest/tutorials/05_elf_infect_plt_got.html)
- - [PE Hooking](https://lief-project.github.io/doc/latest/tutorials/06_pe_hooking.html)
- - [PE Resources](https://lief-project.github.io/doc/latest/tutorials/07_pe_resource.html)
- - [Transforming an ELF executable into a library](https://lief-project.github.io/doc/latest/tutorials/08_elf_bin2lib.html)
- - [How to use frida on a non-rooted device](https://lief-project.github.io/doc/latest/tutorials/09_frida_lief.html)
- - [Android formats](https://lief-project.github.io/doc/latest/tutorials/10_android_formats.html)
- - [Mach-O modification](https://lief-project.github.io/doc/latest/tutorials/11_macho_modification.html)
- - [ELF Coredump](https://lief-project.github.io/doc/latest/tutorials/12_elf_coredump.html)
- - [PE Authenticode](https://lief-project.github.io/doc/latest/tutorials/13_pe_authenticode.html)
+ - [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)
+- [About](#about-1)
- [Authors](#authors)
- [License](#license)
- - [Bibtex](#bibtex)
+ - [BibTeX](#bibtex)
## Downloads / Install
-First, make sure to have an updated version of setuptools:
+### 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 = "2024"
+
+[dependencies]
+lief = "1.0.0"
+```
+
+### Homebrew
```console
-pip install setuptools --upgrade
+brew install lief
```
+### Python
+
To install the latest **version** (release):
```console
@@ -105,22 +110,23 @@ pip install lief
To install nightly build:
```console
-pip install [--user] --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief==0.13.0.dev0
+pip install [--user] --force-reinstall --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief==2.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.12.1**: https://github.com/lief-project/LIEF/releases/tag/0.12.1
+- **v1.0.0**: https://github.com/lief-project/LIEF/releases/tag/1.0.0
Here are guides to install or integrate LIEF:
- * [Python](https://lief-project.github.io/doc/latest/installation.html#python)
- * [VisualStudio](https://lief-project.github.io/doc/latest/installation.html#visual-studio-integration)
- * [XCode](https://lief-project.github.io/doc/latest/installation.html#xcode-integration)
- * [CMake](https://lief-project.github.io/doc/latest/installation.html#cmake-integration)
+ * [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
@@ -131,36 +137,63 @@ import lief
# ELF
binary = lief.parse("/usr/bin/ls")
-print(binary)
+for section in binary.sections:
+ print(section.name, section.virtual_address)
# PE
-binary = lief.parse("C:\\Windows\\explorer.exe")
-print(binary)
+binary = lief.parse(r"C:\Windows\explorer.exe")
+if (rheader := binary.rich_header) is not None:
+ print(rheader.key)
# Mach-O
binary = lief.parse("/usr/bin/ls")
-print(binary)
+if (fixups := binary.dyld_chained_fixups) is not None:
+ print(fixups)
+```
+
+### 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
#include
int main(int argc, char** argv) {
// ELF
if (std::unique_ptr elf = LIEF::ELF::Parser::parse("/bin/ls")) {
- std::cout << *elf << '\n';
+ 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")) {
- std::cout << *pe << '\n';
+ 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")) {
- std::cout << *macho << '\n';
+ for (const LIEF::MachO::Binary& bin : *macho) {
+ if (const LIEF::MachO::DyldChainedFixups* fixups = bin.dyld_chained_fixups()) {
+ std::cout << *fixups << '\n';
+ }
+ }
}
return 0;
@@ -168,48 +201,28 @@ int main(int argc, char** argv) {
```
-### C (Limited API)
-
-```cpp
-#include
-
-int main(int argc, char** argv) {
- Elf_Binary_t* elf = elf_parse("/usr/bin/ls");
-
- Elf_Section_t** sections = elf->sections;
-
- for (size_t i = 0; sections[i] != NULL; ++i) {
- printf("%s\n", sections[i]->name);
- }
-
- elf_binary_destroy(elf);
- return 0;
-}
-```
-
## Documentation
-* [Main documentation](https://lief-project.github.io/doc/latest/index.html)
-* [Tutorial](https://lief-project.github.io/doc/latest/tutorials/index.html)
-* [API](https://lief-project.github.io/doc/latest/api/index.html)
-* [Doxygen](https://lief-project.github.io/doc/latest/doxygen/index.html)
+* [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
-* **Gitter**: [lief-project](https://gitter.im/lief-project)
+* **Discord**: [LIEF](https://discord.gg/7hRFGWYedu)
## About
### Authors
-Romain Thomas ([@rh0main](https://twitter.com/rh0main)) - [Quarkslab](https://www.quarkslab.com)
+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.12.1/LICENSE).
+[Apache 2.0](https://github.com/lief-project/LIEF/blob/1.0.0/LICENSE).
-### Bibtex
+### BibTeX
```bibtex
@MISC {LIEF,
@@ -220,5 +233,3 @@ LIEF is provided under the [Apache 2.0 license](https://github.com/lief-project/
year = "2017"
}
```
-
-
diff --git a/vendor/lief/api/CMakeLists.txt b/vendor/lief/api/CMakeLists.txt
new file mode 100644
index 0000000..6e1675d
--- /dev/null
+++ b/vendor/lief/api/CMakeLists.txt
@@ -0,0 +1,8 @@
+if (LIEF_PYTHON_API)
+ add_subdirectory(python)
+endif()
+
+if(LIEF_RUST_API)
+ add_subdirectory(rust)
+endif()
+
diff --git a/vendor/lief/api/c/CMakeLists.txt b/vendor/lief/api/c/CMakeLists.txt
deleted file mode 100644
index d0af70a..0000000
--- a/vendor/lief/api/c/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-include_directories(
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF"
- "${CMAKE_CURRENT_SOURCE_DIR}/include"
-)
-
-set(LIEF_C_INCLUDE_FILES
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/LIEF.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/logging.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/types.h"
-)
-
-set(LIEF_C_SRC "${CMAKE_CURRENT_LIST_DIR}/logging.cpp")
-
-if (LIEF_ELF)
- include("${CMAKE_CURRENT_LIST_DIR}/ELF/CMakeLists.txt")
-endif()
-
-if (LIEF_PE)
- include("${CMAKE_CURRENT_LIST_DIR}/PE/CMakeLists.txt")
-endif()
-
-if (LIEF_MACHO)
- include("${CMAKE_CURRENT_LIST_DIR}/MachO/CMakeLists.txt")
-endif()
-
-source_group("Header Files\\C API" FILES ${LIEF_C_INCLUDE_FILES})
-
-target_sources(LIB_LIEF PRIVATE "${LIEF_C_SRC}" ${LIEF_C_INCLUDE_FILES})
-
diff --git a/vendor/lief/api/c/ELF/Binary.cpp b/vendor/lief/api/c/ELF/Binary.cpp
deleted file mode 100644
index 953d58f..0000000
--- a/vendor/lief/api/c/ELF/Binary.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include
-#include "LIEF/ELF/Binary.h"
-#include "LIEF/ELF/Section.h"
-#include "LIEF/ELF/Segment.h"
-#include "LIEF/ELF/Header.h"
-#include "LIEF/ELF/Symbol.h"
-
-#include "LIEF/ELF/Parser.hpp"
-#include "LIEF/ELF/Binary.hpp"
-
-#include "Section.hpp"
-#include "Segment.hpp"
-#include "DynamicEntry.hpp"
-#include "Symbol.hpp"
-#include "Header.hpp"
-#include "Binary.hpp"
-
-using namespace LIEF::ELF;
-
-namespace LIEF {
-namespace ELF {
-void init_c_binary(Elf_Binary_t* c_binary, Binary* binary) {
- c_binary->handler = reinterpret_cast(binary);
- c_binary->name = binary->name().c_str();
- c_binary->type = static_cast(binary->type());
- c_binary->interpreter = nullptr;
- if (binary->has_interpreter()) {
- const std::string& interp = binary->interpreter();
- c_binary->interpreter = static_cast(malloc((interp.size() + 1) * sizeof(char)));
- std::memcpy(
- reinterpret_cast(const_cast(c_binary->interpreter)),
- reinterpret_cast(interp.data()),
- interp.size());
- reinterpret_cast(const_cast(c_binary->interpreter))[interp.size()] = '\0';
- }
-
-
- init_c_header(c_binary, binary);
- init_c_sections(c_binary, binary);
- init_c_segments(c_binary, binary);
- init_c_dynamic_symbols(c_binary, binary);
- init_c_static_symbols(c_binary, binary);
- init_c_dynamic_entries(c_binary, binary);
-
-
-}
-
-}
-}
-
-Elf_Binary_t* elf_parse(const char *file) {
- Binary* binary = Parser::parse(file).release();
- auto* c_binary = static_cast(malloc(sizeof(Elf_Binary_t)));
- memset(c_binary, 0, sizeof(Elf_Binary_t));
- init_c_binary(c_binary, binary);
- return c_binary;
-}
-
-// Binary Methods
-// ==============
-
-int elf_binary_save_header(Elf_Binary_t* binary) {
- Header& hdr = reinterpret_cast(binary->handler)->header();
-
- hdr.file_type(static_cast(binary->header.file_type));
- hdr.machine_type(static_cast(binary->header.machine_type));
- hdr.object_file_version(static_cast(binary->header.object_file_version));
- hdr.program_headers_offset(binary->header.program_headers_offset);
- hdr.section_headers_offset(binary->header.section_headers_offset);
- hdr.processor_flag(binary->header.processor_flags);
- hdr.header_size(binary->header.header_size);
- hdr.program_header_size(binary->header.program_header_size);
- hdr.numberof_segments(binary->header.numberof_segments);
- hdr.section_header_size(binary->header.section_header_size);
- hdr.numberof_sections(binary->header.numberof_sections);
- hdr.section_name_table_idx(binary->header.name_string_table_idx);
- hdr.entrypoint(binary->header.entrypoint);
-
- //TODO: identity
- return 1;
-}
-
-
-void elf_binary_destroy(Elf_Binary_t* binary) {
- destroy_sections(binary);
- destroy_segments(binary);
- destroy_dynamic_symbols(binary);
- destroy_static_symbols(binary);
- destroy_dynamic_entries(binary);
-
- if (binary->interpreter != nullptr) {
- free(const_cast(binary->interpreter));
- }
-
- delete reinterpret_cast(binary->handler);
- free(binary);
-
-}
-//}
diff --git a/vendor/lief/api/c/ELF/Binary.hpp b/vendor/lief/api/c/ELF/Binary.hpp
deleted file mode 100644
index 7d61a8d..0000000
--- a/vendor/lief/api/c/ELF/Binary.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_ELF_BINARY_CPP_C_API_
-#define LIEF_ELF_BINARY_CPP_C_API_
-
-#include "LIEF/ELF/Binary.h"
-#include "LIEF/ELF/Binary.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_binary(Elf_Binary_t* c_binary, Binary* binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/ELF/CMakeLists.txt b/vendor/lief/api/c/ELF/CMakeLists.txt
deleted file mode 100644
index 61d8bf9..0000000
--- a/vendor/lief/api/c/ELF/CMakeLists.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-include_directories(
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF"
- "${CMAKE_CURRENT_SOURCE_DIR}/include"
-)
-
-set(LIEF_C_ELF_SRC
- "${CMAKE_CURRENT_LIST_DIR}/Symbol.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Section.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Segment.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/DynamicEntry.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Header.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Binary.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/EnumToString.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/utils.cpp"
-)
-
-
-set(LIEF_API_C_ELF_INCLUDE_FILES_CPP
- "${CMAKE_CURRENT_LIST_DIR}/Binary.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/DynamicEntry.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Header.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Section.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Segment.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Symbol.hpp"
-)
-
-set(LIEF_API_C_ELF_INCLUDE_FILES_C
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Binary.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/DynamicEntry.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/EnumToString.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Header.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Section.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Segment.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Symbol.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/enums.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/utils.h"
-)
-
-set(LIEF_C_ELF_INC "${LIEF_API_C_ELF_INCLUDE_FILES_C}" "${LIEF_API_C_ELF_INCLUDE_FILES_CPP}")
-
-source_group("Source Files\\C API\\ELF" FILES ${LIEF_API_C_ELF_SRC})
-source_group("Header Files\\C API\\ELF" FILES ${LIEF_C_ELF_INC})
-
-target_sources(LIB_LIEF PRIVATE "${LIEF_C_ELF_SRC}" "${LIEF_C_ELF_INC}")
diff --git a/vendor/lief/api/c/ELF/DynamicEntry.cpp b/vendor/lief/api/c/ELF/DynamicEntry.cpp
deleted file mode 100644
index 51e6267..0000000
--- a/vendor/lief/api/c/ELF/DynamicEntry.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "DynamicEntry.hpp"
-
-#include "LIEF/ELF/DynamicEntryFlags.hpp"
-#include "LIEF/ELF/DynamicSharedObject.hpp"
-#include "LIEF/ELF/DynamicEntryLibrary.hpp"
-#include "LIEF/ELF/DynamicEntryRpath.hpp"
-#include "LIEF/ELF/DynamicEntryRunPath.hpp"
-#include "LIEF/ELF/DynamicEntryArray.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
-
- Binary::it_dynamic_entries dyn_entries = binary->dynamic_entries();
- c_binary->dynamic_entries = static_cast(
- malloc((dyn_entries.size() + 1) * sizeof(Elf_DynamicEntry_t**)));
-
- for (size_t i = 0; i < dyn_entries.size(); ++i) {
- DynamicEntry& entry = dyn_entries[i];
- switch(entry.tag()) {
- case DYNAMIC_TAGS::DT_NEEDED:
- {
-
- auto* e = static_cast(
- malloc(sizeof(Elf_DynamicEntry_Library_t)));
-
- e->tag = static_cast(entry.tag());
- e->value = entry.value();
- e->name = reinterpret_cast(&entry)->name().c_str();
-
- c_binary->dynamic_entries[i] = reinterpret_cast(e);
- break;
- }
-
- case DYNAMIC_TAGS::DT_SONAME:
- {
- auto* e = static_cast(
- malloc(sizeof(Elf_DynamicEntry_SharedObject_t)));
-
- e->tag = static_cast(entry.tag());
- e->value = entry.value();
- e->name = reinterpret_cast(&entry)->name().c_str();
-
- c_binary->dynamic_entries[i] = reinterpret_cast(e);
- break;
- }
-
- case DYNAMIC_TAGS::DT_RPATH:
- {
- auto* e = static_cast(
- malloc(sizeof(Elf_DynamicEntry_Rpath_t)));
-
- e->tag = static_cast(entry.tag());
- e->value = entry.value();
- e->rpath = reinterpret_cast(&entry)->name().c_str();
-
- c_binary->dynamic_entries[i] = reinterpret_cast(e);
-
- break;
- }
-
- case DYNAMIC_TAGS::DT_RUNPATH:
- {
- auto* e = static_cast(
- malloc(sizeof(Elf_DynamicEntry_RunPath_t)));
-
- e->tag = static_cast(entry.tag());
- e->value = entry.value();
- e->runpath = reinterpret_cast(&entry)->name().c_str();
-
- c_binary->dynamic_entries[i] = reinterpret_cast(e);
-
- break;
- }
-
- case DYNAMIC_TAGS::DT_INIT_ARRAY:
- case DYNAMIC_TAGS::DT_FINI_ARRAY:
- case DYNAMIC_TAGS::DT_PREINIT_ARRAY:
- {
- auto* e = static_cast(
- malloc(sizeof(Elf_DynamicEntry_Array_t)));
-
- e->tag = static_cast(entry.tag());
- e->value = entry.value();
- const std::vector& array = reinterpret_cast(&entry)->array();
- e->array = static_cast(malloc((array.size() + 1) * sizeof(uint64_t)));
- for (size_t i = 0; i < array.size(); ++i) {
- e->array[i] = array[i];
- }
- e->array[array.size()] = 0;
- c_binary->dynamic_entries[i] = reinterpret_cast(e);
-
- break;
- }
-
- case DYNAMIC_TAGS::DT_FLAGS:
- {
- auto* e = static_cast(
- malloc(sizeof(Elf_DynamicEntry_Flags_t)));
-
- e->tag = static_cast(entry.tag());
- e->value = entry.value();
- const DynamicEntryFlags::flags_list_t& flags = reinterpret_cast(&entry)->flags();
- e->flags = static_cast(malloc((flags.size() + 1) * sizeof(enum LIEF_ELF_DYNAMIC_FLAGS)));
- e->flags_1 = nullptr;
-
- auto it = std::begin(flags);
-
- for (size_t i = 0; it != std::end(flags); ++i, ++it) {
- e->flags[i] = static_cast(*it);
- }
-
- e->flags[flags.size()] = static_cast(0);
- c_binary->dynamic_entries[i] = reinterpret_cast(e);
-
- break;
- }
-
- case DYNAMIC_TAGS::DT_FLAGS_1:
- {
- auto* e = static_cast(
- malloc(sizeof(Elf_DynamicEntry_Flags_t)));
-
- e->tag = static_cast(entry.tag());
- e->value = entry.value();
- const DynamicEntryFlags::flags_list_t& flags = reinterpret_cast(&entry)->flags();
- e->flags_1 = static_cast(malloc((flags.size() + 1) * sizeof(enum LIEF_ELF_DYNAMIC_FLAGS_1)));
- e->flags = nullptr;
-
- auto it = std::begin(flags);
-
- for (size_t i = 0; it != std::end(flags); ++i, ++it) {
- e->flags_1[i] = static_cast(*it);
- }
-
- e->flags_1[flags.size()] = static_cast(0);
- c_binary->dynamic_entries[i] = reinterpret_cast(e);
-
- break;
- }
-
-
-
-
- default:
- {
- c_binary->dynamic_entries[i] =
- static_cast(malloc(sizeof(Elf_DynamicEntry_t)));
- c_binary->dynamic_entries[i]->tag = static_cast(entry.tag());
- c_binary->dynamic_entries[i]->value = entry.value();
-
- }
- }
- }
-
- c_binary->dynamic_entries[dyn_entries.size()] = nullptr;
-
-}
-
-
-
-void destroy_dynamic_entries(Elf_Binary_t* c_binary) {
-
- Elf_DynamicEntry_t **dynamic_entries = c_binary->dynamic_entries;
- for (size_t idx = 0; dynamic_entries[idx] != nullptr; ++idx) {
- switch(static_cast(dynamic_entries[idx]->tag)) {
- case DYNAMIC_TAGS::DT_NEEDED:
- {
- free(reinterpret_cast(dynamic_entries[idx]));
- break;
- }
-
- case DYNAMIC_TAGS::DT_SONAME:
- {
- free(reinterpret_cast(dynamic_entries[idx]));
- break;
- }
-
- case DYNAMIC_TAGS::DT_RPATH:
- {
- free(reinterpret_cast(dynamic_entries[idx]));
- break;
- }
-
- case DYNAMIC_TAGS::DT_RUNPATH:
- {
- free(reinterpret_cast(dynamic_entries[idx]));
- break;
- }
-
- case DYNAMIC_TAGS::DT_INIT_ARRAY:
- case DYNAMIC_TAGS::DT_FINI_ARRAY:
- case DYNAMIC_TAGS::DT_PREINIT_ARRAY:
- {
- free(reinterpret_cast(dynamic_entries[idx]));
- break;
- }
-
- case DYNAMIC_TAGS::DT_FLAGS:
- case DYNAMIC_TAGS::DT_FLAGS_1:
- {
- free(reinterpret_cast(dynamic_entries[idx]));
- break;
- }
-
- default:
- {
-
- free(dynamic_entries[idx]);
- }
-
-
- }
- }
- free(c_binary->dynamic_entries);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/ELF/DynamicEntry.hpp b/vendor/lief/api/c/ELF/DynamicEntry.hpp
deleted file mode 100644
index 375e662..0000000
--- a/vendor/lief/api/c/ELF/DynamicEntry.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_ELF_DYNAMIC_ENTRY_CPP_C_API_
-#define LIEF_ELF_DYNAMIC_ENTRY_CPP_C_API_
-
-#include "LIEF/ELF/Binary.h"
-#include "LIEF/ELF/Binary.hpp"
-
-#include "LIEF/ELF/DynamicEntry.h"
-#include "LIEF/ELF/DynamicEntry.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary);
-void destroy_dynamic_entries(Elf_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/ELF/EnumToString.cpp b/vendor/lief/api/c/ELF/EnumToString.cpp
deleted file mode 100644
index cd4eeec..0000000
--- a/vendor/lief/api/c/ELF/EnumToString.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LIEF/ELF/EnumToString.h"
-#include "LIEF/ELF/EnumToString.hpp"
-
-#include "LIEF/ELF/enums.h"
-#include "LIEF/ELF/enums.hpp"
-
-extern "C"
-{
- const char* E_TYPE_to_string(enum LIEF_ELF_E_TYPE e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* SYMBOL_BINDINGS_to_string(enum LIEF_ELF_SYMBOL_BINDINGS e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* VERSION_to_string(enum LIEF_ELF_VERSION e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* ARCH_to_string(enum LIEF_ELF_ARCH e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* SEGMENT_TYPES_to_string(enum LIEF_ELF_SEGMENT_TYPES e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* DYNAMIC_TAGS_to_string(enum LIEF_ELF_DYNAMIC_TAGS e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* ELF_SECTION_TYPES_to_string(enum LIEF_ELF_ELF_SECTION_TYPES e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* ELF_SECTION_FLAGS_to_string(enum LIEF_ELF_ELF_SECTION_FLAGS e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* ELF_SYMBOL_TYPES_to_string(enum LIEF_ELF_ELF_SYMBOL_TYPES e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* ELF_CLASS_to_string(enum LIEF_ELF_ELF_CLASS e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* ELF_DATA_to_string(enum LIEF_ELF_ELF_DATA e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* OS_ABI_to_string(enum LIEF_ELF_OS_ABI e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* DYNAMIC_FLAGS_to_string(enum LIEF_ELF_DYNAMIC_FLAGS e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
- const char* DYNAMIC_FLAGS_1_to_string(enum LIEF_ELF_DYNAMIC_FLAGS_1 e) {
- return LIEF::ELF::to_string(static_cast(e));
- }
-
-}
diff --git a/vendor/lief/api/c/ELF/Header.cpp b/vendor/lief/api/c/ELF/Header.cpp
deleted file mode 100644
index e579e20..0000000
--- a/vendor/lief/api/c/ELF/Header.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Header.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_header(Elf_Binary_t* c_binary, Binary* binary) {
-
- const Header& hdr = binary->header();
- c_binary->header.file_type = static_cast(hdr.file_type());
- c_binary->header.machine_type = static_cast(hdr.machine_type());
- c_binary->header.object_file_version = static_cast(hdr.object_file_version());
- c_binary->header.program_headers_offset = hdr.program_headers_offset();
- c_binary->header.section_headers_offset = hdr.section_headers_offset();
- c_binary->header.processor_flags = hdr.processor_flag();
- c_binary->header.header_size = hdr.header_size();
- c_binary->header.program_header_size = hdr.program_header_size();
- c_binary->header.numberof_segments = hdr.numberof_segments();
- c_binary->header.section_header_size = hdr.section_header_size();
- c_binary->header.numberof_sections = hdr.numberof_sections();
- c_binary->header.name_string_table_idx = hdr.section_name_table_idx();
- c_binary->header.entrypoint = hdr.entrypoint();
- const Header::identity_t& ident = hdr.identity();
- std::copy(
- std::begin(ident),
- std::end(ident),
- c_binary->header.identity);
-
-}
-
-}
-}
diff --git a/vendor/lief/api/c/ELF/Header.hpp b/vendor/lief/api/c/ELF/Header.hpp
deleted file mode 100644
index 20190a7..0000000
--- a/vendor/lief/api/c/ELF/Header.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_ELF_HEADER_CPP_C_API_
-#define LIEF_ELF_HEADER_CPP_C_API_
-
-#include "LIEF/ELF/Binary.h"
-#include "LIEF/ELF/Binary.hpp"
-
-#include "LIEF/ELF/Header.h"
-#include "LIEF/ELF/Header.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_header(Elf_Binary_t* c_binary, Binary* binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/ELF/Section.cpp b/vendor/lief/api/c/ELF/Section.cpp
deleted file mode 100644
index 109d26e..0000000
--- a/vendor/lief/api/c/ELF/Section.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Section.hpp"
-
-namespace LIEF {
-namespace ELF {
-void init_c_sections(Elf_Binary_t* c_binary, Binary* binary) {
-
- Binary::it_sections sections = binary->sections();
-
- c_binary->sections = static_cast(
- malloc((sections.size() + 1) * sizeof(Elf_Section_t**)));
-
- for (size_t i = 0; i < sections.size(); ++i) {
- Section& b_section = sections[i];
- c_binary->sections[i] = static_cast(malloc(sizeof(Elf_Section_t)));
- span section_content = b_section.content();
- auto* content = static_cast(malloc(section_content.size() * sizeof(uint8_t)));
- std::copy(std::begin(section_content), std::end(section_content),
- content);
-
- c_binary->sections[i]->name = b_section.fullname().c_str();
- c_binary->sections[i]->flags = b_section.flags();
- c_binary->sections[i]->type = static_cast(b_section.type());
- c_binary->sections[i]->virtual_address = b_section.virtual_address();
- c_binary->sections[i]->offset = b_section.file_offset();
- c_binary->sections[i]->original_size = b_section.original_size();
- c_binary->sections[i]->link = b_section.link();
- c_binary->sections[i]->info = b_section.information();
- c_binary->sections[i]->alignment = b_section.alignment();
- c_binary->sections[i]->entry_size = b_section.entry_size();
- c_binary->sections[i]->content = content;
- c_binary->sections[i]->size = section_content.size();
- c_binary->sections[i]->entropy = b_section.entropy();
- }
- c_binary->sections[sections.size()] = nullptr;
-
-}
-
-
-
-void destroy_sections(Elf_Binary_t* c_binary) {
-
- Elf_Section_t **sections = c_binary->sections;
- for (size_t idx = 0; sections[idx] != nullptr; ++idx) {
- free(sections[idx]->content);
- free(sections[idx]);
- }
- free(c_binary->sections);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/ELF/Section.hpp b/vendor/lief/api/c/ELF/Section.hpp
deleted file mode 100644
index 4404af3..0000000
--- a/vendor/lief/api/c/ELF/Section.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_ELF_SECTION_CPP_C_API_
-#define LIEF_ELF_SECTION_CPP_C_API_
-
-#include "LIEF/ELF/Binary.h"
-#include "LIEF/ELF/Binary.hpp"
-
-#include "LIEF/ELF/Section.h"
-#include "LIEF/ELF/Section.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_sections(Elf_Binary_t* c_binary, Binary* binary);
-void destroy_sections(Elf_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/ELF/Segment.cpp b/vendor/lief/api/c/ELF/Segment.cpp
deleted file mode 100644
index decbbf2..0000000
--- a/vendor/lief/api/c/ELF/Segment.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Segment.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_segments(Elf_Binary_t* c_binary, Binary* binary) {
-
- Binary::it_segments segments = binary->segments();
- c_binary->segments = static_cast(
- malloc((segments.size() + 1) * sizeof(Elf_Segment_t**)));
- for (size_t i = 0; i < segments.size(); ++i) {
- Segment& segment = segments[i];
-
- span segment_content = segment.content();
- auto* content = static_cast(malloc(segment_content.size() * sizeof(uint8_t)));
- std::copy(
- std::begin(segment_content),
- std::end(segment_content),
- content);
-
- c_binary->segments[i] = static_cast(malloc(sizeof(Elf_Segment_t)));
- c_binary->segments[i]->type = static_cast(segment.type());
- c_binary->segments[i]->flags = static_cast(segment.flags());
- c_binary->segments[i]->virtual_address = segment.virtual_address();
- c_binary->segments[i]->virtual_size = segment.virtual_size();
- c_binary->segments[i]->offset = segment.file_offset();
- c_binary->segments[i]->alignment = segment.alignment();
- c_binary->segments[i]->size = segment_content.size();
- c_binary->segments[i]->content = content;
- }
-
- c_binary->segments[segments.size()] = nullptr;
-
-}
-
-
-
-void destroy_segments(Elf_Binary_t* c_binary) {
-
- Elf_Segment_t **segments = c_binary->segments;
- for (size_t idx = 0; segments[idx] != nullptr; ++idx) {
- free(segments[idx]->content);
- free(segments[idx]);
- }
- free(c_binary->segments);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/ELF/Segment.hpp b/vendor/lief/api/c/ELF/Segment.hpp
deleted file mode 100644
index e2a50c9..0000000
--- a/vendor/lief/api/c/ELF/Segment.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_ELF_SEGMENT_CPP_C_API_
-#define LIEF_ELF_SEGMENT_CPP_C_API_
-
-#include "LIEF/ELF/Binary.h"
-#include "LIEF/ELF/Binary.hpp"
-
-#include "LIEF/ELF/Segment.h"
-#include "LIEF/ELF/Segment.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_segments(Elf_Binary_t* c_binary, Binary* binary);
-void destroy_segments(Elf_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/ELF/Symbol.cpp b/vendor/lief/api/c/ELF/Symbol.cpp
deleted file mode 100644
index 2ca89b9..0000000
--- a/vendor/lief/api/c/ELF/Symbol.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Symbol.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_dynamic_symbols(Elf_Binary_t* c_binary, Binary* binary) {
- Binary::it_dynamic_symbols dyn_symb = binary->dynamic_symbols();
-
- c_binary->dynamic_symbols = static_cast(
- malloc((dyn_symb.size() + 1) * sizeof(Elf_Symbol_t**)));
-
- for (size_t i = 0; i < dyn_symb.size(); ++i) {
- Symbol& b_sym = dyn_symb[i];
- c_binary->dynamic_symbols[i] = static_cast(malloc(sizeof(Elf_Symbol_t)));
- c_binary->dynamic_symbols[i]->name = b_sym.name().c_str();
- c_binary->dynamic_symbols[i]->type = static_cast(b_sym.type());
- c_binary->dynamic_symbols[i]->binding = static_cast(b_sym.binding());
- c_binary->dynamic_symbols[i]->other = b_sym.other();
- c_binary->dynamic_symbols[i]->shndx = b_sym.shndx();
- c_binary->dynamic_symbols[i]->value = b_sym.value();
- c_binary->dynamic_symbols[i]->size = b_sym.size();
- c_binary->dynamic_symbols[i]->information = b_sym.information();
- c_binary->dynamic_symbols[i]->is_exported = b_sym.is_exported();
- c_binary->dynamic_symbols[i]->is_imported = b_sym.is_imported();
- }
- c_binary->dynamic_symbols[dyn_symb.size()] = nullptr;
-
-
-
-}
-
-
-void init_c_static_symbols(Elf_Binary_t* c_binary, Binary* binary) {
- Binary::it_static_symbols static_symb = binary->static_symbols();
-
- c_binary->static_symbols = static_cast(
- malloc((static_symb.size() + 1) * sizeof(Elf_Symbol_t**)));
-
- for (size_t i = 0; i < static_symb.size(); ++i) {
- Symbol& b_sym = static_symb[i];
- c_binary->static_symbols[i] = static_cast(malloc(sizeof(Elf_Symbol_t)));
- c_binary->static_symbols[i]->name = b_sym.name().c_str();
- c_binary->static_symbols[i]->type = static_cast(b_sym.type());
- c_binary->static_symbols[i]->binding = static_cast(b_sym.binding());
- c_binary->static_symbols[i]->other = b_sym.other();
- c_binary->static_symbols[i]->shndx = b_sym.shndx();
- c_binary->static_symbols[i]->value = b_sym.value();
- c_binary->static_symbols[i]->size = b_sym.size();
- c_binary->static_symbols[i]->information = b_sym.information();
- c_binary->static_symbols[i]->is_exported = b_sym.is_exported();
- c_binary->static_symbols[i]->is_imported = b_sym.is_imported();
- }
- c_binary->static_symbols[static_symb.size()] = nullptr;
-
-}
-
-
-
-void destroy_dynamic_symbols(Elf_Binary_t* c_binary) {
- Elf_Symbol_t **dynamic_symbols = c_binary->dynamic_symbols;
- for (size_t idx = 0; dynamic_symbols[idx] != nullptr; ++idx) {
- free(dynamic_symbols[idx]);
- }
- free(c_binary->dynamic_symbols);
-}
-
-
-void destroy_static_symbols(Elf_Binary_t* c_binary) {
- Elf_Symbol_t **static_symbols = c_binary->static_symbols;
- for (size_t idx = 0; static_symbols[idx] != nullptr; ++idx) {
- free(static_symbols[idx]);
- }
- free(c_binary->static_symbols);
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/ELF/Symbol.hpp b/vendor/lief/api/c/ELF/Symbol.hpp
deleted file mode 100644
index eb34f4c..0000000
--- a/vendor/lief/api/c/ELF/Symbol.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_ELF_SYMBOL_CPP_C_API_
-#define LIEF_ELF_SYMBOL_CPP_C_API_
-
-#include "LIEF/ELF/Binary.h"
-#include "LIEF/ELF/Binary.hpp"
-
-#include "LIEF/ELF/Symbol.h"
-#include "LIEF/ELF/Symbol.hpp"
-
-namespace LIEF {
-namespace ELF {
-
-void init_c_dynamic_symbols(Elf_Binary_t* c_binary, Binary* binary);
-void init_c_static_symbols(Elf_Binary_t* c_binary, Binary* binary);
-
-void destroy_dynamic_symbols(Elf_Binary_t* c_binary);
-void destroy_static_symbols(Elf_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/ELF/utils.cpp b/vendor/lief/api/c/ELF/utils.cpp
deleted file mode 100644
index df0d586..0000000
--- a/vendor/lief/api/c/ELF/utils.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LIEF/ELF/utils.hpp"
-#include "LIEF/ELF/utils.h"
-
-bool is_elf(const char* file) {
- return LIEF::ELF::is_elf(file);
-}
-
diff --git a/vendor/lief/api/c/MachO/Binary.cpp b/vendor/lief/api/c/MachO/Binary.cpp
deleted file mode 100644
index 0035a78..0000000
--- a/vendor/lief/api/c/MachO/Binary.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LIEF/MachO/Binary.h"
-
-#include "LIEF/MachO/Binary.hpp"
-
-#include "Binary.hpp"
-#include "Section.hpp"
-#include "Header.hpp"
-#include "Symbol.hpp"
-#include "Segment.hpp"
-#include "LoadCommand.hpp"
-
-
-using namespace LIEF::MachO;
-
-namespace LIEF {
-namespace MachO {
-void init_c_binary(Macho_Binary_t* c_binary, Binary* binary) {
-
- c_binary->handler = reinterpret_cast(binary);
- c_binary->name = binary->name().c_str();
- c_binary->imagebase = binary->imagebase();
- init_c_header(c_binary, binary);
- init_c_commands(c_binary, binary);
- init_c_symbols(c_binary, binary);
- init_c_sections(c_binary, binary);
- init_c_segments(c_binary, binary);
-}
-}
-}
-
-void macho_binaries_destroy(Macho_Binary_t** binaries) {
- for (size_t i = 0; binaries[i] != nullptr; ++i) {
- destroy_sections(binaries[i]);
- destroy_commands(binaries[i]);
- destroy_symbols(binaries[i]);
- destroy_segments(binaries[i]);
-
- delete reinterpret_cast(binaries[i]->handler);
- free(binaries[i]);
- }
- free(binaries);
-
-}
diff --git a/vendor/lief/api/c/MachO/Binary.hpp b/vendor/lief/api/c/MachO/Binary.hpp
deleted file mode 100644
index ab7c16d..0000000
--- a/vendor/lief/api/c/MachO/Binary.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_MACHO_BINARY_CPP_C_API_
-#define LIEF_MACHO_BINARY_CPP_C_API_
-
-#include "LIEF/MachO/Binary.h"
-#include "LIEF/MachO/Binary.hpp"
-
-namespace LIEF {
-namespace MachO {
-
-void init_c_binary(Macho_Binary_t* c_binary, Binary* binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/MachO/CMakeLists.txt b/vendor/lief/api/c/MachO/CMakeLists.txt
deleted file mode 100644
index 24bedde..0000000
--- a/vendor/lief/api/c/MachO/CMakeLists.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-include_directories(
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF"
- "${CMAKE_CURRENT_SOURCE_DIR}/include"
-)
-
-set(LIEF_API_C_MACHO_SRC
- "${CMAKE_CURRENT_LIST_DIR}/EnumToString.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Parser.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/LoadCommand.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Segment.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Symbol.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Section.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Header.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Binary.cpp"
-)
-
-
-set(LIEF_API_C_MACHO_INCLUDE_FILES_CPP
- "${CMAKE_CURRENT_LIST_DIR}/Header.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Binary.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/LoadCommand.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Section.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Segment.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Symbol.hpp"
-)
-
-
-set(LIEF_API_C_MACHO_INCLUDE_FILES_C
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/enums.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Binary.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/EnumToString.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Header.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/LoadCommand.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Section.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Segment.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Symbol.h"
-)
-
-
-set(LIEF_C_MACHO_INC "${LIEF_API_C_MACHO_INCLUDE_FILES_C}" "${LIEF_API_C_MACHO_INCLUDE_FILES_CPP}")
-
-source_group("Source Files\\C API\\MachO" FILES ${LIEF_API_C_MACHO_SRC})
-source_group("Header Files\\C API\\MachO" FILES ${LIEF_C_MACHO_INC})
-
-target_sources(LIB_LIEF PRIVATE "${LIEF_API_C_MACHO_SRC}" ${LIEF_C_MACHO_INC})
diff --git a/vendor/lief/api/c/MachO/EnumToString.cpp b/vendor/lief/api/c/MachO/EnumToString.cpp
deleted file mode 100644
index d8ab3a8..0000000
--- a/vendor/lief/api/c/MachO/EnumToString.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LIEF/MachO/EnumToString.h"
-#include "LIEF/MachO/EnumToString.hpp"
-
-#include "LIEF/MachO/enums.hpp"
-#include "LIEF/MachO/enums.h"
-
-
-extern "C"
-{
-
-const char* LOAD_COMMAND_TYPES_to_string(enum LIEF_MACHO_LOAD_COMMAND_TYPES e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-const char* MACHO_TYPES_to_string(enum LIEF_MACHO_MACHO_TYPES e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-const char* FILE_TYPES_to_string(enum LIEF_MACHO_FILE_TYPES e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-const char* CPU_TYPES_to_string(enum LIEF_MACHO_CPU_TYPES e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-const char* HEADER_FLAGS_to_string(enum LIEF_MACHO_HEADER_FLAGS e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-const char* MACHO_SECTION_TYPES_to_string(enum LIEF_MACHO_MACHO_SECTION_TYPES e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-const char* MACHO_SYMBOL_TYPES_to_string(enum LIEF_MACHO_MACHO_SYMBOL_TYPES e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-const char* N_LIST_TYPES_to_string(enum LIEF_MACHO_N_LIST_TYPES e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-const char* SYMBOL_DESCRIPTIONS_to_string(enum LIEF_MACHO_SYMBOL_DESCRIPTIONS e) {
- return LIEF::MachO::to_string(static_cast(e));
-}
-
-
-
-
-
-
-
-}
diff --git a/vendor/lief/api/c/MachO/Header.cpp b/vendor/lief/api/c/MachO/Header.cpp
deleted file mode 100644
index 82a33b7..0000000
--- a/vendor/lief/api/c/MachO/Header.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Header.hpp"
-
-namespace LIEF {
-namespace MachO {
-void init_c_header(Macho_Binary_t* c_binary, Binary* binary) {
- Header& header = binary->header();
- c_binary->header.magic = static_cast(header.magic());
- c_binary->header.cpu_type = static_cast(header.cpu_type());
- c_binary->header.cpu_subtype = header.cpu_subtype();
- c_binary->header.file_type = static_cast(header.file_type());
- c_binary->header.nb_cmds = header.nb_cmds();
- c_binary->header.sizeof_cmds = header.sizeof_cmds();
- c_binary->header.flags = header.flags();
- c_binary->header.reserved = header.reserved();
-}
-
-}
-}
diff --git a/vendor/lief/api/c/MachO/Header.hpp b/vendor/lief/api/c/MachO/Header.hpp
deleted file mode 100644
index 274a7d3..0000000
--- a/vendor/lief/api/c/MachO/Header.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_MACHO_HEADER_CPP_C_API_
-#define LIEF_MACHO_HEADER_CPP_C_API_
-
-#include "LIEF/MachO/Binary.h"
-#include "LIEF/MachO/Binary.hpp"
-
-#include "LIEF/MachO/Header.h"
-#include "LIEF/MachO/Header.hpp"
-
-namespace LIEF {
-namespace MachO {
-
-void init_c_header(Macho_Binary_t* c_binary, Binary* binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/MachO/LoadCommand.cpp b/vendor/lief/api/c/MachO/LoadCommand.cpp
deleted file mode 100644
index b284bb9..0000000
--- a/vendor/lief/api/c/MachO/LoadCommand.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LoadCommand.hpp"
-
-namespace LIEF {
-namespace MachO {
-void init_c_commands(Macho_Binary_t* c_binary, Binary* binary) {
- Binary::it_commands commands = binary->commands();
-
- c_binary->commands = static_cast(
- malloc((commands.size() + 1) * sizeof(Macho_Command_t**)));
-
- for (size_t i = 0; i < commands.size(); ++i) {
- LoadCommand& cmd = commands[i];
-
- c_binary->commands[i] = static_cast(malloc(sizeof(Macho_Command_t)));
- const std::vector& cmd_content = cmd.data();
- auto* content = static_cast(malloc(cmd_content.size() * sizeof(uint8_t)));
- std::copy(
- std::begin(cmd_content),
- std::end(cmd_content),
- content);
-
- c_binary->commands[i]->command = static_cast(cmd.command());
- c_binary->commands[i]->size = cmd.size();
- c_binary->commands[i]->data = content;
- c_binary->commands[i]->offset = cmd.command_offset();
- }
-
- c_binary->commands[commands.size()] = nullptr;
-
-}
-
-
-
-void destroy_commands(Macho_Binary_t* c_binary) {
- Macho_Command_t **commands = c_binary->commands;
- for (size_t idx = 0; commands[idx] != nullptr; ++idx) {
- free(commands[idx]->data);
- free(commands[idx]);
- }
- free(c_binary->commands);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/MachO/LoadCommand.hpp b/vendor/lief/api/c/MachO/LoadCommand.hpp
deleted file mode 100644
index 94cf63c..0000000
--- a/vendor/lief/api/c/MachO/LoadCommand.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_MACHO_LOAD_COMMAND_CPP_C_API_
-#define LIEF_MACHO_LOAD_COMMAND_CPP_C_API_
-
-#include "LIEF/MachO/Binary.h"
-#include "LIEF/MachO/Binary.hpp"
-
-#include "LIEF/MachO/LoadCommand.h"
-#include "LIEF/MachO/LoadCommand.hpp"
-
-namespace LIEF {
-namespace MachO {
-
-void init_c_commands(Macho_Binary_t* c_binary, Binary* binary);
-void destroy_commands(Macho_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/MachO/Parser.cpp b/vendor/lief/api/c/MachO/Parser.cpp
deleted file mode 100644
index 8f9efbf..0000000
--- a/vendor/lief/api/c/MachO/Parser.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include
-
-#include "LIEF/MachO/Binary.h"
-#include "LIEF/MachO/Parser.hpp"
-#include "LIEF/MachO/FatBinary.hpp"
-
-#include "Binary.hpp"
-
-using namespace LIEF::MachO;
-
-Macho_Binary_t** macho_parse(const char *file) {
- FatBinary* fat = Parser::parse(file).release();
- if (fat == nullptr) {
- return nullptr;
- }
-
- size_t nb_bin = fat->size();
-
- auto** c_macho_binaries = static_cast(
- malloc((fat->size() + 1) * sizeof(Macho_Binary_t**)));
-
- for (size_t i = 0; i < nb_bin; ++i) {
- Binary* binary = fat->at(i);
- if (binary != nullptr) {
- c_macho_binaries[i] = static_cast(malloc(sizeof(Macho_Binary_t)));
- init_c_binary(c_macho_binaries[i], binary);
- }
- }
-
- fat->release_all_binaries();
-
- c_macho_binaries[nb_bin] = nullptr;
- delete fat;
-
- return c_macho_binaries;
-}
-
diff --git a/vendor/lief/api/c/MachO/Section.cpp b/vendor/lief/api/c/MachO/Section.cpp
deleted file mode 100644
index d88af35..0000000
--- a/vendor/lief/api/c/MachO/Section.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Section.hpp"
-
-namespace LIEF {
-namespace MachO {
-void init_c_sections(Macho_Binary_t* c_binary, Binary* binary) {
- Binary::it_sections sections = binary->sections();
-
- c_binary->sections = static_cast(
- malloc((sections.size() + 1) * sizeof(Macho_Section_t**)));
-
- for (size_t i = 0; i < sections.size(); ++i) {
- const Section& section = sections[i];
-
- c_binary->sections[i] = static_cast(malloc(sizeof(Macho_Section_t)));
- span section_content = section.content();
- auto* content = static_cast(malloc(section_content.size() * sizeof(uint8_t)));
- std::copy(std::begin(section_content), std::end(section_content),
- content);
-
- c_binary->sections[i]->name = section.fullname().c_str();
- c_binary->sections[i]->alignment = section.alignment();
- c_binary->sections[i]->relocation_offset = section.relocation_offset();
- c_binary->sections[i]->numberof_relocations = section.numberof_relocations();
- c_binary->sections[i]->flags = section.flags();
- c_binary->sections[i]->type = static_cast(section.type());
- c_binary->sections[i]->reserved1 = section.reserved1();
- c_binary->sections[i]->reserved2 = section.reserved2();
- c_binary->sections[i]->reserved3 = section.reserved3();
- c_binary->sections[i]->virtual_address = section.virtual_address();
- c_binary->sections[i]->offset = section.offset();
- c_binary->sections[i]->size = section_content.size();
- c_binary->sections[i]->content = content;
- c_binary->sections[i]->entropy = section.entropy();
- }
-
- c_binary->sections[sections.size()] = nullptr;
-
-}
-
-
-
-void destroy_sections(Macho_Binary_t* c_binary) {
- Macho_Section_t **sections = c_binary->sections;
- for (size_t idx = 0; sections[idx] != nullptr; ++idx) {
- free(sections[idx]->content);
- free(sections[idx]);
- }
- free(c_binary->sections);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/MachO/Section.hpp b/vendor/lief/api/c/MachO/Section.hpp
deleted file mode 100644
index f91f5cb..0000000
--- a/vendor/lief/api/c/MachO/Section.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_MACHO_SECTION_CPP_C_API_
-#define LIEF_MACHO_SECTION_CPP_C_API_
-
-#include "LIEF/MachO/Binary.h"
-#include "LIEF/MachO/Binary.hpp"
-
-#include "LIEF/MachO/Section.h"
-#include "LIEF/MachO/Section.hpp"
-
-namespace LIEF {
-namespace MachO {
-
-void init_c_sections(Macho_Binary_t* c_binary, Binary* binary);
-void destroy_sections(Macho_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/MachO/Segment.cpp b/vendor/lief/api/c/MachO/Segment.cpp
deleted file mode 100644
index 24cbea2..0000000
--- a/vendor/lief/api/c/MachO/Segment.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Segment.hpp"
-
-namespace LIEF {
-namespace MachO {
-void init_c_segments(Macho_Binary_t* c_binary, Binary* binary) {
- Binary::it_segments segments = binary->segments();
-
- c_binary->segments = static_cast(
- malloc((segments.size() + 1) * sizeof(Macho_Segment_t**)));
-
- for (size_t i = 0; i < segments.size(); ++i) {
- SegmentCommand& segment = segments[i];
-
- c_binary->segments[i] = static_cast(malloc(sizeof(Macho_Segment_t)));
- span segment_content = segment.content();
- auto* content = static_cast(malloc(segment_content.size() * sizeof(uint8_t)));
- std::copy(
- std::begin(segment_content),
- std::end(segment_content),
- content);
-
- c_binary->segments[i]->name = segment.name().c_str();
- c_binary->segments[i]->virtual_address = segment.virtual_address();
- c_binary->segments[i]->virtual_size = segment.virtual_size();
- c_binary->segments[i]->file_size = segment.file_size();
- c_binary->segments[i]->file_offset = segment.file_offset();
- c_binary->segments[i]->max_protection = segment.max_protection();
- c_binary->segments[i]->init_protection = segment.init_protection();
- c_binary->segments[i]->numberof_sections = segment.numberof_sections();
- c_binary->segments[i]->flags = segment.flags();
- c_binary->segments[i]->content = content;
- c_binary->segments[i]->size = segment_content.size();
- c_binary->segments[i]->sections = nullptr; //TODO
- }
-
- c_binary->segments[segments.size()] = nullptr;
-
-}
-
-
-
-void destroy_segments(Macho_Binary_t* c_binary) {
- Macho_Segment_t **segments = c_binary->segments;
- for (size_t idx = 0; segments[idx] != nullptr; ++idx) {
- free(segments[idx]->content);
- free(segments[idx]);
- }
- free(c_binary->segments);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/MachO/Segment.hpp b/vendor/lief/api/c/MachO/Segment.hpp
deleted file mode 100644
index 4da6258..0000000
--- a/vendor/lief/api/c/MachO/Segment.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_MACHO_SEGMENT_CPP_C_API_
-#define LIEF_MACHO_SEGMENT_CPP_C_API_
-
-#include "LIEF/MachO/Binary.h"
-#include "LIEF/MachO/Binary.hpp"
-
-#include "LIEF/MachO/Segment.h"
-#include "LIEF/MachO/SegmentCommand.hpp"
-
-namespace LIEF {
-namespace MachO {
-
-void init_c_segments(Macho_Binary_t* c_binary, Binary* binary);
-void destroy_segments(Macho_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/MachO/Symbol.cpp b/vendor/lief/api/c/MachO/Symbol.cpp
deleted file mode 100644
index 9d2af10..0000000
--- a/vendor/lief/api/c/MachO/Symbol.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Symbol.hpp"
-
-namespace LIEF {
-namespace MachO {
-void init_c_symbols(Macho_Binary_t* c_binary, Binary* binary) {
- Binary::it_symbols symbols = binary->symbols();
-
- c_binary->symbols = static_cast(
- malloc((symbols.size() + 1) * sizeof(Macho_Symbol_t**)));
-
- for (size_t i = 0; i < symbols.size(); ++i) {
- const Symbol& symbol = symbols[i];
-
- c_binary->symbols[i] = static_cast(malloc(sizeof(Macho_Symbol_t)));
-
- c_binary->symbols[i]->name = symbol.name().c_str();
- c_binary->symbols[i]->type = symbol.type();
- c_binary->symbols[i]->numberof_sections = symbol.numberof_sections();
- c_binary->symbols[i]->description = symbol.description();
- c_binary->symbols[i]->value = symbol.value();
- }
-
- c_binary->symbols[symbols.size()] = nullptr;
-
-}
-
-
-
-void destroy_symbols(Macho_Binary_t* c_binary) {
- Macho_Symbol_t **symbols = c_binary->symbols;
- for (size_t idx = 0; symbols[idx] != nullptr; ++idx) {
- free(symbols[idx]);
- }
- free(c_binary->symbols);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/MachO/Symbol.hpp b/vendor/lief/api/c/MachO/Symbol.hpp
deleted file mode 100644
index 0eaf404..0000000
--- a/vendor/lief/api/c/MachO/Symbol.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_MACHO_SYMBOL_CPP_C_API_
-#define LIEF_MACHO_SYMBOL_CPP_C_API_
-
-#include "LIEF/MachO/Binary.h"
-#include "LIEF/MachO/Binary.hpp"
-
-#include "LIEF/MachO/Symbol.h"
-#include "LIEF/MachO/Symbol.hpp"
-
-namespace LIEF {
-namespace MachO {
-
-void init_c_symbols(Macho_Binary_t* c_binary, Binary* binary);
-void destroy_symbols(Macho_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/PE/Binary.cpp b/vendor/lief/api/c/PE/Binary.cpp
deleted file mode 100644
index 3ece8ff..0000000
--- a/vendor/lief/api/c/PE/Binary.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include
-
-#include "LIEF/PE/Binary.h"
-
-#include "LIEF/PE/Parser.hpp"
-#include "LIEF/PE/Binary.hpp"
-
-#include "Binary.hpp"
-#include "DosHeader.hpp"
-#include "Header.hpp"
-#include "OptionalHeader.hpp"
-#include "Section.hpp"
-#include "DataDirectory.hpp"
-#include "Import.hpp"
-
-using namespace LIEF::PE;
-
-namespace LIEF {
-namespace PE {
-
-void init_c_binary(Pe_Binary_t* c_binary, Binary* binary) {
- c_binary->name = binary->name().c_str();
- c_binary->handler = reinterpret_cast(binary);
-
- init_c_dos_header(c_binary, binary);
- init_c_header(c_binary, binary);
- init_c_optional_header(c_binary, binary);
- init_c_sections(c_binary, binary);
- init_c_data_directories(c_binary, binary);
- init_c_imports(c_binary, binary);
-
-}
-
-}
-}
-
-Pe_Binary_t* pe_parse(const char *file) {
- Binary* binary = Parser::parse(file).release();
- auto* c_binary = static_cast(malloc(sizeof(Pe_Binary_t)));
- std::memset(c_binary, 0, sizeof(Pe_Binary_t));
- init_c_binary(c_binary, binary);
-
- return c_binary;
-}
-
-void pe_binary_destroy(Pe_Binary_t* binary) {
- destroy_sections(binary);
- destroy_data_directories(binary);
- destroy_imports(binary);
- delete reinterpret_cast(binary->handler);
- free(binary);
-}
diff --git a/vendor/lief/api/c/PE/Binary.hpp b/vendor/lief/api/c/PE/Binary.hpp
deleted file mode 100644
index 3369af7..0000000
--- a/vendor/lief/api/c/PE/Binary.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_PE_BINARY_CPP_C_API_
-#define LIEF_PE_BINARY_CPP_C_API_
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/Binary.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_binary(Pe_Binary_t* c_binary, Binary* binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/PE/CMakeLists.txt b/vendor/lief/api/c/PE/CMakeLists.txt
deleted file mode 100644
index 14e478e..0000000
--- a/vendor/lief/api/c/PE/CMakeLists.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-include_directories(
- "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF"
- "${CMAKE_CURRENT_SOURCE_DIR}/include"
-)
-set(LIEF_API_C_PE_SRC
- "${CMAKE_CURRENT_LIST_DIR}/Binary.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/DosHeader.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Header.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/OptionalHeader.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Section.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/DataDirectory.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/EnumToString.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/Import.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/ImportEntry.cpp"
-)
-
-
-set(LIEF_API_C_PE_INCLUDE_FILES_CPP
- "${CMAKE_CURRENT_LIST_DIR}/Binary.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/DataDirectory.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/DosHeader.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Header.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/OptionalHeader.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Section.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/Import.hpp"
- "${CMAKE_CURRENT_LIST_DIR}/ImportEntry.hpp"
-)
-
-set(LIEF_API_C_PE_INCLUDE_FILES_C
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/enums.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/Binary.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/DataDirectory.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/DosHeader.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/EnumToString.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/Header.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/OptionalHeader.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/Section.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/Import.h"
- "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/ImportEntry.h"
-)
-
-
-set(LIEF_C_PE_INC "${LIEF_API_C_PE_INCLUDE_FILES_C}" "${LIEF_API_C_PE_INCLUDE_FILES_CPP}")
-
-source_group("Source Files\\C API\\PE" FILES ${LIEF_API_C_PE_SRC})
-source_group("Header Files\\C API\\PE" FILES ${LIEF_C_PE_INC})
-
-target_sources(LIB_LIEF PRIVATE "${LIEF_API_C_PE_SRC}" "${LIEF_C_PE_INC}")
diff --git a/vendor/lief/api/c/PE/DataDirectory.cpp b/vendor/lief/api/c/PE/DataDirectory.cpp
deleted file mode 100644
index b8dd912..0000000
--- a/vendor/lief/api/c/PE/DataDirectory.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "DataDirectory.hpp"
-
-namespace LIEF {
-namespace PE {
-void init_c_data_directories(Pe_Binary_t* c_binary, Binary* binary) {
-
- Binary::it_data_directories data_directories = binary->data_directories();
-
- c_binary->data_directories = static_cast(
- malloc((data_directories.size() + 1) * sizeof(Pe_DataDirectory_t**)));
-
- for (size_t i = 0; i < data_directories.size(); ++i) {
-
- c_binary->data_directories[i] = static_cast(malloc(sizeof(Pe_DataDirectory_t)));
- c_binary->data_directories[i]->rva = data_directories[i].RVA();
- c_binary->data_directories[i]->size = data_directories[i].size();
- }
- c_binary->data_directories[data_directories.size()] = nullptr;
-
-
-
-}
-
-
-
-void destroy_data_directories(Pe_Binary_t* c_binary) {
-
- Pe_DataDirectory_t **data_directories = c_binary->data_directories;
- for (size_t idx = 0; data_directories[idx] != nullptr; ++idx) {
- free(data_directories[idx]);
- }
- free(c_binary->data_directories);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/PE/DataDirectory.hpp b/vendor/lief/api/c/PE/DataDirectory.hpp
deleted file mode 100644
index cff19ec..0000000
--- a/vendor/lief/api/c/PE/DataDirectory.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_PE_DATA_DIRECTORY_CPP_C_API_
-#define LIEF_PE_DATA_DIRECTORY_CPP_C_API_
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/Binary.hpp"
-
-#include "LIEF/PE/DataDirectory.h"
-#include "LIEF/PE/DataDirectory.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_data_directories(Pe_Binary_t* c_binary, Binary* binary);
-void destroy_data_directories(Pe_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/PE/DosHeader.cpp b/vendor/lief/api/c/PE/DosHeader.cpp
deleted file mode 100644
index 2fcd2cc..0000000
--- a/vendor/lief/api/c/PE/DosHeader.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "DosHeader.hpp"
-
-namespace LIEF {
-namespace PE {
-void init_c_dos_header(Pe_Binary_t* c_binary, Binary* binary) {
- const DosHeader& dos_header = binary->dos_header();
- c_binary->dos_header.magic = dos_header.magic();
- c_binary->dos_header.used_bytes_in_the_last_page = dos_header.used_bytes_in_the_last_page();
- c_binary->dos_header.file_size_in_pages = dos_header.file_size_in_pages();
- c_binary->dos_header.numberof_relocation = dos_header.numberof_relocation();
- c_binary->dos_header.header_size_in_paragraphs = dos_header.header_size_in_paragraphs();
- c_binary->dos_header.minimum_extra_paragraphs = dos_header.minimum_extra_paragraphs();
- c_binary->dos_header.maximum_extra_paragraphs = dos_header.maximum_extra_paragraphs();
- c_binary->dos_header.initial_relative_ss = dos_header.initial_relative_ss();
- c_binary->dos_header.initial_sp = dos_header.initial_sp();
- c_binary->dos_header.checksum = dos_header.checksum();
- c_binary->dos_header.initial_ip = dos_header.initial_ip();
- c_binary->dos_header.initial_relative_cs = dos_header.initial_relative_cs();
- c_binary->dos_header.addressof_relocation_table = dos_header.addressof_relocation_table();
- c_binary->dos_header.overlay_number = dos_header.overlay_number();
- c_binary->dos_header.oem_id = dos_header.oem_id();
- c_binary->dos_header.oem_info = dos_header.oem_info();
- c_binary->dos_header.addressof_new_exeheader = dos_header.addressof_new_exeheader();
-
- const DosHeader::reserved_t& reserved = dos_header.reserved();
- std::copy(
- std::begin(reserved),
- std::end(reserved),
- c_binary->dos_header.reserved);
-
-
- const DosHeader::reserved2_t& reserved2 = dos_header.reserved2();
- std::copy(
- std::begin(reserved2),
- std::end(reserved2),
- c_binary->dos_header.reserved2);
-}
-
-}
-}
diff --git a/vendor/lief/api/c/PE/DosHeader.hpp b/vendor/lief/api/c/PE/DosHeader.hpp
deleted file mode 100644
index d5344c9..0000000
--- a/vendor/lief/api/c/PE/DosHeader.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_PE_DOS_HEADER_CPP_C_API_
-#define LIEF_PE_DOS_HEADER_CPP_C_API_
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/Binary.hpp"
-
-#include "LIEF/PE/DosHeader.h"
-#include "LIEF/PE/DosHeader.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_dos_header(Pe_Binary_t* c_binary, Binary* binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/PE/EnumToString.cpp b/vendor/lief/api/c/PE/EnumToString.cpp
deleted file mode 100644
index 39a36c8..0000000
--- a/vendor/lief/api/c/PE/EnumToString.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LIEF/PE/EnumToString.h"
-#include "LIEF/PE/EnumToString.hpp"
-
-#include "LIEF/PE/enums.hpp"
-#include "LIEF/PE/enums.h"
-
-
-extern "C"
-{
-
-const char* PE_TYPES_to_string(enum LIEF_PE_PE_TYPES e) {
- return LIEF::PE::to_string(static_cast(e));
-}
-
-
-const char* MACHINE_TYPES_to_string(enum LIEF_PE_MACHINE_TYPES e) {
- return LIEF::PE::to_string(static_cast(e));
-}
-
-
-const char* SUBSYSTEM_to_string(enum LIEF_PE_SUBSYSTEM e) {
- return LIEF::PE::to_string(static_cast(e));
-}
-
-}
diff --git a/vendor/lief/api/c/PE/Header.cpp b/vendor/lief/api/c/PE/Header.cpp
deleted file mode 100644
index 1953b17..0000000
--- a/vendor/lief/api/c/PE/Header.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Header.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_header(Pe_Binary_t* c_binary, Binary* binary) {
-
- const Header& header = binary->header();
-
- const Header::signature_t& signature = header.signature();
-
- c_binary->header.machine = static_cast(header.machine());
- c_binary->header.numberof_sections = header.numberof_sections();
- c_binary->header.time_date_stamp = header.time_date_stamp();
- c_binary->header.pointerto_symbol_table = header.pointerto_symbol_table();
- c_binary->header.numberof_symbols = header.numberof_symbols();
- c_binary->header.sizeof_optional_header = header.sizeof_optional_header();
- c_binary->header.characteristics = static_cast(header.characteristics());
-
- std::copy(
- std::begin(signature),
- std::end(signature),
- c_binary->header.signature);
-}
-
-}
-}
diff --git a/vendor/lief/api/c/PE/Header.hpp b/vendor/lief/api/c/PE/Header.hpp
deleted file mode 100644
index a3ebba7..0000000
--- a/vendor/lief/api/c/PE/Header.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_PE_HEADER_CPP_C_API_
-#define LIEF_PE_HEADER_CPP_C_API_
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/Binary.hpp"
-
-#include "LIEF/PE/Header.h"
-#include "LIEF/PE/Header.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_header(Pe_Binary_t* c_binary, Binary* binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/PE/Import.cpp b/vendor/lief/api/c/PE/Import.cpp
deleted file mode 100644
index 3f491d9..0000000
--- a/vendor/lief/api/c/PE/Import.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Import.hpp"
-#include "ImportEntry.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_imports(Pe_Binary_t* c_binary, Binary* binary) {
-
- if (!binary->has_imports()) {
- c_binary->imports = nullptr;
- }
-
- Binary::it_imports imports = binary->imports();
-
- c_binary->imports = static_cast(
- malloc((imports.size() + 1) * sizeof(Pe_Import_t**)));
-
- for (size_t i = 0; i < imports.size(); ++i) {
- Import& imp = imports[i];
- c_binary->imports[i] = static_cast(malloc(sizeof(Pe_Import_t)));
-
- c_binary->imports[i]->name = imp.name().c_str();
- c_binary->imports[i]->forwarder_chain = imp.forwarder_chain();
- c_binary->imports[i]->timedatestamp = imp.forwarder_chain();
- c_binary->imports[i]->import_address_table_rva = imp.import_address_table_rva();
- c_binary->imports[i]->import_lookup_table_rva = imp.import_lookup_table_rva();
- c_binary->imports[i]->entries = nullptr;
- init_c_import_entries(c_binary->imports[i], imp);
- }
-
- c_binary->imports[imports.size()] = nullptr;
-}
-
-
-void destroy_imports(Pe_Binary_t* c_binary) {
- if (c_binary->imports == nullptr) {
- return;
- }
-
- Pe_Import_t **imports = c_binary->imports;
- for (size_t idx = 0; imports[idx] != nullptr; ++idx) {
- destroy_import_entries(imports[idx]);
- free(imports[idx]);
- }
- free(c_binary->imports);
-
-}
-
-}
-}
diff --git a/vendor/lief/api/c/PE/Import.hpp b/vendor/lief/api/c/PE/Import.hpp
deleted file mode 100644
index a56aafa..0000000
--- a/vendor/lief/api/c/PE/Import.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_PE_IMPORT_CPP_C_API_
-#define LIEF_PE_IMPORT_CPP_C_API_
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/Binary.hpp"
-
-#include "LIEF/PE/Import.h"
-#include "LIEF/PE/Import.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_imports(Pe_Binary_t* c_binary, Binary* binary);
-void destroy_imports(Pe_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/PE/ImportEntry.cpp b/vendor/lief/api/c/PE/ImportEntry.cpp
deleted file mode 100644
index 3a00c48..0000000
--- a/vendor/lief/api/c/PE/ImportEntry.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "ImportEntry.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_import_entries(Pe_Import_t* c_import, Import& imp) {
-
- Import::it_entries entries = imp.entries();
-
- c_import->entries = static_cast(
- malloc((entries.size() + 1) * sizeof(Pe_ImportEntry_t**)));
-
- for (size_t i = 0; i < entries.size(); ++i) {
- ImportEntry& import_entry = entries[i];
- c_import->entries[i] = static_cast(malloc(sizeof(Pe_ImportEntry_t)));
-
- c_import->entries[i]->is_ordinal = import_entry.is_ordinal();
- c_import->entries[i]->name = import_entry.is_ordinal() ? nullptr : import_entry.name().c_str();
- c_import->entries[i]->ordinal = import_entry.is_ordinal() ? import_entry.ordinal() : 0;
- c_import->entries[i]->hint_name_rva = import_entry.hint_name_rva();
- c_import->entries[i]->hint = import_entry.hint();
- c_import->entries[i]->iat_value = import_entry.iat_value();
- c_import->entries[i]->data = import_entry.data();
- c_import->entries[i]->iat_address = import_entry.iat_address();
- }
-
- c_import->entries[entries.size()] = nullptr;
-
-}
-
-
-void destroy_import_entries(Pe_Import_t* c_import) {
- Pe_ImportEntry_t **entries = c_import->entries;
- for (size_t idx = 0; entries[idx] != nullptr; ++idx) {
- free(entries[idx]);
- }
- free(c_import->entries);
-
-}
-
-}
-}
diff --git a/vendor/lief/api/c/PE/ImportEntry.hpp b/vendor/lief/api/c/PE/ImportEntry.hpp
deleted file mode 100644
index 067e968..0000000
--- a/vendor/lief/api/c/PE/ImportEntry.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_PE_IMPORT_ENTRY_CPP_C_API_
-#define LIEF_PE_IMPORT_ENTRY_CPP_C_API_
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/Binary.hpp"
-
-#include "LIEF/PE/ImportEntry.h"
-#include "LIEF/PE/ImportEntry.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_import_entries(Pe_Import_t* c_import, Import& imp);
-void destroy_import_entries(Pe_Import_t* c_import);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/PE/OptionalHeader.cpp b/vendor/lief/api/c/PE/OptionalHeader.cpp
deleted file mode 100644
index 1648f41..0000000
--- a/vendor/lief/api/c/PE/OptionalHeader.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "OptionalHeader.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_optional_header(Pe_Binary_t* c_binary, Binary* binary) {
-
- const OptionalHeader& optional_header = binary->optional_header();
- c_binary->optional_header.magic = static_cast(optional_header.magic());
- c_binary->optional_header.major_linker_version = optional_header.major_linker_version();
- c_binary->optional_header.minor_linker_version = optional_header.minor_linker_version();
- c_binary->optional_header.sizeof_code = optional_header.sizeof_code();
- c_binary->optional_header.sizeof_initialized_data = optional_header.sizeof_initialized_data();
- c_binary->optional_header.sizeof_uninitialized_data = optional_header.sizeof_uninitialized_data();
- c_binary->optional_header.addressof_entrypoint = optional_header.addressof_entrypoint();
- c_binary->optional_header.baseof_code = optional_header.baseof_code();
- if (optional_header.magic() == PE_TYPE::PE32) {
- c_binary->optional_header.baseof_data = optional_header.baseof_data();
- } else {
- c_binary->optional_header.baseof_data = 0;
- }
- c_binary->optional_header.imagebase = optional_header.imagebase();
- c_binary->optional_header.section_alignment = optional_header.section_alignment();
- c_binary->optional_header.file_alignment = optional_header.file_alignment();
- c_binary->optional_header.major_operating_system_version = optional_header.major_operating_system_version();
- c_binary->optional_header.minor_operating_system_version = optional_header.minor_operating_system_version();
- c_binary->optional_header.major_image_version = optional_header.major_image_version();
- c_binary->optional_header.minor_image_version = optional_header.minor_image_version();
- c_binary->optional_header.major_subsystem_version = optional_header.major_subsystem_version();
- c_binary->optional_header.minor_subsystem_version = optional_header.minor_subsystem_version();
- c_binary->optional_header.win32_version_value = optional_header.win32_version_value();
- c_binary->optional_header.sizeof_image = optional_header.sizeof_image();
- c_binary->optional_header.sizeof_headers = optional_header.sizeof_headers();
- c_binary->optional_header.checksum = optional_header.checksum();
- c_binary->optional_header.subsystem = static_cast(optional_header.subsystem());
- c_binary->optional_header.dll_characteristics = optional_header.dll_characteristics();
- c_binary->optional_header.sizeof_stack_reserve = optional_header.sizeof_stack_reserve();
- c_binary->optional_header.sizeof_stack_commit = optional_header.sizeof_stack_commit();
- c_binary->optional_header.sizeof_heap_reserve = optional_header.sizeof_heap_reserve();
- c_binary->optional_header.sizeof_heap_commit = optional_header.sizeof_heap_commit();
- c_binary->optional_header.loader_flags = optional_header.loader_flags();
- c_binary->optional_header.numberof_rva_and_size = optional_header.numberof_rva_and_size();
-}
-
-}
-}
diff --git a/vendor/lief/api/c/PE/OptionalHeader.hpp b/vendor/lief/api/c/PE/OptionalHeader.hpp
deleted file mode 100644
index cc5b107..0000000
--- a/vendor/lief/api/c/PE/OptionalHeader.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_PE_OPTIONAL_HEADER_CPP_C_API_
-#define LIEF_PE_OPTIONAL_HEADER_CPP_C_API_
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/Binary.hpp"
-
-#include "LIEF/PE/OptionalHeader.h"
-#include "LIEF/PE/OptionalHeader.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_optional_header(Pe_Binary_t* c_binary, Binary* binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/PE/Section.cpp b/vendor/lief/api/c/PE/Section.cpp
deleted file mode 100644
index ede9817..0000000
--- a/vendor/lief/api/c/PE/Section.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "Section.hpp"
-
-namespace LIEF {
-namespace PE {
-void init_c_sections(Pe_Binary_t* c_binary, Binary* binary) {
-
- Binary::it_sections sections = binary->sections();
-
- c_binary->sections = static_cast(
- malloc((sections.size() + 1) * sizeof(Pe_Section_t**)));
-
- for (size_t i = 0; i < sections.size(); ++i) {
- Section& b_section = sections[i];
- c_binary->sections[i] = static_cast(malloc(sizeof(Pe_Section_t)));
- span section_content = b_section.content();
- uint8_t* content = nullptr;
-
- if (!section_content.empty()) {
- content = static_cast(malloc(section_content.size() * sizeof(uint8_t)));
- std::copy(std::begin(section_content), std::end(section_content),
- content);
- }
-
- c_binary->sections[i]->name = b_section.fullname().c_str();
- c_binary->sections[i]->virtual_address = b_section.virtual_address();
- c_binary->sections[i]->size = b_section.size();
- c_binary->sections[i]->offset = b_section.offset();
- c_binary->sections[i]->virtual_size = b_section.virtual_size();
- c_binary->sections[i]->pointerto_relocation = b_section.pointerto_relocation();
- c_binary->sections[i]->pointerto_line_numbers = b_section.pointerto_line_numbers();
- c_binary->sections[i]->characteristics = b_section.characteristics();
- c_binary->sections[i]->content = content;
- c_binary->sections[i]->content_size = section_content.size();
- c_binary->sections[i]->entropy = b_section.entropy();
- }
- c_binary->sections[sections.size()] = nullptr;
-
-}
-
-
-
-void destroy_sections(Pe_Binary_t* c_binary) {
-
- Pe_Section_t **sections = c_binary->sections;
- for (size_t idx = 0; sections[idx] != nullptr; ++idx) {
- free(sections[idx]->content);
- free(sections[idx]);
- }
- free(c_binary->sections);
-
-}
-
-}
-}
-
-
diff --git a/vendor/lief/api/c/PE/Section.hpp b/vendor/lief/api/c/PE/Section.hpp
deleted file mode 100644
index 8353912..0000000
--- a/vendor/lief/api/c/PE/Section.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_PE_SECTION_CPP_C_API_
-#define LIEF_PE_SECTION_CPP_C_API_
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/Binary.hpp"
-
-#include "LIEF/PE/Section.h"
-#include "LIEF/PE/Section.hpp"
-
-namespace LIEF {
-namespace PE {
-
-void init_c_sections(Pe_Binary_t* c_binary, Binary* binary);
-void destroy_sections(Pe_Binary_t* c_binary);
-
-}
-}
-
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF.h b/vendor/lief/api/c/include/LIEF/ELF.h
deleted file mode 100644
index 940d59d..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_H_
-#define C_LIEF_ELF_H_
-
-//! @defgroup elf_c_api ELF C API
-
-#include "LIEF/ELF/Binary.h"
-#include "LIEF/ELF/Symbol.h"
-#include "LIEF/ELF/Section.h"
-#include "LIEF/ELF/Header.h"
-#include "LIEF/ELF/DynamicEntry.h"
-#include "LIEF/ELF/EnumToString.h"
-#include "LIEF/ELF/utils.h"
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/Binary.h b/vendor/lief/api/c/include/LIEF/ELF/Binary.h
deleted file mode 100644
index cc4578e..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/Binary.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_BINARY_H_
-#define C_LIEF_ELF_BINARY_H_
-
-/** @defgroup elf_binary_c_api Binary
- * @ingroup elf_c_api
- * @addtogroup elf_binary_c_api
- * @brief Binary C API
- *
- * @{
- */
-
-#include
-
-#include "LIEF/visibility.h"
-
-#include "LIEF/ELF/enums.h"
-
-#include "LIEF/ELF/Section.h"
-#include "LIEF/ELF/Segment.h"
-#include "LIEF/ELF/Header.h"
-#include "LIEF/ELF/DynamicEntry.h"
-#include "LIEF/ELF/Symbol.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief LIEF::ELF::Binary C Handler */
-struct Elf_Binary_t {
- void* handler;
- const char* name;
- const char* interpreter;
- enum LIEF_ELF_ELF_CLASS type;
- Elf_Header_t header;
- Elf_Section_t **sections;
- Elf_Segment_t **segments;
- Elf_DynamicEntry_t **dynamic_entries;
- Elf_Symbol_t **dynamic_symbols;
- Elf_Symbol_t **static_symbols;
-};
-
-typedef struct Elf_Binary_t Elf_Binary_t;
-
-/** @brief Wrapper for LIEF::ELF::Parser::parse */
-LIEF_API Elf_Binary_t* elf_parse(const char *file);
-
-LIEF_API void elf_binary_destroy(Elf_Binary_t* binary);
-
-/* ELF::Binary methods
- * ==================
- */
-
-/** @brief Update LIEF::ELF::Header object */
-LIEF_API int elf_binary_save_header(Elf_Binary_t* binary);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/DynamicEntry.h b/vendor/lief/api/c/include/LIEF/ELF/DynamicEntry.h
deleted file mode 100644
index a4f05b2..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/DynamicEntry.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_DYNAMIC_ENTRY_H_
-#define C_LIEF_ELF_DYNAMIC_ENTRY_H_
-
-#include
-
-#include "LIEF/ELF/enums.h"
-
-/** @defgroup elf_dynamic_entry_c_api Dynamic Entry
- * @ingroup elf_c_api
- * @addtogroup elf_dynamic_entry_c_api
- * @brief Dynamic Entry C API
- *
- * @{
- */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Elf_DynamicEntry_t {
- enum LIEF_ELF_DYNAMIC_TAGS tag;
- uint64_t value;
-};
-
-struct Elf_DynamicEntry_Library_t {
- enum LIEF_ELF_DYNAMIC_TAGS tag;
- uint64_t value;
- const char* name;
-};
-
-struct Elf_DynamicEntry_SharedObject_t {
- enum LIEF_ELF_DYNAMIC_TAGS tag;
- uint64_t value;
- const char* name;
-};
-
-struct Elf_DynamicEntry_Array_t {
- enum LIEF_ELF_DYNAMIC_TAGS tag;
- uint64_t value;
- uint64_t* array;
-};
-
-struct Elf_DynamicEntry_Rpath_t {
- enum LIEF_ELF_DYNAMIC_TAGS tag;
- uint64_t value;
- const char* rpath;
-};
-
-struct Elf_DynamicEntry_RunPath_t {
- enum LIEF_ELF_DYNAMIC_TAGS tag;
- uint64_t value;
- const char* runpath;
-};
-
-
-struct Elf_DynamicEntry_Flags_t {
- enum LIEF_ELF_DYNAMIC_TAGS tag;
- uint64_t value;
- enum LIEF_ELF_DYNAMIC_FLAGS *flags;
- enum LIEF_ELF_DYNAMIC_FLAGS_1 *flags_1;
-};
-
-typedef struct Elf_DynamicEntry_t Elf_DynamicEntry_t;
-typedef struct Elf_DynamicEntry_Library_t Elf_DynamicEntry_Library_t;
-typedef struct Elf_DynamicEntry_SharedObject_t Elf_DynamicEntry_SharedObject_t;
-typedef struct Elf_DynamicEntry_Array_t Elf_DynamicEntry_Array_t;
-typedef struct Elf_DynamicEntry_Rpath_t Elf_DynamicEntry_Rpath_t;
-typedef struct Elf_DynamicEntry_RunPath_t Elf_DynamicEntry_RunPath_t;
-typedef struct Elf_DynamicEntry_Flags_t Elf_DynamicEntry_Flags_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/EnumToString.h b/vendor/lief/api/c/include/LIEF/ELF/EnumToString.h
deleted file mode 100644
index cfd388e..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/EnumToString.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_ENUM_TO_STRING_H_
-#define C_LIEF_ELF_ENUM_TO_STRING_H_
-
-#include "LIEF/visibility.h"
-
-#include "LIEF/ELF/enums.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-LIEF_API const char* SYMBOL_BINDINGS_to_string(enum LIEF_ELF_SYMBOL_BINDINGS e);
-LIEF_API const char* E_TYPE_to_string(enum LIEF_ELF_E_TYPE e);
-LIEF_API const char* VERSION_to_string(enum LIEF_ELF_VERSION e);
-LIEF_API const char* ARCH_to_string(enum LIEF_ELF_ARCH e);
-LIEF_API const char* SEGMENT_TYPES_to_string(enum LIEF_ELF_SEGMENT_TYPES e);
-LIEF_API const char* DYNAMIC_TAGS_to_string(enum LIEF_ELF_DYNAMIC_TAGS e);
-LIEF_API const char* ELF_SECTION_TYPES_to_string(enum LIEF_ELF_ELF_SECTION_TYPES e);
-LIEF_API const char* ELF_SECTION_FLAGS_to_string(enum LIEF_ELF_ELF_SECTION_FLAGS e);
-LIEF_API const char* ELF_SYMBOL_TYPES_to_string(enum LIEF_ELF_ELF_SYMBOL_TYPES e);
-LIEF_API const char* ELF_CLASS_to_string(enum LIEF_ELF_ELF_CLASS e);
-LIEF_API const char* ELF_DATA_to_string(enum LIEF_ELF_ELF_DATA e);
-LIEF_API const char* OS_ABI_to_string(enum LIEF_ELF_OS_ABI e);
-LIEF_API const char* DYNAMIC_FLAGS_to_string(enum LIEF_ELF_DYNAMIC_FLAGS e);
-LIEF_API const char* DYNAMIC_FLAGS_1_to_string(enum LIEF_ELF_DYNAMIC_FLAGS_1 e);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/Header.h b/vendor/lief/api/c/include/LIEF/ELF/Header.h
deleted file mode 100644
index 14a3e22..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/Header.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_HEADER_H_
-#define C_LIEF_ELF_HEADER_H_
-#include
-
-#include "LIEF/ELF/enums.h"
-/** @defgroup elf_header_c_api Header
- * @ingroup elf_c_api
- * @addtogroup elf_header_c_api
- * @brief Header C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Elf_Header_t {
- uint8_t identity[LIEF_ELF_EI_NIDENT];
- enum LIEF_ELF_E_TYPE file_type;
- enum LIEF_ELF_ARCH machine_type;
- enum LIEF_ELF_VERSION object_file_version;
- uint64_t entrypoint;
- uint64_t program_headers_offset;
- uint64_t section_headers_offset;
- uint32_t processor_flags;
- uint32_t header_size;
- uint32_t program_header_size;
- uint32_t numberof_segments;
- uint32_t section_header_size;
- uint32_t numberof_sections;
- uint32_t name_string_table_idx;
-};
-
-typedef struct Elf_Header_t Elf_Header_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/Section.h b/vendor/lief/api/c/include/LIEF/ELF/Section.h
deleted file mode 100644
index cc57d1e..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/Section.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_SECTION_H_
-#define C_LIEF_ELF_SECTION_H_
-
-#include
-
-#include "LIEF/ELF/enums.h"
-
-/** @defgroup elf_section_c_api Section
- * @ingroup elf_c_api
- * @addtogroup elf_section_c_api
- * @brief Section C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Elf_Section_t {
- const char* name;
- uint32_t flags;
- enum LIEF_ELF_ELF_SECTION_TYPES type;
- uint64_t virtual_address;
- uint64_t offset;
- uint64_t original_size;
- uint32_t link;
- uint32_t info;
- uint64_t alignment;
- uint64_t entry_size;
- uint64_t size;
- uint8_t* content;
- double entropy;
-};
-
-typedef struct Elf_Section_t Elf_Section_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/Segment.h b/vendor/lief/api/c/include/LIEF/ELF/Segment.h
deleted file mode 100644
index d514d6d..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/Segment.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_SEGMENT_H_
-#define C_LIEF_ELF_SEGMENT_H_
-
-#include
-#include "LIEF/ELF/enums.h"
-
-/** @defgroup elf_segment_c_api Segment
- * @ingroup elf_c_api
- * @addtogroup elf_segment_c_api
- * @brief Segment C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Elf_Segment_t {
- enum LIEF_ELF_SEGMENT_TYPES type;
- uint32_t flags;
- uint64_t virtual_address;
- uint64_t virtual_size;
- uint64_t offset;
- uint64_t alignment;
- uint64_t size;
- uint8_t* content;
-};
-
-typedef struct Elf_Segment_t Elf_Segment_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/Symbol.h b/vendor/lief/api/c/include/LIEF/ELF/Symbol.h
deleted file mode 100644
index 541caac..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/Symbol.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_SYMBOL_H_
-#define C_LIEF_ELF_SYMBOL_H_
-
-#include
-
-#include "LIEF/ELF/enums.h"
-#include "LIEF/types.h"
-/** @defgroup elf_symbol_c_api Symbol
- * @ingroup elf_c_api
- * @addtogroup elf_symbol_c_api
- * @brief Symbol C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Elf_Symbol_t {
- const char* name;
- enum LIEF_ELF_ELF_SYMBOL_TYPES type;
- enum LIEF_ELF_SYMBOL_BINDINGS binding;
- uint8_t information;
- uint8_t other;
- uint16_t shndx;
- uint64_t value;
- uint64_t size;
- bool is_exported; /**< Whether or not the symbol is exported */
- bool is_imported; /**< Whether or not the symbol is imported */
-};
-
-typedef struct Elf_Symbol_t Elf_Symbol_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/enums.h b/vendor/lief/api/c/include/LIEF/ELF/enums.h
deleted file mode 100644
index 986a85b..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/enums.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef LIEF_ELF_C_ENUMS_H_
-#define LIEF_ELF_C_ENUMS_H_
-#include "LIEF/ELF/undef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define _LIEF_EN(N) LIEF_ELF_##N // enum LIEF_N {
-#define _LIEF_EN_2(N, TYPE) LIEF_ELF_##N // enum LIEF_N {
-#define _LIEF_EI(X) LIEF_ELF_##X // LIEF_X
-
-#include "LIEF/ELF/enums.inc"
-
-#undef _LIEF_EN
-#undef _LIEF_EN_2
-#undef _LIEF_EI
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/ELF/utils.h b/vendor/lief/api/c/include/LIEF/ELF/utils.h
deleted file mode 100644
index cdb2b96..0000000
--- a/vendor/lief/api/c/include/LIEF/ELF/utils.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_ELF_UTILS_H_
-#define C_LIEF_ELF_UTILS_H_
-
-/** @defgroup elf_utils_c_api Utils
- * @ingroup elf_c_api
- * @addtogroup elf_utils_c_api
- * @brief Utils C API
- *
- * @{
- */
-
-#include
-
-#include "LIEF/visibility.h"
-#include "LIEF/types.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief Check if the given file is an ELF one. */
-LIEF_API bool is_elf(const char* file);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/LIEF.h b/vendor/lief/api/c/include/LIEF/LIEF.h
deleted file mode 100644
index 4f0ea40..0000000
--- a/vendor/lief/api/c/include/LIEF/LIEF.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_H_
-#define C_LIEF_H_
-
-#include
-#include
-#include
-#include
-
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO.h b/vendor/lief/api/c/include/LIEF/MachO.h
deleted file mode 100644
index 6e949a4..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_MACHO_H_
-#define C_LIEF_MACHO_H_
-
-//! @defgroup macho_c_api MachO C API
-
-#include "LIEF/MachO/Binary.h"
-#include "LIEF/MachO/Symbol.h"
-#include "LIEF/MachO/Segment.h"
-#include "LIEF/MachO/Section.h"
-#include "LIEF/MachO/LoadCommand.h"
-#include "LIEF/MachO/Header.h"
-#include "LIEF/MachO/EnumToString.h"
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO/Binary.h b/vendor/lief/api/c/include/LIEF/MachO/Binary.h
deleted file mode 100644
index ba4b642..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO/Binary.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_MACHO_BINARY_H_
-#define C_LIEF_MACHO_BINARY_H_
-
-/** @defgroup macho_binary_c_api Binary
- * @ingroup macho_c_api
- * @addtogroup macho_binary_c_api
- * @brief Binary C API
- *
- * @{
- */
-
-#include
-
-#include "LIEF/visibility.h"
-
-#include "LIEF/MachO/Header.h"
-#include "LIEF/MachO/LoadCommand.h"
-#include "LIEF/MachO/Symbol.h"
-#include "LIEF/MachO/Section.h"
-#include "LIEF/MachO/Segment.h"
-#include "LIEF/MachO/enums.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief LIEF::MachO::Binary C Handler */
-struct Macho_Binary_t {
- void* handler;
- const char* name;
- uint64_t imagebase;
- Macho_Header_t header;
- Macho_Command_t** commands;
- Macho_Symbol_t** symbols;
- Macho_Section_t** sections;
- Macho_Segment_t** segments;
-
-};
-
-typedef struct Macho_Binary_t Macho_Binary_t;
-
-/** @brief Wrapper on LIEF::MachO::Parser::parse */
-LIEF_API Macho_Binary_t** macho_parse(const char *file);
-
-LIEF_API void macho_binaries_destroy(Macho_Binary_t** binaries);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO/EnumToString.h b/vendor/lief/api/c/include/LIEF/MachO/EnumToString.h
deleted file mode 100644
index 3b99074..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO/EnumToString.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_MACHO_ENUM_TO_STRING_H_
-#define C_LIEF_MACHO_ENUM_TO_STRING_H_
-
-#include "LIEF/visibility.h"
-#include "LIEF/MachO/enums.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-LIEF_API const char* LOAD_COMMAND_TYPES_to_string(enum LIEF_MACHO_LOAD_COMMAND_TYPES e);
-LIEF_API const char* MACHO_TYPES_to_string(enum LIEF_MACHO_MACHO_TYPES e);
-LIEF_API const char* FILE_TYPES_to_string(enum LIEF_MACHO_FILE_TYPES e);
-LIEF_API const char* CPU_TYPES_to_string(enum LIEF_MACHO_CPU_TYPES e);
-LIEF_API const char* HEADER_FLAGS_to_string(enum LIEF_MACHO_HEADER_FLAGS e);
-LIEF_API const char* MACHO_SECTION_TYPES_to_string(enum LIEF_MACHO_MACHO_SECTION_TYPES e);
-LIEF_API const char* MACHO_SYMBOL_TYPES_to_string(enum LIEF_MACHO_MACHO_SYMBOL_TYPES e);
-LIEF_API const char* N_LIST_TYPES_to_string(enum LIEF_MACHO_N_LIST_TYPES e);
-LIEF_API const char* SYMBOL_DESCRIPTIONS_to_string(enum LIEF_MACHO_SYMBOL_DESCRIPTIONS e);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO/Header.h b/vendor/lief/api/c/include/LIEF/MachO/Header.h
deleted file mode 100644
index 99d853e..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO/Header.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_MACHO_HEADER_H_
-#define C_LIEF_MACHO_HEADER_H_
-#include
-
-#include "LIEF/MachO/enums.h"
-/** @defgroup macho_header_c_api Header
- * @ingroup macho_c_api
- * @addtogroup macho_header_c_api
- * @brief Header C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Macho_Header_t {
- uint32_t magic;
- enum LIEF_MACHO_CPU_TYPES cpu_type;
- uint32_t cpu_subtype;
- enum LIEF_MACHO_FILE_TYPES file_type;
- uint32_t nb_cmds;
- uint32_t sizeof_cmds;
- uint32_t flags;
- uint32_t reserved;
-};
-
-typedef struct Macho_Header_t Macho_Header_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO/LoadCommand.h b/vendor/lief/api/c/include/LIEF/MachO/LoadCommand.h
deleted file mode 100644
index 0cc933b..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO/LoadCommand.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_MACHO_LOAD_COMMAND_H_
-#define C_LIEF_MACHO_LOAD_COMMAND_H_
-#include
-
-#include "LIEF/MachO/enums.h"
-/** @defgroup macho_load_command_c_api Header
- * @ingroup macho_c_api
- * @addtogroup macho_load_command_c_api
- * @brief Load Command C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Macho_Command_t {
- enum LIEF_MACHO_LOAD_COMMAND_TYPES command;
- uint32_t size;
- uint8_t* data;
- uint32_t offset;
-};
-
-typedef struct Macho_Command_t Macho_Command_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO/Section.h b/vendor/lief/api/c/include/LIEF/MachO/Section.h
deleted file mode 100644
index 9423856..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO/Section.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_MACHO_SECTION_H_
-#define C_LIEF_MACHO_SECTION_H_
-#include
-
-#include "LIEF/MachO/enums.h"
-/** @defgroup macho_section_c_api Header
- * @ingroup macho_c_api
- * @addtogroup macho_section_c_api
- * @brief Section C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Macho_Section_t {
-
- const char* name;
- uint32_t alignment;
- uint32_t relocation_offset;
- uint32_t numberof_relocations;
- uint32_t flags;
- enum LIEF_MACHO_MACHO_SECTION_TYPES type;
- uint32_t reserved1;
- uint32_t reserved2;
- uint32_t reserved3;
- uint64_t virtual_address;
- uint64_t offset;
- uint64_t size;
- uint8_t* content;
- double entropy;
-};
-
-typedef struct Macho_Section_t Macho_Section_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO/Segment.h b/vendor/lief/api/c/include/LIEF/MachO/Segment.h
deleted file mode 100644
index 79a5154..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO/Segment.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_MACHO_SEGMENT_H_
-#define C_LIEF_MACHO_SEGMENT_H_
-#include
-
-#include "LIEF/MachO/enums.h"
-/** @defgroup macho_segment_c_api Header
- * @ingroup macho_c_api
- * @addtogroup macho_segment_c_api
- * @brief Segment C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Macho_Segment_t {
- const char* name;
- uint64_t virtual_address;
- uint64_t virtual_size;
- uint64_t file_size;
- uint64_t file_offset;
- uint32_t max_protection;
- uint32_t init_protection;
- uint32_t numberof_sections;
- uint32_t flags;
- uint8_t* content;
- uint64_t size;
- Macho_Section_t** sections;
-};
-
-typedef struct Macho_Segment_t Macho_Segment_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO/Symbol.h b/vendor/lief/api/c/include/LIEF/MachO/Symbol.h
deleted file mode 100644
index f74e654..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO/Symbol.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_MACHO_SYMBOL_H_
-#define C_LIEF_MACHO_SYMBOL_H_
-#include
-
-#include "LIEF/MachO/enums.h"
-/** @defgroup macho_symbol_c_api Header
- * @ingroup macho_c_api
- * @addtogroup macho_symbol_c_api
- * @brief Symbol C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Macho_Symbol_t {
- const char* name;
- uint8_t type;
- uint8_t numberof_sections;
- uint16_t description;
- uint64_t value;
-};
-
-typedef struct Macho_Symbol_t Macho_Symbol_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/MachO/enums.h b/vendor/lief/api/c/include/LIEF/MachO/enums.h
deleted file mode 100644
index 08c10c6..0000000
--- a/vendor/lief/api/c/include/LIEF/MachO/enums.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef LIEF_MACHO_C_ENUMS_H_
-#define LIEF_MACHO_C_ENUMS_H_
-#include "LIEF/MachO/undef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _LIEF_EN
- #undef _LIEF_EN
-#endif
-
-#ifdef _LIEF_EN_2
- #undef _LIEF_EN_2
-#endif
-
-#ifdef _LIEF_EI
- #undef _LIEF_EI
-#endif
-
-#define _LIEF_EN(N) LIEF_MACHO_##N // enum LIEF_N {
-#define _LIEF_EN_2(N, TYPE) LIEF_MACHO_##N // enum LIEF_N {
-#define _LIEF_EI(X) LIEF_MACHO_##X // LIEF_X
-
-#include "LIEF/MachO/enums.inc"
-
-#undef _LIEF_EN
-#undef _LIEF_EN_2
-#undef _LIEF_EI
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE.h b/vendor/lief/api/c/include/LIEF/PE.h
deleted file mode 100644
index ed0fcee..0000000
--- a/vendor/lief/api/c/include/LIEF/PE.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_H_
-#define C_LIEF_PE_H_
-
-//! @defgroup pe_c_api PE C API
-
-#include "LIEF/PE/Binary.h"
-#include "LIEF/PE/EnumToString.h"
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/Binary.h b/vendor/lief/api/c/include/LIEF/PE/Binary.h
deleted file mode 100644
index 67d3309..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/Binary.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_BINARY_H_
-#define C_LIEF_PE_BINARY_H_
-
-/** @defgroup pe_binary_c_api Binary
- * @ingroup pe_c_api
- * @addtogroup pe_binary_c_api
- * @brief Binary C API
- *
- * @{
- */
-
-#include
-
-#include "LIEF/visibility.h"
-
-#include "LIEF/PE/enums.h"
-
-#include "LIEF/PE/DosHeader.h"
-#include "LIEF/PE/Header.h"
-#include "LIEF/PE/OptionalHeader.h"
-#include "LIEF/PE/DataDirectory.h"
-#include "LIEF/PE/Section.h"
-#include "LIEF/PE/Import.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief LIEF::PE::Binary C Handler */
-struct Pe_Binary_t {
- void* handler;
- const char* name;
- Pe_DosHeader_t dos_header;
- Pe_Header_t header;
- Pe_OptionalHeader_t optional_header;
- Pe_DataDirectory_t** data_directories;
- Pe_Section_t** sections;
- Pe_Import_t** imports;
-};
-
-typedef struct Pe_Binary_t Pe_Binary_t;
-
-/** Wrapper on LIEF::PE::Parser::parse */
-LIEF_API Pe_Binary_t* pe_parse(const char *file);
-
-LIEF_API void pe_binary_destroy(Pe_Binary_t* binary);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/DataDirectory.h b/vendor/lief/api/c/include/LIEF/PE/DataDirectory.h
deleted file mode 100644
index 4118484..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/DataDirectory.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_DATA_DIRECTORY_H_
-#define C_LIEF_PE_DATA_DIRECTORY_H_
-
-#include
-
-#include "LIEF/PE/enums.h"
-/** @defgroup pe_data_directory_c_api Section
- * @ingroup pe_c_api
- * @addtogroup pe_data_directory_c_api
- * @brief Data directory C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Pe_DataDirectory_t {
- uint32_t rva;
- uint32_t size;
-};
-
-typedef struct Pe_DataDirectory_t Pe_DataDirectory_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/DosHeader.h b/vendor/lief/api/c/include/LIEF/PE/DosHeader.h
deleted file mode 100644
index 6df702f..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/DosHeader.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_DOS_HEADER_H_
-#define C_LIEF_PE_DOS_HEADER_H_
-#include
-
-#include "LIEF/ELF/enums.h"
-/** @defgroup pe_dos_header_c_api DosHeader
- * @ingroup pe_c_api
- * @addtogroup pe_dos_header_c_api
- * @brief Dos Header C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Pe_DosHeader_t {
- uint16_t magic ;
- uint16_t used_bytes_in_the_last_page;
- uint16_t file_size_in_pages;
- uint16_t numberof_relocation;
- uint16_t header_size_in_paragraphs;
- uint16_t minimum_extra_paragraphs;
- uint16_t maximum_extra_paragraphs;
- uint16_t initial_relative_ss;
- uint16_t initial_sp;
- uint16_t checksum;
- uint16_t initial_ip;
- uint16_t initial_relative_cs;
- uint16_t addressof_relocation_table;
- uint16_t overlay_number;
- uint16_t reserved[4];
- uint16_t oem_id;
- uint16_t oem_info;
- uint16_t reserved2[10];
- uint32_t addressof_new_exeheader;
-};
-
-typedef struct Pe_DosHeader_t Pe_DosHeader_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/EnumToString.h b/vendor/lief/api/c/include/LIEF/PE/EnumToString.h
deleted file mode 100644
index f89db52..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/EnumToString.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_ENUM_TO_STRING_H_
-#define C_LIEF_PE_ENUM_TO_STRING_H_
-
-#include "LIEF/visibility.h"
-
-#include "LIEF/PE/enums.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-LIEF_API const char* PE_TYPES_to_string(enum LIEF_PE_PE_TYPES e);
-LIEF_API const char* MACHINE_TYPES_to_string(enum LIEF_PE_MACHINE_TYPES e);
-LIEF_API const char* SUBSYSTEM_to_string(enum LIEF_PE_SUBSYSTEM e);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/Header.h b/vendor/lief/api/c/include/LIEF/PE/Header.h
deleted file mode 100644
index df310bb..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/Header.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_HEADER_H_
-#define C_LIEF_PE_HEADER_H_
-
-#include
-
-#include "LIEF/PE/enums.h"
-/** @defgroup pe_header_c_api Header
- * @ingroup pe_c_api
- * @addtogroup pe_header_c_api
- * @brief Header C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Pe_Header_t {
- uint8_t signature[4];
- enum LIEF_PE_MACHINE_TYPES machine;
- uint16_t numberof_sections;
- uint32_t time_date_stamp;
- uint32_t pointerto_symbol_table;
- uint32_t numberof_symbols;
- uint16_t sizeof_optional_header;
- uint16_t characteristics;
-};
-
-typedef struct Pe_Header_t Pe_Header_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/Import.h b/vendor/lief/api/c/include/LIEF/PE/Import.h
deleted file mode 100644
index 174b6b8..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/Import.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_IMPORT_H_
-#define C_LIEF_PE_IMPORT_H_
-
-#include
-
-#include "LIEF/PE/enums.h"
-#include "LIEF/PE/ImportEntry.h"
-
-/** @defgroup pe_import_c_api Import
- * @ingroup pe_c_api
- * @addtogroup pe_import_c_api
- * @brief Import C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Pe_Import_t {
- const char* name;
- uint32_t forwarder_chain;
- uint32_t timedatestamp;
- Pe_ImportEntry_t** entries;
- uint32_t import_address_table_rva;
- uint32_t import_lookup_table_rva;
-};
-
-typedef struct Pe_Import_t Pe_Import_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/ImportEntry.h b/vendor/lief/api/c/include/LIEF/PE/ImportEntry.h
deleted file mode 100644
index 1efcdba..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/ImportEntry.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_IMPORT_ENTRY_H_
-#define C_LIEF_PE_IMPORT_ENTRY_H_
-
-#include
-
-#include "LIEF/types.h"
-
-#include "LIEF/PE/enums.h"
-#include "LIEF/PE/ImportEntry.h"
-
-/** @defgroup pe_import_entry_c_api Import Entry
- * @ingroup pe_c_api
- * @addtogroup pe_import_entry_c_api
- * @brief Import Entry C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Pe_ImportEntry_t {
- bool is_ordinal;
- const char* name;
- uint16_t ordinal;
- uint64_t hint_name_rva;
- uint16_t hint;
- uint64_t iat_value;
- uint64_t data;
- uint64_t iat_address;
-};
-
-typedef struct Pe_ImportEntry_t Pe_ImportEntry_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/OptionalHeader.h b/vendor/lief/api/c/include/LIEF/PE/OptionalHeader.h
deleted file mode 100644
index f038e3b..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/OptionalHeader.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_OPTIONAL_HEADER_H_
-#define C_LIEF_PE_OPTIONAL_HEADER_H_
-#include
-
-#include "LIEF/PE/enums.h"
-/** @defgroup pe_optional_header_c_api OptionalHeader
- * @ingroup pe_c_api
- * @addtogroup pe_optional_header_c_api
- * @brief OptionalHeader C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Pe_OptionalHeader_t {
- enum LIEF_PE_PE_TYPES magic;
- uint8_t major_linker_version;
- uint8_t minor_linker_version;
- uint32_t sizeof_code;
- uint32_t sizeof_initialized_data;
- uint32_t sizeof_uninitialized_data;
- uint32_t addressof_entrypoint;
- uint32_t baseof_code;
- uint32_t baseof_data;
- uint64_t imagebase;
- uint32_t section_alignment;
- uint32_t file_alignment;
- uint16_t major_operating_system_version;
- uint16_t minor_operating_system_version;
- uint16_t major_image_version;
- uint16_t minor_image_version;
- uint16_t major_subsystem_version;
- uint16_t minor_subsystem_version;
- uint32_t win32_version_value;
- uint32_t sizeof_image;
- uint32_t sizeof_headers;
- uint32_t checksum;
- enum LIEF_PE_SUBSYSTEM subsystem;
- uint32_t dll_characteristics;
- uint64_t sizeof_stack_reserve;
- uint64_t sizeof_stack_commit;
- uint64_t sizeof_heap_reserve;
- uint64_t sizeof_heap_commit;
- uint32_t loader_flags;
- uint32_t numberof_rva_and_size;
-};
-
-typedef struct Pe_OptionalHeader_t Pe_OptionalHeader_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/Section.h b/vendor/lief/api/c/include/LIEF/PE/Section.h
deleted file mode 100644
index 3cb0341..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/Section.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 C_LIEF_PE_SECTION_H_
-#define C_LIEF_PE_SECTION_H_
-
-#include
-
-#include "LIEF/PE/enums.h"
-/** @defgroup pe_section_c_api Section
- * @ingroup pe_c_api
- * @addtogroup pe_section_c_api
- * @brief Section C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct Pe_Section_t {
- const char* name;
- uint64_t virtual_address;
- uint64_t size;
- uint64_t offset;
-
- uint32_t virtual_size;
- uint32_t pointerto_relocation;
- uint32_t pointerto_line_numbers;
- uint32_t characteristics;
-
- uint8_t* content;
- uint64_t content_size;
- double entropy;
-
-};
-
-typedef struct Pe_Section_t Pe_Section_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/PE/enums.h b/vendor/lief/api/c/include/LIEF/PE/enums.h
deleted file mode 100644
index 80c03be..0000000
--- a/vendor/lief/api/c/include/LIEF/PE/enums.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef LIEF_PE_C_ENUMS_H_
-#define LIEF_PE_C_ENUMS_H_
-#include "LIEF/PE/undef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define _LIEF_EN(N) LIEF_PE_##N // enum LIEF_N {
-#define _LIEF_EN_2(N, TYPE) LIEF_PE_##N // enum LIEF_N {
-#define _LIEF_EI(X) LIEF_PE_##X // LIEF_X
-
-#include "LIEF/PE/enums.inc"
-
-#undef _LIEF_EN
-#undef _LIEF_EN_2
-#undef _LIEF_EI
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/vendor/lief/api/c/include/LIEF/logging.h b/vendor/lief/api/c/include/LIEF/logging.h
deleted file mode 100644
index f3333ae..0000000
--- a/vendor/lief/api/c/include/LIEF/logging.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include
-#include "LIEF/visibility.h"
-
-#ifndef C_LIEF_LOGGING_H_
-#define C_LIEF_LOGGING_H_
-
-/** @defgroup logging_c_api Logging
- * @brief Logging C API
- *
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief Disable the logging module */
-LIEF_API void lief_logging_disable(void);
-
-/** @brief Enable the logging module globally*/
-LIEF_API void lief_logging_enable(void);
-
-/** @brief Update logging level */
-LIEF_API void lief_logging_set_level(uint32_t level);
-
-#ifdef __cplusplus
-}
-#endif
-
-/** @} */
-#endif
-
diff --git a/vendor/lief/api/c/include/LIEF/types.h b/vendor/lief/api/c/include/LIEF/types.h
deleted file mode 100644
index e767ed7..0000000
--- a/vendor/lief/api/c/include/LIEF/types.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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_C_TYPES_H_
-#define LIEF_C_TYPES_H_
-#include
-#ifndef __cplusplus
-#ifndef bool
-typedef int bool;
-#endif
-#endif
-#endif
diff --git a/vendor/lief/api/c/logging.cpp b/vendor/lief/api/c/logging.cpp
deleted file mode 100644
index 6f4b8d9..0000000
--- a/vendor/lief/api/c/logging.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LIEF/logging.hpp"
-#include "LIEF/logging.h"
-
-using namespace LIEF::logging;
-
-void lief_logging_disable(void) {
- disable();
-}
-
-void lief_logging_enable(void) {
- enable();
-}
-
-void lief_logging_set_level(uint32_t level) {
- set_level(static_cast(level));
-}
diff --git a/vendor/lief/api/python/ART/CMakeLists.txt b/vendor/lief/api/python/ART/CMakeLists.txt
deleted file mode 100644
index 422be7e..0000000
--- a/vendor/lief/api/python/ART/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-set(LIEF_PYTHON_ART_SRC
- "${CMAKE_CURRENT_LIST_DIR}/pyART.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/pyEnums.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/pyUtils.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pyHeader.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pyParser.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pyFile.cpp"
-)
-
-set(LIEF_PYTHON_ART_HDR
- "${CMAKE_CURRENT_LIST_DIR}/pyART.hpp")
-
-source_group("Source Files\\ART" FILES ${LIEF_PYTHON_ART_SRC})
-source_group("Header Files\\ART" FILES ${LIEF_PYTHON_ART_HDR})
-
-target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_ART_SRC}" "${LIEF_PYTHON_ART_HDR}")
-target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_LIST_DIR}/../")
-
-
diff --git a/vendor/lief/api/python/ART/objects/pyFile.cpp b/vendor/lief/api/python/ART/objects/pyFile.cpp
deleted file mode 100644
index ddd6a46..0000000
--- a/vendor/lief/api/python/ART/objects/pyFile.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LIEF/ART/File.hpp"
-#include "LIEF/ART/hash.hpp"
-
-#include "pyART.hpp"
-
-namespace LIEF {
-namespace ART {
-
-template
-using no_const_getter = T (File::*)(void);
-
-template
-using no_const_func = T (File::*)(P);
-
-template
-using getter_t = T (File::*)(void) const;
-
-template
-using setter_t = void (File::*)(T);
-
-template<>
-void create(py::module& m) {
-
- // File object
- py::class_(m, "File", "ART File representation")
-
- .def_property_readonly("header",
- static_cast>(&File::header),
- "Return the ART " RST_CLASS_REF(lief.ART.Header) "",
- py::return_value_policy::reference)
-
- .def("__eq__", &File::operator==)
- .def("__ne__", &File::operator!=)
- .def("__hash__",
- [] (const File& file) {
- return Hash::hash(file);
- })
-
- .def("__str__",
- [] (const File& file)
- {
- std::ostringstream stream;
- stream << file;
- std::string str = stream.str();
- return str;
- });
-}
-
-}
-}
diff --git a/vendor/lief/api/python/ART/objects/pyHeader.cpp b/vendor/lief/api/python/ART/objects/pyHeader.cpp
deleted file mode 100644
index 4aab5fc..0000000
--- a/vendor/lief/api/python/ART/objects/pyHeader.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "LIEF/ART/Header.hpp"
-#include "LIEF/ART/hash.hpp"
-
-#include "pyART.hpp"
-
-namespace LIEF {
-namespace ART {
-
-template
-using getter_t = T (Header::*)(void) const;
-
-template
-using setter_t = void (Header::*)(T);
-
-template<>
-void create(py::module& m) {
-
- py::class_(m, "Header", "ART Header representation")
- .def_property_readonly("magic",
- static_cast>(&Header::magic)
- )
- .def_property_readonly("version",
- static_cast>(&Header::version)
- )
- .def_property_readonly("image_begin",
- static_cast>(&Header::image_begin)
- )
- .def_property_readonly("image_size",
- static_cast>(&Header::image_size)
- )
- .def_property_readonly("oat_checksum",
- static_cast>(&Header::oat_checksum)
- )
- .def_property_readonly("oat_file_begin",
- static_cast>(&Header::oat_file_begin)
- )
- .def_property_readonly("oat_file_end",
- static_cast>(&Header::oat_file_end)
- )
- .def_property_readonly("oat_data_end",
- static_cast>(&Header::oat_data_end)
- )
- .def_property_readonly("patch_delta",
- static_cast>(&Header::patch_delta)
- )
- .def_property_readonly("image_roots",
- static_cast>(&Header::image_roots)
- )
- .def_property_readonly("pointer_size",
- static_cast>(&Header::pointer_size)
- )
- .def_property_readonly("compile_pic",
- static_cast>(&Header::compile_pic)
- )
- .def_property_readonly("nb_sections",
- static_cast>(&Header::nb_sections)
- )
- .def_property_readonly("nb_methods",
- static_cast>(&Header::nb_methods)
- )
- .def_property_readonly("boot_image_begin",
- static_cast>(&Header::boot_image_begin)
- )
- .def_property_readonly("boot_image_size",
- static_cast>(&Header::boot_image_size)
- )
- .def_property_readonly("boot_oat_begin",
- static_cast>(&Header::boot_oat_begin)
- )
- .def_property_readonly("boot_oat_size",
- static_cast>(&Header::boot_oat_size)
- )
- .def_property_readonly("storage_mode",
- static_cast>(&Header::storage_mode)
- )
- .def_property_readonly("data_size",
- static_cast>(&Header::data_size)
- )
-
- .def("__eq__", &Header::operator==)
- .def("__ne__", &Header::operator!=)
- .def("__hash__",
- [] (const Header& header) {
- return Hash::hash(header);
- })
-
- .def("__str__",
- [] (const Header& header)
- {
- std::ostringstream stream;
- stream << header;
- std::string str = stream.str();
- return str;
- });
-}
-}
-}
-
-
diff --git a/vendor/lief/api/python/ART/objects/pyParser.cpp b/vendor/lief/api/python/ART/objects/pyParser.cpp
deleted file mode 100644
index 2f06e5b..0000000
--- a/vendor/lief/api/python/ART/objects/pyParser.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "pyART.hpp"
-
-#include "LIEF/ART/Parser.hpp"
-
-#include
-
-namespace LIEF {
-namespace ART {
-
-template<>
-void create(py::module& m) {
-
- // Parser (Parser)
- m.def("parse",
- static_cast (*) (const std::string&)>(&Parser::parse),
- "Parse the given filename and return an " RST_CLASS_REF(lief.ART.File) " object",
- "filename"_a,
- py::return_value_policy::take_ownership);
-
- m.def("parse",
- static_cast (*) (std::vector, const std::string&)>(&Parser::parse),
- "Parse the given raw data and return an " RST_CLASS_REF(lief.ART.File) " object",
- "raw"_a, "name"_a = "",
- py::return_value_policy::take_ownership);
-
-
- m.def("parse",
- [] (py::object byteio, const std::string& name) {
- const auto& io = py::module::import("io");
- const auto& RawIOBase = io.attr("RawIOBase");
- const auto& BufferedIOBase = io.attr("BufferedIOBase");
- const auto& TextIOBase = io.attr("TextIOBase");
-
- py::object rawio;
-
-
- if (py::isinstance(byteio, RawIOBase)) {
- rawio = byteio;
- }
-
- else if (py::isinstance(byteio, BufferedIOBase)) {
- rawio = byteio.attr("raw");
- }
-
- else if (py::isinstance(byteio, TextIOBase)) {
- rawio = byteio.attr("buffer").attr("raw");
- }
-
- else {
- throw py::type_error(py::repr(byteio).cast().c_str());
- }
-
- std::string raw_str = static_cast(rawio.attr("readall")());
- std::vector raw = {
- std::make_move_iterator(std::begin(raw_str)),
- std::make_move_iterator(std::end(raw_str))};
-
- return LIEF::ART::Parser::parse(std::move(raw), name);
- },
- "io"_a, "name"_a = "",
- py::return_value_policy::take_ownership);
-}
-
-}
-}
diff --git a/vendor/lief/api/python/ART/pyART.cpp b/vendor/lief/api/python/ART/pyART.cpp
deleted file mode 100644
index ba9ee17..0000000
--- a/vendor/lief/api/python/ART/pyART.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "pyART.hpp"
-
-
-namespace LIEF {
-namespace ART {
-void init_python_module(py::module& m) {
- py::module LIEF_ART_module = m.def_submodule("ART", "Python API for ART format");
-
- init_enums(LIEF_ART_module);
- init_objects(LIEF_ART_module);
- init_utils(LIEF_ART_module);
-}
-
-
-void init_objects(py::module& m) {
- CREATE(Parser, m);
- CREATE(File, m);
- CREATE(Header, m);
-}
-
-}
-}
diff --git a/vendor/lief/api/python/ART/pyART.hpp b/vendor/lief/api/python/ART/pyART.hpp
deleted file mode 100644
index f61510a..0000000
--- a/vendor/lief/api/python/ART/pyART.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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 PY_LIEF_ART_H_
-#define PY_LIEF_ART_H_
-
-#include "LIEF/ART.hpp"
-
-#include "pyLIEF.hpp"
-
-#define SPECIALIZE_CREATE(X) \
- template<> \
- void create(py::module&)
-
-#define CREATE(X,Y) create(Y)
-
-
-namespace LIEF {
-namespace ART {
-
-template
-void create(py::module&);
-
-void init_python_module(py::module& m);
-
-void init_objects(py::module&);
-
-void init_enums(py::module&);
-
-void init_utils(py::module&);
-
-
-SPECIALIZE_CREATE(Parser);
-SPECIALIZE_CREATE(File);
-SPECIALIZE_CREATE(Header);
-
-}
-}
-
-
-#endif
diff --git a/vendor/lief/api/python/ART/pyEnums.cpp b/vendor/lief/api/python/ART/pyEnums.cpp
deleted file mode 100644
index 205d667..0000000
--- a/vendor/lief/api/python/ART/pyEnums.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "pyART.hpp"
-#include "LIEF/ART/enums.hpp"
-#include "LIEF/ART/EnumToString.hpp"
-
-#define PY_ENUM(x) to_string(x), x
-
-namespace LIEF {
-namespace ART {
-void init_enums(py::module& m) {
-
- py::enum_(m, "STORAGE_MODES")
- .value(PY_ENUM(STORAGE_MODES::STORAGE_UNCOMPRESSED))
- .value(PY_ENUM(STORAGE_MODES::STORAGE_LZ4))
- .value(PY_ENUM(STORAGE_MODES::STORAGE_LZ4HC));
-
-}
-}
-}
diff --git a/vendor/lief/api/python/ART/pyUtils.cpp b/vendor/lief/api/python/ART/pyUtils.cpp
deleted file mode 100644
index 69ff112..0000000
--- a/vendor/lief/api/python/ART/pyUtils.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include "pyART.hpp"
-
-#include "LIEF/ART/utils.hpp"
-
-namespace LIEF {
-namespace ART {
-
-void init_utils(py::module& m) {
-
- m.def("is_art",
- static_cast(&is_art),
- "Check if the **file** given in parameter is an ART",
- "path"_a);
-
- m.def("is_art",
- static_cast&)>(&is_art),
- "Check if the **raw data** given in parameter is a ART",
- "raw"_a);
-
- m.def("version",
- static_cast(&version),
- "Return the ART version of the **file** given in parameter",
- "file"_a);
-
- m.def("version",
- static_cast&)>(&version),
- "Return the ART version of the **raw data** given in parameter",
- "raw"_a);
-
-
- m.def("android_version",
- &android_version,
- "Return the " RST_CLASS_REF(lief.Android.ANDROID_VERSIONS) " associated with the given ART version ",
- "art_version"_a);
-}
-
-}
-}
-
diff --git a/vendor/lief/api/python/Abstract/CMakeLists.txt b/vendor/lief/api/python/Abstract/CMakeLists.txt
deleted file mode 100644
index 6075ed8..0000000
--- a/vendor/lief/api/python/Abstract/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-
-set(LIEF_PYTHON_ABSTRACT_SRC
- "${CMAKE_CURRENT_LIST_DIR}/pyAbstract.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pyBinary.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pyHeader.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pySection.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pyParser.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pySymbol.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pyRelocation.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/objects/pyFunction.cpp"
- "${CMAKE_CURRENT_LIST_DIR}/pyEnums.cpp"
-)
-
-
-set(LIEF_PYTHON_ABSTRACT_HDR
- "${CMAKE_CURRENT_LIST_DIR}/pyAbstract.hpp"
-)
-
-source_group("Source Files\\Abstract" FILES ${LIEF_PYTHON_ABSTRACT_SRC})
-source_group("Header Files\\Abstract" FILES ${LIEF_PYTHON_ABSTRACT_HDR})
-
-target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_ABSTRACT_SRC}" "${LIEF_PYTHON_ABSTRACT_HDR}")
-target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}")
-
-
diff --git a/vendor/lief/api/python/Abstract/objects/pyBinary.cpp b/vendor/lief/api/python/Abstract/objects/pyBinary.cpp
deleted file mode 100644
index 25c4ec7..0000000
--- a/vendor/lief/api/python/Abstract/objects/pyBinary.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/* Copyright 2017 - 2022 R. Thomas
- * Copyright 2017 - 2022 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.
- */
-#include
-#include
-
-#include "pyAbstract.hpp"
-#include "pyIterators.hpp"
-#include "pyErr.hpp"
-#include "LIEF/Abstract/Binary.hpp"
-
-
-#define PY_ENUM(x) LIEF::to_string(x), x
-
-namespace LIEF {
-
-template
-using getter_t = T (Binary::*)(void) const;
-
-template
-using setter_t = void (Binary::*)(T);
-
-template
-using it_t = T (Binary::*)(void);
-
-template
-using no_const_func = T (Binary::*)(P);
-
-template<>
-void create(py::module& m) {
- py::class_ pybinary(m, "Binary",
- R"delim(
- File format abstract representation.
-
- This object represents the abstraction of an executable file format.
- It enables to access common features (like the :attr:`~lief.Binary.entrypoint`) regardless
- of the concrete format (e.g. :attr:`lief.ELF.Binary.entrypoint`)
- )delim");
-
- py::enum_(pybinary, "VA_TYPES")
- .value(PY_ENUM(Binary::VA_TYPES::AUTO))
- .value(PY_ENUM(Binary::VA_TYPES::VA))
- .value(PY_ENUM(Binary::VA_TYPES::RVA));
-
- init_ref_iterator(pybinary, "it_sections");
- init_ref_iterator(pybinary, "it_symbols");
- init_ref_iterator(pybinary, "it_relocations");
-
- pybinary
- .def_property_readonly("format",
- &Binary::format,
- "File format " RST_CLASS_REF(lief.EXE_FORMATS) " of the underlying binary.")
-
- .def_property_readonly("is_pie",
- &Binary::is_pie,
- "Check if the binary is position independent")
-
- .def_property_readonly("has_nx",
- &Binary::has_nx,
- "Check if the binary has ``NX`` protection (non executable stack)")
-
- .def_property("name",
- static_cast>(&Binary::name),
- static_cast>(&Binary::name),
- "Binary's name")
-
- .def_property_readonly("header",
- &Binary::header,
- "Binary's abstract header (" RST_CLASS_REF(lief.Header) ")")
-
- .def_property_readonly("entrypoint",
- &Binary::entrypoint,
- "Binary's entrypoint")
-
- .def("remove_section",
- static_cast(&Binary::remove_section),
- "Remove the section with the given name",
- "name"_a, "clear"_a = false)
-
- .def_property_readonly("sections",
- static_cast