LIEF-0.9.0/000077500000000000000000000000001330725006400122375ustar00rootroot00000000000000LIEF-0.9.0/.appveyor.yml000066400000000000000000000122701330725006400147070ustar00rootroot00000000000000version: 0.7.{build} image: Visual Studio 2017 clone_folder: c:\projects\lief configuration: Release #clone_depth: 3 platform: - x86 - x64 #cache: # - rang_cpp_color-prefix -> CMakeLists.txt # - mbed_tls -> CMakeLists.txt # - libjson-prefix -> CMakeLists.txt # - easyloggingpp-prefix -> CMakeLists.txt # - tests\YAMLCPP -> tests\CMakeLists.txt # - tests\lief-samples -> tests\CMakeLists.txt # - tests\catch -> tests\CMakeLists.txt # - api\python\pybind11-prefix -> api\python\CMakeLists.txt environment: LIEF_AUTOMATIC_BUILDS_KEY: secure: TT7SXISIifq2/tf02n2ATgPj+Ky4Cjl3Fg44BAfyI4yRa4i87UAQIx5EFeV63+Xv2rhcU7JcMgl+An7QBrV6ofuQ9jxbuw+Gd1GqcCrAIyY= LIEF_AUTOMATIC_BUILDS_IV: secure: /S6Vbt3vEisoC81siFbkqOXQeVnwxLZZPMYp1r79G7h+HFjLlWUZSidxxpsAgHNE matrix: # Python 2.7 - PYTHON_VERSION: "2.7" PYTHON32_PATH: "C:\\Python27" PYTHON32_INCLUDE: "C:\\Python27\\include" PYTHON32_BINARY: "C:\\Python27\\python.exe" PYTHON32_LIBRARY: "C:\\Python27\\libs\\python27.lib" PYTHON64_PATH: "C:\\Python27-x64" PYTHON64_INCLUDE: "C:\\Python27-x64\\include" PYTHON64_BINARY: "C:\\Python27-x64\\python.exe" PYTHON64_LIBRARY: "C:\\Python27-x64\\libs\\python27.lib" LIEF_TEST_SHARED: "OFF" LIEF_TEST_STATIC: "ON" # Python 3.5 - PYTHON_VERSION: "3.5" PYTHON32_PATH: "C:\\Python35" PYTHON32_INCLUDE: "C:\\Python35\\include" PYTHON32_BINARY: "C:\\Python35\\python.exe" PYTHON32_LIBRARY: "C:\\Python35\\libs\\python35.lib" PYTHON64_PATH: "C:\\Python35-x64" PYTHON64_INCLUDE: "C:\\Python35-x64\\include" PYTHON64_BINARY: "C:\\Python35-x64\\python.exe" PYTHON64_LIBRARY: "C:\\Python35-x64\\libs\\python35.lib" LIEF_TEST_SHARED: "ON" LIEF_TEST_STATIC: "OFF" # Python 3.6 - PYTHON_VERSION: "3.6" PYTHON32_PATH: "C:\\Python36" PYTHON32_INCLUDE: "C:\\Python36\\include" PYTHON32_BINARY: "C:\\Python36\\python.exe" PYTHON32_LIBRARY: "C:\\Python36\\libs\\python36.lib" PYTHON64_PATH: "C:\\Python36-x64" PYTHON64_INCLUDE: "C:\\Python36-x64\\include" PYTHON64_BINARY: "C:\\Python36-x64\\python.exe" PYTHON64_LIBRARY: "C:\\Python36-x64\\libs\\python36.lib" LIEF_TEST_SHARED: "ON" LIEF_TEST_STATIC: "ON" matrix: fast_finish: true # set this flag to immediately finish build once one of the jobs fails. allow_failures: - platform: x86 configuration: Release - platform: x64 configuration: Release install: - ps: if ($env:PLATFORM -eq "x64") { $env:CMAKE_ARCH = "x64" } - ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_PATH = $env:PYTHON64_PATH } - ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_INCLUDE = $env:PYTHON64_INCLUDE } - ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_BINARY = $env:PYTHON64_BINARY } - ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_LIBRARY = $env:PYTHON64_LIBRARY } - ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_PATH = $env:PYTHON32_PATH } - ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_INCLUDE = $env:PYTHON32_INCLUDE } - ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_BINARY = $env:PYTHON32_BINARY } - ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_LIBRARY = $env:PYTHON32_LIBRARY } - set PATH=%PYTHON_PATH%;%PATH% # Upgrade pip - python.exe -m pip install --disable-pip-version-check --user --upgrade pip - python.exe -m pip install --upgrade setuptools build_script: - > cmake -A "%CMAKE_ARCH%" -DLIEF_TESTS=on -DLIEF_PYTHON_API=on -DLIEF_COMPILER_JOBS=4 -DPYTHON_VERSION=%PYTHON_VERSION% -DPYTHON_INCLUDE_DIR=%PYTHON_INCLUDE% -DPYTHON_EXECUTABLE=%PYTHON_BINARY% -DPYTHON_LIBRARY=%PYTHON_LIBRARY% -DLIEF_TEST_SHARED=%LIEF_TEST_SHARED% -DLIEF_TEST_STATIC=%LIEF_TEST_STATIC% - set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - cmake --build . --config Release --target lief_samples -- /v:m /logger:%MSBuildLogger% - cmake . - cmake --build . --config Release --target ALL_BUILD -- /v:m /logger:%MSBuildLogger% test_script: - cmake --build . --config Release --target lief_samples -- /v:m /logger:%MSBuildLogger% - cmake . - cmake --build . --config Release --target check-lief -- /v:m /logger:%MSBuildLogger% after_build: - cmake --build . --config Release --target package -- /v:m /logger:%MSBuildLogger% - cd api\python - python.exe .\setup.py bdist_egg && exit 0 # Ignore warnings... - ps: if ($env:APPVEYOR_REPO_TAG -eq "true") { python.exe .\setup.py sdist --formats=zip } # Ignore warnings... - ps: if ($env:APPVEYOR_REPO_TAG -eq "false") { python.exe .\setup.py sdist --dev --formats=zip } # Ignore warnings... - cd ..\.. - bash ./.github/deploy.sh artifacts: - path: '*.zip' name: sdk - path: 'api\python\dist\*.zip' name: python-src - path: 'api\python\dist\*.egg' name: python-egg deploy: description: "LIEF version $(APPVEYOR_REPO_TAG_NAME)" provider: GitHub auth_token: secure: FU9CGrZ1lm0VDHUZg6zvTL4tidluDvRegVUTehCRo2xgiOv6NZePi7TdSy5CsOdG artifact: sdk;python-src;python-egg draft: false prerelease: false force_update: true on: appveyor_repo_tag: true # deploy on tag push only LIEF-0.9.0/.dockerignore000066400000000000000000000001221330725006400147060ustar00rootroot00000000000000* !src !doc !tests !include !examples !api !CMakeLists.txt !CMakeModules !package LIEF-0.9.0/.github/000077500000000000000000000000001330725006400135775ustar00rootroot00000000000000LIEF-0.9.0/.github/deploy-key.enc000066400000000000000000000062601330725006400163540ustar00rootroot00000000000000p? ij 9?:? }۴rʶ cKtf2kPv# z?&+Vlqlyzju뎨un= 2W +%t*R}5tV#fʈYŀU 5Ziɣ;ldt< uoԂ !8/pM;:.\ ]dGS DڹRߔ1qd5™%frCSm0u=(#Y[cT +rYĠnloT1@)U)v@aw1 CWplN*RG5& /a?g/EgRm{}ug |>R 1_5H6AL.@6bD!ޘ."tC \A&s2ZI^@̛<-*~QN#GU>*`<ޯ/St}׷ߗJCX2\9銄X/~=zs\u`]]LVhW ˯+_dxXC_(rXq|גwV&LgH\!7a\Z#}N8F` #Er7yZkeò\*@7=)=/&Iփz Ć5H V(Zgk)h|b(-53)%]iU ݹ0gΐEr`&sN0|TDMh4,(&)Ixǡ3A: z4-D|z%ʢnS;oĄx‰{2 B2 )bÒ+HFs8u|W:s梋: $$V܏ Φ*w3]4dIPvf ,;iH(hX`ɸ\…e^U]+Kq" I x$3"o:4DzU\+qۉ~0n2$0\z.{dUKmџ G]]/kɏYx*+prG;$C5u|DPo3K-Yu0>IKK1E3L_SiKCb92Zmk}5N]\l8R|&}z 5۵Z9I)[2F9|(Zzv?F7 ë9$4J$I&<݀KN4/CϚ;{?4}3+}I'J^nzY_y8ZP~kA)'Lɩ]{g3\ѷR#ʮF N`Q _;l%t[!𺞕1:r ] ~g:m3i&~Fdi9(9;aqޫ&ڋ.(^'!N4DRcK4RRz "N_.f5:Z(îXmMu QdL LN<>jYfjQO9sp'Ien@w'#b A‡_q.sozY|-dS> zQ^甊H&U?Sh,"tCLd\f K\k2RVQMSjYAlrmCrR"%e8-Ct>aVxzYk+MZX@`p}f>bP4<`v=Ic C bl<ڥ!ǝ-;:?tPәd 5VFFFw@-죙SRahJeڡQ@M`_趽t9ڧ8Ѵ-d\$%xA819ÝU U7dCN7'kLx?G-j2c dm!}0F̾q Ywփ<5+u l}A_1,a;fMThʒ]\ZȢ`.|8TH:}1KMGc+| N·4!L0qM!F-ͣ= B0žC_RG{4- T0<ا6"(0/]tH2l0ETH7c0q^Ј ?̵e3ڢsh OQt`x0Ÿj$0^ǟ&72FPy%'k=@Wޱ$T/A2X1oW6ua, OyܩD7ՈJ?@ϓ4)2`퓌B?-w"h0>՞Li8926QVs bК@nn8-Ae4g Zu]~$)Â)A)(a7ġ&}͸g&akdAGSDqh,8=N')eR0P Cu,c:>SuUi#v?bH+xovACS@$ -Ԋ3|}:cB^ψX 1-7QKxN_o40{ZȠ2ג!ۯƗ$K2sH#^csiNҲ߶pAiDYrGC(S}qYTk%'kM[wakB5*ȮI,qq՚͵d]J`_ك>o"cwj**u@]^Xe{JTndLEtCnhLmC0P%~O&3ޚ+8xZrxF<#`=U&ޱqvv1H7Dcl|aC3ҾbɻCfZV=Vqz?TܕF Gӫ`OjKR ՙ/GBjt?oV6夽D<:+.X1%" 4e8q}4VwN|P j,&7cr˼ӽI? Kz[mIL7B"!ءQ/ԊXi }+hH}{̸xoqB$F'i?LIEF-0.9.0/.github/deploy.sh000066400000000000000000000102221330725006400154240ustar00rootroot00000000000000#! /bin/bash ## vim:set ts=4 sw=4 et: # # Automatic build of LIEF # Repo: https://github.com/lief-project/packages # Mostly inspired by https://github.com/upx/upx-automatic-builds set -e; set -o pipefail if [[ $TRAVIS_OS_NAME == osx ]]; then argv0=$0; argv0abs=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0abs") else argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs") fi set -x # debug if [[ $TRAVIS_OS_NAME == osx ]]; then # use GNU coreutils ("brew install coreutils") date() { gdate "$@" } readlink() { greadlink "$@" } sha256sum() { gsha256sum "$@" } fi if [[ -n $APPVEYOR_JOB_ID ]]; then openssl() { /usr/bin/openssl "$@" } sort() { /usr/bin/sort "$@" } fi fix_home_ssh_perms() { if [[ -d ~/.ssh ]]; then if [[ -x /usr/sbin/restorecon ]]; then /usr/sbin/restorecon -v -R ~/.ssh || true fi chmod -c -R go-rwx ~/.ssh || true fi } # ================= # SETUP BRANCH NAME # ================= branch= if [[ -n $APPVEYOR_JOB_ID ]]; then branch=$APPVEYOR_REPO_BRANCH if [[ -n $APPVEYOR_PULL_REQUEST_NUMBER ]]; then exit 0; fi else branch=$TRAVIS_BRANCH if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi fi case $branch in devel*) ;; master*) ;; deploy*) ;; *) exit 0;; esac # get $rev, $branch and $git_user LIEF_SRCDIR= [[ -z $LIEF_SRCDIR ]] && LIEF_SRCDIR=$(readlink -mn -- $argv0dir/..) cd / && cd $LIEF_SRCDIR || exit 1 rev=$(git rev-parse --verify HEAD) timestamp=$(git log -n1 --format='%at' $rev) date=$(TZ=UTC0 date -d "@$timestamp" '+%Y%m%d-%H%M%S') #branch="$branch-$date-${rev:0:6}" branch="lief-$branch-latest" if [[ -n $APPVEYOR_JOB_ID ]]; then branch="$branch" git_user="AppVeyor CI" else branch="$branch" git_user="Travis CI" fi unset timestamp date # ======================== # SETUP 'deploy' DIRECTORY # ======================== if [[ -n $APPVEYOR_JOB_ID ]]; then [[ -z $LIEF_BUILDDIR ]] && LIEF_BUILDDIR=$(readlink -mn -- .) else [[ -z $LIEF_BUILDDIR ]] && LIEF_BUILDDIR=$(readlink -mn -- ./build) fi echo $LIEF_BUILDDIR cd / && cd $LIEF_BUILDDIR || exit 1 mkdir deploy || exit 1 chmod 700 deploy cd deploy || exit 1 # ================== # CLONE - ADD - PUSH # ================== new_branch=0 if ! git clone -b "$branch" --single-branch https://github.com/lief-project/packages.git; then git clone -b master --single-branch https://github.com/lief-project/packages.git new_branch=1 fi cd packages || exit 1 chmod 700 .git git config user.name "$git_user" git config user.email "lief@quarkslab.com" if [[ $new_branch == 1 ]]; then git checkout --orphan "$branch" git reset --hard || true fi git reset --soft `git rev-list --all | tail -1` git ls-files -v /bin/cp -rf $LIEF_BUILDDIR/api/python/dist/*.zip . /bin/cp -rf $LIEF_BUILDDIR/api/python/dist/*.egg . if [[ -n $APPVEYOR_JOB_ID ]]; then /bin/cp -rf $LIEF_BUILDDIR/*.zip . else /bin/cp -rf $LIEF_BUILDDIR/*.tar.gz . fi git add . if git diff --cached --exit-code --quiet >/dev/null; then # nothing to do ??? exit 0 fi now=$(date '+%s') git commit --date="$now" -m "Automatic build - ${rev:0:7} - Python ${PYTHON_VERSION}" git ls-files -v git log --pretty=fuller umask 077 [[ -d ~/.ssh ]] || mkdir ~/.ssh fix_home_ssh_perms repo=$(git config remote.origin.url) ssh_repo=${repo/https:\/\/github.com\//git@github.com:} eval $(ssh-agent -s) set +x # IMPORTANT openssl aes-256-cbc -K $LIEF_AUTOMATIC_BUILDS_KEY -iv $LIEF_AUTOMATIC_BUILDS_IV -in "$LIEF_SRCDIR/.github/deploy-key.enc" -out .git/deploy-key -d set -x chmod 600 .git/deploy-key ssh-add .git/deploy-key fix_home_ssh_perms ssh-keyscan -H github.com >> ~/.ssh/known_hosts fix_home_ssh_perms # let i=0 || true while true; do if [[ $i -ge 10 ]]; then echo "ERROR: git push failed" exit 1 fi if [[ $new_branch == 1 ]]; then if git push --force -u $ssh_repo "$branch"; then break; fi else if git push --force $ssh_repo "$branch"; then break; fi fi git branch -a -v git fetch -v origin "$branch" git branch -a -v git rebase -s recursive -X theirs FETCH_HEAD git branch -a -v sleep $((RANDOM % 5 + 1)) let i+=1 done exit 0 LIEF-0.9.0/.github/images/000077500000000000000000000000001330725006400150445ustar00rootroot00000000000000LIEF-0.9.0/.github/images/architecture.png000066400000000000000000004217001330725006400202400ustar00rootroot00000000000000PNG  IHDRy1bKGD pHYs  tIME &: IDATxwT-gwg+((ŮIDƖZRL4&ySԘFMh&VTP,4Ez]:;1!1">ϣ<;{Ν̜=w4B!B!.M B!BH@!B!B!B!B!B!!B!BH@!B!B!B!'eJ!GGG[neƍדOyy9%%%x<(HRDQZ[[ ۶)//gܸqQB~BSJ)i!#QQQ#cD"ƏϘ1cäR),4M<4uMp]um˲H(z|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A7t3K m%bBZ|IypBن 92E+ㆂ\h s.gyL,k["7sۼ7߈o|j؂K}W*Io| r.Q5IǹTn_TJߞ{wNLds mC/IGUOxz+jop!Ύq>!.$Imǹ90Xrtbq/Ԡ)w΋<ιeMjo]Hzt| p1mlGOxF)\EoJv .wKu$6\W[s r>Q7?p@mBf,R>+YĖ[;In93-$M!F pD8cㆂ\h sqΐ!nHnj{r]"Ρ\[>m(D[7\|/|GySj|GQN=…nIJĸ BœDkGy ,t3jyB[BzB|Iۤ_8Pjp}!%¥R2qAN:IGZؤ̐bBTpKR7&Sm1ѓP<~JCc .>ypB\\os.gWu *͖|T/YQ.$̹:H7RY\(t3r7V{xKy<#JDm!Nz+'ITQ.6ιFyQȌJ*-d-wxKF|?&"!Djpp)C\Vtr1aN*ID;AۥI)f;1&߹Dpnn[m'x&B%l%چs qSƸA.4ƹԡdȩ\%6D6Ж*D7c&s7׭7p{J!pSp%Jbkra.E5LIYNw:/kj o9ވo"O# Ɇ/ l( и 䮷Ron9Bw)}to06FGS6Osu!wõ;H-7\]W󙵇%[B.2dB q!.G+&Vb-?hX뤶b6Jm o>-4M9I=d.L )cEIENDB`LIEF-0.9.0/.github/trigger_docker.py000066400000000000000000000074121330725006400171470ustar00rootroot00000000000000#!/usr/bin/env python3.6 # Launch Docker CI when committing # Inspired from https://medium.com/@zypherman/my-experiences-with-travis-ci-7f5ea26a87c0 import requests import json import time import sys import logging import pprint import os LOG_LEVEL = logging.INFO logging.getLogger().addHandler(logging.StreamHandler()) logging.getLogger().setLevel(LOG_LEVEL) logger = logging.getLogger(__name__) AUTH_TOKEN = os.getenv("TRAVIS_TOKEN", sys.argv[1] if len(sys.argv) > 1 else None) if not AUTH_TOKEN: logger.fatal("No token found!") sys.exit(1) LIEF_ID = 12579556 DOCKER_ID = 15139981 ENDPOINT = 'https://api.travis-ci.org' LIEF = f"{ENDPOINT}/repo/{LIEF_ID}" DOCKER = f"{ENDPOINT}/repo/{DOCKER_ID}" DOCKER_ENV_VARS_ENDPOINT = f"{DOCKER}/env_vars" headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'User-Agent': 'API Explorer', 'Travis-API-Version': '3', 'Authorization': f'token {AUTH_TOKEN}' } def last_docker_build(): response = requests.get(f"{DOCKER}/branch/master", headers=headers) if not response.ok: logging.error("Error while getting last_docker_build") sys.exit(1) href = response.json()["last_build"]["@href"] build_info = requests.get(f"{ENDPOINT}{href}", headers=headers) if not build_info.ok: logging.error("Error while getting build_info") sys.exit(1) return build_info.json() def trigger_build(): response = requests.get(f"{DOCKER}/branch/master", headers=headers) build_info = last_docker_build() pprint.pprint(build_info) # Get last build info last_build_id = build_info["id"] last_build_status = build_info["state"] # Create env variables env_vars = [ { "env_var.name": "TRIGGER_COMMIT", "env_var.value": os.getenv("TRAVIS_COMMIT"), "env_var.public": False, }, { "env_var.name": "TRIGGER_REPO", "env_var.value": os.getenv("TRAVIS_REPO_SLUG"), "env_var.public": False, }, { "env_var.name": "TRIGGER_ACTION", "env_var.value": "build-doc", "env_var.public": False, }, { "env_var.name": "DEPENDENT_BUILD", "env_var.value": "true", "env_var.public": False, }, ] env_vars_results = requests.get(DOCKER_ENV_VARS_ENDPOINT, headers=headers) if not env_vars_results.ok: logger.error("Error while getting Docker env variables") sys.exit(1) env_vars_remote = env_vars_results.json()["env_vars"] # Set env variables for env_var in env_vars: remote_var = next(filter(lambda v : v["name"] == env_var["env_var.name"], env_vars_remote), None) if remote_var: r = requests.patch(f"{DOCKER}/env_var/{remote_var['id']}", data=json.dumps(env_var), headers=headers) if not r.ok: loggger.error(f"Error while setting variable: '{remote_var['name']}'") sys.exit(1) else: result = requests.post(DOCKER_ENV_VARS_ENDPOINT, data=json.dumps(env_var), headers=headers) if not result.ok: loggger.error(f"Error while setting variable: '{env_var['env_var.name']}'") sys.exit(1) # (Re)Start build result = requests.post(f"{ENDPOINT}/build/{last_build_id}/restart", headers=headers) if not result.ok: logger.error("Error while restarting the build") sys.exit(1) return 0 def main(): is_pull_request = not (os.getenv("TRAVIS_PULL_REQUEST", "false") == "false") if is_pull_request: logger.info("Skipping pull request build...") return 0 return trigger_build() if __name__ == "__main__": sys.exit(main()) LIEF-0.9.0/.travis.yml000066400000000000000000000227451330725006400143620ustar00rootroot00000000000000language: cpp git: depth: false matrix: include: # Linux gcc 5.0 - Python 2.7 - os: linux dist: trusty compiler: gcc addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: ['g++-5', 'ccache', 'libpython2.7'] env: > [ CXX_COMPILER=g++-5 , C_COMPILER=gcc-5 , PYTHON_VERSION=2.7 , PYTHON_INCLUDE_DIR=/usr/include/python2.7 , PYTHON_LIBRARY=/usr/lib/libpython2.7.so , PYTHON_BINARY=/usr/bin/python2.7 , LIEF_TEST_STATIC=ON , LIEF_TEST_SHARED=OFF , ] # Linux gcc 5.0 - Python 3.5 - os: linux dist: trusty compiler: gcc addons: apt: sources: ['ubuntu-toolchain-r-test', 'deadsnakes'] packages: ['g++-5', 'gcc-5', 'ccache', 'python3.5-dev'] env: > [ CXX_COMPILER=g++-5 , C_COMPILER=gcc-5 , PYTHON_VERSION=3.5 , PYTHON_INCLUDE_DIR=/usr/include/python3.5m , PYTHON_LIBRARY=/usr/lib/libpython3.5m.so , PYTHON_BINARY=/usr/bin/python3.5 , LIEF_TEST_STATIC=OFF , LIEF_TEST_SHARED=ON , ] # Linux gcc 6 - Python 3.6 - os: linux dist: trusty compiler: gcc addons: apt: sources: ['ubuntu-toolchain-r-test', 'deadsnakes'] packages: ['g++-6', 'gcc-6', 'ccache', 'python3.6-dev'] env: > [ CXX_COMPILER=g++-6 , C_COMPILER=gcc-6 , PYTHON_VERSION=3.6 , PYTHON_INCLUDE_DIR=/usr/include/python3.6m , PYTHON_LIBRARY=/usr/lib/libpython3.6m.so , PYTHON_BINARY=/usr/bin/python3.6 , LIEF_TEST_STATIC=ON , LIEF_TEST_SHARED=ON , ] # OSX 10.11 - xcode 7.3 - Python 2.7 - os: osx osx_image: xcode7.3 compiler: clang env: > [ CXX_COMPILER=clang++ , C_COMPILER=clang , PYTHON_VERSION=2.7 , LIEF_TEST_STATIC=ON , LIEF_TEST_SHARED=OFF , ] # OSX 10.12 - xcode 8.2 - Python 3.5 - os: osx osx_image: xcode8.2 compiler: clang env: > [ CXX_COMPILER=clang++ , C_COMPILER=clang , PYTHON_VERSION=3.5 , LIEF_TEST_STATIC=OFF , LIEF_TEST_SHARED=ON , ] ## OSX 10.12 - xcode 8.2 - Python 3.6 - os: osx osx_image: xcode8.2 compiler: clang env: > [ CXX_COMPILER=clang++ , C_COMPILER=clang , PYTHON_VERSION=3.6 , LIEF_TEST_STATIC=ON , LIEF_TEST_SHARED=ON , ] #branches: # only: # - master notifications: email: on_success: never on_failure: always sudo: required cache: - apt - ccache - $HOME/.pyenv - build/rang_cpp_color-prefix - build/mbed_tls - build/libjson-prefix - build/easyloggingpp-prefix - build/tests/YAMLCPP - build/tests/lief-samples - build/tests/catch - build/api/python/pybind11-prefix before_install: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -q; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install python-setuptools; fi - export CC="$C_COMPILER" - export CXX="$CXX_COMPILER" - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PREFIX="/usr/local"; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ccache; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PYTHON_CONFIGURE_OPTS="--enable-shared --enable-unicode=ucs2"; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then pyenv root; fi - if [ "$TRAVIS_OS_NAME" == "osx" ]; then pyenv install --list ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then pyenv install 2.7.12; fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then pyenv install 3.5.0; fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then pyenv install 3.6.0; fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/2.7.12/include/python2.7 ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/2.7.12/lib/libpython2.7.dylib ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/2.7.12/bin/python2.7 ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then $PYTHON_BINARY -m pip install --upgrade pip ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then $PYTHON_BINARY -m pip install --upgrade setuptools ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/3.5.0/include/python3.5m ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/3.5.0/lib/libpython3.dylib ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/3.5.0/bin/python3.5 ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/3.6.0/include/python3.6m ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/3.6.0/lib/libpython3.dylib ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/3.6.0/bin/python3.6 ;fi install: - if [ "$GCOV" == "ON" ]; then sudo ln -sf /usr/bin/gcov-5 /usr/bin/gcov; fi - if [ "$GCOV" == "ON" ]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz; fi - if [ "$GCOV" == "ON" ]; then tar xf lcov_1.13.orig.tar.gz; fi - if [ "$GCOV" == "ON" ]; then sudo make -C lcov-1.13/ install; fi # Setup CMake 3.1 for Linux - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget --no-check-certificate http://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz ;fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar -xzf cmake-3.7.2-Linux-x86_64.tar.gz ;fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=$PWD/cmake-3.7.2-Linux-x86_64/bin:$PATH ;fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py ;fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo $PYTHON_BINARY ./get-pip.py ;fi # Prepare build - mkdir build - cd build script: - > cmake -DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DPYTHON_VERSION=$PYTHON_VERSION -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR -DPYTHON_LIBRARY=$PYTHON_LIBRARY -DPYTHON_EXECUTABLE=$PYTHON_BINARY -DLIEF_TESTS=on -DLIEF_PYTHON_API=on -DLIEF_EXAMPLES=on -DLIEF_TEST_SHARED=$LIEF_TEST_SHARED -DLIEF_TEST_STATIC=$LIEF_TEST_STATIC .. - make -j3 lief_samples - cmake .. - make -j3 all - make -j3 check-lief #- sudo make check-lief after_success: - make package - sudo $PYTHON_BINARY -m pip install setuptools - sudo $PYTHON_BINARY -m pip install requests - sudo $PYTHON_BINARY -m pip install --upgrade setuptools - cd api/python - $PYTHON_BINARY setup.py bdist_egg - if [[ -z "$TRAVIS_TAG" ]]; then $PYTHON_BINARY setup.py sdist --dev --formats=zip ;fi - if [[ -n "$TRAVIS_TAG" ]]; then $PYTHON_BINARY setup.py sdist --formats=zip ;fi - cd $TRAVIS_BUILD_DIR - bash ./.github/deploy.sh - if [[ "$TRAVIS_OS_NAME" == "linux" && "$PYTHON_VERSION" == "3.6" ]]; then $PYTHON_BINARY ./.github/trigger_docker.py ;fi deploy: provider: releases api_key: - secure: "RlyaagAWt1BrcOBDSpmOnP+/FYUJqQiURlWw7JWvuBBWBDPBta+WI1zZvH6x5H+1bm8F77LrGdU1mRES/MAlhzb8o/VHgOAFhu2si/A+A7Xa9fAIOQw12jcGbtZQUQ7HCkRfa5VGrW4IlMI5+FJ7uFUU2lLoWOsA3u8pLEwApbdiB/LmtEY+kKhXzX0bT3h9cZATDWTeEoopXOseaBmTFC9IUATE3Ht1wVP49wXRUZHNJA10PJILbKtR1OITCAKm0iu1rVdLhoMzqH3T2dXDZ5ykF9TuYQaXJzKMFHaAeSe135JYOiIEWUUiif80q/mTWXiJAQ6gQXXOyDVu6R0Hi03TKsWXPlEKDBpDCRDu58I2hJyxsc5MPbFg8IAjraXkOLIQkIpgBOfV0JYVihikOLTfbCBKO+w9RFwrEVy91YsKCDosEAUa9p5nyRoV+k9Epmr/2atlHY8z7RyycB2fNQv3/NkHX8jZesiUFUwu5SHaZD76mKGELEZlf7LW8XwL4Cwfa2OB2vsKFcN1qyGUmXS57MODVBAUubQY4oTFwFJJUv28s06KA6BfZE4QqAeWoRSslDr9ORLUlsHHoCpZrAAY0uyl8kff/jL8IJMd8qng9bBTLu8hiK0yyQWKkebMvMWXhvAjssXeqWt3OeL2mssbUG5N1pXt6eHFmQvxqzs=" file_glob: true file: - ${TRAVIS_BUILD_DIR}/build/api/python/dist/*.egg - ${TRAVIS_BUILD_DIR}/build/api/python/dist/*.zip - ${TRAVIS_BUILD_DIR}/build/*.tar.gz skip_cleanup: true on: #branch: master tags: true LIEF-0.9.0/AUTHORS000066400000000000000000000000621330725006400133050ustar00rootroot00000000000000Authors: Romain Thomas LIEF-0.9.0/Acknowledgements000066400000000000000000000013111330725006400154500ustar00rootroot00000000000000Acknowledgements ---------------- LIEF makes use of the following open source projects: - mbedTLS - https://tls.mbed.org/ - pybind11 - https://github.com/pybind/pybind11 - 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 - 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 The logo is designed by Freepik LIEF-0.9.0/CHANGELOG000066400000000000000000000000641330725006400134510ustar00rootroot00000000000000Changelog ========= see doc/sphinx/changelog.rst LIEF-0.9.0/CMakeLists.txt000066400000000000000000000355121330725006400150050ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.6) set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Modules list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") include(CheckCXXCompilerFlag) include(CheckCCompilerFlag) include(Findcppcheck) include(CppcheckTargets) include(ExternalProject) find_package(Git REQUIRED) # Information from git # ==================== include(LIEFGit) # LIEF Project # ============ project(LIEF VERSION ${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH}) message(STATUS "${PROJECT_NAME} ${PROJECT_VERSION}") # LIEF options # ============= include(LIEFOptions) # Compiler detection (C++14, C++17, ...) include(LIEFCompilerDetection) # CCACHE # ====== find_program(CCACHE_FOUND ccache) message(STATUS "ccache: ${LIEF_USE_CCACHE}") if(CCACHE_FOUND AND LIEF_USE_CCACHE) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() # Dependencies # ============ set(THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/") include(LIEFDependencies) # LIEF Source definition # ====================== 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) if (LIEF_LOGGING) set_source_files_properties(${ELG_SOURCE_DIR}/easylogging++.cc PROPERTIES GENERATED TRUE) #set_source_files_properties(${ELG_SOURCE_DIR}/easylogging++.cc PROPERTIES COMPILE_FLAGS -Wno-unused-variable) #set_source_files_properties(${ELG_SOURCE_DIR}/easylogging++.h PROPERTIES COMPILE_FLAGS -Wno-unused-variable) set(ELG_CC_PATH "${ELG_SOURCE_DIR}/easylogging++.cc") endif() set(LIEF_PRIVATE_INCLUDE_DIR) set(LIEF_PUBLIC_INCLUDE_DIR) set(LIEF_PUBLIC_INCLUDE_FILES) set(LIEF_PRIVATE_INCLUDE_FILES) set(LIBLIEF_SOURCE_FILES "${ELG_CC_PATH}" "${mbedtls_src_crypto}" "${mbedtls_src_x509}" "${mbedtls_src_tls}" "${LIBFUZZER_SRC_FILES}" "${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/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/Convert.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/visitors/hash.cpp") # Grouping basic headers together # =============================== set(LIEF_INC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/Builder.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/utf8.h" "${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/Convert.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_SOURCE_DIR}/include/LIEF/json.hpp" "${LIBJSON_SOURCE_DIR}/json.hpp" ) if (LIEF_ENABLE_JSON) list(APPEND LIBLIEF_SOURCE_FILES "${LIEF_JSON_SRC}") list(APPEND LIEF_INC_FILES "${LIEF_JSON_HDR}") list(APPEND LIEF_PUBLIC_INCLUDE_DIR "${LIBJSON_SOURCE_DIR}/") 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}) add_library(LIB_LIEF_STATIC STATIC ${LIBLIEF_SOURCE_FILES} ${LIEF_INCLUDE_FILES}) # Static one if(LIEF_SHARED_LIB) add_library(LIB_LIEF_SHARED SHARED ${LIBLIEF_SOURCE_FILES} ${LIEF_INCLUDE_FILES}) # Shared one else() add_library(LIB_LIEF_SHARED SHARED EXCLUDE_FROM_ALL ${LIBLIEF_SOURCE_FILES} ${LIEF_INCLUDE_FILES}) # Shared one endif() if(WINDOWS) target_link_libraries(LIB_LIEF_SHARED ws2_32) endif() target_compile_definitions(LIB_LIEF_STATIC PRIVATE -DLIEF_STATIC) target_compile_definitions(LIB_LIEF_SHARED PRIVATE -DLIEF_EXPORTS) if (LIEF_SUPPORT_CXX14) target_compile_features(LIB_LIEF_STATIC PRIVATE cxx_std_14) target_compile_features(LIB_LIEF_SHARED 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) endif() # Logging Configuration # ===================== if (LIEF_LOGGING) add_definitions(-DELPP_NO_DEFAULT_LOG_FILE) add_definitions(-DVDEBUG=9) add_definitions(-DELPP_FEATURE_CRASH_LOG) set(ENABLE_LOGGING_SUPPORT 1) else() set(ENABLE_LOGGING_SUPPORT 0) add_definitions(-DELPP_DISABLE_LOGS) add_definitions(-DELPP_NO_LOG_TO_FILE) add_definitions(-DELPP_DISABLE_DEFAULT_CRASH_HANDLING) endif() # Frozen Configuration # ==================== if (LIEF_FROZEN_ENABLED) list(APPEND LIEF_PRIVATE_INCLUDE_DIR "${FROZEN_INCLUDE_DIR}") 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) 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) endif() # Platforms # ========= include(${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/CMakeLists.txt) # LIEF includes # ============= configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/version.h" ) 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/" ) list(APPEND LIEF_PRIVATE_INCLUDE_DIR "${LIEF_PUBLIC_INCLUDE_DIR}" "${LIEF_PUBLIC_INCLUDE_DIR}" "${LIBRANG_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}" "${ELG_SOURCE_DIR}" "${MBEDTLS_INCLUDE_DIRS}" ) # Grouping external projects # ========================== source_group("mbedtls\\crypto" FILES ${mbedtls_src_crypto}) source_group("mbedtls\\x509" FILES ${mbedtls_src_x509}) source_group("mbedtls\\tls" FILES ${mbedtls_src_tls}) if (LIEF_LOGGING) source_group("easylogging" FILES ${ELG_SOURCE_DIR}/easylogging++.cc) endif() # Library definition # ================== target_include_directories(LIB_LIEF_STATIC PUBLIC "${LIEF_PUBLIC_INCLUDE_DIR}" PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") target_include_directories(LIB_LIEF_SHARED PUBLIC "${LIEF_PUBLIC_INCLUDE_DIR}" PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") if (LIEF_ENABLE_JSON) add_dependencies(LIB_LIEF_STATIC lief_libjson) add_dependencies(LIB_LIEF_SHARED lief_libjson) endif() if (LIEF_LOGGING) add_dependencies(LIB_LIEF_STATIC lief_easyloggingpp) add_dependencies(LIB_LIEF_SHARED lief_easyloggingpp) endif() if (LIEF_FROZEN_ENABLED) add_dependencies(LIB_LIEF_STATIC lief_frozen) add_dependencies(LIB_LIEF_SHARED lief_frozen) endif() add_dependencies(LIB_LIEF_STATIC lief_rang_cpp_color) add_dependencies(LIB_LIEF_SHARED lief_rang_cpp_color) add_dependencies(LIB_LIEF_STATIC lief_mbed_tls) add_dependencies(LIB_LIEF_SHARED lief_mbed_tls) # Flags definition # ---------------- set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED PROPERTY CXX_STANDARD 11) set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED PROPERTY CXX_STANDARD_REQUIRED ON) set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED PROPERTY POSITION_INDEPENDENT_CODE ON) # ASAN - LSAN - TSAN - USAN # ~~~~~~~~~~~~~~~~~~~~~~~~~ set(SANITIZER_FLAGS -fno-omit-frame-pointer -g -O1) if (LIEF_ASAN) message(STATUS "Address sanitizer enabled") list(APPEND SANITIZER_FLAGS -fsanitize=address) set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED APPEND PROPERTY LINK_FLAGS -fsanitize=address) target_link_libraries(LIB_LIEF_STATIC INTERFACE asan) target_link_libraries(LIB_LIEF_SHARED INTERFACE asan) endif() if (LIEF_LSAN) message(STATUS "Leak sanitizer enabled") list(APPEND SANITIZER_FLAGS -fsanitize=leak) set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED APPEND PROPERTY LINK_FLAGS -fsanitize=leak) target_link_libraries(LIB_LIEF_STATIC INTERFACE lsan) target_link_libraries(LIB_LIEF_SHARED INTERFACE lsan) endif() if (LIEF_TSAN) message(STATUS "Thread sanitizer enabled") list(APPEND SANITIZER_FLAGS -fsanitize=thread) set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED APPEND PROPERTY LINK_FLAGS -fsanitize=thread) target_link_libraries(LIB_LIEF_STATIC INTERFACE tsan) target_link_libraries(LIB_LIEF_SHARED INTERFACE tsan) endif() if (LIEF_USAN) message(STATUS "Undefined sanitizer enabled") list(APPEND SANITIZER_FLAGS -fsanitize=undefined) set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED APPEND PROPERTY LINK_FLAGS -fsanitize=undefined) target_link_libraries(LIB_LIEF_STATIC INTERFACE ubsan) target_link_libraries(LIB_LIEF_SHARED INTERFACE ubsan) endif() if (LIEF_ASAN OR LIEF_LSAN OR LIEF_TSAN OR LIEF_USAN) #message(STATUS "${SANITIZER_FLAGS}") target_compile_options(LIB_LIEF_STATIC PRIVATE ${SANITIZER_FLAGS}) target_compile_options(LIB_LIEF_SHARED PRIVATE ${SANITIZER_FLAGS}) endif() # Fuzzing # ~~~~~~~ if (LIEF_FUZZING) set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED APPEND PROPERTY LINK_FLAGS ${FUZZING_LINKER_FLAGS}) target_compile_options(LIB_LIEF_STATIC PRIVATE ${FUZZING_FLAGS}) target_compile_options(LIB_LIEF_SHARED PRIVATE ${FUZZING_FLAGS}) target_link_libraries(LIB_LIEF_STATIC asan pthread) target_link_libraries(LIB_LIEF_SHARED asan pthread) add_dependencies(LIB_LIEF_STATIC lief_libfuzzer) add_dependencies(LIB_LIEF_SHARED lief_libfuzzer) 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_STATIC PUBLIC ${PROFILING_FLAGS}) target_compile_options(LIB_LIEF_SHARED 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_STATIC) endif() # Coverage flags # -------------- if(LIEF_COVERAGE) target_compile_options(LIB_LIEF_STATIC PRIVATE -g -O0 --coverage -fprofile-arcs -ftest-coverage) target_compile_options(LIB_LIEF_SHARED PRIVATE -g -O0 --coverage -fprofile-arcs -ftest-coverage) target_link_libraries(LIB_LIEF_STATIC gcov) target_link_libraries(LIB_LIEF_SHARED gcov) endif() find_package(cppcheck) set_target_properties( LIB_LIEF_STATIC PROPERTIES OUTPUT_NAME LIEF CLEAN_DIRECT_OUTPUT 1) set_target_properties( LIB_LIEF_SHARED PROPERTIES OUTPUT_NAME LIEF CLEAN_DIRECT_OUTPUT 1) # Set a default build type if none was specified if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to 'Release' as none was specified.") set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() message(STATUS "Configuration Types: ${CMAKE_CONFIGURATION_TYPES}") message(STATUS "Build Types: ${CMAKE_BUILD_TYPE}") if(APPLE) set_target_properties(LIB_LIEF_STATIC PROPERTIES MACOSX_RPATH ".") set_target_properties(LIB_LIEF_SHARED PROPERTIES MACOSX_RPATH ".") endif() # API # === include(LIEFApi) # Examples # ======== if(LIEF_EXAMPLES) add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/examples") endif() # Tests # ===== if(LIEF_TESTS) enable_testing() add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/tests") endif() # CPP Check # ========= set(CPPCHECK_TEMPLATE_ARG "[{severity}][{id}] {message} {callstack} \(On {file}:{line}\)") set(_cppcheck_args "--enable=warning,performance,portability,information") #add_cppcheck(LIB_LIEF_STATIC FORCE) # Documentation # ============= if (LIEF_DOC) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/doc) 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 # ============ install(TARGETS LIB_LIEF_STATIC ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT libraries) if(LIEF_SHARED_LIB) install(TARGETS LIB_LIEF_SHARED ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT libraries) endif() install( DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} DESTINATION include COMPONENT headers FILES_MATCHING REGEX "(.*).(hpp|h|def)$") install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake DESTINATION share/LIEF/cmake COMPONENT CMakeScripts ) # Package add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/package") LIEF-0.9.0/LICENSE000066400000000000000000000261471330725006400132560ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2017 R. Thomas Copyright 2017 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. LIEF-0.9.0/README.md000066400000000000000000000157221330725006400135250ustar00rootroot00000000000000


       

# About The purpose of this project is to provide a cross platform library which can parse, modify and abstract ELF, PE and MachO formats. Main features: * **Parsing**: LIEF can parse ELF, PE, MachO and provides an user-friendly API to access to format internals. * **Modify**: LIEF enables to modify some parts of these formats * **Abstract**: Three formats have common features like sections, symbols, entry point... LIEF factors them. * **API**: LIEF can be used in C, C++ and Python # Content - [About](#about) - [Download / Install](#downloads--install) - [Getting started](#getting-started) - [Documentation](#documentation) - [Sphinx](https://lief.quarkslab.com/doc/stable/index.html) - [Doxygen](https://lief.quarkslab.com/doc/latest/doxygen/index.html) - Tutorials: - [Parse and manipulate formats](https://lief.quarkslab.com/doc/latest/tutorials/01_play_with_formats.html) - [Create a PE from scratch](https://lief.quarkslab.com/doc/latest/tutorials/02_pe_from_scratch.html) - [Play with ELF symbols](https://lief.quarkslab.com/doc/latest/tutorials/03_elf_change_symbols.html) - [ELF Hooking](https://lief.quarkslab.com/doc/latest/tutorials/04_elf_hooking.html) - [Infecting the plt/got](https://lief.quarkslab.com/doc/latest/tutorials/05_elf_infect_plt_got.html) - [PE Hooking](https://lief.quarkslab.com/doc/latest/tutorials/06_pe_hooking.html) - [PE Resources](https://lief.quarkslab.com/doc/latest/tutorials/07_pe_resource.html) - [Transforming an ELF executable into a library](https://lief.quarkslab.com/doc/latest/tutorials/08_elf_bin2lib.html) - [How to use frida on a non-rooted device](https://lief.quarkslab.com/doc/latest/tutorials/09_frida_lief.html) - [Android formats](https://lief.quarkslab.com/doc/latest/tutorials/10_android_formats.html) - [Contact](#contact) - [Authors](#authors) ## Downloads / Install First: ```bash pip install setuptools --upgrade ``` To install the latest **version**: ```python pip install lief ``` To install the latest **commit**: ```python pip install https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.9.0.dev.zip ``` ### Packages
Linux Windows - x86 Windows - x86-64 OSX
SDK SDK SDK SDK

Python

Linux Windows OSX CentOS Android Documentation
SDK SDK - x86
SDK - x86-64
SDK SDK SDK - x86-64
SDK - x86
SDK - ARM
SDK - AARCH64
Sphinx + Doxygen

Python

Here one can find guides to install or integrate LIEF: * [Python](https://lief.quarkslab.com/doc/installation.html#python) * [VisualStudio](https://lief.quarkslab.com/doc/installation.html#visual-studio-integration) * [XCode](https://lief.quarkslab.com/doc/installation.html#xcode-integration) * [CMake](https://lief.quarkslab.com/doc/installation.html#cmake-integration) ## Getting started ### Python


### C++


### C


## Documentation * [Main documentation](http://lief.quarkslab.com/doc/index.html) * [Tutorial](http://lief.quarkslab.com/doc/tutorials/index.html) * [API](http://lief.quarkslab.com/doc/api/index.html) * [Doxygen](http://lief.quarkslab.com/doxygen/index.html) ## Contact * **Mail**: lief at quarkslab com * **Gitter**: [lief-project](https://gitter.im/lief-project) ## Authors Romain Thomas ([@rh0main](https://twitter.com/rh0main)) - [Quarkslab](https://www.quarkslab.com) ---------------

LIEF-0.9.0/api/000077500000000000000000000000001330725006400130105ustar00rootroot00000000000000LIEF-0.9.0/api/c/000077500000000000000000000000001330725006400132325ustar00rootroot00000000000000LIEF-0.9.0/api/c/CMakeLists.txt000066400000000000000000000017731330725006400160020ustar00rootroot00000000000000include_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_STATIC PRIVATE "${LIEF_C_SRC}" ${LIEF_C_INCLUDE_FILES}) target_sources(LIB_LIEF_SHARED PRIVATE "${LIEF_C_SRC}" ${LIEF_C_INCLUDE_FILES}) LIEF-0.9.0/api/c/ELF/000077500000000000000000000000001330725006400136405ustar00rootroot00000000000000LIEF-0.9.0/api/c/ELF/Binary.cpp000066400000000000000000000072031330725006400155720ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/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()) { 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(); Elf_Binary_t* 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 true; } 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); } //} LIEF-0.9.0/api/c/ELF/Binary.hpp000066400000000000000000000015311330725006400155750ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/ELF/CMakeLists.txt000066400000000000000000000034631330725006400164060ustar00rootroot00000000000000include_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_BINARY_DIR}/include/LIEF/ELF/structures.h" "${CMAKE_CURRENT_BINARY_DIR}/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_STATIC PRIVATE "${LIEF_C_ELF_SRC}" "${LIEF_C_ELF_INC}") target_sources(LIB_LIEF_SHARED PRIVATE "${LIEF_C_ELF_SRC}" "${LIEF_C_ELF_INC}") LIEF-0.9.0/api/c/ELF/DynamicEntry.cpp000066400000000000000000000170321330725006400167550ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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" namespace LIEF { namespace ELF { void init_c_dynamic_entries(Elf_Binary_t* c_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: { Elf_DynamicEntry_Library_t* e = static_cast( malloc(sizeof(Elf_DynamicEntry_Library_t))); e->tag = static_cast(entry.tag()); e->value = entry.value(); e->name = dynamic_cast(&entry)->name().c_str(); c_binary->dynamic_entries[i] = reinterpret_cast(e); break; // cppcheck-suppress memleak } case DYNAMIC_TAGS::DT_SONAME: { Elf_DynamicEntry_SharedObject_t* e = static_cast( malloc(sizeof(Elf_DynamicEntry_SharedObject_t))); e->tag = static_cast(entry.tag()); e->value = entry.value(); e->name = dynamic_cast(&entry)->name().c_str(); c_binary->dynamic_entries[i] = reinterpret_cast(e); break; } case DYNAMIC_TAGS::DT_RPATH: { Elf_DynamicEntry_Rpath_t* e = static_cast( malloc(sizeof(Elf_DynamicEntry_Rpath_t))); e->tag = static_cast(entry.tag()); e->value = entry.value(); e->rpath = dynamic_cast(&entry)->name().c_str(); c_binary->dynamic_entries[i] = reinterpret_cast(e); break; } case DYNAMIC_TAGS::DT_RUNPATH: { Elf_DynamicEntry_RunPath_t* e = static_cast( malloc(sizeof(Elf_DynamicEntry_RunPath_t))); e->tag = static_cast(entry.tag()); e->value = entry.value(); e->runpath = dynamic_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: { Elf_DynamicEntry_Array_t* e = static_cast( malloc(sizeof(Elf_DynamicEntry_Array_t))); e->tag = static_cast(entry.tag()); e->value = entry.value(); const std::vector& array = dynamic_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: { Elf_DynamicEntry_Flags_t* 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 = dynamic_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: { Elf_DynamicEntry_Flags_t* 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 = dynamic_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] != NULL; ++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); } } } LIEF-0.9.0/api/c/ELF/DynamicEntry.hpp000066400000000000000000000017571330725006400167710ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/ELF/EnumToString.cpp000066400000000000000000000054021330725006400167430ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/Structures.hpp" #include "LIEF/ELF/structures.h" 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)); } } LIEF-0.9.0/api/c/ELF/Header.cpp000066400000000000000000000036431330725006400155420ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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); } } } LIEF-0.9.0/api/c/ELF/Header.hpp000066400000000000000000000016261330725006400155460ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/ELF/Section.cpp000066400000000000000000000050321330725006400157500ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { 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))); const std::vector& section_content = b_section.content(); uint8_t* 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.name().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); } } } LIEF-0.9.0/api/c/ELF/Section.hpp000066400000000000000000000017131330725006400157570ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/ELF/Segment.cpp000066400000000000000000000043121330725006400157460ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { 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]; const std::vector& segment_content = segment.content(); uint8_t* 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); } } } LIEF-0.9.0/api/c/ELF/Segment.hpp000066400000000000000000000017131330725006400157550ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/ELF/Symbol.cpp000066400000000000000000000071161330725006400156160ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { it_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) { it_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); } } } LIEF-0.9.0/api/c/ELF/Symbol.hpp000066400000000000000000000021171330725006400156170ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/ELF/utils.cpp000066400000000000000000000013521330725006400155050ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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); } LIEF-0.9.0/api/c/MachO/000077500000000000000000000000001330725006400142215ustar00rootroot00000000000000LIEF-0.9.0/api/c/MachO/Binary.cpp000066400000000000000000000031561330725006400161560ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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); } LIEF-0.9.0/api/c/MachO/Binary.hpp000066400000000000000000000015451330725006400161630ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/MachO/CMakeLists.txt000066400000000000000000000034501330725006400167630ustar00rootroot00000000000000include_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_BINARY_DIR}/include/LIEF/MachO/structures.h" "${CMAKE_CURRENT_BINARY_DIR}/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_STATIC PRIVATE "${LIEF_API_C_MACHO_SRC}" ${LIEF_C_MACHO_INC}) target_sources(LIB_LIEF_SHARED PRIVATE "${LIEF_API_C_MACHO_SRC}" ${LIEF_C_MACHO_INC}) LIEF-0.9.0/api/c/MachO/EnumToString.cpp000066400000000000000000000042051330725006400173240ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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)); } } LIEF-0.9.0/api/c/MachO/Header.cpp000066400000000000000000000024271330725006400161220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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(); } } } LIEF-0.9.0/api/c/MachO/Header.hpp000066400000000000000000000016461330725006400161310ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/MachO/LoadCommand.cpp000066400000000000000000000035701330725006400171100ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { 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(); uint8_t* 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); } } } LIEF-0.9.0/api/c/MachO/LoadCommand.hpp000066400000000000000000000017571330725006400171220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/MachO/Parser.cpp000066400000000000000000000024671330725006400161720ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "Binary.hpp" using namespace LIEF::MachO; Macho_Binary_t** macho_parse(const char *file) { FatBinary* macho_binaries = Parser::parse(file).release(); Macho_Binary_t** c_macho_binaries = static_cast( malloc((macho_binaries->size() + 1) * sizeof(Macho_Binary_t**))); for (size_t i = 0; i < macho_binaries->size(); ++i) { Binary& binary = (*macho_binaries)[i]; c_macho_binaries[i] = static_cast(malloc(sizeof(Macho_Binary_t))); init_c_binary(c_macho_binaries[i], &binary); } c_macho_binaries[macho_binaries->size()] = nullptr; return c_macho_binaries; } LIEF-0.9.0/api/c/MachO/Section.cpp000066400000000000000000000052401330725006400163320ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { 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) { Section& section = sections[i]; c_binary->sections[i] = static_cast(malloc(sizeof(Macho_Section_t))); const std::vector& section_content = section.content(); uint8_t* 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.name().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.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); } } } LIEF-0.9.0/api/c/MachO/Section.hpp000066400000000000000000000017351330725006400163440ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/MachO/Segment.cpp000066400000000000000000000046161330725006400163360ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { 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))); const std::vector& segment_content = segment.content(); uint8_t* 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]->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); } } } LIEF-0.9.0/api/c/MachO/Segment.hpp000066400000000000000000000017441330725006400163420ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/MachO/Symbol.cpp000066400000000000000000000032241330725006400161730ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { 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) { 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); } } } LIEF-0.9.0/api/c/MachO/Symbol.hpp000066400000000000000000000017271330725006400162060ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/PE/000077500000000000000000000000001330725006400135365ustar00rootroot00000000000000LIEF-0.9.0/api/c/PE/Binary.cpp000066400000000000000000000035021330725006400154660ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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(); Pe_Binary_t* 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); } LIEF-0.9.0/api/c/PE/Binary.hpp000066400000000000000000000015231330725006400154740ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/PE/CMakeLists.txt000066400000000000000000000040201330725006400162720ustar00rootroot00000000000000include_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_BINARY_DIR}/include/LIEF/PE/structures.h" "${CMAKE_CURRENT_BINARY_DIR}/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_STATIC PRIVATE "${LIEF_API_C_PE_SRC}" "${LIEF_C_PE_INC}") target_sources(LIB_LIEF_SHARED PRIVATE "${LIEF_API_C_PE_SRC}" "${LIEF_C_PE_INC}") LIEF-0.9.0/api/c/PE/DataDirectory.cpp000066400000000000000000000031241330725006400170000ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { 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); } } } LIEF-0.9.0/api/c/PE/DataDirectory.hpp000066400000000000000000000017541330725006400170140ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/PE/DosHeader.cpp000066400000000000000000000050641330725006400161050ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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); } } } LIEF-0.9.0/api/c/PE/DosHeader.hpp000066400000000000000000000016401330725006400161060ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/PE/EnumToString.cpp000066400000000000000000000022131330725006400166360ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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)); } } LIEF-0.9.0/api/c/PE/Header.cpp000066400000000000000000000027541330725006400154420ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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); } } } LIEF-0.9.0/api/c/PE/Header.hpp000066400000000000000000000016161330725006400154430ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/PE/Import.cpp000066400000000000000000000037531330725006400155240ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 (not binary->has_imports()) { c_binary->imports = nullptr; } 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); } } } LIEF-0.9.0/api/c/PE/Import.hpp000066400000000000000000000016741330725006400155310ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/PE/ImportEntry.cpp000066400000000000000000000037071330725006400165450ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { it_import_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); } } } LIEF-0.9.0/api/c/PE/ImportEntry.hpp000066400000000000000000000017351330725006400165510ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/PE/OptionalHeader.cpp000066400000000000000000000076141330725006400171500ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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(); } } } LIEF-0.9.0/api/c/PE/OptionalHeader.hpp000066400000000000000000000016711330725006400171520ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/PE/Section.cpp000066400000000000000000000045761330725006400156620ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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) { 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))); std::vector section_content = b_section.content(); uint8_t* content = static_cast(malloc(section_content.size() * sizeof(uint8_t))); std::move( std::begin(section_content), std::end(section_content), content); c_binary->sections[i]->name = b_section.name().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]->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); } } } LIEF-0.9.0/api/c/PE/Section.hpp000066400000000000000000000017021330725006400156530ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/000077500000000000000000000000001330725006400146555ustar00rootroot00000000000000LIEF-0.9.0/api/c/include/LIEF/000077500000000000000000000000001330725006400153745ustar00rootroot00000000000000LIEF-0.9.0/api/c/include/LIEF/ELF.h000066400000000000000000000016301330725006400161530ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/ELF/000077500000000000000000000000001330725006400160025ustar00rootroot00000000000000LIEF-0.9.0/api/c/include/LIEF/ELF/Binary.h000066400000000000000000000035561330725006400174100ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/ELF/DynamicEntry.h000066400000000000000000000045741330725006400205730ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/ELF/EnumToString.h000066400000000000000000000035041330725006400205530ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/ELF/Header.h000066400000000000000000000027631330725006400173530ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/ELF/Section.h000066400000000000000000000027041330725006400175620ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/ELF/Segment.h000066400000000000000000000023771330725006400175660ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/ELF/Symbol.h000066400000000000000000000027031330725006400174220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/ELF/enums.h.in000066400000000000000000000006011330725006400177040ustar00rootroot00000000000000#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 @LIEF_ELF_ENUMS@ #undef _LIEF_EN #undef _LIEF_EN_2 #undef _LIEF_EI #ifdef __cplusplus } #endif #endif LIEF-0.9.0/api/c/include/LIEF/ELF/structures.h.in000066400000000000000000000002461330725006400210050ustar00rootroot00000000000000#ifndef LIEF_ELF_C_STRUCTURES_H_ #define LIEF_ELF_C_STRUCTURES_H_ #ifdef __cplusplus extern "C" { #endif @LIEF_ELF_STRUCTURES@ #ifdef __cplusplus } #endif #endif LIEF-0.9.0/api/c/include/LIEF/ELF/utils.h000066400000000000000000000020451330725006400173140ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/LIEF.h000066400000000000000000000013641330725006400162700ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/MachO.h000066400000000000000000000016571330725006400165450ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/MachO/000077500000000000000000000000001330725006400163635ustar00rootroot00000000000000LIEF-0.9.0/api/c/include/LIEF/MachO/Binary.h000066400000000000000000000032401330725006400177570ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/MachO/EnumToString.h000066400000000000000000000030401330725006400211270ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/MachO/Header.h000066400000000000000000000024011330725006400177210ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/MachO/LoadCommand.h000066400000000000000000000022741330725006400207170ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/MachO/Section.h000066400000000000000000000030621330725006400201410ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/MachO/Segment.h000066400000000000000000000025721330725006400201440ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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; Macho_Section_t** sections; }; typedef struct Macho_Segment_t Macho_Segment_t; #ifdef __cplusplus } #endif /** @} */ #endif LIEF-0.9.0/api/c/include/LIEF/MachO/Symbol.h000066400000000000000000000022041330725006400177770ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/MachO/enums.h.in000066400000000000000000000006171330725006400202740ustar00rootroot00000000000000#ifndef LIEF_MACHO_C_ENUMS_H_ #define LIEF_MACHO_C_ENUMS_H_ #include "LIEF/MachO/undef.h" #ifdef __cplusplus extern "C" { #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 @LIEF_MACHO_ENUMS@ #undef _LIEF_EN #undef _LIEF_EN_2 #undef _LIEF_EI #ifdef __cplusplus } #endif #endif LIEF-0.9.0/api/c/include/LIEF/MachO/structures.h.in000066400000000000000000000002541330725006400213650ustar00rootroot00000000000000#ifndef LIEF_MACHO_C_STRUCTURES_H_ #define LIEF_MACHO_C_STRUCTURES_H_ #ifdef __cplusplus extern "C" { #endif @LIEF_MACHO_STRUCTURES@ #ifdef __cplusplus } #endif #endif LIEF-0.9.0/api/c/include/LIEF/PE.h000066400000000000000000000013731330725006400160550ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/PE/000077500000000000000000000000001330725006400157005ustar00rootroot00000000000000LIEF-0.9.0/api/c/include/LIEF/PE/Binary.h000066400000000000000000000032361330725006400173010ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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; /** @brief 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 LIEF-0.9.0/api/c/include/LIEF/PE/DataDirectory.h000066400000000000000000000021201330725006400206020ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/PE/DosHeader.h000066400000000000000000000030761330725006400177150ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/PE/EnumToString.h000066400000000000000000000020161330725006400204460ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/PE/Header.h000066400000000000000000000024571330725006400172510ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/PE/Import.h000066400000000000000000000023631330725006400173270ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/PE/ImportEntry.h000066400000000000000000000024351330725006400203510ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/PE/OptionalHeader.h000066400000000000000000000042161330725006400207520ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 LIEF-0.9.0/api/c/include/LIEF/PE/Section.h000066400000000000000000000024151330725006400174570ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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; double entropy; }; typedef struct Pe_Section_t Pe_Section_t; #ifdef __cplusplus } #endif /** @} */ #endif LIEF-0.9.0/api/c/include/LIEF/PE/enums.h.in000066400000000000000000000006121330725006400176040ustar00rootroot00000000000000#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 @LIEF_PE_ENUMS@ #undef _LIEF_EN #undef _LIEF_EN_2 #undef _LIEF_EI #ifdef __cplusplus } #endif #endif LIEF-0.9.0/api/c/include/LIEF/PE/structures.h.in000066400000000000000000000002431330725006400207000ustar00rootroot00000000000000#ifndef LIEF_PE_C_STRUCTURES_H_ #define LIEF_PE_C_STRUCTURES_H_ #ifdef __cplusplus extern "C" { #endif @LIEF_PE_STRUCTURES@ #ifdef __cplusplus } #endif #endif LIEF-0.9.0/api/c/include/LIEF/logging.h000066400000000000000000000023411330725006400171730ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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); /** @brief Update verbosity level */ LIEF_API void lief_logging_set_verbose_level(uint32_t level); #ifdef __cplusplus } #endif /** @} */ #endif LIEF-0.9.0/api/c/include/LIEF/types.h000066400000000000000000000013421330725006400167110ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 typedef int bool; #endif #endif LIEF-0.9.0/api/c/logging.cpp000066400000000000000000000017571330725006400153760ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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; void lief_logging_disable(void) { Logger::disable(); } void lief_logging_enable(void) { Logger::enable(); } void lief_logging_set_level(uint32_t level) { Logger::set_level(static_cast(level)); } void lief_logging_set_verbose_level(uint32_t level) { Logger::set_verbose_level(level); } LIEF-0.9.0/api/python/000077500000000000000000000000001330725006400143315ustar00rootroot00000000000000LIEF-0.9.0/api/python/ART/000077500000000000000000000000001330725006400147575ustar00rootroot00000000000000LIEF-0.9.0/api/python/ART/CMakeLists.txt000066400000000000000000000013261330725006400175210ustar00rootroot00000000000000set(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}/pyIterators.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}/../") LIEF-0.9.0/api/python/ART/objects/000077500000000000000000000000001330725006400164105ustar00rootroot00000000000000LIEF-0.9.0/api/python/ART/objects/pyFile.cpp000066400000000000000000000032441330725006400203470ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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; }); } } } LIEF-0.9.0/api/python/ART/objects/pyHeader.cpp000066400000000000000000000070321330725006400206570ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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; }); } } } LIEF-0.9.0/api/python/ART/objects/pyParser.cpp000066400000000000000000000046301330725006400207240ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 (*) (const std::vector&, const std::string&)>(&Parser::parse), "Parse the given raw data and return an " RST_CLASS_REF(lief.ART.File) " object\n\n" "raw"_a, py::arg("name") = "", py::return_value_policy::take_ownership); m.def("parse", [] (py::object byteio, const std::string& name) { auto&& io = py::module::import("io"); auto&& RawIOBase = io.attr("RawIOBase"); auto&& BufferedIOBase = io.attr("BufferedIOBase"); 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); } } } LIEF-0.9.0/api/python/ART/pyART.cpp000066400000000000000000000020151330725006400164600ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_iterators(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); } } } LIEF-0.9.0/api/python/ART/pyART.hpp000066400000000000000000000022531330725006400164710ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_iterators(py::module&); void init_enums(py::module&); void init_utils(py::module&); SPECIALIZE_CREATE(Parser); SPECIALIZE_CREATE(File); SPECIALIZE_CREATE(Header); } } #endif LIEF-0.9.0/api/python/ART/pyEnums.cpp000066400000000000000000000020371330725006400171250ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/Structures.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)); } } } LIEF-0.9.0/api/python/ART/pyIterators.cpp000066400000000000000000000014161330725006400200120ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyIterators.hpp" #include "LIEF/ART/type_traits.hpp" namespace LIEF { namespace ART { void init_iterators(py::module& m) { } } } LIEF-0.9.0/api/python/ART/pyUtils.cpp000066400000000000000000000031061330725006400171340ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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); } } } LIEF-0.9.0/api/python/Abstract/000077500000000000000000000000001330725006400160745ustar00rootroot00000000000000LIEF-0.9.0/api/python/Abstract/CMakeLists.txt000066400000000000000000000015151330725006400206360ustar00rootroot00000000000000 set(LIEF_PYTHON_ABSTRACT_SRC "${CMAKE_CURRENT_LIST_DIR}/init.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects" "${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}/pyEnums.cpp" ) set(LIEF_PYTHON_ABSTRACT_HDR "${CMAKE_CURRENT_LIST_DIR}/init.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}") LIEF-0.9.0/api/python/Abstract/init.cpp000066400000000000000000000016061330725006400175460ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyLIEF.hpp" #include "init.hpp" void init_LIEF_module(py::module& m) { init_LIEF_Enum(m); init_LIEF_Header_class(m); init_LIEF_Binary_class(m); init_LIEF_Section_class(m); init_LIEF_Symbol_class(m); init_LIEF_Parser_class(m); init_LIEF_Relocation_class(m); } LIEF-0.9.0/api/python/Abstract/init.hpp000066400000000000000000000017351330725006400175560ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_INIT_H_ #define PY_LIEF_INIT_H_ #include "pyLIEF.hpp" void init_LIEF_Enum(py::module&); void init_LIEF_Header_class(py::module&); void init_LIEF_Binary_class(py::module&); void init_LIEF_Section_class(py::module&); void init_LIEF_Symbol_class(py::module&); void init_LIEF_Parser_class(py::module&); void init_LIEF_Relocation_class(py::module&); #endif LIEF-0.9.0/api/python/Abstract/objects/000077500000000000000000000000001330725006400175255ustar00rootroot00000000000000LIEF-0.9.0/api/python/Abstract/objects/pyBinary.cpp000066400000000000000000000206111330725006400220260ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "init.hpp" #include "LIEF/Abstract/Binary.hpp" #include "LIEF/ELF/Binary.hpp" #include using namespace LIEF; #define PY_ENUM(x) LIEF::to_string(x), x 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); void init_LIEF_Binary_class(py::module& m) { py::class_ pybinary(m, "Binary"); py::enum_(pybinary, "VA_TYPES") .value(PY_ENUM(LIEF::Binary::VA_TYPES::AUTO)) .value(PY_ENUM(LIEF::Binary::VA_TYPES::VA)) .value(PY_ENUM(LIEF::Binary::VA_TYPES::RVA)); 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 uses ``NX`` protection") .def_property("name", static_cast>(&Binary::name), static_cast>(&Binary::name), "Binary's name") .def_property_readonly("header", &Binary::header, "Binary's header") .def_property_readonly("entrypoint", &Binary::entrypoint, "Binary's entrypoint") .def_property_readonly("sections", static_cast>(&Binary::sections), "Return a list in **read only** of binary's abstract " RST_CLASS_REF(lief.Section) "", py::return_value_policy::reference_internal) .def_property_readonly("relocations", static_cast>(&Binary::relocations), "Return an iterator over abstract " RST_CLASS_REF(lief.Relocation) "", py::return_value_policy::reference_internal) .def_property_readonly("exported_functions", [] (const Binary& binary) { const std::vector& exported_functions = binary.exported_functions(); std::vector exported_functions_encoded; exported_functions_encoded.reserve(exported_functions.size()); std::transform( std::begin(exported_functions), std::end(exported_functions), std::back_inserter(exported_functions_encoded), &safe_string_converter); return exported_functions_encoded; }, "Return binary's exported functions (name)") .def_property_readonly("imported_functions", [] (const Binary& binary) { const std::vector& imported_functions = binary.imported_functions(); std::vector imported_functions_encoded; imported_functions_encoded.reserve(imported_functions.size()); std::transform( std::begin(imported_functions), std::end(imported_functions), std::back_inserter(imported_functions_encoded), &safe_string_converter); return imported_functions_encoded; }, "Return binary's imported functions (name)") .def_property_readonly("libraries", [] (const Binary& binary) { const std::vector& imported_libraries = binary.imported_libraries(); std::vector imported_libraries_encoded; imported_libraries_encoded.reserve(imported_libraries.size()); std::transform( std::begin(imported_libraries), std::end(imported_libraries), std::back_inserter(imported_libraries_encoded), &safe_string_converter); return imported_libraries_encoded; }, "Return binary's imported libraries (name)") .def_property_readonly("symbols", static_cast>(&Binary::symbols), "Return a list in **read only** of binary's abstract " RST_CLASS_REF(lief.Symbol) "", py::return_value_policy::reference_internal) .def("has_symbol", &Binary::has_symbol, "Check if a " RST_CLASS_REF(lief.Symbol) " with the given name exists", "symbol_name"_a) .def("get_symbol", static_cast>(&Binary::get_symbol), "Return the " RST_CLASS_REF(lief.Symbol) " with the given ``name``", "symbol_name"_a, py::return_value_policy::reference) .def("get_function_address", &Binary::get_function_address, "Return the address of the given function name", "function_name"_a) .def("patch_address", static_cast&, LIEF::Binary::VA_TYPES)>(&Binary::patch_address), "Patch the address with the given value", "Virtual address is specified in the first argument and the content in the second (as a list of bytes).\n" "If the underlying binary is a PE, one can specify if the virtual address is a " RST_ATTR_REF(lief.Binary.VA_TYPES.RVA) "" " or a " RST_ATTR_REF(lief.Binary.VA_TYPES.VA) ". By default it is set to " RST_ATTR_REF(lief.Binary.VA_TYPES.AUTO) "", "address"_a, "patch_value"_a, "va_type"_a = LIEF::Binary::VA_TYPES::AUTO) .def("patch_address", static_cast(&Binary::patch_address), "Patch the address with the given value", "Virtual address is specified in the first argument, integer in the second and sizeof the integer in third one.\n" "If the underlying binary is a PE, one can specify if the virtual address is a " RST_ATTR_REF(lief.Binary.VA_TYPES.RVA) "" " or a " RST_ATTR_REF(lief.Binary.VA_TYPES.VA) ". By default it is set to " RST_ATTR_REF(lief.Binary.VA_TYPES.AUTO) "", "address"_a, "patch_value"_a, "size"_a = 8, "va_type"_a = LIEF::Binary::VA_TYPES::AUTO) .def("get_content_from_virtual_address", &Binary::get_content_from_virtual_address, "Return the content located at virtual address.\n\n" "Virtual address is specified in the first argument and size to read (in bytes) in the second.\n" "If the underlying binary is a PE, one can specify if the virtual address is a " RST_ATTR_REF(lief.Binary.VA_TYPES.RVA) "" " or a " RST_ATTR_REF(lief.Binary.VA_TYPES.VA) ". By default it is set to " RST_ATTR_REF(lief.Binary.VA_TYPES.AUTO) "", "virtual_address"_a, "size"_a, "va_type"_a = LIEF::Binary::VA_TYPES::AUTO) .def_property_readonly("abstract", [m] (py::object& self) { self.attr("__class__") = m.attr("Binary"); return self; }, "Return the " RST_CLASS_REF(lief.Binary) " object\n\n" ".. warning::\n\n" "\tGetting this property modifies the ``__class__`` attribute so that " "the current binary looks like a " RST_CLASS_REF(lief.Binary) ".\n\n" "\tUse the " RST_ATTR_REF(lief.Binary.concrete) " to get back to the original binary.", py::return_value_policy::reference) .def_property_readonly("concrete", [m] (py::object& self) { self.attr("__class__") = py::cast(self.cast()).attr("__class__"); return self; }, "Return either " RST_CLASS_REF_FULL(lief.ELF.Binary) ", " RST_CLASS_REF_FULL(lief.PE.Binary) ", " RST_CLASS_REF_FULL(lief.MachO.Binary) " object\n\n" "", py::return_value_policy::reference) .def("xref", &Binary::xref, "Return all **virtual address** that *use* the ``address`` given in parameter" "virtual_address"_a) .def("__str__", [] (const Binary& binary) { std::ostringstream stream; stream << binary; std::string str = stream.str(); return str; }); } LIEF-0.9.0/api/python/Abstract/objects/pyHeader.cpp000066400000000000000000000052521330725006400217760ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "init.hpp" #include "LIEF/Abstract/Header.hpp" template using getter_t = T (LIEF::Header::*)(void) const; template using setter_t = void (LIEF::Header::*)(T); void init_LIEF_Header_class(py::module& m) { py::class_(m, "Header") .def(py::init()) .def_property("architecture", static_cast>(&LIEF::Header::architecture), static_cast>(&LIEF::Header::architecture), "Target architecture (" RST_CLASS_REF(lief.ARCHITECTURES) ")") .def_property("modes", static_cast&>>(&LIEF::Header::modes), static_cast&>>(&LIEF::Header::modes), "Target " RST_CLASS_REF(lief.MODES) " (32-bits, 64-bits...)") .def_property("entrypoint", static_cast>(&LIEF::Header::entrypoint), static_cast>(&LIEF::Header::entrypoint), "Binary entrypoint") .def_property("object_type", static_cast>(&LIEF::Header::object_type), static_cast>(&LIEF::Header::object_type), "Type of the binary (executable, library...)\n" "See: " RST_CLASS_REF(lief.OBJECT_TYPES) "") .def_property("endianness", static_cast>(&LIEF::Header::endianness), static_cast>(&LIEF::Header::endianness), "Binary endianness\n" "See: " RST_CLASS_REF(lief.ENDIANNESS) "") .def_property_readonly("is_32", &LIEF::Header::is_32, "``True`` if the binary target a ``32-bits`` architecture") .def_property_readonly("is_64", &LIEF::Header::is_64, "``True`` if the binary target a ``64-bits`` architecture") .def("__str__", [] (const LIEF::Header& header) { std::ostringstream stream; stream << header; std::string str = stream.str(); return str; }); } LIEF-0.9.0/api/python/Abstract/objects/pyParser.cpp000066400000000000000000000045631330725006400220460ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "init.hpp" #include "LIEF/Abstract/Parser.hpp" #include void init_LIEF_Parser_class(py::module& m) { m.def("parse", static_cast (*) (const std::string&)>(&LIEF::Parser::parse), "Parse the given binary and return a " RST_CLASS_REF(lief.Binary) " object", "filepath"_a, py::return_value_policy::take_ownership); m.def("parse", static_cast (*) (const std::vector&, const std::string&)>(&LIEF::Parser::parse), "Parse the given binary and return a " RST_CLASS_REF(lief.Binary) " object", "raw"_a, "name"_a = "", py::return_value_policy::take_ownership); m.def("parse", [] (py::object byteio, const std::string& name) { auto&& io = py::module::import("io"); auto&& RawIOBase = io.attr("RawIOBase"); auto&& BufferedIOBase = io.attr("BufferedIOBase"); 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::Parser::parse(std::move(raw), name); }, "io"_a, "name"_a = "", py::return_value_policy::take_ownership); } LIEF-0.9.0/api/python/Abstract/objects/pyRelocation.cpp000066400000000000000000000037701330725006400227100ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "init.hpp" #include "LIEF/Abstract/hash.hpp" #include "LIEF/Abstract/Relocation.hpp" template using getter_t = T (LIEF::Relocation::*)(void) const; template using setter_t = void (LIEF::Relocation::*)(T); void init_LIEF_Relocation_class(py::module& m) { py::class_(m, "Relocation") .def(py::init(), "Default constructor") .def(py::init(), "Constructor from :attr:`~lief.Relocation.address` and :attr:`~lief.Relocation.size`", "address"_a, "size"_a) .def_property("address", static_cast>(&LIEF::Relocation::address), static_cast>(&LIEF::Relocation::address), "Relocation's address") .def_property("size", static_cast>(&LIEF::Relocation::size), static_cast>(&LIEF::Relocation::size), "Relocation's size (in **bits**)") .def("__eq__", &LIEF::Relocation::operator==) .def("__ne__", &LIEF::Relocation::operator!=) .def("__hash__", [] (const LIEF::Relocation& relocation) { return LIEF::AbstractHash::hash(relocation); }) .def("__str__", [] (const LIEF::Relocation& entry) { std::ostringstream stream; stream << entry; std::string str = stream.str(); return str; }); } LIEF-0.9.0/api/python/Abstract/objects/pySection.cpp000066400000000000000000000063611330725006400222140ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "init.hpp" #include "LIEF/Abstract/Section.hpp" template using getter_t = T (LIEF::Section::*)(void) const; template using setter_t = void (LIEF::Section::*)(T); void init_LIEF_Section_class(py::module& m) { py::class_(m, "Section") .def(py::init(), "Default constructor") .def(py::init(), "Constructor from section name", "name"_a) .def_property("name", [] (const LIEF::Section& obj) { return safe_string_converter(obj.name()); }, static_cast>(&LIEF::Section::name), "Section's name") .def_property("size", static_cast>(&LIEF::Section::size), static_cast>(&LIEF::Section::size), "Section's size") .def_property("offset", static_cast>(&LIEF::Section::offset), static_cast>(&LIEF::Section::offset), "Section's offset") .def_property("virtual_address", static_cast>(&LIEF::Section::virtual_address), static_cast>(&LIEF::Section::virtual_address), "Section's size") .def_property("content", static_cast>>(&LIEF::Section::content), static_cast&>>(&LIEF::Section::content), "Section's content") .def_property_readonly("entropy", &LIEF::Section::entropy, "Section's entropy") .def("search", static_cast(&LIEF::Section::search), "Look for **integer** within the current section", "number"_a, "pos"_a = 0, "size"_a = 0) .def("search", static_cast(&LIEF::Section::search), "Look for **string** within the current section", "str"_a, "pos"_a = 0) .def("search_all", static_cast (LIEF::Section::*)(uint64_t, size_t) const>(&LIEF::Section::search_all), "Look for **all** integers within the current section", "number"_a, "size"_a = 0) .def("search_all", static_cast (LIEF::Section::*)(const std::string&) const>(&LIEF::Section::search_all), "Look for all **strings** within the current section", "str"_a) .def("__str__", [] (const LIEF::Section& section) { std::ostringstream stream; stream << section; std::string str = stream.str(); return str; }); } LIEF-0.9.0/api/python/Abstract/objects/pySymbol.cpp000066400000000000000000000033301330725006400220460ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "init.hpp" #include "LIEF/Abstract/Symbol.hpp" #include #include template using getter_t = const T& (LIEF::Symbol::*)(void) const; template using setter_t = void (LIEF::Symbol::*)(const T&); class PySymbol : public LIEF::Symbol { public: using LIEF::Symbol::Symbol; virtual const std::string& name(void) const override { PYBIND11_OVERLOAD(const std::string&, LIEF::Symbol, name,); }; virtual void name(const std::string& name) override { PYBIND11_OVERLOAD(void, LIEF::Symbol, name, name); }; }; void init_LIEF_Symbol_class(py::module& m) { py::class_(m, "Symbol") .def(py::init()) .def_property("name", [] (const LIEF::Symbol& obj) { return safe_string_converter(obj.name()); }, static_cast>(&LIEF::Symbol::name), "Symbol's name") .def("__str__", [] (const LIEF::Symbol& symbol) { std::ostringstream stream; stream << symbol; std::string str = stream.str(); return str; }); } LIEF-0.9.0/api/python/Abstract/pyEnums.cpp000066400000000000000000000056131330725006400202450ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "init.hpp" #include "LIEF/Abstract/enums.hpp" #include "LIEF/Abstract/EnumToString.hpp" #define PY_ENUM(x) LIEF::to_string(x), x void init_LIEF_Enum(py::module& m) { py::enum_(m, "EXE_FORMATS") .value(PY_ENUM(LIEF::EXE_FORMATS::FORMAT_UNKNOWN)) .value(PY_ENUM(LIEF::EXE_FORMATS::FORMAT_ELF)) .value(PY_ENUM(LIEF::EXE_FORMATS::FORMAT_PE)) .value(PY_ENUM(LIEF::EXE_FORMATS::FORMAT_MACHO)) .export_values(); py::enum_(m, "OBJECT_TYPES") .value(PY_ENUM(LIEF::OBJECT_TYPES::TYPE_NONE)) .value(PY_ENUM(LIEF::OBJECT_TYPES::TYPE_EXECUTABLE)) .value(PY_ENUM(LIEF::OBJECT_TYPES::TYPE_LIBRARY)) .value(PY_ENUM(LIEF::OBJECT_TYPES::TYPE_OBJECT)) .export_values(); py::enum_(m, "ARCHITECTURES") .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_NONE)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_ARM)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_ARM64)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_MIPS)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_X86)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_PPC)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_SPARC)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_SYSZ)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_XCORE)) .value(PY_ENUM(LIEF::ARCHITECTURES::ARCH_INTEL)) .export_values(); py::enum_(m, "MODES") .value(PY_ENUM(LIEF::MODES::MODE_NONE)) .value(PY_ENUM(LIEF::MODES::MODE_16)) .value(PY_ENUM(LIEF::MODES::MODE_32)) .value(PY_ENUM(LIEF::MODES::MODE_64)) .value(PY_ENUM(LIEF::MODES::MODE_ARM)) .value(PY_ENUM(LIEF::MODES::MODE_THUMB)) .value(PY_ENUM(LIEF::MODES::MODE_MCLASS)) .value(PY_ENUM(LIEF::MODES::MODE_MICRO)) .value(PY_ENUM(LIEF::MODES::MODE_MIPS3)) .value(PY_ENUM(LIEF::MODES::MODE_MIPS32R6)) .value(PY_ENUM(LIEF::MODES::MODE_MIPSGP64)) .value(PY_ENUM(LIEF::MODES::MODE_V7)) .value(PY_ENUM(LIEF::MODES::MODE_V8)) .value(PY_ENUM(LIEF::MODES::MODE_V9)) .value(PY_ENUM(LIEF::MODES::MODE_MIPS32)) .value(PY_ENUM(LIEF::MODES::MODE_MIPS64)) .export_values(); py::enum_(m, "ENDIANNESS") .value(PY_ENUM(LIEF::ENDIANNESS::ENDIAN_NONE)) .value(PY_ENUM(LIEF::ENDIANNESS::ENDIAN_BIG)) .value(PY_ENUM(LIEF::ENDIANNESS::ENDIAN_LITTLE)) .export_values(); } LIEF-0.9.0/api/python/CMakeLists.txt000066400000000000000000000131331330725006400170720ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.1) include(ExternalProject) include(CheckCXXCompilerFlag) include(CheckCCompilerFlag) macro(ADD_FLAG_IF_SUPPORTED flag name) CHECK_C_COMPILER_FLAG("${flag}" "C_SUPPORTS_${name}") CHECK_CXX_COMPILER_FLAG("${flag}" "CXX_SUPPORTS_${name}") if (C_SUPPORTS_${name}) target_compile_options(pyLIEF PRIVATE ${flag}) endif() if (CXX_SUPPORTS_${name}) target_compile_options(pyLIEF PRIVATE ${flag}) endif() endmacro() set(PYTHON_VERSION "3.5" CACHE STRING "Python Version to use") find_package(PythonLibsNew EXACT ${PYTHON_VERSION} MODULE REQUIRED) message(STATUS "Python version: ${PYTHON_VERSION}") message(STATUS "Python lib: ${PYTHON_LIBRARY}") message(STATUS "Python include: ${PYTHON_INCLUDE_DIR}") message(STATUS "Python interpreter: ${PYTHON_EXECUTABLE}") set(PYBIND11_VERSION 2.2.1) set(PYBIND11_SHA256 SHA256=53c373d7d0b0711fea96beba666a9985269dc9e43e6088ea73faaa89b07b972e) set(PYBIND11_URL "${THIRD_PARTY_DIRECTORY}/pybind11-${PYBIND11_VERSION}.zip" CACHE STRING "URL to the Pybind11 repo") ExternalProject_Add(lief_pybind11 URL ${PYBIND11_URL} URL_HASH ${PYBIND11_SHA256} CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "") ExternalProject_get_property(lief_pybind11 SOURCE_DIR) set(PYBIND11_SOURCE_DIR "${SOURCE_DIR}") # Define source files set(LIEF_PYTHON_BASIC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/pyLIEF.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/pyUtils.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/pyIterators.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/pyExceptions.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/pyLogger.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/pyHash.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/pyObject.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/encoding.cpp" ) if (LIEF_ENABLE_JSON) set(LIEF_PYTHON_BASIC_SRC ${LIEF_PYTHON_BASIC_SRC} "${CMAKE_CURRENT_SOURCE_DIR}/pyJson.cpp" ) endif() set(LIEF_PYTHON_SRC ${LIEF_PYTHON_BASIC_SRC} ) set(LIEF_PYTHON_BASIC_HDR "${CMAKE_CURRENT_SOURCE_DIR}/pyIterators.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/pyLIEF.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/enums_wrapper.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/encoding.hpp" ) set(LIEF_PYTHON_HDR ${LIEF_PYTHON_BASIC_HDR} ) source_group("Header Files" FILES ${LIEF_PYTHON_BASIC_HDR}) add_library(pyLIEF SHARED ${LIEF_PYTHON_SRC} ${LIEF_PYTHON_HDR}) target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/" "${PYTHON_INCLUDE_DIR}" "${PYBIND11_SOURCE_DIR}/include") add_definitions(-DELPP_NO_DEFAULT_LOG_FILE) include("${CMAKE_CURRENT_SOURCE_DIR}/Abstract/CMakeLists.txt") if(LIEF_ELF) include("${CMAKE_CURRENT_SOURCE_DIR}/ELF/CMakeLists.txt") endif() if(LIEF_PE) include("${CMAKE_CURRENT_SOURCE_DIR}/PE/CMakeLists.txt") endif() if(LIEF_MACHO) include("${CMAKE_CURRENT_SOURCE_DIR}/MachO/CMakeLists.txt") endif() if(LIEF_OAT) include("${CMAKE_CURRENT_SOURCE_DIR}/OAT/CMakeLists.txt") endif() if(LIEF_DEX) include("${CMAKE_CURRENT_SOURCE_DIR}/DEX/CMakeLists.txt") endif() if(LIEF_VDEX) include("${CMAKE_CURRENT_SOURCE_DIR}/VDEX/CMakeLists.txt") endif() if(LIEF_ART) include("${CMAKE_CURRENT_SOURCE_DIR}/ART/CMakeLists.txt") endif() include("${CMAKE_CURRENT_SOURCE_DIR}/platforms/CMakeLists.txt") target_compile_features(pyLIEF PRIVATE cxx_attribute_deprecated) set_property(TARGET pyLIEF PROPERTY CXX_STANDARD 11) set_property(TARGET pyLIEF PROPERTY CXX_STANDARD_REQUIRED ON) if (MSVC) target_compile_options(pyLIEF PUBLIC /FIiso646.h) set_property(TARGET pyLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) endif() set_target_properties(pyLIEF PROPERTIES PYTHON_VERSION ${PYTHON_VERSION}) set(PYLIEF_DEPS_LIBRARIES LIB_LIEF_STATIC) if(LIEF_COVERAGE) target_compile_options(pyLIEF PRIVATE -g -O0 --coverage -fprofile-arcs -ftest-coverage) set(PYLIEF_DEPS_LIBRARIES ${PYLIEF_DEPS_LIBRARIES} gcov) endif() ADD_FLAG_IF_SUPPORTED("-Wno-macro-redefined" NO_MACRO_REDEFINED) set_target_properties(pyLIEF PROPERTIES PREFIX "" OUTPUT_NAME "_pylief") add_dependencies(pyLIEF lief_pybind11) if(APPLE) set_target_properties(pyLIEF PROPERTIES MACOSX_RPATH ".") set_target_properties(pyLIEF PROPERTIES LINK_FLAGS "-undefined dynamic_lookup ") endif() set_target_properties(pyLIEF PROPERTIES PREFIX "") if (UNIX) set_target_properties(pyLIEF PROPERTIES SUFFIX ".so") elseif(WIN32) set_target_properties(pyLIEF PROPERTIES SUFFIX ".pyd") endif() get_target_property(suffix pyLIEF SUFFIX) set(LIEF_LIBRARY_NAME "lief${suffix}") if (WIN32) set(PYLIEF_DEPS_LIBRARIES ${PYLIEF_DEPS_LIBRARIES} ${PYTHON_LIBRARIES}) endif() target_link_libraries(pyLIEF PUBLIC ${PYLIEF_DEPS_LIBRARIES}) add_custom_command(TARGET pyLIEF POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_BINARY_DIR}/api/python/lief ) if (MSVC) add_custom_command(TARGET pyLIEF POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_BINARY_DIR} ) endif() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup.py") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in" "${CMAKE_CURRENT_BINARY_DIR}/lief/__init__.py") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/README" "${CMAKE_CURRENT_BINARY_DIR}/README") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.in" "${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.in") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg" "${CMAKE_CURRENT_BINARY_DIR}/setup.cfg") MESSAGE(STATUS "OS: ${CMAKE_HOST_SYSTEM}") find_program(ENV_BINARY "env") if (UNIX AND ENV_BINARY AND LIEF_INSTALL_PYTHON) install(CODE "execute_process(COMMAND ${ENV_BINARY} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/setup.py install)" COMPONENT python) endif() LIEF-0.9.0/api/python/DEX/000077500000000000000000000000001330725006400147515ustar00rootroot00000000000000LIEF-0.9.0/api/python/DEX/CMakeLists.txt000066400000000000000000000020771330725006400175170ustar00rootroot00000000000000set(LIEF_PYTHON_DEX_SRC "${CMAKE_CURRENT_LIST_DIR}/pyDEX.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyEnums.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyIterators.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" "${CMAKE_CURRENT_LIST_DIR}/objects/pyClass.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyMethod.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyCodeInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyMapList.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyMapItem.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyType.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyPrototype.cpp" ) set(LIEF_PYTHON_DEX_HDR "${CMAKE_CURRENT_LIST_DIR}/pyDEX.hpp") source_group("Source Files\\DEX" FILES ${LIEF_PYTHON_DEX_SRC}) source_group("Header Files\\DEX" FILES ${LIEF_PYTHON_DEX_HDR}) target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_DEX_SRC}" "${LIEF_PYTHON_DEX_HDR}") target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_LIST_DIR}/../") LIEF-0.9.0/api/python/DEX/objects/000077500000000000000000000000001330725006400164025ustar00rootroot00000000000000LIEF-0.9.0/api/python/DEX/objects/pyClass.cpp000066400000000000000000000063271330725006400205340ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/Class.hpp" #include "LIEF/DEX/hash.hpp" #include "pyDEX.hpp" namespace LIEF { namespace DEX { template using getter_t = T (Class::*)(void) const; template using no_const_getter_t = T (Class::*)(void); template using setter_t = void (Class::*)(T); template<> void create(py::module& m) { py::class_(m, "Class", "DEX Class representation") .def_property_readonly("fullname", &Class::fullname, "Mangled class name (e.g. ``Lcom/example/android/MyActivity;``)") .def_property_readonly("pretty_name", &Class::pretty_name, "Demangled class name (e.g. ``com.example.android.MyActivity``)") .def_property_readonly("name", &Class::name, "Class name (e.g. ``MyActivity``)") .def_property_readonly("source_filename", &Class::source_filename, "Original filename") .def_property_readonly("package_name", &Class::package_name, "Package Name (e.g. ``com.example.android``)") .def_property_readonly("has_parent", &Class::has_parent, "True if the current class extends another one") .def_property_readonly("parent", static_cast>(&Class::parent), "" RST_CLASS_REF(lief.DEX.Class) " parent class") .def_property_readonly("methods", static_cast>(&Class::methods), "Iterator over " RST_CLASS_REF(lief.DEX.Method) " implemented in this class") .def("get_method", static_cast(&Class::methods), "Iterator over " RST_CLASS_REF(lief.DEX.Method) " (s) having the given name", "name"_a) .def_property_readonly("access_flags", static_cast>(&Class::access_flags), "List of " RST_CLASS_REF(lief.DEX.ACCESS_FLAGS) "") .def_property_readonly("dex2dex_info", &Class::dex2dex_info, "De-optimize information") .def_property_readonly("index", &Class::index, "Original index in the DEX class pool") .def("has", static_cast(&Class::has), "Check if the given " RST_CLASS_REF(lief.DEX.ACCESS_FLAGS) " is present", "flag"_a) .def("__eq__", &Class::operator==) .def("__ne__", &Class::operator!=) .def("__hash__", [] (const Class& cls) { return Hash::hash(cls); }) .def("__str__", [] (const Class& cls) { std::ostringstream stream; stream << cls; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/objects/pyCodeInfo.cpp000066400000000000000000000026221330725006400211470ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/CodeInfo.hpp" #include "LIEF/DEX/hash.hpp" #include "pyDEX.hpp" namespace LIEF { namespace DEX { template using getter_t = T (CodeInfo::*)(void) const; template using no_const_getter_t = T (CodeInfo::*)(void); template using setter_t = void (CodeInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "CodeInfo", "DEX CodeInfo representation") .def("__eq__", &CodeInfo::operator==) .def("__ne__", &CodeInfo::operator!=) .def("__hash__", [] (const CodeInfo& cinfo) { return Hash::hash(cinfo); }) .def("__str__", [] (const CodeInfo& cinfo) { std::ostringstream stream; stream << cinfo; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/objects/pyFile.cpp000066400000000000000000000075141330725006400203450ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/File.hpp" #include "LIEF/DEX/hash.hpp" #include "pyDEX.hpp" namespace LIEF { namespace DEX { template using getter_t = T (File::*)(void) const; template using no_const_getter_t = T (File::*)(void); template using setter_t = void (File::*)(T); template<> void create(py::module& m) { py::class_(m, "File", "DEX File representation") .def_property_readonly("version", &File::version, "Dex version") .def_property_readonly("header", static_cast>(&File::header), "Dex File " RST_CLASS_REF(lief.DEX.Header) "", py::return_value_policy::reference) .def_property_readonly("classes", static_cast>(&File::classes), "Iterator over Dex " RST_CLASS_REF(lief.DEX.Class) "") .def("has_class", &File::has_class, "Check if a class with a name given in parameter exists", "classname"_a) .def("get_class", static_cast(&File::get_class), "classname"_a, py::return_value_policy::reference) .def("get_class", static_cast(&File::get_class), "classname"_a, py::return_value_policy::reference) .def_property_readonly("methods", static_cast>(&File::methods), "Iterator over Dex " RST_CLASS_REF(lief.DEX.Method) "") .def_property_readonly("strings", static_cast>(&File::strings), "Iterator over Dex strings") .def_property_readonly("types", static_cast>(&File::types), "Iterator over Dex " RST_CLASS_REF(lief.DEX.Type) "") .def_property_readonly("prototypes", static_cast>(&File::prototypes), "Iterator over Dex " RST_CLASS_REF(lief.DEX.Prototype) "") .def_property_readonly("map", static_cast>(&File::map), "Dex " RST_CLASS_REF(lief.DEX.MapList) "") .def("raw", &File::raw, "Original raw file", "deoptimize"_a = true) .def_property("name", static_cast>(&File::name), static_cast>(&File::name), "Name of the dex file") .def_property("location", static_cast>(&File::location), static_cast>(&File::location), "Original location of the dex file") //.def_property_readonly("dex2dex_info", // &File::dex2dex_info) .def_property_readonly("dex2dex_json_info", &File::dex2dex_json_info) .def("save", &File::save, "Save the **original** file into the file given in first parameter", "output"_a = "", "deoptimize"_a = true) .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; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/objects/pyHeader.cpp000066400000000000000000000075321330725006400206560ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/Header.hpp" #include "LIEF/DEX/hash.hpp" #include "pyDEX.hpp" namespace LIEF { namespace DEX { 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", "DEX Header") .def_property_readonly("magic", static_cast>(&Header::magic), "Magic value") .def_property_readonly("checksum", static_cast>(&Header::checksum), "Checksum value of the rest of the file (without " RST_ATTR_REF(lief.DEX.Header.magic) ")") .def_property_readonly("signature", static_cast>(&Header::signature), "SHA-1 signature of the rest of the file (without " RST_ATTR_REF(lief.DEX.Header.magic) " and " RST_ATTR_REF(lief.DEX.Header.checksum) ")") .def_property_readonly("file_size", static_cast>(&Header::file_size), "Size of the current DEX file") .def_property_readonly("header_size", static_cast>(&Header::header_size), "Size of this header. Should be ``0x70``") .def_property_readonly("endian_tag", static_cast>(&Header::endian_tag), "Endianness tag. Should be ``ENDIAN_CONSTANT``") .def_property_readonly("map_offset", static_cast>(&Header::map), "Offset from the start of the file to the map item") .def_property_readonly("strings", static_cast>(&Header::strings), "String identifiers") .def_property_readonly("link", static_cast>(&Header::link), "Link (raw data)") .def_property_readonly("types", static_cast>(&Header::types), "Type identifiers") .def_property_readonly("prototypes", static_cast>(&Header::prototypes), "Prototypes identifiers") .def_property_readonly("fields", static_cast>(&Header::fields), "Fields identifiers") .def_property_readonly("methods", static_cast>(&Header::methods), "Methods identifiers") .def_property_readonly("classes", static_cast>(&Header::classes), "Classess identifiers") .def_property_readonly("data", static_cast>(&Header::data), "Raw data. Should be align on 32-bits") .def_property_readonly("nb_classes", static_cast>(&Header::nb_classes), "Number of classes in the current DEX") .def_property_readonly("nb_methods", static_cast>(&Header::nb_methods), "Number of methods in the current DEX") .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; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/objects/pyMapItem.cpp000066400000000000000000000062621330725006400210210ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/MapItem.hpp" #include "LIEF/DEX/hash.hpp" #include "LIEF/DEX/EnumToString.hpp" #include "pyDEX.hpp" namespace LIEF { namespace DEX { #define PY_ENUM(x) to_string(x), x template using getter_t = T (MapItem::*)(void) const; template using no_const_getter_t = T (MapItem::*)(void); template using setter_t = void (MapItem::*)(T); template<> void create(py::module& m) { py::class_ mapitem(m, "MapItem", "DEX MapItem representation"); py::enum_(mapitem, "TYPES") .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::HEADER)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::STRING_ID)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::TYPE_ID)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::PROTO_ID)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::FIELD_ID)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::METHOD_ID)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::CLASS_DEF)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::CALL_SITE_ID)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::METHOD_HANDLE)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::MAP_LIST)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::TYPE_LIST)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::ANNOTATION_SET_REF_LIST)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::ANNOTATION_SET)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::CLASS_DATA)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::CODE)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::STRING_DATA)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::DEBUG_INFO)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::ANNOTATION)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::ENCODED_ARRAY)) .value(PY_ENUM(LIEF::DEX::MapItem::TYPES::ANNOTATIONS_DIRECTORY)); mapitem .def_property_readonly("type", static_cast>(&MapItem::type), "" RST_CLASS_REF(lief.DEX.MapItem.TYPES) " of the item") .def_property_readonly("offset", static_cast>(&MapItem::offset), "Offset from the start of the file to the items in question") .def_property_readonly("size", static_cast>(&MapItem::size), "count of the number of items to be found at the indicated offset") .def("__eq__", &MapItem::operator==) .def("__ne__", &MapItem::operator!=) .def("__hash__", [] (const MapItem& mlist) { return Hash::hash(mlist); }) .def("__str__", [] (const MapItem& mlist) { std::ostringstream stream; stream << mlist; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/objects/pyMapList.cpp000066400000000000000000000042521330725006400210330ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/MapList.hpp" #include "LIEF/DEX/hash.hpp" #include "pyDEX.hpp" #include "pyIterators.hpp" namespace LIEF { namespace DEX { template using getter_t = T (MapList::*)(void) const; template using no_const_getter_t = T (MapList::*)(void); template using setter_t = void (MapList::*)(T); template<> void create(py::module& m) { init_ref_iterator(m, "lief.DEX.MapList.it_items_t"); py::class_(m, "MapList", "DEX MapList representation") .def_property_readonly("items", static_cast>(&MapList::items), "Iterator over " RST_CLASS_REF(lief.DEX.MapItem) "") .def("has", &MapList::has, "Check if the given " RST_CLASS_REF(lief.DEX.MapItem.TYPES) " is present", "type"_a) .def("get", static_cast(&MapList::get), "Return the " RST_CLASS_REF(lief.DEX.MapItem.TYPES) " from " "the given " RST_CLASS_REF(lief.DEX.MapItem.TYPES) "", "type"_a, py::return_value_policy::reference) .def("__getitem__", static_cast(&MapList::get)) .def("__eq__", &MapList::operator==) .def("__ne__", &MapList::operator!=) .def("__hash__", [] (const MapList& mlist) { return Hash::hash(mlist); }) .def("__str__", [] (const MapList& mlist) { std::ostringstream stream; stream << mlist; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/objects/pyMethod.cpp000066400000000000000000000057671330725006400207160ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/Method.hpp" #include "LIEF/DEX/hash.hpp" #include "pyDEX.hpp" namespace LIEF { namespace DEX { template using getter_t = T (Method::*)(void) const; template using no_const_getter_t = T (Method::*)(void); template using setter_t = void (Method::*)(T); template<> void create(py::module& m) { py::class_(m, "Method", "DEX Method representation") .def_property_readonly("name", &Method::name, "Method's name") .def_property_readonly("index", &Method::index, "Original DEX file index of the method") .def_property_readonly("has_class", &Method::has_class, "True if a class is associated with this method") .def_property_readonly("cls", static_cast>(&Method::cls), "" RST_CLASS_REF(lief.DEX.Class) " associated with this method") .def_property_readonly("code_offset", static_cast>(&Method::code_offset), "Offset to the Dalvik Bytecode") .def_property_readonly("bytecode", static_cast>(&Method::bytecode), "Dalvik Bytecode as a list of bytes") .def_property_readonly("is_virtual", &Method::is_virtual, "True if the method is a virtual (not **private**, **static**, **final**, **constructor**)") .def_property_readonly("prototype", static_cast>(&Method::prototype), "" RST_CLASS_REF(lief.DEX.Prototype) " of this method") .def_property_readonly("access_flags", static_cast>(&Method::access_flags), "List of " RST_CLASS_REF(lief.DEX.ACCESS_FLAGS) "") .def("has", static_cast(&Method::has), "Check if the given " RST_CLASS_REF(lief.DEX.ACCESS_FLAGS) " is present", "flag"_a) .def("insert_dex2dex_info", &Method::insert_dex2dex_info, "Insert de-optimization information", "pc"_a, "index"_a) .def("__eq__", &Method::operator==) .def("__ne__", &Method::operator!=) .def("__hash__", [] (const Method& cls) { return Hash::hash(cls); }) .def("__str__", [] (const Method& cls) { std::ostringstream stream; stream << cls; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/objects/pyParser.cpp000066400000000000000000000046011330725006400207140ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyDEX.hpp" #include "LIEF/DEX/Parser.hpp" #include namespace LIEF { namespace DEX { template<> void create(py::module& m) { m.def("parse", static_cast (*) (const std::string&)>(&Parser::parse), "Parse the given filename and return a " RST_CLASS_REF(lief.DEX.File) " object" "filename"_a, py::return_value_policy::take_ownership); m.def("parse", static_cast (*) (const std::vector&, const std::string&)>(&Parser::parse), "Parse the given raw data and return a " RST_CLASS_REF(lief.DEX.File) " object\n\n" "raw"_a, py::arg("name") = "", py::return_value_policy::take_ownership); m.def("parse", [] (py::object byteio, const std::string& name) { auto&& io = py::module::import("io"); auto&& RawIOBase = io.attr("RawIOBase"); auto&& BufferedIOBase = io.attr("BufferedIOBase"); 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::DEX::Parser::parse(std::move(raw), name); }, "io"_a, "name"_a = "", py::return_value_policy::take_ownership); } } } LIEF-0.9.0/api/python/DEX/objects/pyPrototype.cpp000066400000000000000000000036531330725006400214730ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/Prototype.hpp" #include "LIEF/DEX/hash.hpp" #include "pyDEX.hpp" #include "pyIterators.hpp" namespace LIEF { namespace DEX { template using getter_t = T (Prototype::*)(void) const; template using no_const_getter_t = T (Prototype::*)(void); template using setter_t = void (Prototype::*)(T); template<> void create(py::module& m) { init_ref_iterator(m, "lief.DEX.Prototype.it_params"); py::class_(m, "Prototype", "DEX Prototype representation") .def_property_readonly("return_type", static_cast>(&Prototype::return_type), "" RST_CLASS_REF(lief.DEX.Type) " returned", py::return_value_policy::reference) .def_property_readonly("parameters_type", static_cast>(&Prototype::parameters_type), "Iterator over parameters " RST_CLASS_REF(lief.DEX.Type) "") .def("__eq__", &Prototype::operator==) .def("__ne__", &Prototype::operator!=) .def("__hash__", [] (const Prototype& ptype) { return Hash::hash(ptype); }) .def("__str__", [] (const Prototype& ptype) { std::ostringstream stream; stream << ptype; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/objects/pyType.cpp000066400000000000000000000067501330725006400204100ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/DEX/Type.hpp" #include "LIEF/DEX/hash.hpp" #include "LIEF/DEX/EnumToString.hpp" #include "pyDEX.hpp" #define PY_ENUM(x) to_string(x), x namespace LIEF { namespace DEX { template using getter_t = T (Type::*)(void) const; template using no_const_getter_t = T (Type::*)(void); template using setter_t = void (Type::*)(T); template<> void create(py::module& m) { py::class_ pytype(m, "Type", "DEX Type representation"); py::enum_(pytype, "TYPES") .value(PY_ENUM(Type::TYPES::UNKNOWN)) .value(PY_ENUM(Type::TYPES::ARRAY)) .value(PY_ENUM(Type::TYPES::PRIMITIVE)) .value(PY_ENUM(Type::TYPES::CLASS)); py::enum_(pytype, "PRIMITIVES") .value(PY_ENUM(Type::PRIMITIVES::VOID_T)) .value(PY_ENUM(Type::PRIMITIVES::BOOLEAN)) .value(PY_ENUM(Type::PRIMITIVES::BYTE)) .value(PY_ENUM(Type::PRIMITIVES::SHORT)) .value(PY_ENUM(Type::PRIMITIVES::CHAR)) .value(PY_ENUM(Type::PRIMITIVES::INT)) .value(PY_ENUM(Type::PRIMITIVES::LONG)) .value(PY_ENUM(Type::PRIMITIVES::FLOAT)) .value(PY_ENUM(Type::PRIMITIVES::DOUBLE)); pytype .def_property_readonly("type", &Type::type, "" RST_CLASS_REF(lief.DEX.Type.TYPES) " of this object") .def_property_readonly("value", [] (Type& type) -> py::object { switch (type.type()) { case Type::TYPES::ARRAY: { return py::cast(type.array()); } case Type::TYPES::CLASS: { return py::cast(type.cls()); } case Type::TYPES::PRIMITIVE: { return py::cast(type.primitive()); } case Type::TYPES::UNKNOWN: default: { return py::none{}; } } }, "Depending on the " RST_CLASS_REF(lief.DEX.Type.TYPES) ", return " " " RST_CLASS_REF(lief.DEX.Class) " or " RST_CLASS_REF(lief.DEX.Type.PRIMITIVES) " or array", py::return_value_policy::reference) .def_property_readonly("dim", &Type::dim, "If the current type is an array, return its dimension otherwise 0") .def_property_readonly("underlying_array_type", static_cast>(&Type::underlying_array_type), "Underlying type of the array", py::return_value_policy::reference) .def_static("pretty_name", &Type::pretty_name, "Pretty name of primitives", "primitive"_a) .def("__eq__", &Type::operator==) .def("__ne__", &Type::operator!=) .def("__hash__", [] (const Type& type) { return Hash::hash(type); }) .def("__str__", [] (const Type& type) { std::ostringstream stream; stream << type; return stream.str(); }); } } } LIEF-0.9.0/api/python/DEX/pyDEX.cpp000066400000000000000000000022441330725006400164500ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyDEX.hpp" namespace LIEF { namespace DEX { void init_python_module(py::module& m) { py::module LIEF_DEX_module = m.def_submodule("DEX", "Python API for DEX format"); init_enums(LIEF_DEX_module); init_iterators(LIEF_DEX_module); init_objects(LIEF_DEX_module); init_utils(LIEF_DEX_module); } void init_objects(py::module& m) { CREATE(Parser, m); CREATE(File, m); CREATE(Header, m); CREATE(Class, m); CREATE(Method, m); CREATE(Prototype, m); CREATE(Type, m); CREATE(MapList, m); CREATE(MapItem, m); CREATE(CodeInfo, m); } } } LIEF-0.9.0/api/python/DEX/pyDEX.hpp000066400000000000000000000025541330725006400164610ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_DEX_H_ #define PY_LIEF_DEX_H_ #include "LIEF/DEX.hpp" #include "pyLIEF.hpp" #define SPECIALIZE_CREATE(X) \ template<> \ void create(py::module&) #define CREATE(X,Y) create(Y) namespace LIEF { namespace DEX { template void create(py::module&); void init_python_module(py::module& m); void init_objects(py::module&); void init_iterators(py::module&); void init_enums(py::module&); void init_utils(py::module&); SPECIALIZE_CREATE(Parser); SPECIALIZE_CREATE(File); SPECIALIZE_CREATE(Header); SPECIALIZE_CREATE(Class); SPECIALIZE_CREATE(Method); SPECIALIZE_CREATE(Prototype); SPECIALIZE_CREATE(Type); SPECIALIZE_CREATE(MapList); SPECIALIZE_CREATE(MapItem); SPECIALIZE_CREATE(CodeInfo); } } #endif LIEF-0.9.0/api/python/DEX/pyEnums.cpp000066400000000000000000000036151330725006400171220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyDEX.hpp" #include "LIEF/DEX/Structures.hpp" #include "LIEF/DEX/enums.hpp" #include "LIEF/DEX/EnumToString.hpp" #define PY_ENUM(x) to_string(x), x namespace LIEF { namespace DEX { void init_enums(py::module& m) { py::enum_(m, "ACCESS_FLAGS") .value(PY_ENUM(ACCESS_FLAGS::ACC_UNKNOWN)) .value(PY_ENUM(ACCESS_FLAGS::ACC_PUBLIC)) .value(PY_ENUM(ACCESS_FLAGS::ACC_PRIVATE)) .value(PY_ENUM(ACCESS_FLAGS::ACC_PROTECTED)) .value(PY_ENUM(ACCESS_FLAGS::ACC_STATIC)) .value(PY_ENUM(ACCESS_FLAGS::ACC_FINAL)) .value(PY_ENUM(ACCESS_FLAGS::ACC_SYNCHRONIZED)) .value(PY_ENUM(ACCESS_FLAGS::ACC_VOLATILE)) .value(PY_ENUM(ACCESS_FLAGS::ACC_BRIDGE)) .value(PY_ENUM(ACCESS_FLAGS::ACC_TRANSIENT)) .value(PY_ENUM(ACCESS_FLAGS::ACC_VARARGS)) .value(PY_ENUM(ACCESS_FLAGS::ACC_NATIVE)) .value(PY_ENUM(ACCESS_FLAGS::ACC_INTERFACE)) .value(PY_ENUM(ACCESS_FLAGS::ACC_ABSTRACT)) .value(PY_ENUM(ACCESS_FLAGS::ACC_STRICT)) .value(PY_ENUM(ACCESS_FLAGS::ACC_SYNTHETIC)) .value(PY_ENUM(ACCESS_FLAGS::ACC_ANNOTATION)) .value(PY_ENUM(ACCESS_FLAGS::ACC_ENUM)) .value(PY_ENUM(ACCESS_FLAGS::ACC_CONSTRUCTOR)) .value(PY_ENUM(ACCESS_FLAGS::ACC_ABSTRACT)) .value(PY_ENUM(ACCESS_FLAGS::ACC_DECLARED_SYNCHRONIZED)) .export_values(); } } } LIEF-0.9.0/api/python/DEX/pyIterators.cpp000066400000000000000000000017761330725006400200150ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyDEX.hpp" #include "pyIterators.hpp" #include "LIEF/DEX/type_traits.hpp" namespace LIEF { namespace DEX { void init_iterators(py::module& m) { init_ref_iterator(m, "lief.DEX.it_dex_files"); init_ref_iterator(m, "lief.DEX.it_classes"); init_ref_iterator(m, "lief.DEX.it_methods"); init_ref_iterator(m, "lief.DEX.it_strings"); } } } LIEF-0.9.0/api/python/DEX/pyUtils.cpp000066400000000000000000000026171330725006400171340ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyDEX.hpp" #include "LIEF/DEX/utils.hpp" namespace LIEF { namespace DEX { void init_utils(py::module& m) { m.def("is_dex", static_cast(&is_dex), "Check if the **file** given in parameter is an DDEX", "path"_a); m.def("is_dex", static_cast&)>(&is_dex), "Check if the **raw data** given in parameter is a DEX", "raw"_a); m.def("version", static_cast(&version), "Return the DEX version of the **file** given in parameter", "file"_a); m.def("version", static_cast&)>(&version), "Return the DEX version of the **raw data** given in parameter", "raw"_a); } } } LIEF-0.9.0/api/python/ELF/000077500000000000000000000000001330725006400147375ustar00rootroot00000000000000LIEF-0.9.0/api/python/ELF/CMakeLists.txt000066400000000000000000000036631330725006400175070ustar00rootroot00000000000000set(LIEF_PYTHON_ELF_SRC "${CMAKE_CURRENT_LIST_DIR}/pyELF.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDynamicEntry.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySymbolVersionAuxRequirement.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySymbolVersion.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDynamicEntryRunPath.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySymbolVersionRequirement.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyBinary.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySymbolVersionDefinition.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyHeader.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySymbolVersionAux.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDynamicEntryArray.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDynamicEntryFlags.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySegment.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySection.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDynamicEntryRpath.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRelocation.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDynamicSharedObject.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyParser.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDynamicEntryLibrary.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySymbol.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyGnuHash.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySysvHash.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyBuilder.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyEnums.cpp" "${CMAKE_CURRENT_LIST_DIR}/pySizes.cpp" ) set(LIEF_PYTHON_ELF_NOTE "${CMAKE_CURRENT_LIST_DIR}/objects/pyNote.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyAndroidNote.cpp" ) list(APPEND LIEF_PYTHON_ELF_SRC ${LIEF_PYTHON_ELF_NOTE}) set(LIEF_PYTHON_ELF_HDR "${CMAKE_CURRENT_LIST_DIR}/pyELF.hpp") source_group("Source Files\\ELF" FILES ${LIEF_PYTHON_ELF_SRC}) source_group("Header Files\\ELF" FILES ${LIEF_PYTHON_ELF_HDR}) target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_ELF_SRC}" "${LIEF_PYTHON_ELF_HDR}") target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}") LIEF-0.9.0/api/python/ELF/objects/000077500000000000000000000000001330725006400163705ustar00rootroot00000000000000LIEF-0.9.0/api/python/ELF/objects/pyAndroidNote.cpp000066400000000000000000000041241330725006400216540ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/AndroidNote.hpp" namespace LIEF { namespace ELF { template using getter_t = T (AndroidNote::*)(void) const; template using setter_t = void (AndroidNote::*)(T); template<> void create(py::module& m) { py::class_(m, "AndroidNote") .def_property("sdk_version", static_cast>(&AndroidNote::sdk_version), static_cast>(&AndroidNote::sdk_version), "Target SDK platform" ) .def_property("ndk_version", static_cast>(&AndroidNote::ndk_version), static_cast>(&AndroidNote::ndk_version), "Android NDK version used to build the current binary" ) .def_property("ndk_build_number", static_cast>(&AndroidNote::ndk_build_number), static_cast>(&AndroidNote::ndk_build_number), "Android NDK build number" ) .def("__eq__", &AndroidNote::operator==) .def("__ne__", &AndroidNote::operator!=) .def("__hash__", [] (const AndroidNote& note) { return Hash::hash(note); }) .def("__str__", [] (const AndroidNote& note) { std::ostringstream stream; stream << note; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyBinary.cpp000066400000000000000000000513351330725006400207000ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/Abstract/Binary.hpp" #include "pyELF.hpp" namespace LIEF { namespace ELF { template using no_const_getter = T (Binary::*)(void); template using no_const_func = T (Binary::*)(P); template using getter_t = T (Binary::*)(void) const; template using setter_t = void (Binary::*)(T); template<> void create(py::module& m) { // Binary object py::class_(m, "Binary", "ELF binary representation") .def(py::init()) .def_property_readonly("type", &Binary::type, "Return the binary's " RST_CLASS_REF(lief.ELF.ELF_CLASS) "") .def_property_readonly("header", static_cast>(&Binary::header), "Return " RST_CLASS_REF(lief.ELF.Header) " object", py::return_value_policy::reference_internal) .def_property_readonly("sections", static_cast>(&Binary::sections), "Return an iterator to binary's " RST_CLASS_REF(lief.ELF.Section) "", py::return_value_policy::reference_internal) .def_property_readonly("segments", static_cast>(&Binary::segments), "Return an interator to binary's " RST_CLASS_REF(lief.ELF.Segment) "", py::return_value_policy::reference_internal) .def_property_readonly("dynamic_entries", static_cast>(&Binary::dynamic_entries), "Return an iterator to " RST_CLASS_REF(lief.ELF.DynamicEntry) " entries as a list", py::return_value_policy::reference_internal) .def("add", static_cast(&Binary::add), "Add a new " RST_CLASS_REF(lief.ELF.DynamicEntry) " in the binary", "dynamic_entry", py::return_value_policy::reference) .def_property_readonly("static_symbols", static_cast>(&Binary::static_symbols), "Return an iterator to static " RST_CLASS_REF(lief.ELF.Symbol) "", py::return_value_policy::reference_internal) .def_property_readonly("dynamic_symbols", static_cast>(&Binary::dynamic_symbols), "Return an iterator to dynamic " RST_CLASS_REF(lief.ELF.Symbol) "", py::return_value_policy::reference_internal) .def_property_readonly("symbols", static_cast>(&Binary::symbols), "Return an iterator over both **static** and **dynamic** " RST_CLASS_REF(lief.ELF.Symbol) "", py::return_value_policy::reference_internal) .def_property_readonly("exported_symbols", static_cast>(&Binary::exported_symbols), "Return dynamic " RST_CLASS_REF(lief.ELF.Symbol) " which are exported", py::return_value_policy::reference_internal) .def_property_readonly("imported_symbols", static_cast>(&Binary::imported_symbols), "Return dynamic " RST_CLASS_REF(lief.ELF.Symbol) " which are imported", py::return_value_policy::reference_internal) .def_property_readonly("dynamic_relocations", static_cast>(&Binary::dynamic_relocations), "Return an iterator over dynamics " RST_CLASS_REF(lief.ELF.Relocation) "", py::return_value_policy::reference_internal) .def("add_dynamic_relocation", &Binary::add_dynamic_relocation, py::return_value_policy::reference) .def("add_pltgot_relocation", &Binary::add_pltgot_relocation, py::return_value_policy::reference) .def_property_readonly("pltgot_relocations", static_cast>(&Binary::pltgot_relocations), "Return an iterator over PLT/GOT " RST_CLASS_REF(lief.ELF.Relocation) "", py::return_value_policy::reference_internal) .def_property_readonly("object_relocations", static_cast>(&Binary::object_relocations), "Return an iterator over object " RST_CLASS_REF(lief.ELF.Relocation) "", py::return_value_policy::reference_internal) .def_property_readonly("relocations", static_cast>(&Binary::relocations), "Return an iterator over **all** " RST_CLASS_REF(lief.ELF.Relocation) " s", py::return_value_policy::reference_internal) .def_property_readonly("symbols_version", static_cast>(&Binary::symbols_version), "Return an iterator " RST_CLASS_REF(lief.ELF.SymbolVersion) "", py::return_value_policy::reference_internal) .def_property_readonly("symbols_version_requirement", static_cast>(&Binary::symbols_version_requirement), "Return an iterator to " RST_CLASS_REF(lief.ELF.SymbolVersionRequirement) "", py::return_value_policy::reference_internal) .def_property_readonly("symbols_version_definition", static_cast>(&Binary::symbols_version_definition), "Return an iterator to " RST_CLASS_REF(lief.ELF.SymbolVersionDefinition) "", py::return_value_policy::reference_internal) .def_property_readonly("use_gnu_hash", &Binary::use_gnu_hash, "``True`` if GNU hash is used") .def_property_readonly("gnu_hash", &Binary::gnu_hash, "Return the " RST_CLASS_REF(lief.ELF.GnuHash) " object\n\n" "Hash are used by the loader to speed up symbols resolving (GNU Version)", py::return_value_policy::reference_internal) .def_property_readonly("use_sysv_hash", &Binary::use_sysv_hash, "``True`` if SYSV hash is used") .def_property_readonly("sysv_hash", &Binary::sysv_hash, "Return the " RST_CLASS_REF(lief.ELF.SysvHash) " object\n\n" "Hash are used by the loader to speed up symbols resolving (SYSV version)", py::return_value_policy::reference_internal) .def_property_readonly("imagebase", &Binary::imagebase, "Return the program image base. (e.g. ``0x400000``)") .def_property_readonly("virtual_size", &Binary::virtual_size, "Return the binary's size when mapped in memory") .def_property_readonly("is_pie", &Binary::is_pie, "``True`` if the binary is a ``pie`` one") .def_property_readonly("has_interpreter", &Binary::has_interpreter, "``True`` if the binary uses a loader") .def_property("interpreter", static_cast>(&Binary::interpreter), static_cast>(&Binary::interpreter), "ELF interprer (loader) if any. (e.g. ``/lib64/ld-linux-x86-64.so.2``)") .def("section_from_offset", static_cast>(&Binary::section_from_offset), "Return binary's " RST_CLASS_REF(lief.ELF.Section) " which holds the offset", "offset"_a, py::return_value_policy::reference) .def("section_from_virtual_address", static_cast>(&Binary::section_from_virtual_address), "Return binary's " RST_CLASS_REF(lief.ELF.Section) " which holds the given virtual address", "address"_a, py::return_value_policy::reference) .def("segment_from_virtual_address", static_cast>(&Binary::segment_from_virtual_address), "Return binary's " RST_CLASS_REF(lief.ELF.Segment) " which holds the address", "address"_a, py::return_value_policy::reference) .def("segment_from_offset", static_cast>(&Binary::segment_from_offset), "Return binary's " RST_CLASS_REF(lief.ELF.Segment) " which holds the offset", "offset"_a, py::return_value_policy::reference) .def("get", static_cast>(&Binary::get), "Return first binary's " RST_CLASS_REF(lief.ELF.DynamicEntry) " given its " RST_CLASS_REF(lief.ELF.DYNAMIC_TAGS) "", "tag"_a, py::return_value_policy::reference) .def("get", static_cast>(&Binary::get), "Return **first** binary's " RST_CLASS_REF(lief.ELF.Segment) " given its " RST_CLASS_REF(lief.ELF.SEGMENT_TYPES) "", "type"_a, py::return_value_policy::reference) .def("get", static_cast>(&Binary::get), "Return **first** binary's " RST_CLASS_REF(lief.ELF.Note) " given its " RST_CLASS_REF(lief.ELF.NOTE_TYPES) "", "type"_a, py::return_value_policy::reference) .def("get", static_cast>(&Binary::get), "Return **first** binary's " RST_CLASS_REF(lief.ELF.Section) " given its " RST_CLASS_REF(lief.ELF.ELF_SECTION_TYPES) "", "type"_a, py::return_value_policy::reference) .def("has", static_cast(&Binary::has), "Check if the " RST_CLASS_REF(lief.ELF.DynamicEntry) " associated with the given " RST_CLASS_REF(lief.ELF.DYNAMIC_TAGS) " exists", "tag"_a) .def("has", static_cast(&Binary::has), "Check if a " RST_CLASS_REF(lief.ELF.Segment) " of *type* (" RST_CLASS_REF(lief.ELF.SEGMENT_TYPES) ") exists", "type"_a) .def("has", static_cast(&Binary::has), "Check if a " RST_CLASS_REF(lief.ELF.Note) " of *type* (" RST_CLASS_REF(lief.ELF.NOTE_TYPES) ") exists", "type"_a) .def("has", static_cast(&Binary::has), "Check if a " RST_CLASS_REF(lief.ELF.Section) " of *type* (" RST_CLASS_REF(lief.ELF.ECTION_TYPES) ") exists", "type"_a) .def("patch_pltgot", static_cast(&Binary::patch_pltgot), "Patch the imported symbol's name with the ``address``", "symbol_name"_a, "address"_a) .def("patch_pltgot", static_cast(&Binary::patch_pltgot), "Patch the imported " RST_CLASS_REF(lief.ELF.Symbol) " with the ``address``", "symbol"_a, "address"_a) .def("has_section", &Binary::has_section, "Check if a section with the given name exists in the binary", "section_name"_a) .def("get_section", static_cast>(&Binary::get_section), "Return the " RST_CLASS_REF(lief.ELF.Section) " with the given ``name``", "section_name"_a, py::return_value_policy::reference) .def("add_static_symbol", &Binary::add_static_symbol, "Add a **static** " RST_CLASS_REF(lief.ELF.Symbol) " to the binary", "symbol"_a, py::return_value_policy::reference) .def("add_dynamic_symbol", static_cast(&Binary::add_dynamic_symbol), "Add a **dynamic** " RST_CLASS_REF(lief.ELF.Symbol) " to the binary", "symbol"_a, "symbol_version"_a = SymbolVersion::local(), py::return_value_policy::reference) .def("virtual_address_to_offset", &Binary::virtual_address_to_offset, "Convert the virtual address to an offset in the binary", "virtual_address"_a) .def("add", static_cast(&Binary::add), "Add the given " RST_CLASS_REF(lief.ELF.Section) " to the binary. \n\n" "If the section should not be loaded in memory, ``loaded`` parameter have to be set to ``False`` (default: ``True``)", "section"_a, "loaded"_a = true, py::return_value_policy::reference) .def("add", static_cast(&Binary::add), "Add a segment in the binary", "segment"_a, "base"_a = 0, py::return_value_policy::reference) .def("add", static_cast(&Binary::add), "Add a new " RST_CLASS_REF(lief.ELF.Note) " in the binary", "note"_a, py::return_value_policy::reference) .def("replace", static_cast(&Binary::replace), "Replace the segment given in 2nd parameter with the segment given in the first one and return the updated segment", "new_segment"_a, "original_segment"_a, "base"_a = 0, py::return_value_policy::reference) .def("extend", static_cast(&Binary::extend), "Extend the given given " RST_CLASS_REF(lief.ELF.Segment) " by the given size", "segment"_a, "size"_a, py::return_value_policy::reference) .def("extend", static_cast(&Binary::extend), "Extend the given given " RST_CLASS_REF(lief.ELF.Section) " by the given size", "segment"_a, "size"_a, py::return_value_policy::reference) .def("remove", static_cast(&Binary::remove), "Remove the given " RST_CLASS_REF(lief.ELF.DynamicEntry) " from the dynamic table", "dynamic_entry"_a) .def("remove", static_cast(&Binary::remove), "Remove **all** " RST_CLASS_REF(lief.ELF.DynamicEntry) " with the given " RST_CLASS_REF(lief.ELF.DYNAMIC_TAGS) "", "tag"_a) .def("remove", static_cast(&Binary::remove), "Remove the given " RST_CLASS_REF(lief.ELF.Section) ". ``clear`` specify whether or not " "we must fill its content with ``0`` before removing", "section"_a, "clear"_a = false) .def("remove", static_cast(&Binary::remove), "Remove the given " RST_CLASS_REF(lief.ELF.Note) "", "note"_a) .def("remove", static_cast(&Binary::remove), "Remove **all** " RST_CLASS_REF(lief.ELF.Note) " with the given " RST_CLASS_REF(lief.ELF.NOTE_TYPES) "", "type"_a) .def_property_readonly("has_notes", &Binary::has_notes, "``True`` if the binary contains notes") .def_property_readonly("notes", static_cast>(&Binary::notes), "Return an iterator to " RST_CLASS_REF(lief.ELF.Note) " entries as a list", py::return_value_policy::reference_internal) .def("strip", &Binary::strip, "Strip the binary") .def("permute_dynamic_symbols", &Binary::permute_dynamic_symbols, "Apply the given permutation on the dynamic symbols table", "permutation"_a) .def("write", &Binary::write, "Rebuild the binary and write it in a file", "output"_a, py::return_value_policy::reference_internal) .def_property_readonly("last_offset_section", &Binary::last_offset_section, "Return the last offset used in binary according to **section headers**") .def_property_readonly("last_offset_segment", &Binary::last_offset_segment, "Return the last offset used in binary according to **segment headers**") .def_property_readonly("next_virtual_address", &Binary::next_virtual_address, "Return the next virtual address available") .def("add_library", &Binary::add_library, "Add a library with the given name as dependency", "library_name"_a) .def("has_library", &Binary::has_library, "Check if the given library name exists in the current binary", "library_name"_a) .def("remove_library", &Binary::remove_library, "Remove the given library", "library_name"_a) .def("remove_section", &Binary::remove_section, "Remove the given section from its name", "section_name"_a, "clear"_a = false) .def("get_library", static_cast>(&Binary::get_library), "Return the " RST_CLASS_REF(lief.ELF.DynamicEntryLibrary) " with the given ``name``", "library_name"_a, py::return_value_policy::reference) .def("has_dynamic_symbol", &Binary::has_dynamic_symbol, "Check if the symbol with the given ``name`` exists in the **dynamic** symbol table", "symbol_name"_a) .def("get_dynamic_symbol", static_cast>(&Binary::get_dynamic_symbol), "Get the dynamic symbol from the given name", "symbol_name"_a, py::return_value_policy::reference) .def("has_static_symbol", &Binary::has_static_symbol, "Check if the symbol with the given ``name`` exists in the **static** symbol table", "symbol_name"_a) .def("get_static_symbol", static_cast>(&Binary::get_static_symbol), "Get the **dynamic** symbol from the given ``name``", "symbol_name"_a, py::return_value_policy::reference) .def("add_exported_function", &Binary::add_exported_function, "Create a symbol for the function at the given ``address`` and export it", "address"_a, "name"_a = "", py::return_value_policy::reference) .def("export_symbol", static_cast(&Binary::export_symbol), "Export the given symbol and create it if it doesn't exist", "symbol"_a, py::return_value_policy::reference) .def("export_symbol", static_cast(&Binary::export_symbol), "Export the symbol with the given name and create it if it doesn't exist", "symbol_name"_a, "value"_a = 0, py::return_value_policy::reference) .def(py::self += Segment()) .def(py::self += Section()) .def(py::self += DynamicEntry()) .def(py::self += Note()) .def(py::self -= DynamicEntry()) .def(py::self -= DYNAMIC_TAGS()) .def(py::self -= Note()) .def(py::self -= NOTE_TYPES()) .def("__eq__", &Binary::operator==) .def("__ne__", &Binary::operator!=) .def("__hash__", [] (const Binary& binary) { return Hash::hash(binary); }) .def("__getitem__", static_cast(&Binary::operator[]), "", py::return_value_policy::reference) .def("__getitem__", static_cast(&Binary::operator[]), "", py::return_value_policy::reference) .def("__getitem__", static_cast(&Binary::operator[]), "", py::return_value_policy::reference) .def("__getitem__", static_cast(&Binary::operator[]), "", py::return_value_policy::reference) .def("__contains__", static_cast(&Binary::has), "Check if a " RST_CLASS_REF(lief.ELF.Segment) " of *type* (" RST_CLASS_REF(lief.ELF.SEGMENT_TYPES) ") exists") .def("__contains__", static_cast(&Binary::has), "Check if the " RST_CLASS_REF(lief.ELF.DynamicEntry) " associated with the given " RST_CLASS_REF(lief.ELF.DYNAMIC_TAGS) " exists") .def("__contains__", static_cast(&Binary::has), "Check if the " RST_CLASS_REF(lief.ELF.Note) " associated with the given " RST_CLASS_REF(lief.ELF.NOTE_TYPES) " exists") .def("__contains__", static_cast(&Binary::has), "Check if the " RST_CLASS_REF(lief.ELF.Section) " associated with the given " RST_CLASS_REF(lief.ELF.SECTION_TYPES) " exists") .def("__str__", [] (const Binary& binary) { std::ostringstream stream; stream << binary; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyBuilder.cpp000066400000000000000000000027771330725006400210500ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/Builder.hpp" #include #include namespace LIEF { namespace ELF { template<> void create(py::module& m) { py::class_(m, "Builder") .def(py::init(), "Constructor that takes a " RST_CLASS_REF(lief.ELF.Binary) "", "elf_binary"_a) .def("build", static_cast(&Builder::build), "Perform the build process") .def("empties_gnuhash", &Builder::empties_gnuhash, "Disable the " RST_CLASS_REF(lief.ELF.GnuHash) "", py::return_value_policy::reference) .def("write", &Builder::write, "Write the build result into the ``output`` file", "output"_a) .def("get_build", &Builder::get_build, "Return the build result as a ``list`` of bytes", py::return_value_policy::reference_internal); } } } LIEF-0.9.0/api/python/ELF/objects/pyDynamicEntry.cpp000066400000000000000000000041361330725006400220570ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/DynamicEntry.hpp" #include "LIEF/ELF/hash.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (DynamicEntry::*)(void) const; template using setter_t = void (DynamicEntry::*)(T); template<> void create(py::module& m) { // DynamicEntry object py::class_(m, "DynamicEntry") .def(py::init<>(), "Default constructor") .def(py::init(), "Constructor with " RST_CLASS_REF(lief.ELF.DYNAMIC_TAGS) " and value", "tag"_a, "value"_a) .def_property("tag", static_cast>(&DynamicEntry::tag), static_cast>(&DynamicEntry::tag), "Return the entry's " RST_CLASS_REF(lief.ELF.DYNAMIC_TAGS) " which represent the entry type") .def_property("value", static_cast>(&DynamicEntry::value), static_cast>(&DynamicEntry::value), "Return the entry's value.") .def("__eq__", &DynamicEntry::operator==) .def("__ne__", &DynamicEntry::operator!=) .def("__hash__", [] (const DynamicEntry& entry) { return Hash::hash(entry); }) .def("__str__", [] (const DynamicEntry& dynamicEntry) { std::ostringstream stream; stream << dynamicEntry; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyDynamicEntryArray.cpp000066400000000000000000000054351330725006400230610ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/DynamicEntryArray.hpp" #include "LIEF/ELF/DynamicEntry.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (DynamicEntryArray::*)(void) const; template using setter_t = void (DynamicEntryArray::*)(T); template<> void create(py::module& m) { // Dynamic Entry Array object py::class_(m, "DynamicEntryArray") .def(py::init<>()) .def(py::init(), "Constructor with " RST_CLASS_REF(lief.ELF.DYNAMIC_TAGS) " and value", "tag"_a, "value"_a) .def_property("array", static_cast& (DynamicEntryArray::*) (void)>(&DynamicEntryArray::array), static_cast&>>(&DynamicEntryArray::array), "Return the array", py::return_value_policy::reference) .def("insert", &DynamicEntryArray::insert, "Insert a ``callback`` at the given ``position``", "position"_a, "callback"_a, py::return_value_policy::reference) .def("append", &DynamicEntryArray::append, "Append the given ``callback`` ", "callback"_a, py::return_value_policy::reference) .def("remove", &DynamicEntryArray::remove, "Remove the given ``callback`` ", "callback"_a, py::return_value_policy::reference) .def(py::self += uint64_t()) .def(py::self -= uint64_t()) .def("__getitem__", static_cast(&DynamicEntryArray::operator[]), py::return_value_policy::reference) .def("__len__", &DynamicEntryArray::size) .def("__eq__", &DynamicEntryArray::operator==) .def("__ne__", &DynamicEntryArray::operator!=) .def("__hash__", [] (const DynamicEntryArray& entry) { return Hash::hash(entry); }) .def("__str__", [] (const DynamicEntryArray& entry) { std::ostringstream stream; stream << entry; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyDynamicEntryFlags.cpp000066400000000000000000000063641330725006400230410ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/DynamicEntryFlags.hpp" #include "LIEF/ELF/DynamicEntry.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (DynamicEntryFlags::*)(void) const; template using setter_t = void (DynamicEntryFlags::*)(T); template<> void create(py::module& m) { py::class_(m, "DynamicEntryFlags") .def(py::init<>()) .def(py::init(), "Constructor with " RST_CLASS_REF(lief.ELF.DYNAMIC_TAGS) " and value", "tag"_a, "value"_a) .def_property_readonly("flags", &DynamicEntryFlags::flags, "Return list of " RST_CLASS_REF(lief.ELF.DYNAMIC_FLAGS) " or " RST_CLASS_REF(lief.ELF.DYNAMIC_FLAGS_1) " (integer)", py::return_value_policy::move) .def("add", static_cast(&DynamicEntryFlags::add), "Add the given " RST_CLASS_REF(lief.ELF.DYNAMIC_FLAGS) "", "flag"_a) .def("add", static_cast(&DynamicEntryFlags::add), "Add the given " RST_CLASS_REF(lief.ELF.DYNAMIC_FLAGS_1) "", "flag"_a) .def("remove", static_cast(&DynamicEntryFlags::remove), "Remove the given " RST_CLASS_REF(lief.ELF.DYNAMIC_FLAGS) "", "flag"_a) .def("remove", static_cast(&DynamicEntryFlags::remove), "Remove the given " RST_CLASS_REF(lief.ELF.DYNAMIC_FLAGS_1) "", "flag"_a) .def("__eq__", &DynamicEntryFlags::operator==) .def("__ne__", &DynamicEntryFlags::operator!=) .def("__hash__", [] (const DynamicEntryFlags& entry) { return Hash::hash(entry); }) .def(py::self += DYNAMIC_FLAGS()) .def(py::self += DYNAMIC_FLAGS_1()) .def(py::self -= DYNAMIC_FLAGS()) .def(py::self -= DYNAMIC_FLAGS_1()) .def("__contains__", static_cast(&DynamicEntryFlags::has), "Check if the given " RST_CLASS_REF(lief.ELF.DYNAMIC_FLAGS) " is present") .def("__contains__", static_cast(&DynamicEntryFlags::has), "Check if the given " RST_CLASS_REF(lief.ELF.DYNAMIC_FLAGS_1) " is present") .def("__str__", [] (const DynamicEntryFlags& entry) { std::ostringstream stream; stream << entry; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyDynamicEntryLibrary.cpp000066400000000000000000000037011330725006400234010ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/DynamicEntryLibrary.hpp" #include "LIEF/ELF/DynamicEntry.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (DynamicEntryLibrary::*)(void) const; template using setter_t = void (DynamicEntryLibrary::*)(T); template<> void create(py::module& m) { // // Dynamic Entry Library object // py::class_(m, "DynamicEntryLibrary") .def(py::init(), "Constructor from library name", "library_name"_a) .def_property("name", [] (const DynamicEntryLibrary& obj) { return safe_string_converter(obj.name()); }, static_cast>(&DynamicEntryLibrary::name), "Return library's name") .def("__eq__", &DynamicEntryLibrary::operator==) .def("__ne__", &DynamicEntryLibrary::operator!=) .def("__hash__", [] (const DynamicEntryLibrary& entry) { return Hash::hash(entry); }) .def("__str__", [] (const DynamicEntryLibrary& dynamicEntryLibrary) { std::ostringstream stream; stream << dynamicEntryLibrary; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyDynamicEntryRpath.cpp000066400000000000000000000060161330725006400230550ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/DynamicEntryRpath.hpp" #include "LIEF/ELF/DynamicEntry.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (DynamicEntryRpath::*)(void) const; template using setter_t = void (DynamicEntryRpath::*)(T); template<> void create(py::module& m) { // // Dynamic Entry RPATH object // py::class_(m, "DynamicEntryRpath") .def(py::init(), "Constructor from (r)path", "path"_a = "") .def(py::init &>(), "Constructor from a list of paths", "paths"_a) .def_property("name", [] (const DynamicEntryRpath& obj) { return safe_string_converter(obj.name()); }, static_cast>(&DynamicEntryRpath::name), "Return path value") .def_property("rpath", [] (const DynamicEntryRpath& obj) { return safe_string_converter(obj.rpath()); }, static_cast>(&DynamicEntryRpath::rpath), "Return path value") .def_property("paths", static_cast >>(&DynamicEntryRpath::paths), static_cast&>>(&DynamicEntryRpath::paths), "Paths as a list") .def("insert", &DynamicEntryRpath::insert, "Insert a ``path`` at the given ``position``", "position"_a, "path"_a, py::return_value_policy::reference) .def("append", &DynamicEntryRpath::append, "Append the given ``path`` ", "path"_a, py::return_value_policy::reference) .def("remove", &DynamicEntryRpath::remove, "Remove the given ``path`` ", "path"_a, py::return_value_policy::reference) .def(py::self += std::string()) .def(py::self -= std::string()) .def("__eq__", &DynamicEntryRpath::operator==) .def("__ne__", &DynamicEntryRpath::operator!=) .def("__hash__", [] (const DynamicEntryRpath& entry) { return Hash::hash(entry); }) .def("__str__", [] (const DynamicEntryRpath& entry) { std::ostringstream stream; stream << entry; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyDynamicEntryRunPath.cpp000066400000000000000000000060741330725006400233640ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/DynamicEntryRunPath.hpp" #include "LIEF/ELF/DynamicEntry.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (DynamicEntryRunPath::*)(void) const; template using setter_t = void (DynamicEntryRunPath::*)(T); template<> void create(py::module& m) { // // Dynamic Entry RUNPATH object // py::class_(m, "DynamicEntryRunPath") .def(py::init(), "Constructor from (run)path", "path"_a = "") .def(py::init &>(), "Constructor from a list of paths", "paths"_a) .def_property("name", [] (const DynamicEntryRunPath& obj) { return safe_string_converter(obj.name()); }, static_cast>(&DynamicEntryRunPath::name), "Runpath raw value") .def_property("runpath", [] (const DynamicEntryRunPath& obj) { return safe_string_converter(obj.runpath()); }, static_cast>(&DynamicEntryRunPath::runpath), "Runpath raw value") .def_property("paths", static_cast >>(&DynamicEntryRunPath::paths), static_cast&>>(&DynamicEntryRunPath::paths), "Paths as a list") .def("insert", &DynamicEntryRunPath::insert, "Insert a ``path`` at the given ``position``", "position"_a, "path"_a, py::return_value_policy::reference) .def("append", &DynamicEntryRunPath::append, "Append the given ``path`` ", "path"_a, py::return_value_policy::reference) .def("remove", &DynamicEntryRunPath::remove, "Remove the given ``path`` ", "path"_a, py::return_value_policy::reference) .def(py::self += std::string()) .def(py::self -= std::string()) .def("__eq__", &DynamicEntryRunPath::operator==) .def("__ne__", &DynamicEntryRunPath::operator!=) .def("__hash__", [] (const DynamicEntryRunPath& entry) { return Hash::hash(entry); }) .def("__str__", [] (const DynamicEntryRunPath& entry) { std::ostringstream stream; stream << entry; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyDynamicSharedObject.cpp000066400000000000000000000036721330725006400233170ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/DynamicSharedObject.hpp" #include "LIEF/ELF/DynamicEntry.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (DynamicSharedObject::*)(void) const; template using setter_t = void (DynamicSharedObject::*)(T); template<> void create(py::module& m) { // // Dynamic Shared Object object // py::class_(m, "DynamicSharedObject") .def(py::init(), "Constructor from library name", "library_name"_a) .def_property("name", [] (const DynamicSharedObject& obj) { return safe_string_converter(obj.name()); }, static_cast>(&DynamicSharedObject::name), "Return the library name") .def("__eq__", &DynamicSharedObject::operator==) .def("__ne__", &DynamicSharedObject::operator!=) .def("__hash__", [] (const DynamicSharedObject& entry) { return Hash::hash(entry); }) .def("__str__", [] (const DynamicSharedObject& dynamicSharedObject) { std::ostringstream stream; stream << dynamicSharedObject; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyGnuHash.cpp000066400000000000000000000065141330725006400210100ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/GnuHash.hpp" namespace LIEF { namespace ELF { template using getter_t = T (GnuHash::*)(void) const; template using setter_t = void (GnuHash::*)(T); template<> void create(py::module& m) { py::class_(m, "GnuHash") .def(py::init<>()) .def_property_readonly("nb_buckets", &GnuHash::nb_buckets, "Return the number of buckets") .def_property_readonly("symbol_index", &GnuHash::symbol_index, "Index of the first symbol in the dynamic symbols table which is accessible with the hash table") .def_property_readonly("shift2", &GnuHash::shift2, "Shift count used in the bloom filter") .def_property_readonly("bloom_filters", &GnuHash::bloom_filters, "Bloom filters", py::return_value_policy::reference_internal) .def_property_readonly("bloom_filters", &GnuHash::bloom_filters, "Bloom filters", py::return_value_policy::reference_internal) .def_property_readonly("buckets", &GnuHash::buckets, "hash buckets", py::return_value_policy::reference_internal) .def_property_readonly("hash_values", &GnuHash::hash_values, "Hash values", py::return_value_policy::reference_internal) .def("check_bloom_filter", &GnuHash::check_bloom_filter, "Check if the given hash pass the bloom filter", "hash"_a) .def("check_bucket", &GnuHash::check_bucket, "Check if the given hash pass the bucket filter", "hash"_a) .def("check", static_cast(&GnuHash::check), "Check if the symbol *probably* exists. If " "the returned value is ``false`` you can assume at ``100%`` that " "the symbol with the given name doesn't exists. If ``true`` you can't " "do any assumption ", "symbol_name"_a) .def("check", static_cast(&GnuHash::check), "Check if the symbol associated with the given *probably* exists. If " "the returned value is ``false`` you can assume at ``100%`` that " "the symbol doesn't exists. If ``true`` you can't " "do any assumption", "hash_value"_a) .def("__eq__", &GnuHash::operator==) .def("__ne__", &GnuHash::operator!=) .def("__hash__", [] (const GnuHash& gnuhash) { return Hash::hash(gnuhash); }) .def("__str__", [] (const GnuHash& gnuhash) { std::ostringstream stream; stream << gnuhash; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyHeader.cpp000066400000000000000000000167031330725006400206440ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/Header.hpp" namespace LIEF { namespace ELF { 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") .def(py::init<>()) .def_property("identity_class", static_cast>(&Header::identity_class), static_cast>(&Header::identity_class), "Return header's " RST_CLASS_REF(lief.ELF.ELF_CLASS) "." ) .def_property("identity_data", static_cast>(&Header::identity_data), static_cast>(&Header::identity_data), "Return header's " RST_CLASS_REF(lief.ELF.ELF_DATA) "." ) .def_property("identity_version", static_cast>(&Header::identity_version), static_cast>(&Header::identity_version), "Return header's " RST_CLASS_REF(lief.ELF.VERSION) "." ) .def_property("identity_os_abi", static_cast>(&Header::identity_os_abi), static_cast>(&Header::identity_os_abi), "Return header's " RST_CLASS_REF(lief.ELF.OS_ABI) "." ) .def_property_readonly("identity", static_cast(&Header::identity), "Return header's identity.", py::return_value_policy::reference_internal ) .def_property("file_type", static_cast>(&Header::file_type), static_cast>(&Header::file_type), "Return binary's " RST_CLASS_REF(lief.ELF.E_TYPE) ". It determine if the binary \ is a executable, a library..." ) .def_property("machine_type", static_cast>(&Header::machine_type), static_cast>(&Header::machine_type), "Return target architecture (" RST_CLASS_REF(lief.ELF.ARCH) ")") .def_property("object_file_version", static_cast>(&Header::object_file_version), static_cast>(&Header::object_file_version), "Return " RST_CLASS_REF(lief.ELF.VERSION) "") .def_property("entrypoint", static_cast>(&Header::entrypoint), static_cast>(&Header::entrypoint), "Return binary entry point") .def_property("program_header_offset", static_cast>(&Header::program_headers_offset), static_cast>(&Header::program_headers_offset), "Return file offset to the program header table") .def_property("section_header_offset", static_cast>(&Header::section_headers_offset), static_cast>(&Header::section_headers_offset), "Return file offset to the section header table") .def_property("processor_flag", static_cast>(&Header::processor_flag), static_cast>(&Header::processor_flag)) .def_property_readonly("arm_flags_list", &Header::arm_flags_list, "Return list of " RST_CLASS_REF(lief.ELF.ARM_EFLAGS) " present in " ":attr:`~lief.ELF.Header.processor_flag`", py::return_value_policy::reference_internal) .def_property_readonly("mips_flags_list", &Header::mips_flags_list, "Return list of " RST_CLASS_REF(lief.ELF.MIPS_EFLAGS) " present in " ":attr:`~lief.ELF.Header.processor_flag`", py::return_value_policy::reference_internal) .def_property_readonly("ppc64_flags_list", &Header::ppc64_flags_list, "Return list of " RST_CLASS_REF(lief.ELF.PPC64_EFLAGS) " present in " ":attr:`~lief.ELF.Header.processor_flag`", py::return_value_policy::reference_internal) .def_property_readonly("hexagon_flags_list", &Header::hexagon_flags_list, "Return list of " RST_CLASS_REF(lief.ELF.HEXAGON_EFLAGS) " present in " ":attr:`~lief.ELF.Header.processor_flag`", py::return_value_policy::reference_internal) .def_property("header_size", static_cast>(&Header::header_size), static_cast>(&Header::header_size), "Return the size of the ELF header") .def_property("program_header_size", static_cast>(&Header::program_header_size), static_cast>(&Header::program_header_size), "Return this size of a program header entry") .def_property("numberof_segments", static_cast>(&Header::numberof_segments), static_cast>(&Header::numberof_segments), "Return the number of program headers (segments)") .def_property("section_header_size", static_cast>(&Header::section_header_size), static_cast>(&Header::section_header_size), "Return the size of a section header entry") .def_property("numberof_sections", static_cast>(&Header::numberof_sections), static_cast>(&Header::numberof_sections), "Return the number of section's headers") .def_property("section_name_table_idx", static_cast>(&Header::section_name_table_idx), static_cast>(&Header::section_name_table_idx), "Return the section index which hold sections's name") .def("__eq__", &Header::operator==) .def("__ne__", &Header::operator!=) .def("__hash__", [] (const Header& header) { return Hash::hash(header); }) .def("__contains__", static_cast(&Header::has), "Check if the given " RST_CLASS_REF(lief.ELF.ARM_EFLAGS) " is present in " ":attr:`~lief.ELF.Header.processor_flag`") .def("__contains__", static_cast(&Header::has), "Check if the given " RST_CLASS_REF(lief.ELF.MIPS_EFLAGS) " is present in " ":attr:`~lief.ELF.Header.processor_flag`") .def("__contains__", static_cast(&Header::has), "Check if the given " RST_CLASS_REF(lief.ELF.PPC64_EFLAGS) " is present in " ":attr:`~lief.ELF.Header.processor_flag`") .def("__contains__", static_cast(&Header::has), "Check if the given " RST_CLASS_REF(lief.ELF.HEXAGON_EFLAGS) " is present in " ":attr:`~lief.ELF.Header.processor_flag`") .def("__str__", [] (const Header& header) { std::ostringstream stream; stream << header; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyNote.cpp000066400000000000000000000054171330725006400203610ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/Note.hpp" namespace LIEF { namespace ELF { template using getter_t = T (Note::*)(void) const; template using setter_t = void (Note::*)(T); template<> void create(py::module& m) { py::class_(m, "Note") .def(py::init<>(), "Default ctor") .def(py::init&>(), "Ctor from ``name``, ``type`` and ``description``", "name"_a, "type"_a, "description"_a) .def_property("name", static_cast>(&Note::name), static_cast>(&Note::name), "Return the *name* of the note (Usually the owner)." ) .def_property("type", static_cast>(&Note::type), static_cast>(&Note::type), "Return the type of the note. Can be one of the " RST_CLASS_REF(lief.ELF.NOTE_TYPES) " values" ) .def_property("description", static_cast>(&Note::description), static_cast>(&Note::description), "Return the description associated with the note" ) .def_property_readonly("abi", static_cast>(&Note::abi), "Return the target " RST_CLASS_REF(lief.ELF.NOTE_TYPES) ". Require a :attr:`~lief.ELF.NOTE_TYPES.ABI_TAG` :attr:`~lief.ELF.Note.type`" ) .def_property_readonly("version", static_cast>(&Note::version), "Return the target version as ``(Major, Minor, Patch)``. Require a :attr:`~lief.ELF.NOTE_TYPES.ABI_TAG` :attr:`~lief.ELF.Note.type`" ) .def("__eq__", &Note::operator==) .def("__ne__", &Note::operator!=) .def("__hash__", [] (const Note& note) { return Hash::hash(note); }) .def("__str__", [] (const Note& note) { std::ostringstream stream; stream << note; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pyParser.cpp000066400000000000000000000056251330725006400207110ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/Parser.hpp" #include namespace LIEF { namespace ELF { template<> void create(py::module& m) { // Parser (Parser) m.def("parse", static_cast (*) (const std::string&, DYNSYM_COUNT_METHODS)>(&Parser::parse), "Parse the given binary and return a " RST_CLASS_REF(lief.ELF.Binary) " object\n\n" "For *weird* binaries (e.g sectionless) you can choose the method to use to count dynamic symbols " " (" RST_CLASS_REF(lief.ELF.DYNSYM_COUNT_METHODS) ")", "filename"_a, py::arg("dynsym_count_method") = DYNSYM_COUNT_METHODS::COUNT_AUTO, py::return_value_policy::take_ownership); m.def("parse", static_cast (*) (const std::vector&, const std::string&, DYNSYM_COUNT_METHODS)>(&Parser::parse), "Parse the given binary and return a " RST_CLASS_REF(lief.ELF.Binary) " object\n\n" "For *weird* binaries (e.g sectionless) you can choose the method to use to count dynamic symbols " " (" RST_CLASS_REF(lief.ELF.DYNSYM_COUNT_METHODS) ")", "raw"_a, py::arg("name") = "", py::arg("dynsym_count_method") = DYNSYM_COUNT_METHODS::COUNT_AUTO, py::return_value_policy::take_ownership); m.def("parse", [] (py::object byteio, const std::string& name) { auto&& io = py::module::import("io"); auto&& RawIOBase = io.attr("RawIOBase"); auto&& BufferedIOBase = io.attr("BufferedIOBase"); 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::ELF::Parser::parse(std::move(raw), name); }, "io"_a, "name"_a = "", py::return_value_policy::take_ownership); } } } LIEF-0.9.0/api/python/ELF/objects/pyRelocation.cpp000066400000000000000000000074131330725006400215510ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/Relocation.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (Relocation::*)(void) const; template using setter_t = void (Relocation::*)(T); template<> void create(py::module& m) { // Relocation object py::class_(m, "Relocation") .def(py::init<>()) .def(py::init(), "address"_a, "type"_a = 0, "addend"_a = 0, "is_rela"_a = false) .def_property("addend", static_cast>(&Relocation::addend), static_cast>(&Relocation::addend), "Additional value") .def_property("info", static_cast>(&Relocation::info), static_cast>(&Relocation::info), "Extra information like symbol index") .def_property("purpose", static_cast>(&Relocation::purpose), static_cast>(&Relocation::purpose), "Purpose (" RST_CLASS_REF(lief.ELF.RELOCATION_PURPOSES) ") of the relocation") .def_property("type", static_cast>(&Relocation::type), static_cast>(&Relocation::type), "Relocation type.\n\n" "See:\n\n" "\t\t * " RST_CLASS_REF(lief.ELF.RELOCATION_X86_64) "\n\n" "\t\t * " RST_CLASS_REF(lief.ELF.RELOCATION_ARM) "\n\n" "\t\t * " RST_CLASS_REF(lief.ELF.RELOCATION_i386) "\n\n") .def_property_readonly("has_symbol", &Relocation::has_symbol, "``True`` if a " RST_CLASS_REF(lief.ELF.Symbol) " is associated with the relocations") .def_property_readonly("symbol", static_cast(&Relocation::symbol), "" RST_CLASS_REF(lief.ELF.Symbol) " associated with the relocation", py::return_value_policy::reference_internal) .def_property_readonly("has_section", &Relocation::has_section, "``True`` if a this relocation has a " RST_CLASS_REF(lief.ELF.Section) " associated") .def_property_readonly("section", static_cast(&Relocation::section), "" RST_CLASS_REF(lief.ELF.Section) " to which the relocation applies", py::return_value_policy::reference) .def_property_readonly("is_rela", static_cast>(&Relocation::is_rela), "``True`` if the relocation uses the :attr:`~lief.ELF.Relocation.addend` proprety") .def_property_readonly("is_rel", static_cast>(&Relocation::is_rel), "``True`` if the relocation doesn't use the :attr:`~lief.ELF.Relocation.addend` proprety") .def("__eq__", &Relocation::operator==) .def("__ne__", &Relocation::operator!=) .def("__hash__", [] (const Relocation& relocation) { return Hash::hash(relocation); }) .def("__str__", [] (const Relocation& relocation) { std::ostringstream stream; stream << relocation; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySection.cpp000066400000000000000000000143351330725006400210570ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/Abstract/Section.hpp" #include "LIEF/ELF/Section.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (Section::*)(void) const; template using setter_t = void (Section::*)(T); template using no_const_getter = T (Section::*)(void); template<> void create
(py::module& m) { // Section object py::class_(m, "Section") .def(py::init<>(), "Default constructor") .def(py::init(), "Constructor from name and type", "name"_a, "type"_a = ELF_SECTION_TYPES::SHT_PROGBITS) .def("__init__", [] (Section& section, std::vector& content, ELF_CLASS type) { new (§ion) Section(content.data(), type); }) .def_property_readonly("name_idx", static_cast>(&Section::name_idx), "Index of the section's name in the string table\n\n" ".. warning:: The value will probably change when re-building binary.") .def_property("type", static_cast>(&Section::type), static_cast>(&Section::type), "Return a " RST_CLASS_REF(lief.ELF.SECTION_TYPES) "") .def_property("flags", static_cast>(&Section::flags), static_cast>(&Section::flags), "Return section's flags as an integer") .def_property_readonly("flags_list", &Section::flags_list, "Return section's flags as a list of " RST_CLASS_REF(lief.ELF.SECTION_FLAGS) "") .def_property("virtual_address", static_cast>(&Section::virtual_address), static_cast>(&Section::virtual_address), "Return address where the section will be mapped in memory\n\n" ".. warning:: This value is not reliable use segment's virtual address " "(:attr:`~lief.ELF.Segment.virtual_address`) instead.") .def_property("file_offset", static_cast>(&Section::file_offset), static_cast>(&Section::file_offset), "Offset of the section's content") .def_property_readonly("original_size", static_cast>(&Section::original_size), "original data size. Without modification we have `original_size == size`") .def_property("alignment", static_cast>(&Section::alignment), static_cast>(&Section::alignment), "Section alignment") .def_property("information", static_cast>(&Section::information), static_cast>(&Section::information), "Section information (this value depends on the section)") .def_property("entry_size", static_cast>(&Section::entry_size), static_cast>(&Section::entry_size), "If section's content is an array, `entry_size` holds the element size\n\n" ":Example:\n" "\tThe `.dynamic` section contains an array of " RST_CLASS_REF(lief.ELF.DynamicEntry) ". As the size " "of a dynamic entry is 0x10 (for ELF64), entry_size will contains this value\n\n" ".. warning:: This value is not necessarily reliable.") .def_property("link", static_cast>(&Section::link), static_cast>(&Section::link), "Index to another section") .def_property_readonly("segments", static_cast>(&Section::segments), "Return segment(s) associated with the given section", py::return_value_policy::reference_internal) .def("clear", &Section::clear, "Clear the content of the section with the given ``value``", "value"_a = 0, py::return_value_policy::reference) .def("add", &Section::add, "Add the given " RST_CLASS_REF(lief.ELF.SECTION_FLAGS) " to the list of " ":attr:`~lief.ELF.Section.flags`", "flag"_a) .def("remove", &Section::remove, "Remove the given " RST_CLASS_REF(lief.ELF.SECTION_FLAGS) " to the list of " ":attr:`~lief.ELF.Section.flags`", "flag"_a) .def("has", static_cast(&Section::has), "Check if the given " RST_CLASS_REF(lief.ELF.SECTION_FLAGS) " is present", "flag"_a) .def("has", static_cast(&Section::has), "Check if the given " RST_CLASS_REF(lief.ELF.Segment) " is present " "in :attr:`~lief.ELF.Section.segments`", "segment"_a) .def("__eq__", &Section::operator==) .def("__ne__", &Section::operator!=) .def("__hash__", [] (const Section& section) { return Hash::hash(section); }) .def(py::self += ELF_SECTION_FLAGS()) .def(py::self -= ELF_SECTION_FLAGS()) .def("__contains__", static_cast(&Section::has), "Check if the given " RST_CLASS_REF(lief.ELF.SECTION_FLAGS) " is present") .def("__contains__", static_cast(&Section::has), "Check if the given " RST_CLASS_REF(lief.ELF.Segment) " is present " "in :attr:`~lief.ELF.Section.segments`") .def("__str__", [] (const Section& section) { std::ostringstream stream; stream << section; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySegment.cpp000066400000000000000000000134701330725006400210540ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/Segment.hpp" #include "pyELF.hpp" namespace LIEF { namespace ELF { template using getter_t = T (Segment::*)(void) const; template using setter_t = void (Segment::*)(T); template using no_const_getter = T (Segment::*)(void); template<> void create(py::module& m) { py::class_(m, "Segment") .def(py::init<>()) .def(py::init&>()) .def(py::init&, ELF_CLASS>()) .def_property("type", static_cast>(&Segment::type), static_cast>(&Segment::type), "Segment's " RST_CLASS_REF(lief.ELF.SEGMENT_TYPES) "") .def_property("flags", static_cast>(&Segment::flags), static_cast>(&Segment::flags), "Segment's flags") .def_property("file_offset", static_cast>(&Segment::file_offset), static_cast>(&Segment::file_offset), "Data offset in the binary") .def_property("virtual_address", static_cast>(&Segment::virtual_address), static_cast>(&Segment::virtual_address), "Address where the segment will be mapped\n\n" ".. warning:: We must have\n\n" "\t.. math::\n\n" "\t\t\\text{virtual address} \\equiv \\text{file offset} \\pmod{\\text{page size}}\n\n" "\t\t\\text{virtual address} \\equiv \\text{file offset} \\pmod{\\text{alignment}}" ) .def_property("physical_address", static_cast>(&Segment::physical_address), static_cast>(&Segment::physical_address), "Physical address of beginning of segment (OS-specific)") .def_property("physical_size", static_cast>(&Segment::physical_size), static_cast>(&Segment::physical_size), "Size of data in the binary") .def_property("virtual_size", static_cast>(&Segment::virtual_size), static_cast>(&Segment::virtual_size), "Size of this segment in memory") .def_property("alignment", static_cast>(&Segment::alignment), static_cast>(&Segment::alignment), "This member gives the value to which the segments are aligned in memory and in the file.\n" "Values 0 and 1 mean no alignment is required.") .def_property("content", static_cast>>(&Segment::content), static_cast&>>(&Segment::content), "Segment's raw data") .def("add", &Segment::add, "Add the given " RST_CLASS_REF(lief.ELF.SEGMENT_FLAGS) " to the list of " ":attr:`~lief.ELF.Segment.flags`", "flag"_a) .def("remove", &Segment::remove, "Remove the given " RST_CLASS_REF(lief.ELF.SEGMENT_FLAGS) " to the list of " ":attr:`~lief.ELF.Segment.flags`", "flag"_a) .def("has", static_cast(&Segment::has), "Check if the given " RST_CLASS_REF(lief.ELF.SEGMENT_FLAGS) " is present", "flag"_a) .def("has", static_cast(&Segment::has), "Check if the given " RST_CLASS_REF(lief.ELF.Section) " is present " "in :attr:`~lief.ELF.Segment.sections`", "section"_a) .def("has", static_cast(&Segment::has), "Check if the given " RST_CLASS_REF(lief.ELF.Section) " 's name is present " "in :attr:`~lief.ELF.Segment.sections`", "section_name"_a) .def_property_readonly("sections", static_cast>(&Segment::sections), "" RST_CLASS_REF(lief.ELF.Section) " (s) inside this segment", py::return_value_policy::reference_internal) .def("__eq__", &Segment::operator==) .def("__ne__", &Segment::operator!=) .def("__hash__", [] (const Segment& segment) { return Hash::hash(segment); }) .def(py::self += ELF_SEGMENT_FLAGS()) .def(py::self -= ELF_SEGMENT_FLAGS()) .def("__contains__", static_cast(&Segment::has), "Check if the given " RST_CLASS_REF(lief.ELF.SEGMENT_FLAGS) " is present") .def("__contains__", static_cast(&Segment::has), "Check if the given " RST_CLASS_REF(lief.ELF.Section) " is present " "in :attr:`~lief.ELF.Segment.sections`") .def("__contains__", static_cast(&Segment::has), "Check if the given " RST_CLASS_REF(lief.ELF.Section) " 's name is present " "in :attr:`~lief.ELF.Segment.sections`") .def("__str__", [] (const Segment& segment) { std::ostringstream stream; stream << segment; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySymbol.cpp000066400000000000000000000125171330725006400207200ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/Symbol.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/Abstract/Symbol.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (Symbol::*)(void) const; template using setter_t = void (Symbol::*)(T); template<> void create(py::module& m) { py::class_(m, "Symbol") .def(py::init<>()) .def_property_readonly("demangled_name", &Symbol::demangled_name, "Symbol's unmangled name") .def_property("type", static_cast>(&Symbol::type), static_cast>(&Symbol::type), "A symbol's type provides a general classification for the associated entity. See: " RST_CLASS_REF(lief.ELF.SYMBOL_TYPES) "") .def_property("binding", static_cast>(&Symbol::binding), static_cast>(&Symbol::binding), "A symbol's binding determines the linkage visibility and behavior. See " RST_CLASS_REF(lief.ELF.SYMBOL_BINDINGS) "") .def_property("information", static_cast>(&Symbol::information), static_cast>(&Symbol::information), "This member specifies the symbol's type and binding attributes") .def_property("other", static_cast>(&Symbol::other), static_cast>(&Symbol::other), "This member **should** holds ``0`` and **should** not have defined meaning.\n\n" "See: " RST_ATTR_REF(lief.ELF.Symbol.visibility) "") .def_property("visibility", static_cast>(&Symbol::visibility), static_cast>(&Symbol::visibility), "Symbol " RST_CLASS_REF(lief.ELF.SYMBOL_VISIBILITY) ". \n\n" "It's basically an alias on " RST_ATTR_REF(lief.ELF.Symbol.other) "") .def_property("value", static_cast>(&Symbol::value), static_cast>(&Symbol::value), "This member have slightly different interpretations\n\n" "\t- In relocatable files, `value` holds alignment constraints for a symbol whose section index is " "`SHN_COMMON`.\n\n" "\t- In relocatable files, `value` holds a section offset for a defined symbol. That is, `value` is an" "offset from the beginning of the section associated with this symbol.\n\n" "\t- In executable and shared object files, `value` holds a virtual address. To make these files's" "symbols more useful for the dynamic linker, the section offset (file interpretation) gives way to" "a virtual address (memory interpretation) for which the section number is irrelevant.") .def_property("size", static_cast>(&Symbol::size), static_cast>(&Symbol::size), "Many symbols have associated sizes. For example, a data object's size is the number of " "bytes contained in the object. This member holds `0` if the symbol has no size or " "an unknown size.") .def_property("shndx", static_cast>(&Symbol::shndx), static_cast>(&Symbol::shndx), "Section index associated with the symbol") .def_property_readonly("has_version", &Symbol::has_version, "Check if this symbols has a " RST_CLASS_REF(lief.ELF.SymbolVersion) "") .def_property_readonly("symbol_version", static_cast(&Symbol::symbol_version), "Return the " RST_CLASS_REF(lief.ELF.SymbolVersion) " associated with this symbol", py::return_value_policy::reference_internal) .def_property_readonly("is_static", &Symbol::is_static, "True if the symbol is a static one") .def_property_readonly("is_function", &Symbol::is_function, "True if the symbol is a function") .def_property_readonly("is_variable", &Symbol::is_variable, "True if the symbol is a variable") .def_property("exported", &Symbol::is_exported, &Symbol::set_exported, "Whether or not the symbol is **exported**") .def_property("imported", &Symbol::is_imported, &Symbol::set_imported, "Whether or not the symbol is **imported**") .def("__eq__", &Symbol::operator==) .def("__ne__", &Symbol::operator!=) .def("__hash__", [] (const Symbol& symbol) { return Hash::hash(symbol); }) .def("__str__", [] (const Symbol& symbol) { std::ostringstream stream; stream << symbol; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySymbolVersion.cpp000066400000000000000000000055431330725006400222670ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/SymbolVersion.hpp" #include "LIEF/ELF/hash.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (SymbolVersion::*)(void) const; template using setter_t = void (SymbolVersion::*)(T); template<> void create(py::module& m) { py::class_(m, "SymbolVersion") .def(py::init<>(),"Default constructor") .def(py::init(), "Constructor from :attr:`~lief.SymbolVersion.value`") .def_property_readonly_static("local", [] (const py::object&) { return SymbolVersion::local(); }, "Generate a *local* " RST_CLASS_REF(lief.ELF.SymbolVersion) "") .def_property_readonly_static("global_", [] (const py::object&) { return SymbolVersion::global(); }, "Generate a *global* " RST_CLASS_REF(lief.ELF.SymbolVersion) "") .def_property("value", static_cast>(&SymbolVersion::value), static_cast>(&SymbolVersion::value), "- `0` : The symbol is local\n" "- `1` : The symbol is global\n\n" "All other values are used for versions in the own object or in any of\n" "the dependencies. This is the version the symbol is tight to.") .def_property_readonly("has_auxiliary_version", &SymbolVersion::has_auxiliary_version, "Check if this symbols has a " RST_CLASS_REF(lief.ELF.SymbolVersionAux) "") .def_property_readonly( "symbol_version_auxiliary", static_cast( &SymbolVersion::symbol_version_auxiliary), "Return the " RST_CLASS_REF(lief.ELF.SymbolVersionAux) " associated with this version", py::return_value_policy::reference_internal) .def("__eq__", &SymbolVersion::operator==) .def("__ne__", &SymbolVersion::operator!=) .def("__hash__", [] (const SymbolVersion& sv) { return Hash::hash(sv); }) .def("__str__", [] (const SymbolVersion& symbolVersion) { std::ostringstream stream; stream << symbolVersion; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySymbolVersionAux.cpp000066400000000000000000000034511330725006400227410ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/SymbolVersionAux.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (SymbolVersionAux::*)(void) const; template using setter_t = void (SymbolVersionAux::*)(T); template<> void create(py::module& m) { // Symbol Version Auxiliary object py::class_(m, "SymbolVersionAux", "Class which modelize an Auxiliary Symbol version") .def_property("name", [] (const SymbolVersionAux& obj) { return safe_string_converter(obj.name()); }, static_cast>(&SymbolVersionAux::name), "Symbol's name") .def("__eq__", &SymbolVersionAux::operator==) .def("__ne__", &SymbolVersionAux::operator!=) .def("__hash__", [] (const SymbolVersionAux& sva) { return Hash::hash(sva); }) .def("__str__", [] (const SymbolVersionAux& symbolVersionAux) { std::ostringstream stream; stream << symbolVersionAux; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySymbolVersionAuxRequirement.cpp000066400000000000000000000042641330725006400251650ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/SymbolVersionAuxRequirement.hpp" #include #include namespace LIEF { namespace ELF { template using getter_t = T (SymbolVersionAuxRequirement::*)(void) const; template using setter_t = void (SymbolVersionAuxRequirement::*)(T); template<> void create(py::module& m) { // // Symbol Version Requirement Auxiliary object // py::class_(m, "SymbolVersionAuxRequirement") .def_property("hash", static_cast>(&SymbolVersionAuxRequirement::hash), static_cast>(&SymbolVersionAuxRequirement::hash)) .def_property("flags", static_cast>(&SymbolVersionAuxRequirement::flags), static_cast>(&SymbolVersionAuxRequirement::flags)) .def_property("other", static_cast>(&SymbolVersionAuxRequirement::other), static_cast>(&SymbolVersionAuxRequirement::other)) .def("__eq__", &SymbolVersionAuxRequirement::operator==) .def("__ne__", &SymbolVersionAuxRequirement::operator!=) .def("__hash__", [] (const SymbolVersionAuxRequirement& svar) { return Hash::hash(svar); }) .def("__str__", [] (const SymbolVersionAuxRequirement& symbolVersionAux) { std::ostringstream stream; stream << symbolVersionAux; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySymbolVersionDefinition.cpp000066400000000000000000000047071330725006400243010ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/SymbolVersionDefinition.hpp" namespace LIEF { namespace ELF { template using getter_t = T (SymbolVersionDefinition::*)(void) const; template using setter_t = void (SymbolVersionDefinition::*)(T); template using no_const_getter = T (SymbolVersionDefinition::*)(void); template<> void create(py::module& m) { py::class_(m, "SymbolVersionDefinition", "Class which modelization of an entry defined in ``DT_VERDEF`` (or ``.gnu.version_d``)") .def_property("version", static_cast>(&SymbolVersionDefinition::version), static_cast>(&SymbolVersionDefinition::version), "Version revision. Should holds 1") .def_property("flags", static_cast>(&SymbolVersionDefinition::flags), static_cast>(&SymbolVersionDefinition::flags)) .def_property("hash", static_cast>(&SymbolVersionDefinition::hash), static_cast>(&SymbolVersionDefinition::hash)) .def_property_readonly("auxiliary_symbols", static_cast>(&SymbolVersionDefinition::symbols_aux), py::return_value_policy::reference_internal) .def("__eq__", &SymbolVersionDefinition::operator==) .def("__ne__", &SymbolVersionDefinition::operator!=) .def("__hash__", [] (const SymbolVersionDefinition& svd) { return Hash::hash(svd); }) .def("__str__", [] (const SymbolVersionDefinition& svd) { std::ostringstream stream; stream << svd; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySymbolVersionRequirement.cpp000066400000000000000000000046431330725006400245100ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/ELF/hash.hpp" #include "LIEF/ELF/SymbolVersionRequirement.hpp" #include "pyELF.hpp" namespace LIEF { namespace ELF { template using getter_t = T (SymbolVersionRequirement::*)(void) const; template using setter_t = void (SymbolVersionRequirement::*)(T); template using no_const_getter = T (SymbolVersionRequirement::*)(void); template<> void create(py::module& m) { // Symbol Version Requirement object py::class_(m, "SymbolVersionRequirement", "Class which modelize an entry in ``DT_VERNEED`` or ``.gnu.version_r`` table") .def_property("version", static_cast>(&SymbolVersionRequirement::version), static_cast>(&SymbolVersionRequirement::version), "Version revision. Should holds 1") .def_property("name", static_cast>(&SymbolVersionRequirement::name), static_cast>(&SymbolVersionRequirement::name)) .def("get_auxiliary_symbols", static_cast>(&SymbolVersionRequirement::auxiliary_symbols), "Auxiliary entries", py::return_value_policy::reference_internal) .def("__eq__", &SymbolVersionRequirement::operator==) .def("__ne__", &SymbolVersionRequirement::operator!=) .def("__hash__", [] (const SymbolVersionRequirement& svr) { return Hash::hash(svr); }) .def("__str__", [] (const SymbolVersionRequirement& symbolVersionRequirement) { std::ostringstream stream; stream << symbolVersionRequirement; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/objects/pySysvHash.cpp000066400000000000000000000036331330725006400212220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "LIEF/ELF/hash.hpp" #include "LIEF/ELF/SysvHash.hpp" namespace LIEF { namespace ELF { template using getter_t = T (SysvHash::*)(void) const; template using setter_t = void (SysvHash::*)(T); template<> void create(py::module& m) { py::class_(m, "SysvHash") .def(py::init<>()) .def_property_readonly("nbucket", &SysvHash::nbucket, "Return the number of buckets") .def_property_readonly("nchain", &SysvHash::nchain, "Return the number of *chains* (symbol table index)") .def_property_readonly("buckets", &SysvHash::buckets, "Buckets values", py::return_value_policy::reference_internal) .def_property_readonly("chains", &SysvHash::chains, "Chains values", py::return_value_policy::reference_internal) .def("__eq__", &SysvHash::operator==) .def("__ne__", &SysvHash::operator!=) .def("__hash__", [] (const SysvHash& sysvhash) { return Hash::hash(sysvhash); }) .def("__str__", [] (const SysvHash& sysvhash) { std::ostringstream stream; stream << sysvhash; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/ELF/pyELF.cpp000066400000000000000000000034231330725006400164240ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" namespace LIEF { namespace ELF { void init_python_module(py::module& m) { py::module LIEF_ELF_module = m.def_submodule("ELF", "Python API for ELF format"); init_enums(LIEF_ELF_module); init_objects(LIEF_ELF_module); py::module LIEF_ELF32_module = LIEF_ELF_module.def_submodule("ELF32", ""); init_ELF32_sizes(LIEF_ELF32_module); py::module LIEF_ELF64_module = LIEF_ELF_module.def_submodule("ELF64", ""); init_ELF64_sizes(LIEF_ELF64_module); } void init_objects(py::module& m) { CREATE(Parser, m); CREATE(SymbolVersion, m); CREATE(Binary, m); CREATE(Header, m); CREATE(Section, m); CREATE(Segment, m); CREATE(Symbol, m); CREATE(Relocation, m); CREATE(SymbolVersionAux, m); CREATE(SymbolVersionAuxRequirement, m); CREATE(SymbolVersionDefinition,m ); CREATE(SymbolVersionRequirement, m); CREATE(DynamicEntry, m); CREATE(DynamicEntryLibrary, m); CREATE(DynamicSharedObject, m); CREATE(DynamicEntryArray, m); CREATE(DynamicEntryRpath, m); CREATE(DynamicEntryRunPath, m); CREATE(DynamicEntryFlags, m); CREATE(GnuHash, m); CREATE(SysvHash, m); CREATE(Builder, m); CREATE(Note, m); CREATE(AndroidNote, m); } } } LIEF-0.9.0/api/python/ELF/pyELF.hpp000066400000000000000000000037251330725006400164360ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_ELF_H_ #define PY_LIEF_ELF_H_ #include "LIEF/ELF/Parser.hpp" #include "LIEF/ELF/Binary.hpp" #include "LIEF/ELF/Builder.hpp" #include "pyLIEF.hpp" #define SPECIALIZE_CREATE(X) \ template<> \ void create(py::module&) #define CREATE(X,Y) create(Y) namespace LIEF { namespace ELF { template void create(py::module&); void init_python_module(py::module& m); void init_objects(py::module&); void init_enums(py::module&); void init_ELF32_sizes(py::module&); void init_ELF64_sizes(py::module&); SPECIALIZE_CREATE(Parser); SPECIALIZE_CREATE(Binary); SPECIALIZE_CREATE(Header); SPECIALIZE_CREATE(Section); SPECIALIZE_CREATE(Segment); SPECIALIZE_CREATE(Symbol); SPECIALIZE_CREATE(Relocation); SPECIALIZE_CREATE(SymbolVersion); SPECIALIZE_CREATE(SymbolVersionAux); SPECIALIZE_CREATE(SymbolVersionRequirement); SPECIALIZE_CREATE(SymbolVersionDefinition); SPECIALIZE_CREATE(SymbolVersionAuxRequirement); SPECIALIZE_CREATE(DynamicEntry); SPECIALIZE_CREATE(DynamicEntryLibrary); SPECIALIZE_CREATE(DynamicSharedObject); SPECIALIZE_CREATE(DynamicEntryArray); SPECIALIZE_CREATE(DynamicEntryRpath); SPECIALIZE_CREATE(DynamicEntryRunPath); SPECIALIZE_CREATE(DynamicEntryFlags); SPECIALIZE_CREATE(GnuHash); SPECIALIZE_CREATE(SysvHash); SPECIALIZE_CREATE(Builder); SPECIALIZE_CREATE(Note); SPECIALIZE_CREATE(AndroidNote); } } #endif LIEF-0.9.0/api/python/ELF/pyEnums.cpp000066400000000000000000001531311330725006400171070ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyELF.hpp" #include "enums_wrapper.hpp" #include "LIEF/ELF/Structures.hpp" #include "LIEF/ELF/EnumToString.hpp" #define PY_ENUM(x) to_string(x), x namespace LIEF { namespace ELF { void init_enums(py::module& m) { LIEF::enum_(m, "ELF_CLASS") .value(PY_ENUM(ELF_CLASS::ELFCLASSNONE)) .value(PY_ENUM(ELF_CLASS::ELFCLASS32)) .value(PY_ENUM(ELF_CLASS::ELFCLASS64)); LIEF::enum_(m, "ELF_DATA") .value(PY_ENUM(ELF_DATA::ELFDATANONE)) .value(PY_ENUM(ELF_DATA::ELFDATA2LSB)) .value(PY_ENUM(ELF_DATA::ELFDATA2MSB)); LIEF::enum_(m, "OS_ABI") .value(PY_ENUM(OS_ABI::ELFOSABI_SYSTEMV)) .value(PY_ENUM(OS_ABI::ELFOSABI_HPUX)) .value(PY_ENUM(OS_ABI::ELFOSABI_NETBSD)) .value(PY_ENUM(OS_ABI::ELFOSABI_GNU)) .value(PY_ENUM(OS_ABI::ELFOSABI_LINUX)) .value(PY_ENUM(OS_ABI::ELFOSABI_HURD)) .value(PY_ENUM(OS_ABI::ELFOSABI_SOLARIS)) .value(PY_ENUM(OS_ABI::ELFOSABI_AIX)) .value(PY_ENUM(OS_ABI::ELFOSABI_IRIX)) .value(PY_ENUM(OS_ABI::ELFOSABI_FREEBSD)) .value(PY_ENUM(OS_ABI::ELFOSABI_TRU64)) .value(PY_ENUM(OS_ABI::ELFOSABI_MODESTO)) .value(PY_ENUM(OS_ABI::ELFOSABI_OPENBSD)) .value(PY_ENUM(OS_ABI::ELFOSABI_OPENVMS)) .value(PY_ENUM(OS_ABI::ELFOSABI_NSK)) .value(PY_ENUM(OS_ABI::ELFOSABI_AROS)) .value(PY_ENUM(OS_ABI::ELFOSABI_FENIXOS)) .value(PY_ENUM(OS_ABI::ELFOSABI_CLOUDABI)) .value(PY_ENUM(OS_ABI::ELFOSABI_C6000_ELFABI)) .value(PY_ENUM(OS_ABI::ELFOSABI_AMDGPU_HSA)) .value(PY_ENUM(OS_ABI::ELFOSABI_C6000_LINUX)) .value(PY_ENUM(OS_ABI::ELFOSABI_ARM)) .value(PY_ENUM(OS_ABI::ELFOSABI_STANDALONE)); // Enum for the *e_type* of ElfXX_Ehdr LIEF::enum_(m, "E_TYPE") .value(PY_ENUM(E_TYPE::ET_NONE)) .value(PY_ENUM(E_TYPE::ET_REL)) .value(PY_ENUM(E_TYPE::ET_EXEC)) .value(PY_ENUM(E_TYPE::ET_DYN)) .value(PY_ENUM(E_TYPE::ET_CORE)) .value(PY_ENUM(E_TYPE::ET_LOPROC)) .value(PY_ENUM(E_TYPE::ET_HIPROC)); //! Enum for the *e_version* of ElfXX_Ehdr; LIEF::enum_(m, "VERSION") .value(PY_ENUM(VERSION::EV_NONE)) .value(PY_ENUM(VERSION::EV_CURRENT)); // Enum for the *e_machine* of ElfXX_Ehdr LIEF::enum_(m, "ARCH") .value(PY_ENUM(ARCH::EM_NONE)) .value(PY_ENUM(ARCH::EM_M32)) .value(PY_ENUM(ARCH::EM_SPARC)) .value(PY_ENUM(ARCH::EM_386)) .value(PY_ENUM(ARCH::EM_68K)) .value(PY_ENUM(ARCH::EM_88K)) .value(PY_ENUM(ARCH::EM_IAMCU)) .value(PY_ENUM(ARCH::EM_860)) .value(PY_ENUM(ARCH::EM_MIPS)) .value(PY_ENUM(ARCH::EM_S370)) .value(PY_ENUM(ARCH::EM_MIPS_RS3_LE)) .value(PY_ENUM(ARCH::EM_PARISC)) .value(PY_ENUM(ARCH::EM_VPP500)) .value(PY_ENUM(ARCH::EM_NONE)) .value(PY_ENUM(ARCH::EM_960)) .value(PY_ENUM(ARCH::EM_PPC)) .value(PY_ENUM(ARCH::EM_PPC64)) .value(PY_ENUM(ARCH::EM_S390)) .value(PY_ENUM(ARCH::EM_SPU)) .value(PY_ENUM(ARCH::EM_V800)) .value(PY_ENUM(ARCH::EM_FR20)) .value(PY_ENUM(ARCH::EM_RH32)) .value(PY_ENUM(ARCH::EM_RCE)) .value(PY_ENUM(ARCH::EM_ARM)) .value(PY_ENUM(ARCH::EM_ALPHA)) .value(PY_ENUM(ARCH::EM_SH)) .value(PY_ENUM(ARCH::EM_SPARCV9)) .value(PY_ENUM(ARCH::EM_TRICORE)) .value(PY_ENUM(ARCH::EM_ARC)) .value(PY_ENUM(ARCH::EM_H8_300)) .value(PY_ENUM(ARCH::EM_H8_300H)) .value(PY_ENUM(ARCH::EM_H8S)) .value(PY_ENUM(ARCH::EM_H8_500)) .value(PY_ENUM(ARCH::EM_IA_64)) .value(PY_ENUM(ARCH::EM_MIPS_X)) .value(PY_ENUM(ARCH::EM_COLDFIRE)) .value(PY_ENUM(ARCH::EM_68HC12)) .value(PY_ENUM(ARCH::EM_MMA)) .value(PY_ENUM(ARCH::EM_PCP)) .value(PY_ENUM(ARCH::EM_NCPU)) .value(PY_ENUM(ARCH::EM_NDR1)) .value(PY_ENUM(ARCH::EM_STARCORE)) .value(PY_ENUM(ARCH::EM_ME16)) .value(PY_ENUM(ARCH::EM_ST100)) .value(PY_ENUM(ARCH::EM_TINYJ)) .value(PY_ENUM(ARCH::EM_X86_64)) .value(PY_ENUM(ARCH::EM_PDSP)) .value(PY_ENUM(ARCH::EM_PDP10)) .value(PY_ENUM(ARCH::EM_PDP11)) .value(PY_ENUM(ARCH::EM_FX66)) .value(PY_ENUM(ARCH::EM_ST9PLUS)) .value(PY_ENUM(ARCH::EM_ST7)) .value(PY_ENUM(ARCH::EM_68HC16)) .value(PY_ENUM(ARCH::EM_68HC11)) .value(PY_ENUM(ARCH::EM_68HC08)) .value(PY_ENUM(ARCH::EM_68HC05)) .value(PY_ENUM(ARCH::EM_SVX)) .value(PY_ENUM(ARCH::EM_ST19)) .value(PY_ENUM(ARCH::EM_VAX)) .value(PY_ENUM(ARCH::EM_CRIS)) .value(PY_ENUM(ARCH::EM_JAVELIN)) .value(PY_ENUM(ARCH::EM_FIREPATH)) .value(PY_ENUM(ARCH::EM_ZSP)) .value(PY_ENUM(ARCH::EM_MMIX)) .value(PY_ENUM(ARCH::EM_HUANY)) .value(PY_ENUM(ARCH::EM_PRISM)) .value(PY_ENUM(ARCH::EM_AVR)) .value(PY_ENUM(ARCH::EM_FR30)) .value(PY_ENUM(ARCH::EM_D10V)) .value(PY_ENUM(ARCH::EM_D30V)) .value(PY_ENUM(ARCH::EM_V850)) .value(PY_ENUM(ARCH::EM_M32R)) .value(PY_ENUM(ARCH::EM_MN10300)) .value(PY_ENUM(ARCH::EM_MN10200)) .value(PY_ENUM(ARCH::EM_PJ)) .value(PY_ENUM(ARCH::EM_OPENRISC)) .value(PY_ENUM(ARCH::EM_ARC_COMPACT)) .value(PY_ENUM(ARCH::EM_XTENSA)) .value(PY_ENUM(ARCH::EM_VIDEOCORE)) .value(PY_ENUM(ARCH::EM_TMM_GPP)) .value(PY_ENUM(ARCH::EM_NS32K)) .value(PY_ENUM(ARCH::EM_TPC)) .value(PY_ENUM(ARCH::EM_SNP1K)) .value(PY_ENUM(ARCH::EM_ST200)) .value(PY_ENUM(ARCH::EM_IP2K)) .value(PY_ENUM(ARCH::EM_MAX)) .value(PY_ENUM(ARCH::EM_CR)) .value(PY_ENUM(ARCH::EM_F2MC16)) .value(PY_ENUM(ARCH::EM_MSP430)) .value(PY_ENUM(ARCH::EM_BLACKFIN)) .value(PY_ENUM(ARCH::EM_SE_C33)) .value(PY_ENUM(ARCH::EM_SEP)) .value(PY_ENUM(ARCH::EM_ARCA)) .value(PY_ENUM(ARCH::EM_UNICORE)) .value(PY_ENUM(ARCH::EM_EXCESS)) .value(PY_ENUM(ARCH::EM_DXP)) .value(PY_ENUM(ARCH::EM_ALTERA_NIOS2)) .value(PY_ENUM(ARCH::EM_CRX)) .value(PY_ENUM(ARCH::EM_XGATE)) .value(PY_ENUM(ARCH::EM_C166)) .value(PY_ENUM(ARCH::EM_M16C)) .value(PY_ENUM(ARCH::EM_DSPIC30F)) .value(PY_ENUM(ARCH::EM_CE)) .value(PY_ENUM(ARCH::EM_M32C)) .value(PY_ENUM(ARCH::EM_TSK3000)) .value(PY_ENUM(ARCH::EM_RS08)) .value(PY_ENUM(ARCH::EM_SHARC)) .value(PY_ENUM(ARCH::EM_ECOG2)) .value(PY_ENUM(ARCH::EM_SCORE7)) .value(PY_ENUM(ARCH::EM_DSP24)) .value(PY_ENUM(ARCH::EM_VIDEOCORE3)) .value(PY_ENUM(ARCH::EM_LATTICEMICO32)) .value(PY_ENUM(ARCH::EM_SE_C17)) .value(PY_ENUM(ARCH::EM_TI_C6000)) .value(PY_ENUM(ARCH::EM_TI_C2000)) .value(PY_ENUM(ARCH::EM_TI_C5500)) .value(PY_ENUM(ARCH::EM_MMDSP_PLUS)) .value(PY_ENUM(ARCH::EM_CYPRESS_M8C)) .value(PY_ENUM(ARCH::EM_R32C)) .value(PY_ENUM(ARCH::EM_TRIMEDIA)) .value(PY_ENUM(ARCH::EM_HEXAGON)) .value(PY_ENUM(ARCH::EM_8051)) .value(PY_ENUM(ARCH::EM_STXP7X)) .value(PY_ENUM(ARCH::EM_NDS32)) .value(PY_ENUM(ARCH::EM_ECOG1)) .value(PY_ENUM(ARCH::EM_ECOG1X)) .value(PY_ENUM(ARCH::EM_MAXQ30)) .value(PY_ENUM(ARCH::EM_XIMO16)) .value(PY_ENUM(ARCH::EM_MANIK)) .value(PY_ENUM(ARCH::EM_CRAYNV2)) .value(PY_ENUM(ARCH::EM_RX)) .value(PY_ENUM(ARCH::EM_METAG)) .value(PY_ENUM(ARCH::EM_MCST_ELBRUS)) .value(PY_ENUM(ARCH::EM_ECOG16)) .value(PY_ENUM(ARCH::EM_CR16)) .value(PY_ENUM(ARCH::EM_ETPU)) .value(PY_ENUM(ARCH::EM_SLE9X)) .value(PY_ENUM(ARCH::EM_L10M)) .value(PY_ENUM(ARCH::EM_K10M)) .value(PY_ENUM(ARCH::EM_AARCH64)) .value(PY_ENUM(ARCH::EM_AVR32)) .value(PY_ENUM(ARCH::EM_STM8)) .value(PY_ENUM(ARCH::EM_TILE64)) .value(PY_ENUM(ARCH::EM_TILEPRO)) .value(PY_ENUM(ARCH::EM_CUDA)) .value(PY_ENUM(ARCH::EM_TILEGX)) .value(PY_ENUM(ARCH::EM_CLOUDSHIELD)) .value(PY_ENUM(ARCH::EM_COREA_1ST)) .value(PY_ENUM(ARCH::EM_COREA_2ND)) .value(PY_ENUM(ARCH::EM_ARC_COMPACT2)) .value(PY_ENUM(ARCH::EM_OPEN8)) .value(PY_ENUM(ARCH::EM_RL78)) .value(PY_ENUM(ARCH::EM_VIDEOCORE5)) .value(PY_ENUM(ARCH::EM_78KOR)) .value(PY_ENUM(ARCH::EM_56800EX)) .value(PY_ENUM(ARCH::EM_BA1)) .value(PY_ENUM(ARCH::EM_BA2)) .value(PY_ENUM(ARCH::EM_XCORE)) .value(PY_ENUM(ARCH::EM_MCHP_PIC)) .value(PY_ENUM(ARCH::EM_INTEL205)) .value(PY_ENUM(ARCH::EM_INTEL206)) .value(PY_ENUM(ARCH::EM_INTEL207)) .value(PY_ENUM(ARCH::EM_INTEL208)) .value(PY_ENUM(ARCH::EM_INTEL209)) .value(PY_ENUM(ARCH::EM_KM32)) .value(PY_ENUM(ARCH::EM_KMX32)) .value(PY_ENUM(ARCH::EM_KMX16)) .value(PY_ENUM(ARCH::EM_KMX8)) .value(PY_ENUM(ARCH::EM_KVARC)) .value(PY_ENUM(ARCH::EM_CDP)) .value(PY_ENUM(ARCH::EM_COGE)) .value(PY_ENUM(ARCH::EM_COOL)) .value(PY_ENUM(ARCH::EM_NORC)) .value(PY_ENUM(ARCH::EM_CSR_KALIMBA)) .value(PY_ENUM(ARCH::EM_AMDGPU)); //! Enum for the *sh_type* of ElfXX_Shdr; LIEF::enum_(m, "SECTION_TYPES") .value(PY_ENUM(ELF_SECTION_TYPES::SHT_NULL)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_PROGBITS)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_SYMTAB)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_STRTAB)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_RELA)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_HASH)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_DYNAMIC)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_NOTE)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_NOBITS)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_REL)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_SHLIB)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_DYNSYM)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_INIT_ARRAY)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_FINI_ARRAY)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_PREINIT_ARRAY)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_GROUP)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_SYMTAB_SHNDX)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_LOOS)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_GNU_ATTRIBUTES)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_GNU_HASH)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_GNU_verdef)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_GNU_verneed)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_GNU_versym)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_HIOS)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_LOPROC)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_ARM_EXIDX)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_ARM_PREEMPTMAP)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_ARM_ATTRIBUTES)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_ARM_DEBUGOVERLAY)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_ARM_OVERLAYSECTION)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_HEX_ORDERED)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_X86_64_UNWIND)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_MIPS_REGINFO)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_MIPS_OPTIONS)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_MIPS_ABIFLAGS)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_HIPROC)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_LOUSER)) .value(PY_ENUM(ELF_SECTION_TYPES::SHT_HIUSER)); //! Enum for the *sh_flags* field of ElfXX_Shdr; LIEF::enum_(m, "SECTION_FLAGS", py::arithmetic()) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_NONE)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_WRITE)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_ALLOC)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_EXECINSTR)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MERGE)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_STRINGS)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_INFO_LINK)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_LINK_ORDER)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_OS_NONCONFORMING)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_GROUP)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_TLS)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_EXCLUDE)) .value(PY_ENUM(ELF_SECTION_FLAGS::XCORE_SHF_CP_SECTION)) .value(PY_ENUM(ELF_SECTION_FLAGS::XCORE_SHF_DP_SECTION)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MASKOS)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MASKPROC)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_HEX_GPREL)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MIPS_NODUPES)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MIPS_NAMES)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MIPS_LOCAL)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MIPS_NOSTRIP)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MIPS_GPREL)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MIPS_MERGE)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MIPS_ADDR)) .value(PY_ENUM(ELF_SECTION_FLAGS::SHF_MIPS_STRING)); //! Enum for the *p_type* field of ElfXX_Phdr LIEF::enum_(m, "SEGMENT_TYPES") .value(PY_ENUM(SEGMENT_TYPES::PT_NULL)) .value(PY_ENUM(SEGMENT_TYPES::PT_LOAD)) .value(PY_ENUM(SEGMENT_TYPES::PT_DYNAMIC)) .value(PY_ENUM(SEGMENT_TYPES::PT_INTERP)) .value(PY_ENUM(SEGMENT_TYPES::PT_NOTE)) .value(PY_ENUM(SEGMENT_TYPES::PT_SHLIB)) .value(PY_ENUM(SEGMENT_TYPES::PT_PHDR)) .value(PY_ENUM(SEGMENT_TYPES::PT_TLS)) .value(PY_ENUM(SEGMENT_TYPES::PT_LOOS)) .value(PY_ENUM(SEGMENT_TYPES::PT_HIOS)) .value(PY_ENUM(SEGMENT_TYPES::PT_LOPROC)) .value(PY_ENUM(SEGMENT_TYPES::PT_HIPROC)) .value(PY_ENUM(SEGMENT_TYPES::PT_GNU_EH_FRAME)) .value(PY_ENUM(SEGMENT_TYPES::PT_SUNW_EH_FRAME)) .value(PY_ENUM(SEGMENT_TYPES::PT_SUNW_UNWIND)) .value(PY_ENUM(SEGMENT_TYPES::PT_GNU_STACK)) .value(PY_ENUM(SEGMENT_TYPES::PT_GNU_RELRO)) .value(PY_ENUM(SEGMENT_TYPES::PT_ARM_ARCHEXT)) .value(PY_ENUM(SEGMENT_TYPES::PT_ARM_EXIDX)) .value(PY_ENUM(SEGMENT_TYPES::PT_ARM_UNWIND)) .value(PY_ENUM(SEGMENT_TYPES::PT_MIPS_REGINFO)) .value(PY_ENUM(SEGMENT_TYPES::PT_MIPS_RTPROC)) .value(PY_ENUM(SEGMENT_TYPES::PT_MIPS_OPTIONS)) .value(PY_ENUM(SEGMENT_TYPES::PT_MIPS_ABIFLAGS)); //! Enum for the *p_flags* field of ElfXX_Phdr LIEF::enum_(m, "SEGMENT_FLAGS", py::arithmetic()) .value(PY_ENUM(ELF_SEGMENT_FLAGS::PF_NONE)) .value(PY_ENUM(ELF_SEGMENT_FLAGS::PF_X)) .value(PY_ENUM(ELF_SEGMENT_FLAGS::PF_W)) .value(PY_ENUM(ELF_SEGMENT_FLAGS::PF_R)); LIEF::enum_(m, "DYNAMIC_TAGS") .value(PY_ENUM(DYNAMIC_TAGS::DT_NULL)) .value(PY_ENUM(DYNAMIC_TAGS::DT_NEEDED)) .value(PY_ENUM(DYNAMIC_TAGS::DT_PLTRELSZ)) .value(PY_ENUM(DYNAMIC_TAGS::DT_PLTGOT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_HASH)) .value(PY_ENUM(DYNAMIC_TAGS::DT_STRTAB)) .value(PY_ENUM(DYNAMIC_TAGS::DT_SYMTAB)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RELA)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RELASZ)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RELAENT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_STRSZ)) .value(PY_ENUM(DYNAMIC_TAGS::DT_SYMENT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_INIT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_FINI)) .value(PY_ENUM(DYNAMIC_TAGS::DT_SONAME)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RPATH)) .value(PY_ENUM(DYNAMIC_TAGS::DT_SYMBOLIC)) .value(PY_ENUM(DYNAMIC_TAGS::DT_REL)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RELSZ)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RELENT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_PLTREL)) .value(PY_ENUM(DYNAMIC_TAGS::DT_DEBUG)) .value(PY_ENUM(DYNAMIC_TAGS::DT_TEXTREL)) .value(PY_ENUM(DYNAMIC_TAGS::DT_JMPREL)) .value(PY_ENUM(DYNAMIC_TAGS::DT_BIND_NOW)) .value(PY_ENUM(DYNAMIC_TAGS::DT_INIT_ARRAY)) .value(PY_ENUM(DYNAMIC_TAGS::DT_FINI_ARRAY)) .value(PY_ENUM(DYNAMIC_TAGS::DT_INIT_ARRAYSZ)) .value(PY_ENUM(DYNAMIC_TAGS::DT_FINI_ARRAYSZ)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RUNPATH)) .value(PY_ENUM(DYNAMIC_TAGS::DT_FLAGS)) //.value(PY_ENUM(DYNAMIC_TAGS::DT_ENCODING)) .value(PY_ENUM(DYNAMIC_TAGS::DT_PREINIT_ARRAY)) .value(PY_ENUM(DYNAMIC_TAGS::DT_PREINIT_ARRAYSZ)) .value(PY_ENUM(DYNAMIC_TAGS::DT_LOOS)) .value(PY_ENUM(DYNAMIC_TAGS::DT_HIOS)) .value(PY_ENUM(DYNAMIC_TAGS::DT_LOPROC)) .value(PY_ENUM(DYNAMIC_TAGS::DT_HIPROC)) .value(PY_ENUM(DYNAMIC_TAGS::DT_GNU_HASH)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RELACOUNT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_RELCOUNT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_FLAGS_1)) .value(PY_ENUM(DYNAMIC_TAGS::DT_VERSYM)) .value(PY_ENUM(DYNAMIC_TAGS::DT_VERDEF)) .value(PY_ENUM(DYNAMIC_TAGS::DT_VERDEFNUM)) .value(PY_ENUM(DYNAMIC_TAGS::DT_VERNEED)) .value(PY_ENUM(DYNAMIC_TAGS::DT_VERNEEDNUM)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_RLD_VERSION)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_TIME_STAMP)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_ICHECKSUM)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_IVERSION)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_FLAGS)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_BASE_ADDRESS)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_MSYM)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_CONFLICT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_LIBLIST)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_LOCAL_GOTNO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_CONFLICTNO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_LIBLISTNO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_SYMTABNO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_UNREFEXTNO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_GOTSYM)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_HIPAGENO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_RLD_MAP)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_CLASS)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_CLASS_NO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_INSTANCE)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_INSTANCE_NO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_RELOC)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_RELOC_NO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_SYM)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_SYM_NO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_CLASSSYM)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DELTA_CLASSSYM_NO)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_CXX_FLAGS)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_PIXIE_INIT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_SYMBOL_LIB)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_LOCALPAGE_GOTIDX)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_LOCAL_GOTIDX)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_HIDDEN_GOTIDX)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_PROTECTED_GOTIDX)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_OPTIONS)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_INTERFACE)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_DYNSTR_ALIGN)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_INTERFACE_SIZE)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_RLD_TEXT_RESOLVE_ADDR)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_PERF_SUFFIX)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_COMPACT_SIZE)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_GP_VALUE)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_AUX_DYNAMIC)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_PLTGOT)) .value(PY_ENUM(DYNAMIC_TAGS::DT_MIPS_RWPLT)); LIEF::enum_(m, "SYMBOL_TYPES") .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_NOTYPE)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_OBJECT)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_FUNC)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_SECTION)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_FILE)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_COMMON)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_TLS)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_GNU_IFUNC)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_LOOS)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_HIOS)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_LOPROC)) .value(PY_ENUM(ELF_SYMBOL_TYPES::STT_HIPROC)); LIEF::enum_(m, "SYMBOL_BINDINGS") .value(PY_ENUM(SYMBOL_BINDINGS::STB_LOCAL)) .value(PY_ENUM(SYMBOL_BINDINGS::STB_GLOBAL)) .value(PY_ENUM(SYMBOL_BINDINGS::STB_WEAK)) .value(PY_ENUM(SYMBOL_BINDINGS::STB_GNU_UNIQUE)) .value(PY_ENUM(SYMBOL_BINDINGS::STB_LOOS)) .value(PY_ENUM(SYMBOL_BINDINGS::STB_HIOS)) .value(PY_ENUM(SYMBOL_BINDINGS::STB_LOPROC)) .value(PY_ENUM(SYMBOL_BINDINGS::STB_HIPROC)); LIEF::enum_(m, "RELOCATION_X86_64") .value(PY_ENUM(RELOC_x86_64::R_X86_64_NONE)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_PC32)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOT32)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_PLT32)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_COPY)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GLOB_DAT)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_JUMP_SLOT)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_RELATIVE)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTPCREL)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_32)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_32S)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_16)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_PC16)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_8)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_PC8)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_DTPMOD64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_DTPOFF64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_TPOFF64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_TLSGD)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_TLSLD)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_DTPOFF32)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTTPOFF)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_TPOFF32)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_PC64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTOFF64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTPC32)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOT64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTPCREL64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTPC64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTPLT64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_PLTOFF64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_SIZE32)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_SIZE64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTPC32_TLSDESC)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_TLSDESC_CALL)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_TLSDESC)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_IRELATIVE)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_RELATIVE64)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_PC32_BND)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_PLT32_BND)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_GOTPCRELX)) .value(PY_ENUM(RELOC_x86_64::R_X86_64_REX_GOTPCRELX)); LIEF::enum_(m, "RELOCATION_ARM") .value(PY_ENUM(RELOC_ARM::R_ARM_NONE)) .value(PY_ENUM(RELOC_ARM::R_ARM_PC24)) .value(PY_ENUM(RELOC_ARM::R_ARM_ABS32)) .value(PY_ENUM(RELOC_ARM::R_ARM_REL32)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDR_PC_G0)) .value(PY_ENUM(RELOC_ARM::R_ARM_ABS16)) .value(PY_ENUM(RELOC_ARM::R_ARM_ABS12)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_ABS5)) .value(PY_ENUM(RELOC_ARM::R_ARM_ABS8)) .value(PY_ENUM(RELOC_ARM::R_ARM_SBREL32)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_CALL)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_PC8)) .value(PY_ENUM(RELOC_ARM::R_ARM_BREL_ADJ)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_DESC)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_SWI8)) .value(PY_ENUM(RELOC_ARM::R_ARM_XPC25)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_XPC22)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_DTPMOD32)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_DTPOFF32)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_TPOFF32)) .value(PY_ENUM(RELOC_ARM::R_ARM_COPY)) .value(PY_ENUM(RELOC_ARM::R_ARM_GLOB_DAT)) .value(PY_ENUM(RELOC_ARM::R_ARM_JUMP_SLOT)) .value(PY_ENUM(RELOC_ARM::R_ARM_RELATIVE)) .value(PY_ENUM(RELOC_ARM::R_ARM_GOTOFF32)) .value(PY_ENUM(RELOC_ARM::R_ARM_BASE_PREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_GOT_BREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_PLT32)) .value(PY_ENUM(RELOC_ARM::R_ARM_CALL)) .value(PY_ENUM(RELOC_ARM::R_ARM_JUMP24)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_JUMP24)) .value(PY_ENUM(RELOC_ARM::R_ARM_BASE_ABS)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_PCREL_7_0)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_PCREL_15_8)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_PCREL_23_15)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDR_SBREL_11_0_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_SBREL_19_12_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_SBREL_27_20_CK)) .value(PY_ENUM(RELOC_ARM::R_ARM_TARGET1)) .value(PY_ENUM(RELOC_ARM::R_ARM_SBREL31)) .value(PY_ENUM(RELOC_ARM::R_ARM_V4BX)) .value(PY_ENUM(RELOC_ARM::R_ARM_TARGET2)) .value(PY_ENUM(RELOC_ARM::R_ARM_PREL31)) .value(PY_ENUM(RELOC_ARM::R_ARM_MOVW_ABS_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_MOVT_ABS)) .value(PY_ENUM(RELOC_ARM::R_ARM_MOVW_PREL_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_MOVT_PREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_MOVW_ABS_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_MOVT_ABS)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_MOVW_PREL_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_MOVT_PREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_JUMP19)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_JUMP6)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_ALU_PREL_11_0)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_PC12)) .value(PY_ENUM(RELOC_ARM::R_ARM_ABS32_NOI)) .value(PY_ENUM(RELOC_ARM::R_ARM_REL32_NOI)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_PC_G0_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_PC_G0)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_PC_G1_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_PC_G1)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_PC_G2)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDR_PC_G1)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDR_PC_G2)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDRS_PC_G0)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDRS_PC_G1)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDRS_PC_G2)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDC_PC_G0)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDC_PC_G1)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDC_PC_G2)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_SB_G0_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_SB_G0)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_SB_G1_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_SB_G1)) .value(PY_ENUM(RELOC_ARM::R_ARM_ALU_SB_G2)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDR_SB_G0)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDR_SB_G1)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDR_SB_G2)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDRS_SB_G0)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDRS_SB_G1)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDRS_SB_G2)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDC_SB_G0)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDC_SB_G1)) .value(PY_ENUM(RELOC_ARM::R_ARM_LDC_SB_G2)) .value(PY_ENUM(RELOC_ARM::R_ARM_MOVW_BREL_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_MOVT_BREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_MOVW_BREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_MOVW_BREL_NC)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_MOVT_BREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_MOVW_BREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_GOTDESC)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_CALL)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_DESCSEQ)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_TLS_CALL)) .value(PY_ENUM(RELOC_ARM::R_ARM_PLT32_ABS)) .value(PY_ENUM(RELOC_ARM::R_ARM_GOT_ABS)) .value(PY_ENUM(RELOC_ARM::R_ARM_GOT_PREL)) .value(PY_ENUM(RELOC_ARM::R_ARM_GOT_BREL12)) .value(PY_ENUM(RELOC_ARM::R_ARM_GOTOFF12)) .value(PY_ENUM(RELOC_ARM::R_ARM_GOTRELAX)) .value(PY_ENUM(RELOC_ARM::R_ARM_GNU_VTENTRY)) .value(PY_ENUM(RELOC_ARM::R_ARM_GNU_VTINHERIT)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_JUMP11)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_JUMP8)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_GD32)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_LDM32)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_LDO32)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_IE32)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_LE32)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_LDO12)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_LE12)) .value(PY_ENUM(RELOC_ARM::R_ARM_TLS_IE12GP)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_0)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_1)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_2)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_3)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_4)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_5)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_6)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_7)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_8)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_9)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_10)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_11)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_12)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_13)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_14)) .value(PY_ENUM(RELOC_ARM::R_ARM_PRIVATE_15)) .value(PY_ENUM(RELOC_ARM::R_ARM_ME_TOO)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_TLS_DESCSEQ16)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_TLS_DESCSEQ32)) .value(PY_ENUM(RELOC_ARM::R_ARM_IRELATIVE)) .value(PY_ENUM(RELOC_ARM::R_ARM_RXPC25)) .value(PY_ENUM(RELOC_ARM::R_ARM_RSBREL32)) .value(PY_ENUM(RELOC_ARM::R_ARM_THM_RPC22)) .value(PY_ENUM(RELOC_ARM::R_ARM_RREL32)) .value(PY_ENUM(RELOC_ARM::R_ARM_RPC24)) .value(PY_ENUM(RELOC_ARM::R_ARM_RBASE)); LIEF::enum_(m, "RELOCATION_i386") .value(PY_ENUM(RELOC_i386::R_386_NONE)) .value(PY_ENUM(RELOC_i386::R_386_32)) .value(PY_ENUM(RELOC_i386::R_386_PC32)) .value(PY_ENUM(RELOC_i386::R_386_GOT32)) .value(PY_ENUM(RELOC_i386::R_386_PLT32)) .value(PY_ENUM(RELOC_i386::R_386_COPY)) .value(PY_ENUM(RELOC_i386::R_386_GLOB_DAT)) .value(PY_ENUM(RELOC_i386::R_386_JUMP_SLOT)) .value(PY_ENUM(RELOC_i386::R_386_RELATIVE)) .value(PY_ENUM(RELOC_i386::R_386_GOTOFF)) .value(PY_ENUM(RELOC_i386::R_386_GOTPC)) .value(PY_ENUM(RELOC_i386::R_386_32PLT)) .value(PY_ENUM(RELOC_i386::R_386_TLS_TPOFF)) .value(PY_ENUM(RELOC_i386::R_386_TLS_IE)) .value(PY_ENUM(RELOC_i386::R_386_TLS_GOTIE)) .value(PY_ENUM(RELOC_i386::R_386_TLS_LE)) .value(PY_ENUM(RELOC_i386::R_386_TLS_GD)) .value(PY_ENUM(RELOC_i386::R_386_TLS_LDM)) .value(PY_ENUM(RELOC_i386::R_386_16)) .value(PY_ENUM(RELOC_i386::R_386_PC16)) .value(PY_ENUM(RELOC_i386::R_386_8)) .value(PY_ENUM(RELOC_i386::R_386_PC8)) .value(PY_ENUM(RELOC_i386::R_386_TLS_GD_32)) .value(PY_ENUM(RELOC_i386::R_386_TLS_GD_PUSH)) .value(PY_ENUM(RELOC_i386::R_386_TLS_GD_CALL)) .value(PY_ENUM(RELOC_i386::R_386_TLS_GD_POP)) .value(PY_ENUM(RELOC_i386::R_386_TLS_LDM_32)) .value(PY_ENUM(RELOC_i386::R_386_TLS_LDM_PUSH)) .value(PY_ENUM(RELOC_i386::R_386_TLS_LDM_CALL)) .value(PY_ENUM(RELOC_i386::R_386_TLS_LDM_POP)) .value(PY_ENUM(RELOC_i386::R_386_TLS_LDO_32)) .value(PY_ENUM(RELOC_i386::R_386_TLS_IE_32)) .value(PY_ENUM(RELOC_i386::R_386_TLS_LE_32)) .value(PY_ENUM(RELOC_i386::R_386_TLS_DTPMOD32)) .value(PY_ENUM(RELOC_i386::R_386_TLS_DTPOFF32)) .value(PY_ENUM(RELOC_i386::R_386_TLS_TPOFF32)) .value(PY_ENUM(RELOC_i386::R_386_TLS_GOTDESC)) .value(PY_ENUM(RELOC_i386::R_386_TLS_DESC_CALL)) .value(PY_ENUM(RELOC_i386::R_386_TLS_DESC)) .value(PY_ENUM(RELOC_i386::R_386_IRELATIVE)) .value(PY_ENUM(RELOC_i386::R_386_NUM)); LIEF::enum_(m, "RELOCATION_AARCH64") .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_NONE)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_ABS64)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_ABS32)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_ABS16)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_PREL64)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_PREL32)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_PREL16)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_UABS_G0)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_UABS_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_UABS_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_UABS_G1_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_UABS_G2)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_UABS_G2_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_UABS_G3)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_SABS_G0)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_SABS_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_SABS_G2)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LD_PREL_LO19)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_ADR_PREL_LO21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_ADR_PREL_PG_HI21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_ADR_PREL_PG_HI21_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_ADD_ABS_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LDST8_ABS_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TSTBR14)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_CONDBR19)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_JUMP26)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_CALL26)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LDST16_ABS_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LDST32_ABS_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LDST64_ABS_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_PREL_G0)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_PREL_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_PREL_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_PREL_G1_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_PREL_G2)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_PREL_G2_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_PREL_G3)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LDST128_ABS_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_GOTOFF_G0)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_GOTOFF_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_GOTOFF_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_GOTOFF_G1_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_GOTOFF_G2)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_GOTOFF_G2_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_MOVW_GOTOFF_G3)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_GOTREL64)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_GOTREL32)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_GOT_LD_PREL19)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LD64_GOTOFF_LO15)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_ADR_GOT_PAGE)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LD64_GOT_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_LD64_GOTPAGE_LO15)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSGD_ADR_PREL21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSGD_ADR_PAGE21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSGD_ADD_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSGD_MOVW_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSGD_MOVW_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_ADR_PREL21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_ADR_PAGE21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_ADD_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_MOVW_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_MOVW_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LD_PREL19)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_MOVW_DTPREL_G2)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_MOVW_DTPREL_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_MOVW_DTPREL_G0)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_ADD_DTPREL_HI12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_ADD_DTPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST8_DTPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST16_DTPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST32_DTPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST64_DTPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSIE_MOVW_GOTTPREL_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSIE_LD_GOTTPREL_PREL19)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_MOVW_TPREL_G2)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_MOVW_TPREL_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_MOVW_TPREL_G1_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_MOVW_TPREL_G0)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_ADD_TPREL_HI12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_ADD_TPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST8_TPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST16_TPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST32_TPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST64_TPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_LD_PREL19)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_ADR_PREL21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_ADR_PAGE21)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_LD64_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_ADD_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_OFF_G1)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_OFF_G0_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_LDR)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_ADD)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC_CALL)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST128_TPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST128_DTPREL_LO12)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_COPY)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_GLOB_DAT)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_JUMP_SLOT)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_RELATIVE)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLS_DTPREL64)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLS_DTPMOD64)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLS_TPREL64)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_TLSDESC)) .value(PY_ENUM(RELOC_AARCH64::R_AARCH64_IRELATIVE)); LIEF::enum_(m, "RELOCATION_PPC") .value(PY_ENUM(RELOC_POWERPC32::R_PPC_NONE)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR32)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR24)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR16_HA)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR14)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR14_BRTAKEN)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_ADDR14_BRNTAKEN)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL24)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL14)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL14_BRTAKEN)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL14_BRNTAKEN)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT16_HA)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_PLTREL24)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_JMP_SLOT)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_RELATIVE)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_LOCAL24PC)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL32)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_TLS)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_DTPMOD32)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_TPREL16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_TPREL16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_TPREL16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_TPREL16_HA)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_TPREL32)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_DTPREL16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_DTPREL16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_DTPREL16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_DTPREL16_HA)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_DTPREL32)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TLSGD16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TLSGD16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TLSGD16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TLSGD16_HA)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TLSLD16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TLSLD16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TLSLD16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TLSLD16_HA)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TPREL16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TPREL16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TPREL16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_TPREL16_HA)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_DTPREL16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_DTPREL16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_DTPREL16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_GOT_DTPREL16_HA)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_TLSGD)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_TLSLD)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL16)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL16_LO)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL16_HI)) .value(PY_ENUM(RELOC_POWERPC32::R_PPC_REL16_HA)); LIEF::enum_(m, "RELOCATION_PPC64") .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_NONE)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR32)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR24)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_LO)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR14)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR14_BRTAKEN)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR14_BRNTAKEN)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL24)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL14)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL14_BRTAKEN)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL14_BRNTAKEN)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT16)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT16_LO)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_JMP_SLOT)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_RELATIVE)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL32)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR64)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_HIGHER)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_HIGHERA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_HIGHEST)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_HIGHESTA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL64)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TOC16)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TOC16_LO)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TOC16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TOC16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TOC)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_ADDR16_LO_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT16_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT16_LO_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TOC16_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TOC16_LO_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TLS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPMOD64)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_LO)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL64)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_LO)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL64)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TLSGD16)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TLSGD16_LO)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TLSGD16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TLSGD16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TLSLD16)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TLSLD16_LO)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TLSLD16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TLSLD16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TPREL16_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TPREL16_LO_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TPREL16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_TPREL16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_DTPREL16_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_DTPREL16_LO_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_DTPREL16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_GOT_DTPREL16_HA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_LO_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_HIGHER)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_HIGHERA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_HIGHEST)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TPREL16_HIGHESTA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_LO_DS)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_HIGHER)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_HIGHERA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_HIGHEST)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_DTPREL16_HIGHESTA)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TLSGD)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_TLSLD)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL16)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL16_LO)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL16_HI)) .value(PY_ENUM(RELOC_POWERPC64::R_PPC64_REL16_HA)); LIEF::enum_(m, "DYNSYM_COUNT_METHODS") .value(PY_ENUM(DYNSYM_COUNT_METHODS::COUNT_AUTO)) .value(PY_ENUM(DYNSYM_COUNT_METHODS::COUNT_SECTION)) .value(PY_ENUM(DYNSYM_COUNT_METHODS::COUNT_HASH)) .value(PY_ENUM(DYNSYM_COUNT_METHODS::COUNT_RELOCATIONS)); LIEF::enum_(m, "NOTE_TYPES") .value(PY_ENUM(NOTE_TYPES::NT_UNKNOWN)) .value(PY_ENUM(NOTE_TYPES::NT_GNU_ABI_TAG)) .value(PY_ENUM(NOTE_TYPES::NT_GNU_HWCAP)) .value(PY_ENUM(NOTE_TYPES::NT_GNU_BUILD_ID)) .value(PY_ENUM(NOTE_TYPES::NT_GNU_GOLD_VERSION)); LIEF::enum_(m, "NOTE_ABIS") .value(PY_ENUM(NOTE_ABIS::ELF_NOTE_UNKNOWN)) .value(PY_ENUM(NOTE_ABIS::ELF_NOTE_OS_LINUX)) .value(PY_ENUM(NOTE_ABIS::ELF_NOTE_OS_GNU)) .value(PY_ENUM(NOTE_ABIS::ELF_NOTE_OS_SOLARIS2)) .value(PY_ENUM(NOTE_ABIS::ELF_NOTE_OS_FREEBSD)) .value(PY_ENUM(NOTE_ABIS::ELF_NOTE_OS_NETBSD)) .value(PY_ENUM(NOTE_ABIS::ELF_NOTE_OS_SYLLABLE)); LIEF::enum_(m, "RELOCATION_PURPOSES") .value(PY_ENUM(RELOCATION_PURPOSES::RELOC_PURPOSE_NONE)) .value(PY_ENUM(RELOCATION_PURPOSES::RELOC_PURPOSE_PLTGOT)) .value(PY_ENUM(RELOCATION_PURPOSES::RELOC_PURPOSE_DYNAMIC)) .value(PY_ENUM(RELOCATION_PURPOSES::RELOC_PURPOSE_OBJECT)); LIEF::enum_(m, "ARM_EFLAGS", py::arithmetic()) .value(PY_ENUM(ARM_EFLAGS::EF_ARM_SOFT_FLOAT)) .value(PY_ENUM(ARM_EFLAGS::EF_ARM_VFP_FLOAT)) .value(PY_ENUM(ARM_EFLAGS::EF_ARM_EABI_UNKNOWN)) .value(PY_ENUM(ARM_EFLAGS::EF_ARM_EABI_VER1)) .value(PY_ENUM(ARM_EFLAGS::EF_ARM_EABI_VER2)) .value(PY_ENUM(ARM_EFLAGS::EF_ARM_EABI_VER3)) .value(PY_ENUM(ARM_EFLAGS::EF_ARM_EABI_VER4)) .value(PY_ENUM(ARM_EFLAGS::EF_ARM_EABI_VER5)); LIEF::enum_(m, "PPC64_EFLAGS", py::arithmetic()) .value(PY_ENUM(PPC64_EFLAGS::EF_PPC64_ABI)); LIEF::enum_(m, "MIPS_EFLAGS", py::arithmetic()) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_NOREORDER)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_PIC)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_CPIC)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ABI2)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_32BITMODE)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_FP64)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_NAN2008)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ABI_O32)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ABI_O64)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ABI_EABI32)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ABI_EABI64)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_3900)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_4010)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_4100)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_4650)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_4120)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_4111)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_SB1)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_OCTEON)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_XLR)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_OCTEON2)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_OCTEON3)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_5400)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_5900)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_5500)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_9000)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_LS2E)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_LS2F)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MACH_LS3A)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_MICROMIPS)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_ASE_M16)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_ASE_MDMX)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_1)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_2)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_3)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_4)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_5)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_32)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_64)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_32R2)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_64R2)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_32R6)) .value(PY_ENUM(MIPS_EFLAGS::EF_MIPS_ARCH_64R6)); LIEF::enum_(m, "HEXAGON_EFLAGS", py::arithmetic()) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_MACH_V2)) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_MACH_V3)) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_MACH_V4)) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_MACH_V5)) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_ISA_MACH)) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_ISA_V2)) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_ISA_V3)) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_ISA_V4)) .value(PY_ENUM(HEXAGON_EFLAGS::EF_HEXAGON_ISA_V5)); LIEF::enum_(m, "IDENTITY") .value(PY_ENUM(IDENTITY::EI_MAG0)) .value(PY_ENUM(IDENTITY::EI_MAG1)) .value(PY_ENUM(IDENTITY::EI_MAG2)) .value(PY_ENUM(IDENTITY::EI_MAG3)) .value(PY_ENUM(IDENTITY::EI_CLASS)) .value(PY_ENUM(IDENTITY::EI_DATA)) .value(PY_ENUM(IDENTITY::EI_VERSION)) .value(PY_ENUM(IDENTITY::EI_OSABI)) .value(PY_ENUM(IDENTITY::EI_ABIVERSION)) .value(PY_ENUM(IDENTITY::EI_PAD)) .value(PY_ENUM(IDENTITY::EI_NIDENT)); LIEF::enum_(m, "SYMBOL_SECTION_INDEX") .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_UNDEF)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_LORESERVE)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_LOPROC)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_HIPROC)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_LOOS)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_HIOS)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_ABS)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_COMMON)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_XINDEX)) .value(PY_ENUM(SYMBOL_SECTION_INDEX::SHN_HIRESERVE)); LIEF::enum_(m, "DYNAMIC_FLAGS", py::arithmetic()) .value(PY_ENUM(DYNAMIC_FLAGS::DF_ORIGIN)) .value(PY_ENUM(DYNAMIC_FLAGS::DF_SYMBOLIC)) .value(PY_ENUM(DYNAMIC_FLAGS::DF_TEXTREL)) .value(PY_ENUM(DYNAMIC_FLAGS::DF_BIND_NOW)) .value(PY_ENUM(DYNAMIC_FLAGS::DF_STATIC_TLS)); LIEF::enum_(m, "DYNAMIC_FLAGS_1", py::arithmetic()) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NOW)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_GLOBAL)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_GROUP)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NODELETE)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_LOADFLTR)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_INITFIRST)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NOOPEN)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_ORIGIN)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_DIRECT)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_TRANS)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_INTERPOSE)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NODEFLIB)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NODUMP)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_CONFALT)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_ENDFILTEE)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_DISPRELDNE)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_DISPRELPND)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NODIRECT)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_IGNMULDEF)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NOKSYMS)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NOHDR)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_EDITED)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_NORELOC)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_SYMINTPOSE)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_GLOBAUDIT)) .value(PY_ENUM(DYNAMIC_FLAGS_1::DF_1_SINGLETON)); LIEF::enum_(m, "SYMBOL_VISIBILITY") .value(PY_ENUM(ELF_SYMBOL_VISIBILITY::STV_DEFAULT)) .value(PY_ENUM(ELF_SYMBOL_VISIBILITY::STV_HIDDEN)) .value(PY_ENUM(ELF_SYMBOL_VISIBILITY::STV_INTERNAL)) .value(PY_ENUM(ELF_SYMBOL_VISIBILITY::STV_PROTECTED)); } } } LIEF-0.9.0/api/python/ELF/pySizes.cpp000066400000000000000000000050251330725006400171130ustar00rootroot00000000000000#include "pyELF.hpp" #include "LIEF/ELF/Structures.hpp" namespace LIEF { namespace ELF { void init_ELF32_sizes(py::module& m) { enum SIZES : size_t {}; py::enum_(m, "SIZES") .value("ADDR", static_cast(sizeof(Elf32_Addr))) .value("OFF", static_cast(sizeof(Elf32_Off))) .value("HALF", static_cast(sizeof(Elf32_Half))) .value("WORD", static_cast(sizeof(Elf32_Word))) .value("SWORD", static_cast(sizeof(Elf32_Sword))) .value("INT", static_cast(sizeof(uint32_t))) .value("EHDR", static_cast(sizeof(Elf32_Ehdr))) .value("SHDR", static_cast(sizeof(Elf32_Shdr))) .value("PHDR", static_cast(sizeof(Elf32_Phdr))) .value("SYM", static_cast(sizeof(Elf32_Sym))) .value("REL", static_cast(sizeof(Elf32_Rel))) .value("RELA", static_cast(sizeof(Elf32_Rela))) .value("DYN", static_cast(sizeof(Elf32_Dyn))) .value("VERNEED", static_cast(sizeof(Elf32_Verneed))) .value("VERNAUX", static_cast(sizeof(Elf32_Vernaux))) .value("AUXV", static_cast(sizeof(Elf32_Auxv))) .value("VERDEF", static_cast(sizeof(Elf32_Verdef))) .value("VERDAUX", static_cast(sizeof(Elf32_Verdaux))) .export_values(); } void init_ELF64_sizes(py::module& m) { enum SIZES : size_t {}; py::enum_(m, "SIZES") .value("ADDR", static_cast(sizeof(Elf64_Addr))) .value("OFF", static_cast(sizeof(Elf64_Off))) .value("HALF", static_cast(sizeof(Elf64_Half))) .value("WORD", static_cast(sizeof(Elf64_Word))) .value("SWORD", static_cast(sizeof(Elf64_Sword))) .value("INT", static_cast(sizeof(uint64_t))) .value("EHDR", static_cast(sizeof(Elf64_Ehdr))) .value("SHDR", static_cast(sizeof(Elf64_Shdr))) .value("PHDR", static_cast(sizeof(Elf64_Phdr))) .value("SYM", static_cast(sizeof(Elf64_Sym))) .value("REL", static_cast(sizeof(Elf64_Rel))) .value("RELA", static_cast(sizeof(Elf64_Rela))) .value("DYN", static_cast(sizeof(Elf64_Dyn))) .value("VERNEED", static_cast(sizeof(Elf64_Verneed))) .value("VERNAUX", static_cast(sizeof(Elf64_Vernaux))) .value("AUXV", static_cast(sizeof(Elf64_Auxv))) .value("VERDEF", static_cast(sizeof(Elf64_Verdef))) .value("VERDAUX", static_cast(sizeof(Elf64_Verdaux))) .export_values(); } } } LIEF-0.9.0/api/python/MANIFEST.in000066400000000000000000000000311330725006400160610ustar00rootroot00000000000000include README setup.cfg LIEF-0.9.0/api/python/MachO/000077500000000000000000000000001330725006400153205ustar00rootroot00000000000000LIEF-0.9.0/api/python/MachO/CMakeLists.txt000066400000000000000000000044321330725006400200630ustar00rootroot00000000000000set(LIEF_PYTHON_MACHO_SRC "${CMAKE_CURRENT_LIST_DIR}/pyMachO.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDylibCommand.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyBinary.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyFatBinary.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyLoadCommand.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySegmentCommand.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/pySymbolCommand.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyUUID.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySourceVersion.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyVersionMin.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyMainCommand.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDylinker.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDyldInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyFunctionStarts.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRelocation.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRelocationObject.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRelocationDyld.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyBindingInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyExportInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyThreadCommand.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRPathCommand.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyParserConfig.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDynamicSymbolCommand.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyCodeSignature.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySegmentSplitInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDataInCode.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDataCodeEntry.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySubFramework.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDyldEnvironment.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyEncryptionInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyEnums.cpp" ) set(LIEF_PYTHON_MACHO_HDR "${CMAKE_CURRENT_LIST_DIR}/pyMachO.hpp") source_group("Source Files\\MachO" FILES ${LIEF_PYTHON_MACHO_SRC}) source_group("Header Files\\MachO" FILES ${LIEF_PYTHON_MACHO_HDR}) target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}") target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_MACHO_SRC}" "${LIEF_PYTHON_MACHO_HDR}") LIEF-0.9.0/api/python/MachO/objects/000077500000000000000000000000001330725006400167515ustar00rootroot00000000000000LIEF-0.9.0/api/python/MachO/objects/pyBinary.cpp000066400000000000000000000343231330725006400212570ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/Abstract/Binary.hpp" #include "LIEF/MachO/Binary.hpp" #include "LIEF/MachO/hash.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using no_const_getter = T (Binary::*)(void); template using no_const_func = T (Binary::*)(P); template<> void create(py::module& m) { py::class_(m, "Binary") .def_property_readonly("header", static_cast>(&Binary::header), "Return binary's " RST_CLASS_REF(lief.MachO.Header) "", py::return_value_policy::reference_internal) .def_property_readonly("sections", static_cast>(&Binary::sections), "Return binary's " RST_CLASS_REF(lief.MachO.Section) "", py::return_value_policy::reference_internal) .def_property_readonly("relocations", static_cast>(&Binary::relocations), "Return an iterator over binary's " RST_CLASS_REF(lief.MachO.Relocation) "", py::return_value_policy::reference_internal) .def_property_readonly("segments", static_cast>(&Binary::segments), "Return binary's " RST_CLASS_REF(lief.MachO.SegmentCommand) "", py::return_value_policy::reference_internal) .def_property_readonly("libraries", static_cast>(&Binary::libraries), "Return binary's " RST_CLASS_REF(lief.MachO.DylibCommand) "", py::return_value_policy::reference_internal) .def_property_readonly("symbols", static_cast>(&Binary::symbols), "Return binary's " RST_CLASS_REF(lief.MachO.Symbol) "", py::return_value_policy::reference_internal) .def("has_symbol", &Binary::has_symbol, "Check if a " RST_CLASS_REF(lief.MachO.Symbol) " with the given name exists", "name"_a) .def("get_symbol", static_cast>(&Binary::get_symbol), "Return the " RST_CLASS_REF(lief.MachO.Symbol) " from the given name", "name"_a, py::return_value_policy::reference) .def_property_readonly("imported_symbols", static_cast>(&Binary::imported_symbols), "Return binary's " RST_CLASS_REF(lief.MachO.Symbol) " which are imported", py::return_value_policy::reference_internal) .def_property_readonly("exported_symbols", static_cast>(&Binary::exported_symbols), "Return binary's " RST_CLASS_REF(lief.MachO.Symbol) " which are exported", py::return_value_policy::reference_internal) .def_property_readonly("commands", static_cast>(&Binary::commands), "Return binary's " RST_CLASS_REF(lief.MachO.Command) "", py::return_value_policy::reference_internal) .def_property_readonly("imagebase", &Binary::imagebase, "Return binary's ``image base`` which is the base address\ where segments are mapped (without PIE). ``0`` if not relevant.", py::return_value_policy::reference_internal) .def_property_readonly("fat_offset", &Binary::fat_offset, "Return binary's *fat offset*. ``0`` if not relevant.", py::return_value_policy::copy) .def("section_from_offset", static_cast(&Binary::section_from_offset), "Return the " RST_CLASS_REF(lief.MachO.Section) " which contains the offset", py::return_value_policy::reference) .def("section_from_virtual_address", static_cast(&Binary::section_from_virtual_address), "Return the " RST_CLASS_REF(lief.MachO.Section) " which contains the virtual address", py::return_value_policy::reference) .def("segment_from_offset", static_cast(&Binary::segment_from_offset), "Return the " RST_CLASS_REF(lief.MachO.SegmentCommand) " which contains the offset", py::return_value_policy::reference) .def("segment_from_virtual_address", static_cast(&Binary::segment_from_virtual_address), "Return the " RST_CLASS_REF(lief.MachO.SegmentCommand) " which contains the virtual address", py::return_value_policy::reference) .def_property_readonly("has_entrypoint", &Binary::has_entrypoint, "``True`` if the binary has an entrypoint.\n" "Basically for libraries it will return ``false``", py::return_value_policy::reference_internal) .def_property_readonly("has_uuid", &Binary::has_uuid, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.UUIDCommand) " command.", py::return_value_policy::reference_internal) .def_property_readonly("uuid", static_cast>(&Binary::uuid), "Return binary's " RST_CLASS_REF(lief.MachO.UUIDCommand) " if any.", py::return_value_policy::reference) .def_property_readonly("has_main_command", &Binary::has_main_command, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.MainCommand) " command.", py::return_value_policy::reference_internal) .def_property_readonly("main_command", static_cast>(&Binary::main_command), "Return binary's " RST_CLASS_REF(lief.MachO.MainCommand) " if any.", py::return_value_policy::reference) .def_property_readonly("has_dylinker", &Binary::has_dylinker, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.DylinkerCommand) " command.", py::return_value_policy::reference_internal) .def_property_readonly("dylinker", static_cast>(&Binary::dylinker), "Return binary's " RST_CLASS_REF(lief.MachO.DylinkerCommand) " if any.", py::return_value_policy::reference) .def_property_readonly("has_dyld_info", &Binary::has_dyld_info, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.DyldInfo) " command.", py::return_value_policy::reference_internal) .def_property_readonly("dyld_info", static_cast>(&Binary::dyld_info), "Return binary's " RST_CLASS_REF(lief.MachO.DyldInfo) " if any.", py::return_value_policy::reference) .def_property_readonly("has_function_starts", &Binary::has_function_starts, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.FunctionStarts) " command.", py::return_value_policy::reference_internal) .def_property_readonly("function_starts", static_cast>(&Binary::function_starts), "Return binary's " RST_CLASS_REF(lief.MachO.FunctionStarts) " if any.", py::return_value_policy::reference) .def_property_readonly("has_source_version", &Binary::has_source_version, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.SourceVersion) " command.", py::return_value_policy::reference_internal) .def_property_readonly("source_version", static_cast>(&Binary::source_version), "Return binary's " RST_CLASS_REF(lief.MachO.SourceVersion) " if any.", py::return_value_policy::reference) .def_property_readonly("has_version_min", &Binary::has_version_min, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.VersionMin) " command.", py::return_value_policy::reference_internal) .def_property_readonly("version_min", static_cast>(&Binary::version_min), "Return binary's " RST_CLASS_REF(lief.MachO.VersionMin) " if any.", py::return_value_policy::reference) .def_property_readonly("has_thread_command", &Binary::has_thread_command, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.ThreadCommand) " command.", py::return_value_policy::reference_internal) .def_property_readonly("thread_command", static_cast>(&Binary::thread_command), "Return binary's " RST_CLASS_REF(lief.MachO.ThreadCommand) " if any.", py::return_value_policy::reference) .def_property_readonly("has_rpath", &Binary::has_rpath, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.RPathCommand) " command.", py::return_value_policy::reference_internal) .def_property_readonly("rpath", static_cast>(&Binary::rpath), "Return binary's " RST_CLASS_REF(lief.MachO.RPathCommand) " if any.", py::return_value_policy::reference) .def_property_readonly("has_symbol_command", &Binary::has_symbol_command, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.SymbolCommand) " command.", py::return_value_policy::reference_internal) .def_property_readonly("symbol_command", static_cast>(&Binary::symbol_command), "Return binary's " RST_CLASS_REF(lief.MachO.SymbolCommand) " if any.", py::return_value_policy::reference) .def_property_readonly("has_dynamic_symbol_command", &Binary::has_dynamic_symbol_command, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.DynamicSymbolCommand) " command.", py::return_value_policy::reference_internal) .def_property_readonly("dynamic_symbol_command", static_cast>(&Binary::dynamic_symbol_command), "Return binary's " RST_CLASS_REF(lief.MachO.DynamicSymbolCommand) " if any.", py::return_value_policy::reference) .def_property_readonly("has_code_signature", &Binary::has_code_signature, "``True`` if the binary is signed (i.e. has a " RST_CLASS_REF(lief.MachO.CodeSignature) " command)", py::return_value_policy::reference_internal) .def_property_readonly("code_signature", static_cast>(&Binary::code_signature), "Return binary's " RST_CLASS_REF(lief.MachO.CodeSignature) " if any.", py::return_value_policy::reference) .def_property_readonly("has_data_in_code", &Binary::has_data_in_code, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.DataInCode) " command", py::return_value_policy::reference_internal) .def_property_readonly("data_in_code", static_cast>(&Binary::data_in_code), "Return binary's " RST_CLASS_REF(lief.MachO.DataInCode) " if any.", py::return_value_policy::reference) .def_property_readonly("has_segment_split_info", &Binary::has_segment_split_info, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.SegmentSplitInfo) " command", py::return_value_policy::reference_internal) .def_property_readonly("segment_split_info", static_cast>(&Binary::segment_split_info), "Return binary's " RST_CLASS_REF(lief.MachO.SegmentSplitInfo) " if any.", py::return_value_policy::reference) .def_property_readonly("has_sub_framework", &Binary::has_sub_framework, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.SubFramework) " command", py::return_value_policy::reference_internal) .def_property_readonly("sub_framework", static_cast>(&Binary::sub_framework), "Return binary's " RST_CLASS_REF(lief.MachO.SubFramework) " if any.", py::return_value_policy::reference) .def_property_readonly("has_dyld_environment", &Binary::has_dyld_environment, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.DyldEnvironment) " command", py::return_value_policy::reference_internal) .def_property_readonly("dyld_environment", static_cast>(&Binary::dyld_environment), "Return binary's " RST_CLASS_REF(lief.MachO.DyldEnvironment) " if any.", py::return_value_policy::reference) .def_property_readonly("has_encryption_info", &Binary::has_encryption_info, "``True`` if the binary has a " RST_CLASS_REF(lief.MachO.EncryptionInfo) " command", py::return_value_policy::reference_internal) .def_property_readonly("encryption_info", static_cast>(&Binary::encryption_info), "Return binary's " RST_CLASS_REF(lief.MachO.EncryptionInfo) " if any.", py::return_value_policy::reference) .def("virtual_address_to_offset", &Binary::virtual_address_to_offset, "Convert the virtual address to an offset in the binary", "virtual_address"_a) .def("has_section", &Binary::has_section, "Check if a section with the given name exists", "name"_a) .def("get_section", static_cast(&Binary::get_section), "Return the section from the given name", "name"_a, py::return_value_policy::reference) .def_property_readonly("va_ranges", &Binary::va_ranges, "Return the range of virtual addresses as a tuple ``(va_start, va_end)``") .def("is_valid_addr", &Binary::is_valid_addr, "Check if the given address is comprise between the lowest " "virtual address and the biggest one", "address"_a) .def("__str__", [] (const Binary& binary) { std::ostringstream stream; stream << binary; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyBindingInfo.cpp000066400000000000000000000105451330725006400222210ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/BindingInfo.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (BindingInfo::*)(void) const; template using setter_t = void (BindingInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "BindingInfo") .def_property("binding_class", static_cast>(&BindingInfo::binding_class), static_cast>(&BindingInfo::binding_class), "" RST_CLASS_REF(lief.MachO.BINDING_CLASS) " of the binding", py::return_value_policy::reference_internal) .def_property("address", static_cast>(&BindingInfo::address), static_cast>(&BindingInfo::address), "Binding's address", py::return_value_policy::reference_internal) .def_property("binding_type", static_cast>(&BindingInfo::binding_type), static_cast>(&BindingInfo::binding_type), "" RST_CLASS_REF(lief.MachO.BIND_TYPES) " of the binding\n" "Most of the times it's :attr:`~lief.MachO.BIND_TYPES.POINTER`", py::return_value_policy::reference_internal) .def_property("library_ordinal", static_cast>(&BindingInfo::library_ordinal), static_cast>(&BindingInfo::library_ordinal), py::return_value_policy::reference_internal) .def_property("addend", static_cast>(&BindingInfo::addend), static_cast>(&BindingInfo::addend), "Value added to the segment's virtual address when binding", py::return_value_policy::reference_internal) .def_property("weak_import", static_cast>(&BindingInfo::is_weak_import), static_cast>(&BindingInfo::set_weak_import), py::return_value_policy::reference_internal) .def_property_readonly("has_library", &BindingInfo::has_library, "``True`` if the binding info has a " RST_CLASS_REF(lief.MachO.DylibCommand) " associated with") .def_property_readonly("library", static_cast(&BindingInfo::library), "" RST_CLASS_REF(lief.MachO.DylibCommand) " associated with the binding (if any)", py::return_value_policy::reference) .def_property_readonly("has_segment", &BindingInfo::has_segment, "``True`` if the binding info has a " RST_CLASS_REF(lief.MachO.SegmentCommand) " associated with") .def_property_readonly("segment", static_cast(&BindingInfo::segment), "" RST_CLASS_REF(lief.MachO.SegmentCommand) " associated with the binding (if any)", py::return_value_policy::reference) .def_property_readonly("has_symbol", &BindingInfo::has_symbol, "``True`` if the binding info has a " RST_CLASS_REF(lief.MachO.Symbol) " associated with") .def_property_readonly("symbol", static_cast(&BindingInfo::symbol), "" RST_CLASS_REF(lief.MachO.Symbol) " associated with the binding (if any)", py::return_value_policy::reference) .def("__eq__", &BindingInfo::operator==) .def("__ne__", &BindingInfo::operator!=) .def("__hash__", [] (const BindingInfo& binding_info) { return Hash::hash(binding_info); }) .def("__str__", [] (const BindingInfo& binding_info) { std::ostringstream stream; stream << binding_info; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyCodeSignature.cpp000066400000000000000000000035751330725006400225740ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/CodeSignature.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (CodeSignature::*)(void) const; template using setter_t = void (CodeSignature::*)(T); template<> void create(py::module& m) { py::class_(m, "CodeSignature") .def_property("data_offset", static_cast>(&CodeSignature::data_offset), static_cast>(&CodeSignature::data_offset), "Offset in the binary where signature starts") .def_property("data_size", static_cast>(&CodeSignature::data_size), static_cast>(&CodeSignature::data_size), "Size of the raw signature") .def("__eq__", &CodeSignature::operator==) .def("__ne__", &CodeSignature::operator!=) .def("__hash__", [] (const CodeSignature& func) { return Hash::hash(func); }) .def("__str__", [] (const CodeSignature& func) { std::ostringstream stream; stream << func; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyDataCodeEntry.cpp000066400000000000000000000051111330725006400225120ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/DataCodeEntry.hpp" #include "LIEF/MachO/EnumToString.hpp" #include "enums_wrapper.hpp" #include "pyMachO.hpp" #define PY_ENUM(x) LIEF::MachO::to_string(x), x namespace LIEF { namespace MachO { template using getter_t = T (DataCodeEntry::*)(void) const; template using setter_t = void (DataCodeEntry::*)(T); template<> void create(py::module& m) { py::class_ cls(m, "DataCodeEntry"); cls .def_property("offset", static_cast>(&DataCodeEntry::offset), static_cast>(&DataCodeEntry::offset), "Offset of the data") .def_property("length", static_cast>(&DataCodeEntry::length), static_cast>(&DataCodeEntry::length), "Length of the data") .def_property("type", static_cast>(&DataCodeEntry::type), static_cast>(&DataCodeEntry::type), "Type of the entry (" RST_CLASS_REF(lief.MachO.DataCodeEntry.TYPES) "") .def("__eq__", &DataCodeEntry::operator==) .def("__ne__", &DataCodeEntry::operator!=) .def("__hash__", [] (const DataCodeEntry& func) { return Hash::hash(func); }) .def("__str__", [] (const DataCodeEntry& func) { std::ostringstream stream; stream << func; std::string str = stream.str(); return str; }); LIEF::enum_(cls, "TYPES") .value(PY_ENUM(DataCodeEntry::TYPES::UNKNOWN)) .value(PY_ENUM(DataCodeEntry::TYPES::DATA)) .value(PY_ENUM(DataCodeEntry::TYPES::JUMP_TABLE_8)) .value(PY_ENUM(DataCodeEntry::TYPES::JUMP_TABLE_16)) .value(PY_ENUM(DataCodeEntry::TYPES::JUMP_TABLE_32)) .value(PY_ENUM(DataCodeEntry::TYPES::ABS_JUMP_TABLE_32)); } } } LIEF-0.9.0/api/python/MachO/objects/pyDataInCode.cpp000066400000000000000000000044201330725006400217610ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/DataInCode.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (DataInCode::*)(void) const; template using setter_t = void (DataInCode::*)(T); template<> void create(py::module& m) { // Init Iterator init_ref_iterator(m); py::class_(m, "DataInCode") .def_property("data_offset", static_cast>(&DataInCode::data_offset), static_cast>(&DataInCode::data_offset), "Offset in the binary where signature starts") .def_property("data_size", static_cast>(&DataInCode::data_size), static_cast>(&DataInCode::data_size), "Size of the raw signature") .def_property_readonly("entries", static_cast(&DataInCode::entries), "Iterator over " RST_CLASS_REF(lief.MachO.DataCodeEntry) "", py::return_value_policy::reference_internal) .def("add", &DataInCode::add, "Add an new " RST_CLASS_REF(lief.MachO.DataCodeEntry) "", "entry"_a) .def("__eq__", &DataInCode::operator==) .def("__ne__", &DataInCode::operator!=) .def("__hash__", [] (const DataInCode& func) { return Hash::hash(func); }) .def("__str__", [] (const DataInCode& func) { std::ostringstream stream; stream << func; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyDyldEnvironment.cpp000066400000000000000000000033171330725006400231530ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/DyldEnvironment.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (DyldEnvironment::*)(void) const; template using setter_t = void (DyldEnvironment::*)(T); template<> void create(py::module& m) { py::class_(m, "DyldEnvironment") .def_property("value", static_cast>(&DyldEnvironment::value), static_cast>(&DyldEnvironment::value), "Environment variable as a string", py::return_value_policy::reference_internal) .def("__eq__", &DyldEnvironment::operator==) .def("__ne__", &DyldEnvironment::operator!=) .def("__hash__", [] (const DyldEnvironment& env) { return Hash::hash(env); }) .def("__str__", [] (const DyldEnvironment& env) { std::ostringstream stream; stream << env; return stream.str(); }); } } } LIEF-0.9.0/api/python/MachO/objects/pyDyldInfo.cpp000066400000000000000000000262551330725006400215500ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/DyldInfo.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (DyldInfo::*)(void) const; template using setter_t = void (DyldInfo::*)(T); template using no_const_getter = T (DyldInfo::*)(void); template<> void create(py::module& m) { py::class_(m, "DyldInfo") .def_property("rebase", static_cast>(&DyldInfo::rebase), static_cast>(&DyldInfo::rebase), "*Rebase* information as a tuple ``(offset, size)``\n\n" "Dyld rebases an image whenever dyld loads it at an address different \n" "from its preferred address. The rebase information is a stream \n" "of byte sized opcodes whose symbolic names start with ``REBASE_OPCODE_``. \n" "Conceptually the rebase information is a table of tuples: \n" "``(seg-index, seg-offset, type)``\n" "The opcodes are a compressed way to encode the table by only \n" "encoding when a column changes. In addition simple patterns \n" "like \"every n'th offset for m times\" can be encoded in a few \n" "bytes.\n\n" ".. seealso::\n\n" "\t``/usr/include/mach-o/loader.h``\n", py::return_value_policy::reference_internal) .def_property("rebase_opcodes", static_cast>(&DyldInfo::rebase_opcodes), static_cast>(&DyldInfo::rebase_opcodes), "Return Rebase's opcodes as ``list`` of bytes") .def_property_readonly("show_rebases_opcodes", &DyldInfo::show_rebases_opcodes, "Return the rebase opcodes in a humman-readable way", py::return_value_policy::reference_internal) .def_property("bind", static_cast>(&DyldInfo::bind), static_cast>(&DyldInfo::bind), "*Bind* information as a tuple ``(offset, size)``\n\n" "Dyld binds an image during the loading process, if the image\n" "requires any pointers to be initialized to symbols in other images.\n" "The rebase information is a stream of byte sized\n" "opcodes whose symbolic names start with ``BIND_OPCODE_``.\n" "Conceptually the bind information is a table of tuples:\n" "``(seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend)``\n" "The opcodes are a compressed way to encode the table by only\n" "encoding when a column changes. In addition simple patterns\n" "like for runs of pointers initialzed to the same value can be\n" "encoded in a few bytes.\n\n" ".. seealso::\n\n" "\t``/usr/include/mach-o/loader.h``\n", py::return_value_policy::reference_internal) .def_property("bind_opcodes", static_cast>(&DyldInfo::bind_opcodes), static_cast>(&DyldInfo::bind_opcodes), "Return Binding's opcodes as ``list`` of bytes") .def_property_readonly("show_bind_opcodes", &DyldInfo::show_bind_opcodes, "Return the bind opcodes in a humman-readable way", py::return_value_policy::reference_internal) .def_property("weak_bind", static_cast>(&DyldInfo::weak_bind), static_cast>(&DyldInfo::weak_bind), "*Weak Bind* information as a tuple ``(offset, size)``\n\n" "Some C++ programs require dyld to unique symbols so that all\n" "images in the process use the same copy of some code/data.\n" "This step is done after binding. The content of the weak_bind\n" "info is an opcode stream like the bind_info. But it is sorted\n" "alphabetically by symbol name. This enable dyld to walk\n" "all images with weak binding information in order and look\n" "for collisions. If there are no collisions, dyld does\n" "no updating. That means that some fixups are also encoded\n" "in the bind_info. For instance, all calls to ``operator new`` \n" "are first bound to ``libstdc++.dylib`` using the information\n" "in bind_info. Then if some image overrides operator new\n" "that is detected when the weak_bind information is processed\n" "and the call to operator new is then rebound.\n\n" ".. seealso::\n\n" "\t``/usr/include/mach-o/loader.h``\n", py::return_value_policy::reference_internal) .def_property("weak_bind_opcodes", static_cast>(&DyldInfo::weak_bind_opcodes), static_cast>(&DyldInfo::weak_bind_opcodes), "Return **Weak** binding's opcodes as ``list`` of bytes") .def_property_readonly("show_weak_bind_opcodes", &DyldInfo::show_weak_bind_opcodes, "Return the weak bind opcodes in a humman-readable way", py::return_value_policy::reference_internal) .def_property("lazy_bind", static_cast>(&DyldInfo::lazy_bind), static_cast>(&DyldInfo::lazy_bind), "*Lazy Bind* information as a tuple ``(offset, size)``\n\n" "Some uses of external symbols do not need to be bound immediately.\n" "Instead they can be lazily bound on first use. The lazy_bind\n" "are contains a stream of BIND opcodes to bind all lazy symbols.\n" "Normal use is that dyld ignores the lazy_bind section when\n" "loading an image. Instead the static linker arranged for the\n" "lazy pointer to initially point to a helper function which\n" "pushes the offset into the lazy_bind area for the symbol\n" "needing to be bound, then jumps to dyld which simply adds\n" "the offset to lazy_bind_off to get the information on what\n" "to bind.\n\n" ".. seealso::\n\n" "\t``/usr/include/mach-o/loader.h``\n", py::return_value_policy::reference_internal) .def_property("lazy_bind_opcodes", static_cast>(&DyldInfo::lazy_bind_opcodes), static_cast>(&DyldInfo::lazy_bind_opcodes), "Return **lazy** binding's opcodes as ``list`` of bytes") .def_property_readonly("show_lazy_bind_opcodes", &DyldInfo::show_lazy_bind_opcodes, "Return the weak bind opcodes in a humman-readable way", py::return_value_policy::reference_internal) .def_property_readonly("bindings", static_cast>(&DyldInfo::bindings), "Return an iterator over Dyld's " RST_CLASS_REF(lief.MachO.BindingInfo) "", py::return_value_policy::reference_internal) .def_property("export_info", static_cast>(&DyldInfo::export_info), static_cast>(&DyldInfo::export_info), "*Export* information as a tuple ``(offset, size)``\n\n" "The symbols exported by a dylib are encoded in a trie. This\n" "is a compact representation that factors out common prefixes.\n" "It also reduces ``LINKEDIT`` pages in RAM because it encodes all\n" "information (name, address, flags) in one small, contiguous range.\n" "The export area is a stream of nodes. The first node sequentially\n" "is the start node for the trie.\n\n" "Nodes for a symbol start with a byte that is the length of\n" "the exported symbol information for the string so far.\n" "If there is no exported symbol, the byte is zero. If there\n" "is exported info, it follows the length byte. The exported\n" "info normally consists of a flags and offset both encoded\n" "in `uleb128 `_. The offset is location of the content named\n" "by the symbol. It is the offset from the mach_header for\n" "the image.\n\n" "After the initial byte and optional exported symbol information\n" "is a byte of how many edges (0-255) that this node has leaving\n" "it, followed by each edge.\n" "Each edge is a zero terminated cstring of the addition chars\n" "in the symbol, followed by a uleb128 offset for the node that\n" "edge points to.\n\n" ".. seealso::\n\n" "\t``/usr/include/mach-o/loader.h``\n", py::return_value_policy::reference_internal) .def_property("export_trie", static_cast>(&DyldInfo::export_trie), static_cast>(&DyldInfo::export_trie), "Return Export's trie as ``list`` of bytes") .def_property_readonly("exports", static_cast>(&DyldInfo::exports), "Return an iterator over Dyld's " RST_CLASS_REF(lief.MachO.ExportInfo) "", py::return_value_policy::reference_internal) .def_property_readonly("show_export_trie", &DyldInfo::show_export_trie, "Return the export trie in a humman-readable way", py::return_value_policy::reference_internal) .def("set_rebase_offset", &DyldInfo::set_rebase_offset, "offset"_a) .def("set_rebase_size", &DyldInfo::set_rebase_size, "size"_a) .def("set_bind_offset", &DyldInfo::set_bind_offset, "offset"_a) .def("set_bind_size", &DyldInfo::set_bind_size, "size"_a) .def("set_weak_bind_offset", &DyldInfo::set_weak_bind_offset, "offset"_a) .def("set_weak_bind_size", &DyldInfo::set_weak_bind_size, "size"_a) .def("set_lazy_bind_offset", &DyldInfo::set_lazy_bind_offset, "offset"_a) .def("set_lazy_bind_size", &DyldInfo::set_lazy_bind_size, "size"_a) .def("set_export_offset", &DyldInfo::set_export_offset, "offset"_a) .def("set_export_size", &DyldInfo::set_export_size, "size"_a) .def("__eq__", &DyldInfo::operator==) .def("__ne__", &DyldInfo::operator!=) .def("__hash__", [] (const DyldInfo& info) { return Hash::hash(info); }) .def("__str__", [] (const DyldInfo& info) { std::ostringstream stream; stream << info; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyDylibCommand.cpp000066400000000000000000000051061330725006400223720ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/DylibCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (DylibCommand::*)(void) const; template using setter_t = void (DylibCommand::*)(T); template<> void create(py::module& m) { py::class_(m, "DylibCommand") .def_property("name", static_cast>(&DylibCommand::name), static_cast>(&DylibCommand::name), "Library's name", py::return_value_policy::reference_internal) .def_property("timestamp", static_cast>(&DylibCommand::timestamp), static_cast>(&DylibCommand::timestamp), "Library's timestamp", py::return_value_policy::reference_internal) .def_property("current_version", static_cast>(&DylibCommand::current_version), static_cast>(&DylibCommand::current_version), "Library's current version", py::return_value_policy::reference_internal) .def_property("compatibility_version", static_cast>(&DylibCommand::compatibility_version), static_cast>(&DylibCommand::compatibility_version), "Library's compatibility version", py::return_value_policy::reference_internal) .def("__eq__", &DylibCommand::operator==) .def("__ne__", &DylibCommand::operator!=) .def("__hash__", [] (const DylibCommand& dylib_command) { return Hash::hash(dylib_command); }) .def("__str__", [] (const DylibCommand& command) { std::ostringstream stream; stream << command; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyDylinker.cpp000066400000000000000000000034121330725006400216070ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/DylinkerCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (DylinkerCommand::*)(void) const; template using setter_t = void (DylinkerCommand::*)(T); template<> void create(py::module& m) { py::class_(m, "DylinkerCommand") .def_property("name", static_cast>(&DylinkerCommand::name), static_cast>(&DylinkerCommand::name), "Path to the loader used to load the binary", py::return_value_policy::reference_internal) .def("__eq__", &DylinkerCommand::operator==) .def("__ne__", &DylinkerCommand::operator!=) .def("__hash__", [] (const DylinkerCommand& dylinker) { return Hash::hash(dylinker); }) .def("__str__", [] (const DylinkerCommand& dylinker) { std::ostringstream stream; stream << dylinker; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyDynamicSymbolCommand.cpp000066400000000000000000000172551330725006400241110ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/DynamicSymbolCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (DynamicSymbolCommand::*)(void) const; template using setter_t = void (DynamicSymbolCommand::*)(T); template using no_const_getter = T (DynamicSymbolCommand::*)(void); template<> void create(py::module& m) { py::class_(m, "DynamicSymbolCommand") .def_property("idx_local_symbol", static_cast>(&DynamicSymbolCommand::idx_local_symbol), static_cast>(&DynamicSymbolCommand::idx_local_symbol), "Index of the first symbol in the group of local symbols." ) .def_property("nb_local_symbols", static_cast>(&DynamicSymbolCommand::nb_local_symbols), static_cast>(&DynamicSymbolCommand::nb_local_symbols), "Number of symbols in the group of local symbols." ) .def_property("idx_external_define_symbol", static_cast>(&DynamicSymbolCommand::idx_external_define_symbol), static_cast>(&DynamicSymbolCommand::idx_external_define_symbol), "Index of the first symbol in the group of defined external symbols." ) .def_property("nb_external_define_symbols", static_cast>(&DynamicSymbolCommand::nb_external_define_symbols), static_cast>(&DynamicSymbolCommand::nb_external_define_symbols), "Number of symbols in the group of defined external symbols." ) .def_property("idx_undefined_symbol", static_cast>(&DynamicSymbolCommand::idx_undefined_symbol), static_cast>(&DynamicSymbolCommand::idx_undefined_symbol), "Index of the first symbol in the group of undefined external symbols." ) .def_property("nb_undefined_symbols", static_cast>(&DynamicSymbolCommand::nb_undefined_symbols), static_cast>(&DynamicSymbolCommand::nb_undefined_symbols), "Number of symbols in the group of undefined external symbols." ) .def_property("toc_offset", static_cast>(&DynamicSymbolCommand::toc_offset), static_cast>(&DynamicSymbolCommand::toc_offset), "Byte offset from the start of the file to the table of contents data\n\n" "Table of content is used by legacy Mach-O loader and this field should be set to 0" ) .def_property("nb_toc", static_cast>(&DynamicSymbolCommand::nb_toc), static_cast>(&DynamicSymbolCommand::nb_toc), "Number of entries in the table of contents\n\n" "Should be set to 0 on recent Mach-O" ) .def_property("module_table_offset", static_cast>(&DynamicSymbolCommand::module_table_offset), static_cast>(&DynamicSymbolCommand::module_table_offset), "Byte offset from the start of the file to the module table data.\n\n" "This field seems unused by recent Mach-O loader and should be set to 0" ) .def_property("nb_module_table", static_cast>(&DynamicSymbolCommand::nb_module_table), static_cast>(&DynamicSymbolCommand::nb_module_table), "Number of entries in the module table..\n\n" "This field seems unused by recent Mach-O loader and should be set to 0" ) .def_property("external_reference_symbol_offset", static_cast>(&DynamicSymbolCommand::external_reference_symbol_offset), static_cast>(&DynamicSymbolCommand::external_reference_symbol_offset), "Byte offset from the start of the file to the external reference table data.\n\n" "This field seems unused by recent Mach-O loader and should be set to 0" ) .def_property("nb_external_reference_symbols", static_cast>(&DynamicSymbolCommand::nb_external_reference_symbols), static_cast>(&DynamicSymbolCommand::nb_external_reference_symbols), "Number of entries in the external reference table\n\n" "This field seems unused by recent Mach-O loader and should be set to 0" ) .def_property("indirect_symbol_offset", static_cast>(&DynamicSymbolCommand::indirect_symbol_offset), static_cast>(&DynamicSymbolCommand::indirect_symbol_offset), "Byte offset from the start of the file to the indirect symbol table data..\n\n" "Indirect symbol table is used by the loader to speed-up symbol resolution during " "the *lazy binding* process\n\n" "References:\n\n" "\t* ``dyld-519.2.1/src/ImageLoaderMachOCompressed.cpp``\n" "\t* ``dyld-519.2.1/src/ImageLoaderMachOClassic.cpp``\n" ) .def_property("nb_indirect_symbols", static_cast>(&DynamicSymbolCommand::nb_indirect_symbols), static_cast>(&DynamicSymbolCommand::nb_indirect_symbols), "Number of entries in the indirect symbol table." ) .def_property("external_relocation_offset", static_cast>(&DynamicSymbolCommand::external_relocation_offset), static_cast>(&DynamicSymbolCommand::external_relocation_offset), "Byte offset from the start of the file to the module table data.\n\n" "This field seems unused by recent Mach-O loader and should be set to 0" ) .def_property("nb_external_relocations", static_cast>(&DynamicSymbolCommand::nb_external_relocations), static_cast>(&DynamicSymbolCommand::nb_external_relocations), "Number of entries in the external relocation table.\n\n" "This field seems unused by recent Mach-O loader and should be set to 0" ) .def_property("local_relocation_offset", static_cast>(&DynamicSymbolCommand::local_relocation_offset), static_cast>(&DynamicSymbolCommand::local_relocation_offset), "Byte offset from the start of the file to the local relocation table data.\n\n" "This field seems unused by recent Mach-O loader and should be set to 0" ) .def_property("nb_local_relocations", static_cast>(&DynamicSymbolCommand::nb_local_relocations), static_cast>(&DynamicSymbolCommand::nb_local_relocations), "Number of entries in the local relocation table.\n\n" "This field seems unused by recent Mach-O loader and should be set to 0" ) .def("__eq__", &DynamicSymbolCommand::operator==) .def("__ne__", &DynamicSymbolCommand::operator!=) .def("__hash__", [] (const DynamicSymbolCommand& cmd) { return Hash::hash(cmd); }) .def("__str__", [] (const DynamicSymbolCommand& info) { std::ostringstream stream; stream << info; return stream.str(); }); } } } LIEF-0.9.0/api/python/MachO/objects/pyEncryptionInfo.cpp000066400000000000000000000044131330725006400227760ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/EncryptionInfo.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (EncryptionInfo::*)(void) const; template using setter_t = void (EncryptionInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "EncryptionInfo") .def_property("crypt_offset", static_cast>(&EncryptionInfo::crypt_offset), static_cast>(&EncryptionInfo::crypt_offset), "File offset of encrypted range", py::return_value_policy::reference_internal) .def_property("crypt_size", static_cast>(&EncryptionInfo::crypt_size), static_cast>(&EncryptionInfo::crypt_size), "File size of encrypted range", py::return_value_policy::reference_internal) .def_property("crypt_id", static_cast>(&EncryptionInfo::crypt_id), static_cast>(&EncryptionInfo::crypt_id), "Which enryption system, 0 means not-encrypted yet", py::return_value_policy::reference_internal) .def("__eq__", &EncryptionInfo::operator==) .def("__ne__", &EncryptionInfo::operator!=) .def("__hash__", [] (const EncryptionInfo& uuid) { return Hash::hash(uuid); }) .def("__str__", [] (const EncryptionInfo& uuid) { std::ostringstream stream; stream << uuid; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyExportInfo.cpp000066400000000000000000000045611330725006400221310ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/ExportInfo.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (ExportInfo::*)(void) const; template using setter_t = void (ExportInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "ExportInfo") .def_property_readonly("node_offset", static_cast>(&ExportInfo::node_offset)) .def_property("flags", static_cast>(&ExportInfo::flags), static_cast>(&ExportInfo::flags), py::return_value_policy::reference_internal) .def_property("address", static_cast>(&ExportInfo::address), static_cast>(&ExportInfo::address), py::return_value_policy::reference_internal) .def_property_readonly("has_symbol", &ExportInfo::has_symbol, "``True`` if the export info has a " RST_CLASS_REF(lief.MachO.Symbol) " associated with") .def_property_readonly("symbol", static_cast(&ExportInfo::symbol), "" RST_CLASS_REF(lief.MachO.Symbol) " associated with the export (if any)", py::return_value_policy::reference) .def("__eq__", &ExportInfo::operator==) .def("__ne__", &ExportInfo::operator!=) .def("__hash__", [] (const ExportInfo& export_info) { return Hash::hash(export_info); }) .def("__str__", [] (const ExportInfo& export_info) { std::ostringstream stream; stream << export_info; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyFatBinary.cpp000066400000000000000000000033551330725006400217130ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/FatBinary.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template<> void create(py::module& m) { py::class_(m, "FatBinary") .def_property_readonly("size", &FatBinary::size, "Number of " RST_CLASS_REF(lief.MachO.Binary) " registred") .def("at", static_cast(&FatBinary::at), "Return the " RST_CLASS_REF(lief.MachO.Binary) " at the given index", "index"_a, py::return_value_policy::reference_internal) .def("__len__", &FatBinary::size) .def("__getitem__", static_cast(&FatBinary::operator[]), "", py::return_value_policy::reference_internal) .def("__iter__", static_cast(&FatBinary::begin), py::return_value_policy::reference_internal) .def("__str__", [] (const FatBinary& fat_binary) { std::ostringstream stream; stream << fat_binary; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyFunctionStarts.cpp000066400000000000000000000050371330725006400230210ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/FunctionStarts.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (FunctionStarts::*)(void) const; template using setter_t = void (FunctionStarts::*)(T); template<> void create(py::module& m) { py::class_(m, "FunctionStarts") .def_property("data_offset", static_cast>(&FunctionStarts::data_offset), static_cast>(&FunctionStarts::data_offset), "Offset in the binary where *start functions* are located") .def_property("data_size", static_cast>(&FunctionStarts::data_size), static_cast>(&FunctionStarts::data_size), "Size of the functions list in the binary") .def_property("functions", static_cast&>>(&FunctionStarts::functions), static_cast&>>(&FunctionStarts::functions), "Addresses of every function entry point in the executable\n\n" "This allows for functions to exist that have no entries in the symbol table.\n\n" ".. warning::\n\n" "\tThe address is relative to the ``__TEXT`` segment\n\n", py::return_value_policy::reference_internal) .def("add_function", &FunctionStarts::add_function, "Add a new function", "address"_a) .def("__eq__", &FunctionStarts::operator==) .def("__ne__", &FunctionStarts::operator!=) .def("__hash__", [] (const FunctionStarts& func) { return Hash::hash(func); }) .def("__str__", [] (const FunctionStarts& func) { std::ostringstream stream; stream << func; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyHeader.cpp000066400000000000000000000076531330725006400212310ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/MachO/hash.hpp" #include "LIEF/MachO/Header.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { 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") .def(py::init<>()) .def_property("magic", static_cast>(&Header::magic), static_cast>(&Header::magic), "" ) .def_property("cpu_type", static_cast>(&Header::cpu_type), static_cast>(&Header::cpu_type), "Target CPU ( " RST_CLASS_REF(lief.MachO.CPU_TYPES) ")") .def_property("cpu_subtype", static_cast>(&Header::cpu_subtype), static_cast>(&Header::cpu_subtype), "CPU subtype") .def_property("file_type", static_cast>(&Header::file_type), static_cast>(&Header::file_type), "Binary's type ( " RST_CLASS_REF(lief.MachO.FILE_TYPES) ")") .def_property("flags", static_cast>(&Header::flags), static_cast>(&Header::flags), "Binary's flags ( " RST_CLASS_REF(lief.MachO.HEADER_FLAGS) ")") .def_property("nb_cmds", static_cast>(&Header::nb_cmds), static_cast>(&Header::nb_cmds), "Number of " RST_CLASS_REF(lief.MachO.LoadCommand) "") .def_property("sizeof_cmds", static_cast>(&Header::sizeof_cmds), static_cast>(&Header::sizeof_cmds), "Size of all " RST_CLASS_REF(lief.MachO.LoadCommand) "") .def_property("reserved", static_cast>(&Header::reserved), static_cast>(&Header::reserved), "") .def_property_readonly("flags_list", &Header::flags_list, "" RST_CLASS_REF(lief.PE.HEADER_FLAGS) " as a list") .def("add", static_cast(&Header::add), "Add the given " RST_CLASS_REF(lief.MachO.HEADER_FLAGS) "", "flag"_a) .def("remove", static_cast(&Header::remove), "Remove the given " RST_CLASS_REF(lief.MachO.HEADER_FLAGS) "", "flag"_a) .def("has", static_cast(&Header::has), "``True`` if the given " RST_CLASS_REF(lief.MachO.HEADER_FLAGS) " is in the " ":attr:`~lief.MachO.Header.flags`", "flag"_a) .def("__eq__", &Header::operator==) .def("__ne__", &Header::operator!=) .def("__hash__", [] (const Header& header) { return Hash::hash(header); }) .def(py::self += HEADER_FLAGS()) .def(py::self -= HEADER_FLAGS()) .def("__contains__", static_cast(&Header::has), "Check if the given " RST_CLASS_REF(lief.MachO.HEADER_FLAGS) " is present") .def("__str__", [] (const Header& header) { std::ostringstream stream; stream << header; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyLoadCommand.cpp000066400000000000000000000044521330725006400222110ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/MachO/hash.hpp" #include "LIEF/MachO/LoadCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (LoadCommand::*)(void) const; template using setter_t = void (LoadCommand::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadCommand") .def(py::init<>()) .def_property("command", static_cast>(&LoadCommand::command), static_cast>(&LoadCommand::command), "Command type ( " RST_CLASS_REF(lief.MachO.LOAD_COMMAND_TYPES) ")" ) .def_property("size", static_cast>(&LoadCommand::size), static_cast>(&LoadCommand::size), "Command size") .def_property("data", static_cast&>>(&LoadCommand::data), static_cast&>>(&LoadCommand::data), "Command's data") .def_property("command_offset", static_cast>(&LoadCommand::command_offset), static_cast>(&LoadCommand::command_offset), "Offset to the comand") .def("__eq__", &LoadCommand::operator==) .def("__ne__", &LoadCommand::operator!=) .def("__hash__", [] (const LoadCommand& load_command) { return Hash::hash(load_command); }) .def("__str__", [] (const LoadCommand& command) { std::ostringstream stream; stream << command; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyMainCommand.cpp000066400000000000000000000036551330725006400222220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/MainCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (MainCommand::*)(void) const; template using setter_t = void (MainCommand::*)(T); template<> void create(py::module& m) { py::class_(m, "MainCommand") .def_property("entrypoint", static_cast>(&MainCommand::entrypoint), static_cast>(&MainCommand::entrypoint), "Program entry point", py::return_value_policy::reference_internal) .def_property("stack_size", static_cast>(&MainCommand::stack_size), static_cast>(&MainCommand::stack_size), "Program stack_size", py::return_value_policy::reference_internal) .def("__eq__", &MainCommand::operator==) .def("__ne__", &MainCommand::operator!=) .def("__hash__", [] (const MainCommand& main) { return Hash::hash(main); }) .def("__str__", [] (const MainCommand& main) { std::ostringstream stream; stream << main; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyParser.cpp000066400000000000000000000056261330725006400212730ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/MachO/Parser.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template<> void create(py::module& m) { // Parser (Parser) m.def("parse", static_cast (*) (const std::string&, const ParserConfig&)>(&LIEF::MachO::Parser::parse), "Parse the given binary and return a " RST_CLASS_REF(lief.MachO.FatBinary) " object\n\n" "One can configure the parsing with the ``config`` parameter. See " RST_CLASS_REF(lief.MachO.ParserConfig) "", "filename"_a, "config"_a = ParserConfig::deep(), py::return_value_policy::take_ownership); m.def("parse", static_cast (*) (const std::vector&, const std::string&, const ParserConfig&)>(&LIEF::MachO::Parser::parse), "Parse the given binary (from raw) and return a " RST_CLASS_REF(lief.MachO.FatBinary) " objects\n\n" "One can configure the parsing with the ``config`` parameter. See " RST_CLASS_REF(lief.MachO.ParserConfig) "", "raw"_a, "name"_a = "", "config"_a = ParserConfig::quick(), py::return_value_policy::take_ownership); m.def("parse", [] (py::object byteio, std::string name, const ParserConfig& config) { auto&& io = py::module::import("io"); auto&& RawIOBase = io.attr("RawIOBase"); auto&& BufferedIOBase = io.attr("BufferedIOBase"); 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::MachO::Parser::parse(std::move(raw), name, config); }, "io"_a, "name"_a = "", "config"_a = ParserConfig::quick(), py::return_value_policy::take_ownership); } } } LIEF-0.9.0/api/python/MachO/objects/pyParserConfig.cpp000066400000000000000000000030031330725006400224040ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/ParserConfig.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template<> void create(py::module& m) { py::class_(m, "ParserConfig", "Configuration of MachO's parser") .def(py::init<>()) .def_property("parse_dyldinfo_deeply", static_cast(&ParserConfig::parse_dyldinfo_deeply), static_cast(&ParserConfig::parse_dyldinfo_deeply), "If set to ``True``, parse deeply the " RST_CLASS_REF(lief.MachO.DyldInfo) " " "structure. It includes Exports, Bindings and Rebases") .def_property_readonly_static("deep", [] (py::object /* self */) { return ParserConfig::deep(); }, "foobar") .def_property_readonly_static("quick", [] (py::object /* self */) { return ParserConfig::quick(); }, ""); } } } LIEF-0.9.0/api/python/MachO/objects/pyRPathCommand.cpp000066400000000000000000000033671330725006400223540ustar00rootroot00000000000000/* Copyright 2017 J.Rieck (based on R. Thomas's work) * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/RPathCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (RPathCommand::*)(void) const; template using setter_t = void (RPathCommand::*)(T); template<> void create(py::module& m) { py::class_(m, "RPathCommand") .def_property("path", static_cast>(&RPathCommand::path), static_cast>(&RPathCommand::path), "@rpath path", py::return_value_policy::reference_internal) .def("__eq__", &RPathCommand::operator==) .def("__ne__", &RPathCommand::operator!=) .def("__hash__", [] (const RPathCommand& rpath_command) { return Hash::hash(rpath_command); }) .def("__str__", [] (const RPathCommand& rpath_command) { std::ostringstream stream; stream << rpath_command; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyRelocation.cpp000066400000000000000000000130251330725006400221260ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/Relocation.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (Relocation::*)(void) const; template using setter_t = void (Relocation::*)(T); template<> void create(py::module& m) { py::class_(m, "Relocation") .def_property("address", static_cast>(&Relocation::address), static_cast>(&Relocation::address), "For :attr:`~lief.MachO.FILE_TYPES.OBJECT` or (:attr:`~lief.MachO.Relocation.origin` is :attr:`~lief.MachO.RELOCATION_ORIGINS.RELOC_TABLE`) this is an " "offset from the start of the " RST_CLASS_REF(lief.MachO.Section) " " "to the item containing the address requiring relocation.\n\n" "For :attr:`~lief.MachO.FILE_TYPES.EXECUTE` / :attr:`~lief.MachO.FILE_TYPES.DYLIB` or " "(:attr:`~lief.MachO.Relocation.origin` is :attr:`~lief.MachO.RELOCATION_ORIGINS.DYLDINFO`) " " this is an :attr:`~lief.MachO.SegmentCommand.virtual_address`", py::return_value_policy::reference_internal) .def_property("pc_relative", static_cast>(&Relocation::is_pc_relative), static_cast>(&Relocation::pc_relative), "Indicates whether the item containing the address to be " "relocated is part of a CPU instruction that uses PC-relative addressing.\n\n" "For addresses contained in PC-relative instructions, the CPU adds the address of " "the instruction to the address contained in the instruction.", py::return_value_policy::reference_internal) .def_property("type", static_cast>(&Relocation::type), static_cast>(&Relocation::type), "Type of the relocation according to the :attr:`~lief.MachO.Relocation.architecture` and/or :attr:`~lief.MachO.Relocation.origin` \n\n" "If :attr:`~lief.MachO.Relocation.origin` is :attr:`~lief.MachO.RELOCATION_ORIGINS.RELOC_TABLE`: \n\n" "See:\n" "\t * " RST_CLASS_REF(lief.MachO.X86_RELOCATION) "\n" "\t * " RST_CLASS_REF(lief.MachO.X86_64_RELOCATION) "\n" "\t * " RST_CLASS_REF(lief.MachO.PPC_RELOCATION) "\n" "\t * " RST_CLASS_REF(lief.MachO.ARM_RELOCATION) "\n" "\t * " RST_CLASS_REF(lief.MachO.ARM64_RELOCATION) "\n\n" "If :attr:`~lief.MachO.Relocation.origin` is :attr:`~lief.MachO.RELOCATION_ORIGINS.DYLDINFO`: \n\n" "See:\n" "\t * " RST_CLASS_REF(lief.MachO.REBASE_TYPES) "\n", py::return_value_policy::reference_internal) .def_property_readonly("architecture", &Relocation::architecture, "" RST_CLASS_REF(lief.MachO.CPU_TYPES) " of the relocation") .def_property_readonly("has_symbol", &Relocation::has_symbol, "``True`` if the relocation has a " RST_CLASS_REF(lief.MachO.Symbol) " associated with") .def_property_readonly("symbol", static_cast(&Relocation::symbol), "" RST_CLASS_REF(lief.MachO.Symbol) " associated with the relocation (if any)", py::return_value_policy::reference) .def_property_readonly("has_section", &Relocation::has_section, "``True`` if the relocation has a " RST_CLASS_REF(lief.MachO.Section) " associated with") .def_property_readonly("section", static_cast(&Relocation::section), "" RST_CLASS_REF(lief.MachO.Section) " associated with the relocation (if any)", py::return_value_policy::reference) .def_property_readonly("origin", &Relocation::origin, "" RST_CLASS_REF(lief.MachO.RELOCATION_ORIGINS) " of the relocation\n\n" "For :attr:`~lief.MachO.FILE_TYPES.OBJECT` file it should be :attr:`~lief.MachO.RELOCATION_ORIGINS.RELOC_TABLE` " "for :attr:`~lief.MachO.FILE_TYPES.EXECUTE` / :attr:`~lief.MachO.FILE_TYPES.DYLIB` it should be :attr:`~lief.MachO.RELOCATION_ORIGINS.DYLDINFO`") .def_property_readonly("has_segment", &Relocation::has_segment, "``True`` if the relocation has a " RST_CLASS_REF(lief.MachO.SegmentCommand) " associated with") .def_property_readonly("segment", static_cast(&Relocation::segment), "" RST_CLASS_REF(lief.MachO.SegmentCommand) " associated with the relocation (if any)", py::return_value_policy::reference) .def("__eq__", &Relocation::operator==) .def("__ne__", &Relocation::operator!=) .def("__hash__", [] (const Relocation& relocation) { return Hash::hash(relocation); }) .def("__str__", [] (const Relocation& relocation) { std::ostringstream stream; stream << relocation; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyRelocationDyld.cpp000066400000000000000000000027531330725006400227510ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/RelocationDyld.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (RelocationDyld::*)(void) const; template using setter_t = void (RelocationDyld::*)(T); template<> void create(py::module& m) { py::class_(m, "RelocationDyld") .def("__eq__", &RelocationDyld::operator==) .def("__ne__", &RelocationDyld::operator!=) .def("__hash__", [] (const RelocationDyld& relocation) { return Hash::hash(relocation); }) .def("__str__", [] (const RelocationDyld& relocation) { std::ostringstream stream; stream << relocation; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyRelocationObject.cpp000066400000000000000000000045271330725006400232640ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/RelocationObject.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (RelocationObject::*)(void) const; template using setter_t = void (RelocationObject::*)(T); template<> void create(py::module& m) { py::class_(m, "RelocationObject") .def_property("value", static_cast>(&RelocationObject::value), static_cast>(&RelocationObject::value), "For **scattered** relocations, the address of the relocatable expression " "for the item in the file that needs to be updated if the address is changed.\n\n" "For relocatable expressions with the difference of two section addresses, " "the address from which to subtract (in mathematical terms, the minuend) " "is contained in the first relocation entry and the address to subtract (the subtrahend) " "is contained in the second relocation entry.", py::return_value_policy::reference_internal) .def_property_readonly("is_scattered", &RelocationObject::is_scattered, "``True`` if the relocation is a scattered one") .def("__eq__", &RelocationObject::operator==) .def("__ne__", &RelocationObject::operator!=) .def("__hash__", [] (const RelocationObject& relocation) { return Hash::hash(relocation); }) .def("__str__", [] (const RelocationObject& relocation) { std::ostringstream stream; stream << relocation; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pySection.cpp000066400000000000000000000047161330725006400214420ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/MachO/hash.hpp" #include "LIEF/MachO/Section.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (Section::*)(void) const; template using setter_t = void (Section::*)(T); template using no_const_getter = T (Section::*)(void); template<> void create
(py::module& m) { py::class_(m, "Section") .def(py::init<>()) .def_property("alignment", static_cast>(&Section::alignment), static_cast>(&Section::alignment), "Section's alignment ") .def_property("relocation_offset", static_cast>(&Section::relocation_offset), static_cast>(&Section::relocation_offset), "") .def_property("numberof_relocations", static_cast>(&Section::numberof_relocations), static_cast>(&Section::numberof_relocations), "") .def_property("type", static_cast>(&Section::type), static_cast>(&Section::type), "") .def_property_readonly("relocations", static_cast>(&Section::relocations), "Iterator over " RST_CLASS_REF(lief.MachO.Relocation) " (if any)", py::return_value_policy::reference_internal) .def("__eq__", &Section::operator==) .def("__ne__", &Section::operator!=) .def("__hash__", [] (const Section& section) { return Hash::hash(section); }) .def("__str__", [] (const Section& section) { std::ostringstream stream; stream << section; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pySegmentCommand.cpp000066400000000000000000000101471330725006400227320ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyMachO.hpp" #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/SegmentCommand.hpp" #include #include namespace LIEF { namespace MachO { template using getter_t = T (SegmentCommand::*)(void) const; template using setter_t = void (SegmentCommand::*)(T); template using no_const_getter = T (SegmentCommand::*)(void); template<> void create(py::module& m) { py::class_(m, "SegmentCommand") .def(py::init<>()) .def_property("name", [] (const SegmentCommand& obj) { return safe_string_converter(obj.name()); }, static_cast>(&SegmentCommand::name), "Segment's name" ) .def_property("virtual_address", static_cast>(&SegmentCommand::virtual_address), static_cast>(&SegmentCommand::virtual_address), "Segment's virtual address" ) .def_property("virtual_size", static_cast>(&SegmentCommand::virtual_size), static_cast>(&SegmentCommand::virtual_size), "Segment's virtual size" ) .def_property("file_size", static_cast>(&SegmentCommand::file_size), static_cast>(&SegmentCommand::file_size), "Segment's file size" ) .def_property("file_offset", static_cast>(&SegmentCommand::file_offset), static_cast>(&SegmentCommand::file_offset), "Segment's file offset" ) .def_property("max_protection", static_cast>(&SegmentCommand::max_protection), static_cast>(&SegmentCommand::max_protection), "Segment's max protection" ) .def_property("init_protection", static_cast>(&SegmentCommand::init_protection), static_cast>(&SegmentCommand::init_protection), "Segment's initial protection" ) .def_property("numberof_sections", static_cast>(&SegmentCommand::numberof_sections), static_cast>(&SegmentCommand::numberof_sections), "Number of sections in this segment" ) .def_property_readonly("sections", static_cast>(&SegmentCommand::sections), "Segment's sections" ) .def_property_readonly("relocations", static_cast>(&SegmentCommand::relocations), "Segment's relocations" ) .def_property("content", static_cast&>>(&SegmentCommand::content), static_cast&>>(&SegmentCommand::content), "Segment's content" ) .def_property("flags", static_cast>(&SegmentCommand::flags), static_cast>(&SegmentCommand::flags), "Segment's flags" ) .def("__eq__", &SegmentCommand::operator==) .def("__ne__", &SegmentCommand::operator!=) .def("__hash__", [] (const SegmentCommand& segment_command) { return Hash::hash(segment_command); }) .def("__str__", [] (const SegmentCommand& segment) { std::ostringstream stream; stream << segment; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pySegmentSplitInfo.cpp000066400000000000000000000036331330725006400232650ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/SegmentSplitInfo.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (SegmentSplitInfo::*)(void) const; template using setter_t = void (SegmentSplitInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "SegmentSplitInfo") .def_property("data_offset", static_cast>(&SegmentSplitInfo::data_offset), static_cast>(&SegmentSplitInfo::data_offset), "Offset in the binary where data start") .def_property("data_size", static_cast>(&SegmentSplitInfo::data_size), static_cast>(&SegmentSplitInfo::data_size), "Size of the raw data") .def("__eq__", &SegmentSplitInfo::operator==) .def("__ne__", &SegmentSplitInfo::operator!=) .def("__hash__", [] (const SegmentSplitInfo& func) { return Hash::hash(func); }) .def("__str__", [] (const SegmentSplitInfo& func) { std::ostringstream stream; stream << func; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pySourceVersion.cpp000066400000000000000000000034141330725006400226360ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/SourceVersion.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (SourceVersion::*)(void) const; template using setter_t = void (SourceVersion::*)(T); template<> void create(py::module& m) { py::class_(m, "SourceVersion") .def_property("version", static_cast>(&SourceVersion::version), static_cast>(&SourceVersion::version), "Version as a tuple of **5** integers", py::return_value_policy::reference_internal) .def("__eq__", &SourceVersion::operator==) .def("__ne__", &SourceVersion::operator!=) .def("__hash__", [] (const SourceVersion& version) { return Hash::hash(version); }) .def("__str__", [] (const SourceVersion& version) { std::ostringstream stream; stream << version; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pySubFramework.cpp000066400000000000000000000032041330725006400224340ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/SubFramework.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (SubFramework::*)(void) const; template using setter_t = void (SubFramework::*)(T); template<> void create(py::module& m) { py::class_(m, "SubFramework") .def_property("umbrella", static_cast>(&SubFramework::umbrella), static_cast>(&SubFramework::umbrella), "") .def("__eq__", &SubFramework::operator==) .def("__ne__", &SubFramework::operator!=) .def("__hash__", [] (const SubFramework& func) { return Hash::hash(func); }) .def("__str__", [] (const SubFramework& func) { std::ostringstream stream; stream << func; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pySymbol.cpp000066400000000000000000000061351330725006400213000ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/MachO/hash.hpp" #include "LIEF/MachO/Section.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (Symbol::*)(void) const; template using setter_t = void (Symbol::*)(T); template<> void create(py::module& m) { py::class_(m, "Symbol") .def(py::init<>()) .def_property_readonly("demangled_name", &Symbol::demangled_name, "Symbol's unmangled name") .def_property("type", static_cast>(&Symbol::type), static_cast>(&Symbol::type)) .def_property("numberof_sections", static_cast>(&Symbol::numberof_sections), static_cast>(&Symbol::numberof_sections)) .def_property("description", static_cast>(&Symbol::description), static_cast>(&Symbol::description)) .def_property("value", static_cast>(&Symbol::value), static_cast>(&Symbol::value)) .def_property_readonly("has_export_info", &Symbol::has_export_info, "``True`` if the symbol has a " RST_CLASS_REF(lief.MachO.ExportInfo) " associated with") .def_property_readonly("origin", &Symbol::origin, "Return the " RST_CLASS_REF(lief.MachO.SYMBOL_ORIGINS) " of this symbol") .def_property_readonly("export_info", static_cast(&Symbol::export_info), "" RST_CLASS_REF(lief.MachO.ExportInfo) " associated with the symbol (if any)", py::return_value_policy::reference) .def_property_readonly("has_binding_info", &Symbol::has_binding_info, "``True`` if the symbol has an " RST_CLASS_REF(lief.MachO.BindingInfo) " associated with") .def_property_readonly("binding_info", static_cast(&Symbol::binding_info), "" RST_CLASS_REF(lief.MachO.BindingInfo) " associated with the symbol (if any)", py::return_value_policy::reference) .def("__eq__", &Symbol::operator==) .def("__ne__", &Symbol::operator!=) .def("__hash__", [] (const Symbol& symbol) { return Hash::hash(symbol); }) .def("__str__", [] (const Symbol& symbol) { std::ostringstream stream; stream << symbol; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pySymbolCommand.cpp000066400000000000000000000046451330725006400226030ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/MachO/hash.hpp" #include "LIEF/MachO/SymbolCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (SymbolCommand::*)(void) const; template using setter_t = void (SymbolCommand::*)(T); template<> void create(py::module& m) { py::class_(m, "SymbolCommand") .def(py::init<>()) .def_property("symbol_offset", static_cast>(&SymbolCommand::symbol_offset), static_cast>(&SymbolCommand::symbol_offset), "Offset from the start of the file to the n_list associated with the command") .def_property("numberof_symbols", static_cast>(&SymbolCommand::numberof_symbols), static_cast>(&SymbolCommand::numberof_symbols), "Number of symbols registered") .def_property("strings_offset", static_cast>(&SymbolCommand::strings_offset), static_cast>(&SymbolCommand::strings_offset), "Offset from the start of the file to the string table") .def_property("strings_size", static_cast>(&SymbolCommand::strings_size), static_cast>(&SymbolCommand::strings_size), "Size of the size string table") .def("__eq__", &SymbolCommand::operator==) .def("__ne__", &SymbolCommand::operator!=) .def("__hash__", [] (const SymbolCommand& symbolcmd) { return Hash::hash(symbolcmd); }) .def("__str__", [] (const SymbolCommand& symbolcmd) { std::ostringstream stream; stream << symbolcmd; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyThreadCommand.cpp000066400000000000000000000044601330725006400225400ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/ThreadCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (ThreadCommand::*)(void) const; template using setter_t = void (ThreadCommand::*)(T); template<> void create(py::module& m) { py::class_(m, "ThreadCommand") .def_property("flavor", static_cast>(&ThreadCommand::flavor), static_cast>(&ThreadCommand::flavor), "", py::return_value_policy::reference_internal) .def_property("state", static_cast&>>(&ThreadCommand::state), static_cast&>>(&ThreadCommand::state), "", py::return_value_policy::reference_internal) .def_property("count", static_cast>(&ThreadCommand::count), static_cast>(&ThreadCommand::count), "", py::return_value_policy::reference_internal) .def_property_readonly("pc", static_cast>(&ThreadCommand::pc), py::return_value_policy::reference_internal) .def("__eq__", &ThreadCommand::operator==) .def("__ne__", &ThreadCommand::operator!=) .def("__hash__", [] (const ThreadCommand& thread) { return LIEF::Hash::hash(thread); }) .def("__str__", [] (const ThreadCommand& thread) { std::ostringstream stream; stream << thread; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyUUID.cpp000066400000000000000000000032701330725006400205760ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/UUIDCommand.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (UUIDCommand::*)(void) const; template using setter_t = void (UUIDCommand::*)(T); template<> void create(py::module& m) { py::class_(m, "UUIDCommand") .def_property("uuid", static_cast>(&UUIDCommand::uuid), static_cast>(&UUIDCommand::uuid), "UUID as a list", py::return_value_policy::reference_internal) .def("__eq__", &UUIDCommand::operator==) .def("__ne__", &UUIDCommand::operator!=) .def("__hash__", [] (const UUIDCommand& uuid) { return Hash::hash(uuid); }) .def("__str__", [] (const UUIDCommand& uuid) { std::ostringstream stream; stream << uuid; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/objects/pyVersionMin.cpp000066400000000000000000000037751330725006400221330ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 #include "LIEF/MachO/hash.hpp" #include "LIEF/MachO/VersionMin.hpp" #include "pyMachO.hpp" namespace LIEF { namespace MachO { template using getter_t = T (VersionMin::*)(void) const; template using setter_t = void (VersionMin::*)(T); template<> void create(py::module& m) { py::class_(m, "VersionMin") .def_property("version", static_cast>(&VersionMin::version), static_cast>(&VersionMin::version), "Version as a tuple of **3** integers", py::return_value_policy::reference_internal) .def_property("sdk", static_cast>(&VersionMin::sdk), static_cast>(&VersionMin::sdk), "SDK as a tuple of **3** integers", py::return_value_policy::reference_internal) .def("__eq__", &VersionMin::operator==) .def("__ne__", &VersionMin::operator!=) .def("__hash__", [] (const VersionMin& version) { return Hash::hash(version); }) .def("__str__", [] (const VersionMin& version) { std::ostringstream stream; stream << version; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/MachO/pyEnums.cpp000066400000000000000000000430751330725006400174750ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyMachO.hpp" #include "LIEF/MachO/Structures.hpp" #include "LIEF/MachO/EnumToString.hpp" #include "enums_wrapper.hpp" #define PY_ENUM(x) LIEF::MachO::to_string(x), x namespace LIEF { namespace MachO { void init_enums(py::module& m) { LIEF::enum_(m, "CPU_TYPES") .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_ANY)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_X86)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_I386)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_X86_64)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_MC98000)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_ARM)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_ARM64)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_SPARC)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_POWERPC)) .value(PY_ENUM(LIEF::MachO::CPU_TYPES::CPU_TYPE_POWERPC64)); LIEF::enum_(m, "MACHO_TYPES") .value(PY_ENUM(LIEF::MachO::MACHO_TYPES::MH_MAGIC)) .value(PY_ENUM(LIEF::MachO::MACHO_TYPES::MH_CIGAM)) .value(PY_ENUM(LIEF::MachO::MACHO_TYPES::MH_MAGIC_64)) .value(PY_ENUM(LIEF::MachO::MACHO_TYPES::MH_CIGAM_64)) .value(PY_ENUM(LIEF::MachO::MACHO_TYPES::FAT_MAGIC)) .value(PY_ENUM(LIEF::MachO::MACHO_TYPES::FAT_CIGAM)); LIEF::enum_(m, "FILE_TYPES") .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_OBJECT)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_EXECUTE)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_FVMLIB)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_CORE)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_PRELOAD)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_DYLIB)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_DYLINKER)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_BUNDLE)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_DYLIB_STUB)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_DSYM)) .value(PY_ENUM(LIEF::MachO::FILE_TYPES::MH_KEXT_BUNDLE)); LIEF::enum_(m, "HEADER_FLAGS") .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_NOUNDEFS)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_INCRLINK)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_DYLDLINK)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_BINDATLOAD)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_PREBOUND)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_SPLIT_SEGS)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_LAZY_INIT)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_TWOLEVEL)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_FORCE_FLAT)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_NOMULTIDEFS)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_NOFIXPREBINDING)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_PREBINDABLE)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_ALLMODSBOUND)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_SUBSECTIONS_VIA_SYMBOLS)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_CANONICAL)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_WEAK_DEFINES)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_BINDS_TO_WEAK)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_ALLOW_STACK_EXECUTION)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_ROOT_SAFE)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_SETUID_SAFE)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_NO_REEXPORTED_DYLIBS)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_PIE)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_DEAD_STRIPPABLE_DYLIB)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_HAS_TLV_DESCRIPTORS)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_NO_HEAP_EXECUTION)) .value(PY_ENUM(LIEF::MachO::HEADER_FLAGS::MH_APP_EXTENSION_SAFE)); LIEF::enum_(m, "LOAD_COMMAND_TYPES") .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SEGMENT)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SYMTAB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SYMSEG)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_THREAD)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_UNIXTHREAD)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_LOADFVMLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_IDFVMLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_IDENT)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_FVMFILE)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_PREPAGE)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_DYSYMTAB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_LOAD_DYLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_ID_DYLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_LOAD_DYLINKER)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_ID_DYLINKER)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_PREBOUND_DYLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_ROUTINES)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SUB_FRAMEWORK)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SUB_UMBRELLA)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SUB_CLIENT)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SUB_LIBRARY)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_TWOLEVEL_HINTS)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_PREBIND_CKSUM)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_LOAD_WEAK_DYLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SEGMENT_64)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_ROUTINES_64)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_UUID)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_RPATH)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_CODE_SIGNATURE)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SEGMENT_SPLIT_INFO)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_REEXPORT_DYLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_LAZY_LOAD_DYLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_ENCRYPTION_INFO)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_DYLD_INFO)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_DYLD_INFO_ONLY)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_LOAD_UPWARD_DYLIB)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_VERSION_MIN_MACOSX)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_VERSION_MIN_IPHONEOS)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_FUNCTION_STARTS)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_DYLD_ENVIRONMENT)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_MAIN)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_DATA_IN_CODE)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_SOURCE_VERSION)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_DYLIB_CODE_SIGN_DRS)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_ENCRYPTION_INFO_64)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_LINKER_OPTION)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_LINKER_OPTIMIZATION_HINT)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_VERSION_MIN_TVOS)) .value(PY_ENUM(LIEF::MachO::LOAD_COMMAND_TYPES::LC_VERSION_MIN_WATCHOS)); LIEF::enum_(m, "SECTION_TYPES") .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_REGULAR)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_ZEROFILL)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_CSTRING_LITERALS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_4BYTE_LITERALS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_8BYTE_LITERALS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_LITERAL_POINTERS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_NON_LAZY_SYMBOL_POINTERS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_LAZY_SYMBOL_POINTERS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_SYMBOL_STUBS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_MOD_INIT_FUNC_POINTERS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_MOD_TERM_FUNC_POINTERS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_COALESCED)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_GB_ZEROFILL)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_INTERPOSING)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_16BYTE_LITERALS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_DTRACE_DOF)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_LAZY_DYLIB_SYMBOL_POINTERS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_THREAD_LOCAL_REGULAR)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_THREAD_LOCAL_ZEROFILL)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_THREAD_LOCAL_VARIABLES)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_THREAD_LOCAL_VARIABLE_POINTERS)) .value(PY_ENUM(LIEF::MachO::MACHO_SECTION_TYPES::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS)); LIEF::enum_(m, "X86_RELOCATION") .value(PY_ENUM(LIEF::MachO::X86_RELOCATION::GENERIC_RELOC_VANILLA)) .value(PY_ENUM(LIEF::MachO::X86_RELOCATION::GENERIC_RELOC_PAIR)) .value(PY_ENUM(LIEF::MachO::X86_RELOCATION::GENERIC_RELOC_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::X86_RELOCATION::GENERIC_RELOC_PB_LA_PTR)) .value(PY_ENUM(LIEF::MachO::X86_RELOCATION::GENERIC_RELOC_LOCAL_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::X86_RELOCATION::GENERIC_RELOC_TLV)); LIEF::enum_(m, "X86_64_RELOCATION") .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_UNSIGNED)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_SIGNED)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_BRANCH)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_GOT_LOAD)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_GOT)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_SUBTRACTOR)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_SIGNED_1)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_SIGNED_2)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_SIGNED_4)) .value(PY_ENUM(LIEF::MachO::X86_64_RELOCATION::X86_64_RELOC_TLV)); LIEF::enum_(m, "PPC_RELOCATION") .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_VANILLA)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_PAIR)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_BR14)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_BR24)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_HI16)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_LO16)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_HA16)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_LO14)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_PB_LA_PTR)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_HI16_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_LO16_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_HA16_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_JBSR)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_LO14_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::PPC_RELOCATION::PPC_RELOC_LOCAL_SECTDIFF)); LIEF::enum_(m, "ARM_RELOCATION") .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_RELOC_VANILLA)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_RELOC_PAIR)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_RELOC_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_RELOC_LOCAL_SECTDIFF)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_RELOC_PB_LA_PTR)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_RELOC_BR24)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_THUMB_RELOC_BR22)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_THUMB_32BIT_BRANCH)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_RELOC_HALF)) .value(PY_ENUM(LIEF::MachO::ARM_RELOCATION::ARM_RELOC_HALF_SECTDIFF)); LIEF::enum_(m, "ARM64_RELOCATION") .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_UNSIGNED)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_SUBTRACTOR)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_BRANCH26)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_PAGE21)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_PAGEOFF12)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_GOT_LOAD_PAGE21)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_GOT_LOAD_PAGEOFF12)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_POINTER_TO_GOT)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_TLVP_LOAD_PAGE21)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_TLVP_LOAD_PAGEOFF12)) .value(PY_ENUM(LIEF::MachO::ARM64_RELOCATION::ARM64_RELOC_ADDEND)); LIEF::enum_(m, "RELOCATION_ORIGINS") .value(PY_ENUM(LIEF::MachO::RELOCATION_ORIGINS::ORIGIN_UNKNOWN)) .value(PY_ENUM(LIEF::MachO::RELOCATION_ORIGINS::ORIGIN_DYLDINFO)) .value(PY_ENUM(LIEF::MachO::RELOCATION_ORIGINS::ORIGIN_RELOC_TABLE)); LIEF::enum_(m, "REBASE_TYPES") .value(PY_ENUM(LIEF::MachO::REBASE_TYPES::REBASE_TYPE_POINTER)) .value(PY_ENUM(LIEF::MachO::REBASE_TYPES::REBASE_TYPE_TEXT_ABSOLUTE32)) .value(PY_ENUM(LIEF::MachO::REBASE_TYPES::REBASE_TYPE_TEXT_PCREL32)); LIEF::enum_(m, "BINDING_CLASS") .value(PY_ENUM(LIEF::MachO::BINDING_CLASS::BIND_CLASS_WEAK)) .value(PY_ENUM(LIEF::MachO::BINDING_CLASS::BIND_CLASS_LAZY)) .value(PY_ENUM(LIEF::MachO::BINDING_CLASS::BIND_CLASS_STANDARD)); LIEF::enum_(m, "REBASE_OPCODES") .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_DONE)) .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_SET_TYPE_IMM)) .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB)) .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_ADD_ADDR_ULEB)) .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_ADD_ADDR_IMM_SCALED)) .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_DO_REBASE_IMM_TIMES)) .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_DO_REBASE_ULEB_TIMES)) .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB)) .value(PY_ENUM(LIEF::MachO::REBASE_OPCODES::REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB)); LIEF::enum_(m, "BIND_TYPES") .value(PY_ENUM(LIEF::MachO::BIND_TYPES::BIND_TYPE_POINTER)) .value(PY_ENUM(LIEF::MachO::BIND_TYPES::BIND_TYPE_TEXT_ABSOLUTE32)) .value(PY_ENUM(LIEF::MachO::BIND_TYPES::BIND_TYPE_TEXT_PCREL32)); LIEF::enum_(m, "BIND_SPECIAL_DYLIB") .value(PY_ENUM(LIEF::MachO::BIND_SPECIAL_DYLIB::BIND_SPECIAL_DYLIB_SELF)) .value(PY_ENUM(LIEF::MachO::BIND_SPECIAL_DYLIB::BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE)) .value(PY_ENUM(LIEF::MachO::BIND_SPECIAL_DYLIB::BIND_SPECIAL_DYLIB_FLAT_LOOKUP)); LIEF::enum_(m, "BIND_OPCODES") .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_DONE)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_SET_DYLIB_ORDINAL_IMM)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_SET_DYLIB_SPECIAL_IMM)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_SET_TYPE_IMM)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_SET_ADDEND_SLEB)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_ADD_ADDR_ULEB)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_DO_BIND)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED)) .value(PY_ENUM(LIEF::MachO::BIND_OPCODES::BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB)); LIEF::enum_(m, "EXPORT_SYMBOL_KINDS") .value(PY_ENUM(LIEF::MachO::EXPORT_SYMBOL_KINDS::EXPORT_SYMBOL_FLAGS_KIND_REGULAR)) .value(PY_ENUM(LIEF::MachO::EXPORT_SYMBOL_KINDS::EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL)) .value(PY_ENUM(LIEF::MachO::EXPORT_SYMBOL_KINDS::EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE)); LIEF::enum_(m, "VM_PROTECTIONS") .value(PY_ENUM(LIEF::MachO::VM_PROTECTIONS::VM_PROT_READ)) .value(PY_ENUM(LIEF::MachO::VM_PROTECTIONS::VM_PROT_WRITE)) .value(PY_ENUM(LIEF::MachO::VM_PROTECTIONS::VM_PROT_EXECUTE)); LIEF::enum_(m, "SYMBOL_ORIGINS") .value(PY_ENUM(LIEF::MachO::SYMBOL_ORIGINS::SYM_ORIGIN_UNKNOWN)) .value(PY_ENUM(LIEF::MachO::SYMBOL_ORIGINS::SYM_ORIGIN_DYLD_EXPORT)) .value(PY_ENUM(LIEF::MachO::SYMBOL_ORIGINS::SYM_ORIGIN_LC_SYMTAB)); } } } LIEF-0.9.0/api/python/MachO/pyMachO.cpp000066400000000000000000000034451330725006400173720ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyMachO.hpp" namespace LIEF { namespace MachO { void init_python_module(py::module& m) { py::module LIEF_MachO_module = m.def_submodule("MachO", "Python API for MachO"); init_enums(LIEF_MachO_module); init_objects(LIEF_MachO_module); } void init_objects(py::module& m) { CREATE(ParserConfig, m); CREATE(Parser, m); CREATE(FatBinary, m); CREATE(Binary, m); CREATE(Header, m); CREATE(LoadCommand, m); CREATE(UUIDCommand, m); CREATE(SymbolCommand, m); CREATE(SegmentCommand, m); CREATE(Section, m); CREATE(MainCommand, m); CREATE(DynamicSymbolCommand, m); CREATE(DylinkerCommand, m); CREATE(DyldInfo, m); CREATE(DylibCommand, m); CREATE(ThreadCommand, m); CREATE(RPathCommand, m); CREATE(Symbol, m); CREATE(Relocation, m); CREATE(RelocationObject, m); CREATE(RelocationDyld, m); CREATE(BindingInfo, m); CREATE(ExportInfo, m); CREATE(FunctionStarts, m); CREATE(CodeSignature, m); CREATE(DataInCode, m); CREATE(DataCodeEntry, m); CREATE(SourceVersion, m); CREATE(VersionMin, m); CREATE(SegmentSplitInfo, m); CREATE(SubFramework, m); CREATE(DyldEnvironment, m); CREATE(EncryptionInfo, m); } } } LIEF-0.9.0/api/python/MachO/pyMachO.hpp000066400000000000000000000044551330725006400174010ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_MACHO_H_ #define PY_LIEF_MACHO_H_ #include "LIEF/MachO/Parser.hpp" #include "LIEF/MachO/Binary.hpp" #include "LIEF/MachO/Builder.hpp" #include #include #include "pyLIEF.hpp" #define SPECIALIZE_CREATE(X) \ template<> \ void create(py::module&) #define CREATE(X,Y) create(Y) namespace LIEF { namespace MachO { template void create(py::module&); void init_python_module(py::module& m); void init_objects(py::module&); void init_enums(py::module&); SPECIALIZE_CREATE(Parser); SPECIALIZE_CREATE(ParserConfig); SPECIALIZE_CREATE(FatBinary); SPECIALIZE_CREATE(Binary); SPECIALIZE_CREATE(Header); SPECIALIZE_CREATE(LoadCommand); SPECIALIZE_CREATE(UUIDCommand); SPECIALIZE_CREATE(SymbolCommand); SPECIALIZE_CREATE(SegmentCommand); SPECIALIZE_CREATE(Section); SPECIALIZE_CREATE(MainCommand); SPECIALIZE_CREATE(DynamicSymbolCommand); SPECIALIZE_CREATE(DylinkerCommand); SPECIALIZE_CREATE(DyldInfo); SPECIALIZE_CREATE(DylibCommand); SPECIALIZE_CREATE(ThreadCommand); SPECIALIZE_CREATE(RPathCommand); SPECIALIZE_CREATE(Symbol); SPECIALIZE_CREATE(Relocation); SPECIALIZE_CREATE(RelocationObject); SPECIALIZE_CREATE(RelocationDyld); SPECIALIZE_CREATE(BindingInfo); SPECIALIZE_CREATE(ExportInfo); SPECIALIZE_CREATE(FunctionStarts); SPECIALIZE_CREATE(CodeSignature); SPECIALIZE_CREATE(DataInCode); SPECIALIZE_CREATE(DataCodeEntry); SPECIALIZE_CREATE(SourceVersion); SPECIALIZE_CREATE(VersionMin); SPECIALIZE_CREATE(SegmentSplitInfo); SPECIALIZE_CREATE(SubFramework); SPECIALIZE_CREATE(DyldEnvironment); SPECIALIZE_CREATE(EncryptionInfo); } } // Opaque containers PYBIND11_MAKE_OPAQUE(std::vector) #endif LIEF-0.9.0/api/python/OAT/000077500000000000000000000000001330725006400147545ustar00rootroot00000000000000LIEF-0.9.0/api/python/OAT/CMakeLists.txt000066400000000000000000000020721330725006400175150ustar00rootroot00000000000000set(LIEF_PYTHON_OAT_OBJECTS_SRC "${CMAKE_CURRENT_LIST_DIR}/objects/pyHeader.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyParser.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDexFile.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyClass.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyMethod.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyParser.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyBinary.cpp" ) set(LIEF_PYTHON_OAT_SRC "${CMAKE_CURRENT_LIST_DIR}/pyOAT.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyEnums.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyIterators.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyOpaqueTypes.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyUtils.cpp" ) set(LIEF_PYTHON_OAT_HDR "${CMAKE_CURRENT_LIST_DIR}/pyOAT.hpp") list(APPEND LIEF_PYTHON_OAT_SRC ${LIEF_PYTHON_OAT_OBJECTS_SRC}) source_group("Source Files\\OAT" FILES ${LIEF_PYTHON_OAT_SRC}) source_group("Header Files\\OAT" FILES ${LIEF_PYTHON_OAT_HDR}) target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_OAT_SRC}" "${LIEF_PYTHON_OAT_HDR}") target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_LIST_DIR}/../") LIEF-0.9.0/api/python/OAT/objects/000077500000000000000000000000001330725006400164055ustar00rootroot00000000000000LIEF-0.9.0/api/python/OAT/objects/pyBinary.cpp000066400000000000000000000063231330725006400207120ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/OAT/Binary.hpp" #include "LIEF/OAT/hash.hpp" #include "LIEF/ELF/Binary.hpp" #include "pyOAT.hpp" namespace LIEF { namespace OAT { template using no_const_getter = T (Binary::*)(void); template using no_const_func = T (Binary::*)(P); template using getter_t = T (Binary::*)(void) const; template using setter_t = void (Binary::*)(T); template<> void create(py::module& m) { // Binary object py::class_(m, "Binary", "OAT binary representation") .def_property_readonly("header", static_cast>(&Binary::header), "Return the OAT " RST_CLASS_REF(lief.OAT.Header) "", py::return_value_policy::reference) .def_property_readonly("dex_files", static_cast>(&Binary::dex_files), "Return an iterator over " RST_CLASS_REF(lief.DEX.File) "") .def_property_readonly("oat_dex_files", static_cast>(&Binary::oat_dex_files), "Return an iterator over " RST_CLASS_REF(lief.OAT.DexFile) "") .def_property_readonly("classes", static_cast>(&Binary::classes), "Return an iterator over " RST_CLASS_REF(lief.OAT.Class) "", py::return_value_policy::reference) .def_property_readonly("methods", static_cast>(&Binary::methods), "Return an iterator over " RST_CLASS_REF(lief.OAT.Method) "", py::return_value_policy::reference) .def_property_readonly("has_class", &Binary::has_class, "Check if the class if the given name is present in the current OAT binary") .def("get_class", static_cast>(&Binary::get_class), "Return the " RST_CLASS_REF(lief.OAT.Class) " from its name", "class_name"_a, py::return_value_policy::reference) .def("get_class", static_cast>(&Binary::get_class), "Return the " RST_CLASS_REF(lief.OAT.Class) " from its **index**", "class_index"_a, py::return_value_policy::reference) .def_property_readonly("dex2dex_json_info", &Binary::dex2dex_json_info) .def("__eq__", &Binary::operator==) .def("__ne__", &Binary::operator!=) .def("__hash__", [] (const Binary& bin) { return Hash::hash(bin); }) .def("__str__", [] (const Binary& binary) { std::ostringstream stream; stream << binary; return stream.str(); }); } } } LIEF-0.9.0/api/python/OAT/objects/pyClass.cpp000066400000000000000000000062111330725006400205270ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/OAT/Class.hpp" #include "LIEF/OAT/hash.hpp" #include "pyOAT.hpp" namespace LIEF { namespace OAT { template using getter_t = T (Class::*)(void) const; template using setter_t = void (Class::*)(T); template using no_const_getter = T (Class::*)(void); template<> void create(py::module& m) { py::class_(m, "Class", "OAT Class representation") .def(py::init<>()) .def("has_dex_class", &Class::has_dex_class, "True if a " RST_CLASS_REF_FULL(lief.DEX.Class) " object " "is associated with this **OAT** Class") .def_property_readonly("status", &Class::status, "Class " RST_CLASS_REF(lief.OAT.OAT_CLASS_STATUS) "") .def_property_readonly("type", &Class::type, "Information (" RST_CLASS_REF(lief.OAT.OAT_CLASS_TYPES) ") about how methods " "are optimized") .def_property_readonly("fullname", &Class::fullname, "Class mangled name (e.g. ``Lcom/android/MyActivity;``)") .def_property_readonly("index", &Class::index, "Index the **DEX** classes pool (" RST_ATTR_REF_FULL(lief.DEX.File.classes) ")") .def_property_readonly("methods", static_cast>(&Class::methods), "Iterator over " RST_CLASS_REF_FULL(lief.OAT.Method) "") .def_property_readonly("bitmap", &Class::bitmap, "Bitmap information used to quickly find which methods are " "optimized") .def("is_quickened", static_cast(&Class::is_quickened), "Check if the given " RST_CLASS_REF_FULL(lief.DEX.Method) " is compiled into native code", "dex_method"_a) .def("is_quickened", static_cast(&Class::is_quickened), "Check if the Method at the given index is compiled into native code", "method_index"_a) .def("method_offsets_index", static_cast(&Class::method_offsets_index)) .def("method_offsets_index", static_cast(&Class::method_offsets_index)) .def("__eq__", &Class::operator==) .def("__ne__", &Class::operator!=) .def("__hash__", [] (const Class& cls) { return Hash::hash(cls); }) .def("__str__", [] (const Class& cls) { std::ostringstream stream; stream << cls; return stream.str(); }); } } } LIEF-0.9.0/api/python/OAT/objects/pyDexFile.cpp000066400000000000000000000045561330725006400210140ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/OAT/DexFile.hpp" #include "LIEF/OAT/hash.hpp" #include "pyOAT.hpp" namespace LIEF { namespace OAT { template using getter_t = T (DexFile::*)(void) const; template using setter_t = void (DexFile::*)(T); template using no_const_getter = T (DexFile::*)(void); template<> void create(py::module& m) { py::class_(m, "DexFile", "OAT DexFile representation") .def(py::init<>()) .def_property("location", static_cast>(&DexFile::location), static_cast>(&DexFile::location), "Original location of the DEX file") .def_property("checksum", static_cast>(&DexFile::checksum), static_cast>(&DexFile::checksum), "Checksum of the underlying DEX file") .def_property("dex_offset", static_cast>(&DexFile::dex_offset), static_cast>(&DexFile::dex_offset), "Offset to the raw " RST_CLASS_REF_FULL(lief.DEX.File) "") .def_property_readonly("has_dex_file", &DexFile::has_dex_file, "Check if the " RST_CLASS_REF_FULL(lief.DEX.File) " is present") .def_property_readonly("dex_file", static_cast>(&DexFile::dex_file), "Associated " RST_CLASS_REF_FULL(lief.DEX.File) "") .def("__eq__", &DexFile::operator==) .def("__ne__", &DexFile::operator!=) .def("__hash__", [] (const DexFile& dex_file) { return Hash::hash(dex_file); }) .def("__str__", [] (const DexFile& dexfile) { std::ostringstream stream; stream << dexfile; return stream.str(); }); } } } LIEF-0.9.0/api/python/OAT/objects/pyHeader.cpp000066400000000000000000000125231330725006400206550ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/OAT/Header.hpp" #include "LIEF/OAT/hash.hpp" #include "pyOAT.hpp" namespace LIEF { namespace OAT { template using getter_t = T (Header::*)(void) const; template using setter_t = void (Header::*)(T); template using no_const_getter = T (Header::*)(void); template<> void create
(py::module& m) { py::class_(m, "Header", "OAT Header representation") .def(py::init<>()) .def_property_readonly("key_values", static_cast>(&Header::key_values), "Configuration used for the ``dex2oat`` transformation", py::return_value_policy::reference_internal) .def_property_readonly("keys", &Header::keys, "List of " RST_CLASS_REF(lief.OAT.HEADER_KEYS) " present", py::return_value_policy::reference_internal) .def_property_readonly("values", &Header::values, "List of values associated with " RST_ATTR_REF(lief.OAT.Header.keys) "", py::return_value_policy::move) .def_property_readonly("magic", static_cast>(&Header::magic), "Magic number: ``oat\\x0A``") .def_property_readonly("version", static_cast>(&Header::version), "Underlying version of the OAT file") .def_property_readonly("checksum", static_cast>(&Header::checksum), "Checksum of the OAT file") .def_property_readonly("instruction_set", static_cast>(&Header::instruction_set), "List of " RST_CLASS_REF(lief.OAT.INSTRUCTION_SETS) "") .def_property_readonly("nb_dex_files", static_cast>(&Header::nb_dex_files), "Number of " RST_CLASS_REF_FULL(lief.DEX.File) " registred in the current OAT") .def_property_readonly("oat_dex_files_offset", static_cast>(&Header::oat_dex_files_offset), "Offset to the raw " RST_CLASS_REF_FULL(lief.OAT.DexFile) "\n\n" ".. warning::\n\n" "\tThis attribute is only relevant for OAT whose version is above 131") .def_property_readonly("executable_offset", static_cast>(&Header::executable_offset)) .def_property_readonly("i2i_bridge_offset", static_cast>(&Header::i2i_bridge_offset)) .def_property_readonly("i2c_code_bridge_offset", static_cast>(&Header::i2c_code_bridge_offset)) .def_property_readonly("jni_dlsym_lookup_offset", static_cast>(&Header::jni_dlsym_lookup_offset)) .def_property_readonly("quick_generic_jni_trampoline_offset", static_cast>(&Header::quick_generic_jni_trampoline_offset)) .def_property_readonly("quick_imt_conflict_trampoline_offset", static_cast>(&Header::quick_imt_conflict_trampoline_offset)) .def_property_readonly("quick_resolution_trampoline_offset", static_cast>(&Header::quick_resolution_trampoline_offset)) .def_property_readonly("quick_to_interpreter_bridge_offset", static_cast>(&Header::quick_to_interpreter_bridge_offset)) .def_property_readonly("image_patch_delta", static_cast>(&Header::image_patch_delta)) .def_property_readonly("image_file_location_oat_checksum", static_cast>(&Header::image_file_location_oat_checksum)) .def_property_readonly("image_file_location_oat_data_begin", static_cast>(&Header::image_file_location_oat_data_begin)) .def_property_readonly("key_value_size", static_cast>(&Header::key_value_size)) .def("get", static_cast(&Header::get), "key"_a, py::return_value_policy::move) .def("set", static_cast(&Header::set), "key"_a, "value"_a, py::return_value_policy::reference) .def("__getitem__", static_cast(&Header::operator[]), "", py::return_value_policy::move) .def("__setitem__", static_cast(&Header::set), "", py::return_value_policy::reference) .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; return stream.str(); }); } } } LIEF-0.9.0/api/python/OAT/objects/pyMethod.cpp000066400000000000000000000052201330725006400207010ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/OAT/Method.hpp" #include "LIEF/OAT/hash.hpp" #include "pyOAT.hpp" namespace LIEF { namespace OAT { template using getter_t = T (Method::*)(void) const; template using setter_t = void (Method::*)(T); template using no_const_getter = T (Method::*)(void); template<> void create(py::module& m) { py::class_(m, "Method", "OAT Method representation") .def(py::init<>()) .def_property_readonly("name", &Method::name, "Method's name") .def_property_readonly("oat_class", static_cast>(&Method::oat_class), "" RST_CLASS_REF(lief.OAT.Class) " associated with the method", py::return_value_policy::reference) .def_property_readonly("dex_method", static_cast>(&Method::dex_method), "Mirrored " RST_CLASS_REF(lief.DEX.Method) " associated with the OAT method", py::return_value_policy::reference) .def_property_readonly("has_dex_method", &Method::has_dex_method, "Check if a " RST_CLASS_REF(lief.DEX.Method) " is associated with the OAT method", py::return_value_policy::reference) .def_property_readonly("is_dex2dex_optimized", &Method::is_dex2dex_optimized, "True if the optimization is **DEX**") .def_property_readonly("is_compiled", &Method::is_compiled, "True if the optimization is **native**") .def_property("quick_code", static_cast>(&Method::quick_code), static_cast>(&Method::quick_code), "Quick code associated with the method") .def("__eq__", &Method::operator==) .def("__ne__", &Method::operator!=) .def("__hash__", [] (const Method& method) { return Hash::hash(method); }) .def("__str__", [] (const Method& method) { std::ostringstream stream; stream << method; return stream.str(); }); } } } LIEF-0.9.0/api/python/OAT/objects/pyParser.cpp000066400000000000000000000053111330725006400207160ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyOAT.hpp" #include "LIEF/OAT/Parser.hpp" #include namespace LIEF { namespace OAT { template<> void create(py::module& m) { // Parser (Parser) m.def("parse", static_cast (*) (const std::string&)>(&Parser::parse), "Parse the given OAT file and return a " RST_CLASS_REF(lief.OAT.Binary) " object" "oat_file"_a, py::return_value_policy::take_ownership); m.def("parse", static_cast (*) (const std::string&, const std::string&)>(&Parser::parse), "Parse the given OAT with its VDEX file and return a " RST_CLASS_REF(lief.OAT.Binary) " object" "oat_file"_a, "vdex_file"_a, py::return_value_policy::take_ownership); m.def("parse", static_cast (*) (const std::vector&, const std::string&)>(&Parser::parse), "Parse the given raw data and return a " RST_CLASS_REF(lief.OAT.Binary) " object\n\n" "raw"_a, py::arg("name") = "", py::return_value_policy::take_ownership); m.def("parse", [] (py::object byteio, const std::string& name) { auto&& io = py::module::import("io"); auto&& RawIOBase = io.attr("RawIOBase"); auto&& BufferedIOBase = io.attr("BufferedIOBase"); 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::OAT::Parser::parse(std::move(raw), name); }, "io"_a, "name"_a = "", py::return_value_policy::take_ownership); } } } LIEF-0.9.0/api/python/OAT/pyEnums.cpp000066400000000000000000000060111330725006400171160ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyOAT.hpp" #include "LIEF/OAT/Structures.hpp" #include "LIEF/OAT/enums.hpp" #include "LIEF/OAT/EnumToString.hpp" #define PY_ENUM(x) to_string(x), x namespace LIEF { namespace OAT { void init_enums(py::module& m) { py::enum_(m, "OAT_CLASS_TYPES") .value(PY_ENUM(OAT_CLASS_TYPES::OAT_CLASS_ALL_COMPILED)) .value(PY_ENUM(OAT_CLASS_TYPES::OAT_CLASS_SOME_COMPILED)) .value(PY_ENUM(OAT_CLASS_TYPES::OAT_CLASS_NONE_COMPILED)) .export_values(); py::enum_(m, "OAT_CLASS_STATUS") .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_RETIRED)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_ERROR)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_NOTREADY)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_IDX)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_LOADED)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_RESOLVING)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_RESOLVED)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_VERIFYING)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_RETRY_VERIFICATION_AT_RUNTIME)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_VERIFYING_AT_RUNTIME)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_VERIFIED)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_INITIALIZING)) .value(PY_ENUM(OAT_CLASS_STATUS::STATUS_INITIALIZED)) .export_values(); py::enum_(m, "HEADER_KEYS") .value(PY_ENUM(HEADER_KEYS::KEY_IMAGE_LOCATION)) .value(PY_ENUM(HEADER_KEYS::KEY_DEX2OAT_CMD_LINE)) .value(PY_ENUM(HEADER_KEYS::KEY_DEX2OAT_HOST)) .value(PY_ENUM(HEADER_KEYS::KEY_PIC)) .value(PY_ENUM(HEADER_KEYS::KEY_HAS_PATCH_INFO)) .value(PY_ENUM(HEADER_KEYS::KEY_DEBUGGABLE)) .value(PY_ENUM(HEADER_KEYS::KEY_NATIVE_DEBUGGABLE)) .value(PY_ENUM(HEADER_KEYS::KEY_COMPILER_FILTER)) .value(PY_ENUM(HEADER_KEYS::KEY_CLASS_PATH)) .value(PY_ENUM(HEADER_KEYS::KEY_BOOT_CLASS_PATH)) .value(PY_ENUM(HEADER_KEYS::KEY_CONCURRENT_COPYING)) .export_values(); py::enum_(m, "INSTRUCTION_SETS") .value(PY_ENUM(INSTRUCTION_SETS::INST_SET_NONE)) .value(PY_ENUM(INSTRUCTION_SETS::INST_SET_ARM)) .value(PY_ENUM(INSTRUCTION_SETS::INST_SET_ARM_64)) .value(PY_ENUM(INSTRUCTION_SETS::INST_SET_THUMB2)) .value(PY_ENUM(INSTRUCTION_SETS::INST_SET_X86)) .value(PY_ENUM(INSTRUCTION_SETS::INST_SET_X86_64)) .value(PY_ENUM(INSTRUCTION_SETS::INST_SET_MIPS)) .value(PY_ENUM(INSTRUCTION_SETS::INST_SET_MIPS_64)) .export_values(); } } } LIEF-0.9.0/api/python/OAT/pyIterators.cpp000066400000000000000000000041561330725006400200130ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyOAT.hpp" #include "pyIterators.hpp" #include "pyOpaqueTypes.hpp" #include "LIEF/OAT/type_traits.hpp" template<> void init_ref_iterator(py::module& m, const std::string& it_name) { py::class_(m, it_name.c_str()) .def("__getitem__", [] (LIEF::OAT::Header::it_key_values_t& v, size_t i) -> LIEF::OAT::Header::it_key_values_t::value_type { if (i >= v.size()) throw py::index_error(); return v[i]; }, py::return_value_policy::reference_internal) .def("__len__", [](LIEF::OAT::Header::it_key_values_t& v) { return v.size(); }) .def("__iter__", [](LIEF::OAT::Header::it_key_values_t& v) -> LIEF::OAT::Header::it_key_values_t { return std::begin(v); }, py::return_value_policy::reference_internal) .def("__next__", [] (LIEF::OAT::Header::it_key_values_t& v) -> LIEF::OAT::Header::it_key_values_t::value_type { if (v == std::end(v)) { throw py::stop_iteration(); } return *(v++); }, py::return_value_policy::reference_internal); } namespace LIEF { namespace OAT { void init_iterators(py::module& m) { init_ref_iterator(m, "Header.it_key_values_t"); init_ref_iterator(m, "lief.OAT.it_methods"); init_ref_iterator(m, "lief.OAT.it_classes"); init_ref_iterator(m, "lief.OAT.it_dex_files"); } } } LIEF-0.9.0/api/python/OAT/pyOAT.cpp000066400000000000000000000021651330725006400164600ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyOAT.hpp" namespace LIEF { namespace OAT { void init_python_module(py::module& m) { py::module LIEF_OAT_module = m.def_submodule("OAT", "Python API for OAT format"); init_opaque_types(LIEF_OAT_module); init_enums(LIEF_OAT_module); init_iterators(LIEF_OAT_module); init_utils(LIEF_OAT_module); init_objects(LIEF_OAT_module); } void init_objects(py::module& m) { CREATE(Parser, m); CREATE(Binary, m); CREATE(Header, m); CREATE(DexFile, m); CREATE(Class, m); CREATE(Method, m); } } } LIEF-0.9.0/api/python/OAT/pyOAT.hpp000066400000000000000000000025541330725006400164670ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_OAT_H_ #define PY_LIEF_OAT_H_ #include "LIEF/OAT.hpp" #include "pyLIEF.hpp" #include "pyOpaqueTypes.hpp" #include #include #define SPECIALIZE_CREATE(X) \ template<> \ void create(py::module&) #define CREATE(X,Y) create(Y) namespace LIEF { namespace OAT { template void create(py::module&); void init_python_module(py::module& m); void init_objects(py::module&); void init_iterators(py::module&); void init_opaque_types(py::module&); void init_enums(py::module&); void init_utils(py::module&); SPECIALIZE_CREATE(Parser); SPECIALIZE_CREATE(Binary); SPECIALIZE_CREATE(Header); SPECIALIZE_CREATE(DexFile); SPECIALIZE_CREATE(Class); SPECIALIZE_CREATE(Method); } } #endif LIEF-0.9.0/api/python/OAT/pyOpaqueTypes.cpp000066400000000000000000000025341330725006400203140ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyOAT.hpp" #include "LIEF/OAT/type_traits.hpp" namespace LIEF { namespace OAT { void init_opaque_types(py::module& m) { py::class_(m, "LIEF.OAT.Header.it_key_values_t.value_type") .def_property_readonly("key", [] (Header::it_key_values_t::reference p) { return p.first; }, py::return_value_policy::reference_internal) .def_property("value", [] (Header::it_key_values_t::reference p) { return p.second; }, [] (Header::it_key_values_t::reference p, const std::string& value) { std::string& ref_value = p.second; ref_value = value; }, py::return_value_policy::reference_internal); } } } LIEF-0.9.0/api/python/OAT/pyOpaqueTypes.hpp000066400000000000000000000016171330725006400203220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_OAT_OPAQUES_TYPES_H_ #define PY_LIEF_OAT_OPAQUES_TYPES_H_ #include "LIEF/OAT.hpp" #include "pyLIEF.hpp" #include #include PYBIND11_MAKE_OPAQUE(LIEF::OAT::Header::it_key_values_t::value_type); // std::pair> #endif LIEF-0.9.0/api/python/OAT/pyUtils.cpp000066400000000000000000000037031330725006400171340ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyOAT.hpp" #include "LIEF/OAT/utils.hpp" namespace LIEF { namespace OAT { void init_utils(py::module& m) { m.def("is_oat", static_cast(&is_oat), "Check if the " RST_CLASS_REF(lief.ELF.Binary) " given in parameter is a OAT one", "binary"_a); m.def("is_oat", static_cast(&is_oat), "Check if the **file** given in parameter is a OAT one", "path"_a); m.def("is_oat", static_cast&)>(&is_oat), "Check if the **raw data** given in parameter is a OAT one", "raw"_a); m.def("version", static_cast(&version), "Return the OAT version of the " RST_CLASS_REF(lief.ELF.Binary) " given in parameter", "binary"_a); m.def("version", static_cast(&version), "Return the OAT version of the **file** given in parameter", "file"_a); m.def("version", static_cast&)>(&version), "Return the OAT 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 OAT version"); } } } LIEF-0.9.0/api/python/PE/000077500000000000000000000000001330725006400146355ustar00rootroot00000000000000LIEF-0.9.0/api/python/PE/CMakeLists.txt000066400000000000000000000055211330725006400174000ustar00rootroot00000000000000set(LIEF_PYTHON_PE_SRC "${CMAKE_CURRENT_LIST_DIR}/pyUtils.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyResourceNode.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyResourceData.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyResourceDirectory.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/resources/pyResourceIcon.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/resources/pyResourceVersion.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/resources/pyResourceVarFileInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/resources/pyResourceFixedFileInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/resources/pyResourceStringFileInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/resources/pyLangCodeItem.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/resources/pyResourceDialog.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/resources/pyResourceDialogItem.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/signature/pySignerInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/signature/pyAuthenticatedAttributes.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/signature/pyx509.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/signature/pyContentInfo.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/signature/pySignature.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyCodeIntegrity.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDataDirectory.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDosHeader.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRichHeader.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRichEntry.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyBuilder.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyOptionalHeader.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRelocationEntry.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyBinary.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyResourcesManager.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyHeader.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyDebug.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyCodeView.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyCodeViewPDB.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySection.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyExport.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyImport.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyExportEntry.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyRelocation.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyParser.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyImportEntry.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pySymbol.cpp" "${CMAKE_CURRENT_LIST_DIR}/objects/pyTLS.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyEnums.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyPE.cpp" ) set(LIEF_PYTHON_PE_HDR "${CMAKE_CURRENT_LIST_DIR}/pyPE.hpp") source_group("Source Files\\PE" FILES ${LIEF_PYTHON_PE_SRC}) source_group("Header Files\\PE" FILES ${LIEF_PYTHON_PE_HDR}) target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}") target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_PE_SRC}" "${LIEF_PYTHON_PE_HDR}") include("${CMAKE_CURRENT_LIST_DIR}/objects/LoadConfigurations/CMakeLists.txt") LIEF-0.9.0/api/python/PE/objects/000077500000000000000000000000001330725006400162665ustar00rootroot00000000000000LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/000077500000000000000000000000001330725006400220605ustar00rootroot00000000000000LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/CMakeLists.txt000066400000000000000000000013111330725006400246140ustar00rootroot00000000000000set(LIEF_PYTHON_PE_LOAD_CONFIGURE_SRC "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfiguration.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfigurationV0.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfigurationV1.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfigurationV2.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfigurationV3.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfigurationV4.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfigurationV5.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfigurationV6.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyLoadConfigurationV7.cpp" ) source_group("Source Files\\PE\\Load Configuration" FILES ${LIEF_PYTHON_PE_LOAD_CONFIGURE_SRC}) target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_PE_LOAD_CONFIGURE_SRC}") LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfiguration.cpp000066400000000000000000000152631330725006400265530ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfiguration::*)(void) const; template using setter_t = void (LoadConfiguration::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfiguration", "Class modeling the default PE's ``LoadConfiguration``\n\n" "It's the base class for any future version of the structure" ) .def(py::init<>()) .def_property_readonly("version", &LoadConfiguration::version, "(SDK) Version of the structure. (" RST_CLASS_REF(lief.PE.WIN_VERSION) ")") .def_property("characteristics", static_cast>(&LoadConfiguration::characteristics), static_cast>(&LoadConfiguration::characteristics), "Characteristics of the structure.") .def_property("timedatestamp", static_cast>(&LoadConfiguration::timedatestamp), static_cast>(&LoadConfiguration::timedatestamp), "Date and time stamp value") .def_property("major_version", static_cast>(&LoadConfiguration::major_version), static_cast>(&LoadConfiguration::major_version), "Major Version") .def_property("minor_version", static_cast>(&LoadConfiguration::minor_version), static_cast>(&LoadConfiguration::minor_version), "Minor version") .def_property("global_flags_clear", static_cast>(&LoadConfiguration::global_flags_clear), static_cast>(&LoadConfiguration::global_flags_clear), "The global loader flags to clear for this process as the loader start the process.") .def_property("global_flags_set", static_cast>(&LoadConfiguration::global_flags_set), static_cast>(&LoadConfiguration::global_flags_set), "The global loader flags to set for this process as the loader starts the process.") .def_property("critical_section_default_timeout", static_cast>(&LoadConfiguration::critical_section_default_timeout), static_cast>(&LoadConfiguration::critical_section_default_timeout), "The default timeout value to use for is process’s critical sections that are abandoned.") .def_property("decommit_free_block_threshold", static_cast>(&LoadConfiguration::decommit_free_block_threshold), static_cast>(&LoadConfiguration::decommit_free_block_threshold), "Memory that must be freed before it is returned to the system, in bytes.") .def_property("decommit_total_free_threshold", static_cast>(&LoadConfiguration::decommit_total_free_threshold), static_cast>(&LoadConfiguration::decommit_total_free_threshold), "Total amount of free memory, in bytes") .def_property("lock_prefix_table", static_cast>(&LoadConfiguration::lock_prefix_table), static_cast>(&LoadConfiguration::lock_prefix_table), "The **VA** of a list of addresses where the ``LOCK`` prefix " "is used so that they can be replaced with ``NOP`` on single processor machines.") .def_property("maximum_allocation_size", static_cast>(&LoadConfiguration::maximum_allocation_size), static_cast>(&LoadConfiguration::maximum_allocation_size), "Maximum allocation size, in bytes.") .def_property("virtual_memory_threshold", static_cast>(&LoadConfiguration::virtual_memory_threshold), static_cast>(&LoadConfiguration::virtual_memory_threshold), "Maximum virtual memory size, in bytes.") .def_property("process_affinity_mask", static_cast>(&LoadConfiguration::process_affinity_mask), static_cast>(&LoadConfiguration::process_affinity_mask), "Setting this field to a non-zero value is equivalent to calling " "``SetProcessAffinityMask`` with this value during process startup (.exe only)") .def_property("process_heap_flags", static_cast>(&LoadConfiguration::process_heap_flags), static_cast>(&LoadConfiguration::process_heap_flags), "Process heap flags that correspond to the first argument of the " "``HeapCreate`` function. These flags apply to the process heap that is " "created during process startup.") .def_property("csd_version", static_cast>(&LoadConfiguration::csd_version), static_cast>(&LoadConfiguration::csd_version), "The service pack version identifier.") .def_property("reserved1", static_cast>(&LoadConfiguration::reserved1), static_cast>(&LoadConfiguration::reserved1), "Must be zero.") .def_property("editlist", static_cast>(&LoadConfiguration::editlist), static_cast>(&LoadConfiguration::editlist), "Reserved for use by the system.") .def_property("security_cookie", static_cast>(&LoadConfiguration::security_cookie), static_cast>(&LoadConfiguration::security_cookie), "A pointer to a cookie that is used by Visual C++ or GS implementation.") .def("__eq__", &LoadConfiguration::operator==) .def("__ne__", &LoadConfiguration::operator!=) .def("__hash__", [] (const LoadConfiguration& config) { return Hash::hash(config); }) .def("__str__", [] (const LoadConfiguration& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfigurationV0.cpp000066400000000000000000000043551330725006400267610ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfigurationV0::*)(void) const; template using setter_t = void (LoadConfigurationV0::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfigurationV0", "" RST_CLASS_REF(lief.PE.LoadConfiguration) " enhanced with SEH. \n\n" "It is associated with the " RST_CLASS_REF(lief.PE.WIN_VERSION) ": " ":attr:`~lief.PE.WIN_VERSION.SEH`") .def(py::init<>()) .def_property("se_handler_table", static_cast>(&LoadConfigurationV0::se_handler_table), static_cast>(&LoadConfigurationV0::se_handler_table), "The VA of the sorted table of RVAs of each valid, unique " "SE handler in the image.") .def_property("se_handler_count", static_cast>(&LoadConfigurationV0::se_handler_count), static_cast>(&LoadConfigurationV0::se_handler_count), "The count of unique handlers in the table.") .def("__eq__", &LoadConfigurationV0::operator==) .def("__ne__", &LoadConfigurationV0::operator!=) .def("__hash__", [] (const LoadConfigurationV0& config) { return Hash::hash(config); }) .def("__str__", [] (const LoadConfigurationV0& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfigurationV1.cpp000066400000000000000000000076441330725006400267660ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfigurationV1::*)(void) const; template using setter_t = void (LoadConfigurationV1::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfigurationV1", "" RST_CLASS_REF(lief.PE.LoadConfigurationV0) " enhanced with *Control Flow Guard*. \n\n" "It is associated with the " RST_CLASS_REF(lief.PE.WIN_VERSION) ": " ":attr:`~lief.PE.WIN_VERSION.WIN_8_1`" ) .def(py::init<>()) .def_property("guard_cf_check_function_pointer", static_cast>(&LoadConfigurationV1::guard_cf_check_function_pointer), static_cast>(&LoadConfigurationV1::guard_cf_check_function_pointer), "The VA where Control Flow Guard check-function pointer is stored.") .def_property("guard_cf_dispatch_function_pointer", static_cast>(&LoadConfigurationV1::guard_cf_dispatch_function_pointer), static_cast>(&LoadConfigurationV1::guard_cf_dispatch_function_pointer), "The VA where Control Flow Guard dispatch-function pointer is stored.") .def_property("guard_cf_function_table", static_cast>(&LoadConfigurationV1::guard_cf_function_table), static_cast>(&LoadConfigurationV1::guard_cf_function_table), "The VA of the sorted table of RVAs of each Control Flow Guard function in the image.") .def_property("guard_cf_function_count", static_cast>(&LoadConfigurationV1::guard_cf_function_count), static_cast>(&LoadConfigurationV1::guard_cf_function_count), "The count of unique RVAs in the :attr:`~lief.PE.LoadConfigurationV1.guard_cf_function_table`") .def_property("guard_flags", static_cast>(&LoadConfigurationV1::guard_flags), static_cast>(&LoadConfigurationV1::guard_flags), "Control Flow Guard related flags.") .def("has", static_cast(&LoadConfigurationV1::has), "Check if the given " RST_CLASS_REF(lief.PE.GUARD_CF_FLAGS) " is present in " ":attr:`~lief.PE.LoadConfigurationV1.guard_flags`", "flag"_a) .def_property_readonly("guard_cf_flags_list", &LoadConfigurationV1::guard_cf_flags_list, "Return list of " RST_CLASS_REF(lief.PE.GUARD_CF_FLAGS) " present in " ":attr:`~lief.PE.LoadConfigurationV1.guard_flags`", py::return_value_policy::reference_internal) .def("__eq__", &LoadConfigurationV1::operator==) .def("__ne__", &LoadConfigurationV1::operator!=) .def("__hash__", [] (const LoadConfigurationV1& config) { return Hash::hash(config); }) .def("__contains__", static_cast(&LoadConfigurationV1::has)) .def("__str__", [] (const LoadConfigurationV1& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfigurationV2.cpp000066400000000000000000000037251330725006400267630ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfigurationV2::*)(void) const; template using setter_t = void (LoadConfigurationV2::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfigurationV2", "" RST_CLASS_REF(lief.PE.LoadConfigurationV1) " enhanced with *code integrity*. \n\n" "It is associated with the " RST_CLASS_REF(lief.PE.WIN_VERSION) ": " ":attr:`~lief.PE.WIN_VERSION.WIN10_0_9879`") .def(py::init<>()) .def_property_readonly("code_integrity", static_cast(&LoadConfigurationV2::code_integrity), "" RST_CLASS_REF(lief.PE.CodeIntegrity) " object", py::return_value_policy::reference) .def("__eq__", &LoadConfigurationV2::operator==) .def("__ne__", &LoadConfigurationV2::operator!=) .def("__hash__", [] (const LoadConfigurationV2& config) { return Hash::hash(config); }) .def("__str__", [] (const LoadConfigurationV2& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfigurationV3.cpp000066400000000000000000000057401330725006400267630ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfigurationV3::*)(void) const; template using setter_t = void (LoadConfigurationV3::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfigurationV3", "" RST_CLASS_REF(lief.PE.LoadConfigurationV2) " with Control Flow Guard improved. \n\n" "It is associated with the " RST_CLASS_REF(lief.PE.WIN_VERSION) ": " ":attr:`~lief.PE.WIN_VERSION.WIN10_0_14286`") .def(py::init<>()) .def_property("guard_address_taken_iat_entry_table", static_cast>(&LoadConfigurationV3::guard_address_taken_iat_entry_table), static_cast>(&LoadConfigurationV3::guard_address_taken_iat_entry_table), "VA of a table associated with CFG's *IAT* checks") .def_property("guard_address_taken_iat_entry_count", static_cast>(&LoadConfigurationV3::guard_address_taken_iat_entry_count), static_cast>(&LoadConfigurationV3::guard_address_taken_iat_entry_count), "Number of entries in the :attr:`~lief.PE.guard_address_taken_iat_entry_table`") .def_property("guard_long_jump_target_table", static_cast>(&LoadConfigurationV3::guard_long_jump_target_table), static_cast>(&LoadConfigurationV3::guard_long_jump_target_table), "VA of a table associated with CFG's *long jump*") .def_property("guard_long_jump_target_count", static_cast>(&LoadConfigurationV3::guard_long_jump_target_count), static_cast>(&LoadConfigurationV3::guard_long_jump_target_count), "Number of entries in the :attr:`~lief.PE.guard_address_taken_iat_entry_table`") .def("__eq__", &LoadConfigurationV3::operator==) .def("__ne__", &LoadConfigurationV3::operator!=) .def("__hash__", [] (const LoadConfigurationV3& config) { return Hash::hash(config); }) .def("__str__", [] (const LoadConfigurationV3& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfigurationV4.cpp000066400000000000000000000044561330725006400267670ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfigurationV4::*)(void) const; template using setter_t = void (LoadConfigurationV4::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfigurationV4", "" RST_CLASS_REF(lief.PE.LoadConfigurationV3) " enhanced with:\n\n" "\t\t * Kind of dynamic relocations\n\n" "\t\t * *Hybrid Metadata Pointer* \n\n" "It is associated with the " RST_CLASS_REF(lief.PE.WIN_VERSION) ": " ":attr:`~lief.PE.WIN_VERSION.WIN10_0_14383`") .def(py::init<>()) .def_property("dynamic_value_reloc_table", static_cast>(&LoadConfigurationV4::dynamic_value_reloc_table), static_cast>(&LoadConfigurationV4::dynamic_value_reloc_table), "VA of pointing to a ``IMAGE_DYNAMIC_RELOCATION_TABLE``") .def_property("hybrid_metadata_pointer", static_cast>(&LoadConfigurationV4::hybrid_metadata_pointer), static_cast>(&LoadConfigurationV4::hybrid_metadata_pointer), "") .def("__eq__", &LoadConfigurationV4::operator==) .def("__ne__", &LoadConfigurationV4::operator!=) .def("__hash__", [] (const LoadConfigurationV4& config) { return Hash::hash(config); }) .def("__str__", [] (const LoadConfigurationV4& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfigurationV5.cpp000066400000000000000000000061561330725006400267670ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfigurationV5::*)(void) const; template using setter_t = void (LoadConfigurationV5::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfigurationV5", "" RST_CLASS_REF(lief.PE.LoadConfigurationV4) " enhanced with Return Flow Guard. \n\n" "It is associated with the " RST_CLASS_REF(lief.PE.WIN_VERSION) ": " ":attr:`~lief.PE.WIN_VERSION.WIN10_0_14901`") .def(py::init<>()) .def_property("guard_rf_failure_routine", static_cast>(&LoadConfigurationV5::guard_rf_failure_routine), static_cast>(&LoadConfigurationV5::guard_rf_failure_routine), "VA of the failure routine") .def_property("guard_rf_failure_routine_function_pointer", static_cast>(&LoadConfigurationV5::guard_rf_failure_routine_function_pointer), static_cast>(&LoadConfigurationV5::guard_rf_failure_routine_function_pointer), "VA of the failure routine ``fptr``") .def_property("dynamic_value_reloctable_offset", static_cast>(&LoadConfigurationV5::dynamic_value_reloctable_offset), static_cast>(&LoadConfigurationV5::dynamic_value_reloctable_offset), "Offset of dynamic relocation table relative to the relocation table") .def_property("dynamic_value_reloctable_section", static_cast>(&LoadConfigurationV5::dynamic_value_reloctable_section), static_cast>(&LoadConfigurationV5::dynamic_value_reloctable_section), "The section index of the dynamic value relocation table") .def_property("reserved2", static_cast>(&LoadConfigurationV5::reserved2), static_cast>(&LoadConfigurationV5::reserved2), "Must be zero") .def("__eq__", &LoadConfigurationV5::operator==) .def("__ne__", &LoadConfigurationV5::operator!=) .def("__hash__", [] (const LoadConfigurationV5& config) { return Hash::hash(config); }) .def("__str__", [] (const LoadConfigurationV5& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfigurationV6.cpp000066400000000000000000000044751330725006400267720ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfigurationV6::*)(void) const; template using setter_t = void (LoadConfigurationV6::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfigurationV6", "" RST_CLASS_REF(lief.PE.LoadConfigurationV5) " enhanced with Hotpatch and improved RFG. \n\n" "It is associated with the " RST_CLASS_REF(lief.PE.WIN_VERSION) ": " ":attr:`~lief.PE.WIN_VERSION.WIN10_0_15002`") .def(py::init<>()) .def_property("guard_rf_verify_stackpointer_function_pointer", static_cast>(&LoadConfigurationV6::guard_rf_verify_stackpointer_function_pointer), static_cast>(&LoadConfigurationV6::guard_rf_verify_stackpointer_function_pointer), "VA of the Function verifying the stack pointer") .def_property("hotpatch_table_offset", static_cast>(&LoadConfigurationV6::hotpatch_table_offset), static_cast>(&LoadConfigurationV6::hotpatch_table_offset), "Offset to the *hotpatch* table") .def("__eq__", &LoadConfigurationV6::operator==) .def("__ne__", &LoadConfigurationV6::operator!=) .def("__hash__", [] (const LoadConfigurationV6& config) { return Hash::hash(config); }) .def("__str__", [] (const LoadConfigurationV6& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/LoadConfigurations/pyLoadConfigurationV7.cpp000066400000000000000000000036571330725006400267740ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/LoadConfigurations.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LoadConfigurationV7::*)(void) const; template using setter_t = void (LoadConfigurationV7::*)(T); template<> void create(py::module& m) { py::class_(m, "LoadConfigurationV7") .def(py::init<>()) .def_property("reserved3", static_cast>(&LoadConfigurationV7::reserved3), static_cast>(&LoadConfigurationV7::reserved3), "") .def_property("addressof_unicode_string", static_cast>(&LoadConfigurationV7::addressof_unicode_string), static_cast>(&LoadConfigurationV7::addressof_unicode_string), "") .def("__eq__", &LoadConfigurationV7::operator==) .def("__ne__", &LoadConfigurationV7::operator!=) .def("__hash__", [] (const LoadConfigurationV7& config) { return Hash::hash(config); }) .def("__str__", [] (const LoadConfigurationV7& config) { std::ostringstream stream; stream << config; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyBinary.cpp000066400000000000000000000270271330725006400205770ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/Parser.hpp" #include "LIEF/PE/Builder.hpp" #include "LIEF/PE/Binary.hpp" #include "LIEF/Abstract/Binary.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { template using no_const_func = T (Binary::*)(P); template using no_const_getter = T (Binary::*)(void); template using getter_t = T (Binary::*)(void) const; template using setter_t = void (Binary::*)(T); template<> void create(py::module& m) { py::class_(m, "Binary") .def(py::init()) .def_property_readonly("sections", static_cast>(&Binary::sections), "Return binary's " RST_CLASS_REF(lief.PE.Section) " sections", py::return_value_policy::reference) .def_property_readonly("dos_header", static_cast(&Binary::dos_header), "Return " RST_CLASS_REF(lief.PE.DosHeader) "", py::return_value_policy::reference) .def_property_readonly("header", static_cast(&Binary::header), "Return " RST_CLASS_REF(lief.PE.Header) "", py::return_value_policy::reference) .def_property_readonly("optional_header", static_cast(&Binary::optional_header), "Return " RST_CLASS_REF(lief.PE.OptionalHeader) "", py::return_value_policy::reference) .def_property_readonly("virtual_size", &Binary::virtual_size, "Binary size when mapped in memory.\n\n" "This value should matches :attr:`~lief.PE.OptionalHeader.sizeof_image`") .def_property_readonly("sizeof_headers", &Binary::sizeof_headers, "Size of all PE headers") .def("rva_to_offset", &Binary::rva_to_offset, "rva_address"_a, "Convert a relative virtual address to an offset") .def("va_to_offset", &Binary::va_to_offset, "va_address"_a, "Convert a **absolute** virtual address to an offset") .def("section_from_offset", static_cast(&Binary::section_from_offset), "Return the " RST_CLASS_REF(lief.PE.Section) " which contains the offset", "offset"_a, py::return_value_policy::reference) .def("section_from_rva", static_cast(&Binary::section_from_rva), "Return the " RST_CLASS_REF(lief.PE.Section) " which contains the **relative** virtual address", "rva"_a, py::return_value_policy::reference) .def_property("tls", static_cast(&Binary::tls), static_cast(&Binary::tls), "" RST_CLASS_REF(lief.PE.TLS) " object (if present)", py::return_value_policy::reference) .def_property("rich_header", static_cast(&Binary::rich_header), static_cast(&Binary::rich_header), "" RST_CLASS_REF(lief.PE.RichHeader) " object (if present)", py::return_value_policy::reference) .def_property_readonly("has_rich_header", &Binary::has_rich_header, "``True`` if the current binary has a " RST_CLASS_REF(lief.PE.RichHeader) " object") .def_property_readonly("has_debug", &Binary::has_debug, "``True`` if the current binary has a " RST_CLASS_REF(lief.PE.Debug) " object") .def_property_readonly("has_tls", &Binary::has_tls, "``True`` if the current binary has a " RST_CLASS_REF(lief.PE.TLS) " object") .def_property_readonly("has_imports", &Binary::has_imports, "``True`` if the current binary import libraries (" RST_CLASS_REF(lief.PE.Import) ")") .def_property_readonly("has_exports", &Binary::has_exports, "``True`` if the current binary has a " RST_CLASS_REF(lief.PE.Export) " object") .def_property_readonly("has_resources", &Binary::has_resources, "``True`` if the current binary has a " RST_CLASS_REF(lief.PE.Resources) " object") .def_property_readonly("has_exceptions", &Binary::has_exceptions, "``True`` if the current binary has ``Exceptions``") .def_property_readonly("has_relocations", &Binary::has_relocations, "``True`` if the current binary use " RST_CLASS_REF(lief.PE.Relocation) "") .def_property_readonly("has_configuration", &Binary::has_configuration, "``True`` if the current binary has " RST_CLASS_REF(lief.PE.LoadConfiguration) "") .def_property_readonly("has_signature", &Binary::has_signature, "``True`` if the binary is signed (" RST_CLASS_REF(lief.PE.Signature) ")") .def("predict_function_rva", static_cast(&Binary::predict_function_rva), "Try to predict the RVA of the given function name in the given import library name", "library"_a, "function"_a) .def_property_readonly("signature", static_cast(&Binary::signature), "Return the " RST_CLASS_REF(lief.PE.Signature) " object", py::return_value_policy::reference) .def_property_readonly("debug", static_cast(&Binary::debug), "Return the " RST_CLASS_REF(lief.PE.Debug) " object", py::return_value_policy::reference) .def_property_readonly("load_configuration", static_cast(&Binary::load_configuration), "Return the " RST_CLASS_REF(lief.PE.LoadConfiguration) " object", py::return_value_policy::reference) .def("get_export", static_cast(&Binary::get_export), "Return a " RST_CLASS_REF(lief.PE.Export) " object", py::return_value_policy::reference) .def_property_readonly("symbols", static_cast& (Binary::*)(void)>(&Binary::symbols), "Return binary's " RST_CLASS_REF(lief.PE.Symbol) "", py::return_value_policy::reference) .def("get_section", static_cast>(&Binary::get_section), "Return the " RST_CLASS_REF(lief.PE.Section) " object from the given name", "section_name"_a, py::return_value_policy::reference) .def("add_section", &Binary::add_section, "Add a " RST_CLASS_REF(lief.PE.Section) " to the binary.", "section"_a, py::arg("type") = PE_SECTION_TYPES::UNKNOWN, py::return_value_policy::reference) //.def("delete_section", (void (Binary::*)(const std::string&)) &Binary::delete_section) //.def("get_import_section", // static_cast>(&Binary::get_import_section), // py::return_value_policy::reference_internal) .def_property_readonly("relocations", static_cast>(&Binary::relocations), "Return an iterator on the " RST_CLASS_REF(lief.PE.Relocation) "", py::return_value_policy::reference) .def("add_relocation", &Binary::add_relocation, "Add a " RST_CLASS_REF(lief.PE.Relocation) " to the binary", "relocation"_a) .def("remove_all_relocations", &Binary::remove_all_relocations) .def_property_readonly("data_directories", static_cast>(&Binary::data_directories), "Return an iterator on the " RST_CLASS_REF(lief.PE.DataDirectory) "", py::return_value_policy::reference) .def("data_directory", static_cast(&Binary::data_directory), "Return the " RST_CLASS_REF(lief.PE.DataDirectory) " object from the given " RST_CLASS_REF(lief.PE.DATA_DIRECTORY) " type", "type"_a, py::return_value_policy::reference) .def_property_readonly("imports", static_cast>(&Binary::imports), "Return an iterator on the " RST_CLASS_REF(lief.PE.Import) " libraries", py::return_value_policy::reference) .def("has_import", &Binary::has_import, "``True`` if the binary import the given library name", "import_name"_a) .def("get_import", static_cast>(&Binary::get_import), "Returns the " RST_CLASS_REF(lief.PE.Import) " from the given name", "import_name"_a, py::return_value_policy::reference) .def_property_readonly("resources_manager", static_cast>(&Binary::resources_manager), "Return the " RST_CLASS_REF(lief.PE.ResourcesManager) " to manage resources") .def_property_readonly("resources", static_cast>(&Binary::resources), "Return the " RST_CLASS_REF(lief.PE.ResourceNode) " tree", py::return_value_policy::reference) .def_property_readonly("overlay", static_cast&>>(&Binary::overlay), "Return the overlay content as a ``list`` of bytes", py::return_value_policy::reference) .def_property("dos_stub", static_cast&>>(&Binary::dos_stub), static_cast&>>(&Binary::dos_stub), "DOS stub content as a ``list`` of bytes") .def("add_import_function", &Binary::add_import_function, "Add a function to the given " RST_CLASS_REF(lief.PE.Import) " name", "import_name"_a, "function_name"_a, py::return_value_policy::reference) .def("add_library", &Binary::add_library, "Add an " RST_CLASS_REF(lief.PE.Import) " by name", "import_name"_a, py::return_value_policy::reference) .def("remove_library", &Binary::remove_library, "Remove the " RST_CLASS_REF(lief.PE.Import) " from the given name", "import_name"_a) .def("hook_function", static_cast(&Binary::hook_function), "Hook the given function name\n\n" ".. note:: \n\n" "\tWhen using this function, the :class:`~lief.PE.Builder` should be configured as follow:\n\n" "\t.. code-block:: python\n\n" "\t\t\n\n" "\t\tbuilder.build_imports(True).patch_imports(True)\n\n", "function_name"_a, "hook_address"_a) .def("hook_function", static_cast(&Binary::hook_function), "Hook the function name from the given library name", "library_name"_a, "function_name"_a, "hook_address"_a) .def("remove_all_libraries", &Binary::remove_all_libraries, "Remove all imported libraries") .def("write", &Binary::write, "Build the binary and write the result to the given ``output``", "output_path"_a) .def("__str__", [] (const Binary& binary) { std::ostringstream stream; stream << binary; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyBuilder.cpp000066400000000000000000000061121330725006400207310ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/Builder.hpp" #include #include namespace LIEF { namespace PE { template<> void create(py::module& m) { py::class_(m, "Builder") .def(py::init(), "Constructor that takes a " RST_CLASS_REF(lief.PE.Binary) "", "pe_binary"_a) .def("build", &Builder::build, "Perform the build process") .def("build_imports", &Builder::build_imports, "Rebuild the import table in another section", py::arg("enable") = true, py::return_value_policy::reference) .def("patch_imports", &Builder::patch_imports, "Patch the original import table in order to redirect functions to " "the new import table.\n\n" "This setting should be used with ``build_imports`` set to ``True``", py::arg("enable") = true, py::return_value_policy::reference) .def("build_relocations", &Builder::build_relocations, "Rebuild the relocation table in another section", py::arg("enable") = true, py::return_value_policy::reference) .def("build_tls", static_cast(&Builder::build_tls), "Rebuild TLS object in another section", py::arg("enable") = true, py::return_value_policy::reference) .def("build_resources", static_cast(&Builder::build_resources), "Rebuid the resources in another section", py::arg("enable") = true, py::return_value_policy::reference) .def("build_overlay", static_cast(&Builder::build_overlay), "Rebuild the binary's overlay", py::arg("enable") = true, py::return_value_policy::reference) .def("build_dos_stub", static_cast(&Builder::build_dos_stub), "Rebuild the DOS stub", py::arg("enable") = true, py::return_value_policy::reference) .def("write", &Builder::write, "Write the build result into the ``output`` file", "output"_a) .def("get_build", &Builder::get_build, "Return the build result as a ``list`` of bytes", py::return_value_policy::reference_internal) .def("__str__", [] (const Builder& builder) { std::ostringstream stream; stream << builder; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyCodeIntegrity.cpp000066400000000000000000000043741330725006400221240ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/CodeIntegrity.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (CodeIntegrity::*)(void) const; template using setter_t = void (CodeIntegrity::*)(T); template<> void create(py::module& m) { py::class_(m, "CodeIntegrity") .def(py::init<>()) .def_property("flags", static_cast>(&CodeIntegrity::flags), static_cast>(&CodeIntegrity::flags), "Flags to indicate if CI information is available, etc.") .def_property("catalog", static_cast>(&CodeIntegrity::catalog), static_cast>(&CodeIntegrity::catalog), "``0xFFFF`` means not available") .def_property("catalog_offset", static_cast>(&CodeIntegrity::catalog_offset), static_cast>(&CodeIntegrity::catalog_offset), "") .def_property("reserved", static_cast>(&CodeIntegrity::reserved), static_cast>(&CodeIntegrity::reserved), "Additional bitmask to be defined later") .def("__eq__", &CodeIntegrity::operator==) .def("__ne__", &CodeIntegrity::operator!=) .def("__hash__", [] (const CodeIntegrity& code) { return Hash::hash(code); }) .def("__str__", [] (const CodeIntegrity& code) { std::ostringstream stream; stream << code; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyCodeView.cpp000066400000000000000000000030341330725006400210500ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/CodeView.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (CodeView::*)(void) const; template using setter_t = void (CodeView::*)(T); template<> void create(py::module& m) { py::class_(m, "CodeView") .def_property_readonly("cv_signature", static_cast>(&CodeView::cv_signature), "Type of the code view (" RST_CLASS_REF(lief.PE.CODE_VIEW_SIGNATURES) ")") .def("__eq__", &CodeView::operator==) .def("__ne__", &CodeView::operator!=) .def("__hash__", [] (const CodeView& codeview) { return Hash::hash(codeview); }) .def("__str__", [] (const CodeView& cv) { std::ostringstream stream; stream << cv; return stream.str(); }); } } } LIEF-0.9.0/api/python/PE/objects/pyCodeViewPDB.cpp000066400000000000000000000036141330725006400214020ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/CodeViewPDB.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (CodeViewPDB::*)(void) const; template using setter_t = void (CodeViewPDB::*)(T); template<> void create(py::module& m) { py::class_(m, "CodeViewPDB") .def(py::init<>()) .def_property("signature", static_cast>(&CodeViewPDB::signature), static_cast>(&CodeViewPDB::signature)) .def_property("age", static_cast>(&CodeViewPDB::age), static_cast>(&CodeViewPDB::age)) .def_property("filename", static_cast>(&CodeViewPDB::filename), static_cast>(&CodeViewPDB::filename)) .def("__eq__", &CodeViewPDB::operator==) .def("__ne__", &CodeViewPDB::operator!=) .def("__hash__", [] (const CodeViewPDB& codeview) { return Hash::hash(codeview); }) .def("__str__", [] (const CodeViewPDB& cv) { std::ostringstream stream; stream << cv; return stream.str(); }); } } } LIEF-0.9.0/api/python/PE/objects/pyDataDirectory.cpp000066400000000000000000000050651330725006400221070ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/PE/hash.hpp" #include "LIEF/PE/DataDirectory.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { template using getter_t = T (DataDirectory::*)(void) const; template using setter_t = void (DataDirectory::*)(T); template<> void create(py::module& m) { py::class_(m, "DataDirectory") .def(py::init<>()) .def_property("rva", static_cast>(&DataDirectory::RVA), static_cast>(&DataDirectory::RVA), "**Relative** virtual address of the content associated with the current data directory") .def_property("size", static_cast>(&DataDirectory::size), static_cast>(&DataDirectory::size), "Size in bytes of the content associated with the current data directory") .def_property_readonly("section", static_cast(&DataDirectory::section), "" RST_CLASS_REF(lief.PE.Section) " associated with the current data directory", py::return_value_policy::reference) .def_property_readonly("type", &DataDirectory::type, "Type (" RST_CLASS_REF(lief.PE.DATA_DIRECTORY) ") of the current data directory", py::return_value_policy::reference_internal) .def_property_readonly("has_section", &DataDirectory::has_section, "``True`` if the current data directory is tied to a " RST_CLASS_REF(lief.PE.Section) "") .def("__eq__", &DataDirectory::operator==) .def("__ne__", &DataDirectory::operator!=) .def("__hash__", [] (const DataDirectory& data_directory) { return Hash::hash(data_directory); }) .def("__str__", [] (const DataDirectory& datadir) { std::ostringstream stream; stream << datadir; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyDebug.cpp000066400000000000000000000070641330725006400204000ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/Debug.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (Debug::*)(void) const; template using setter_t = void (Debug::*)(T); template<> void create(py::module& m) { py::class_(m, "Debug") .def(py::init<>()) .def_property("characteristics", static_cast>(&Debug::characteristics), static_cast>(&Debug::characteristics), "Reserved should be 0") .def_property("timestamp", static_cast>(&Debug::timestamp), static_cast>(&Debug::timestamp), "The time and date that the debug data was created.") .def_property("major_version", static_cast>(&Debug::major_version), static_cast>(&Debug::major_version), "The major version number of the debug data format.") .def_property("minor_version", static_cast>(&Debug::minor_version), static_cast>(&Debug::minor_version), "The minor version number of the debug data format.") .def_property("type", static_cast>(&Debug::type), static_cast>(&Debug::type), "The format (" RST_CLASS_REF(lief.PE.DEBUG_TYPES) ") of the debugging information") .def_property("sizeof_data", static_cast>(&Debug::sizeof_data), static_cast>(&Debug::sizeof_data), "Size of the debug data") .def_property("addressof_rawdata", static_cast>(&Debug::addressof_rawdata), static_cast>(&Debug::addressof_rawdata), "Address of the debug data relative to the image base") .def_property("pointerto_rawdata", static_cast>(&Debug::pointerto_rawdata), static_cast>(&Debug::pointerto_rawdata), "File offset of the debug data") .def_property_readonly("has_code_view", &Debug::has_code_view, "Whether or not a code view is present") .def_property_readonly("code_view", static_cast(&Debug::code_view), "Return an object which subclass " RST_CLASS_REF(lief.PE.CodeView) " representing the code view \n\n" "The subclassed object can be one of: \n\n" " * " RST_CLASS_REF(lief.PE.CodeViewPDB) "\n", py::return_value_policy::reference) .def("__eq__", &Debug::operator==) .def("__ne__", &Debug::operator!=) .def("__hash__", [] (const Debug& debug) { return Hash::hash(debug); }) .def("__str__", [] (const Debug& debug) { std::ostringstream stream; stream << debug; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyDosHeader.cpp000066400000000000000000000103561330725006400212060ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/DosHeader.hpp" #include #include namespace LIEF { namespace PE { template using getter_abs_t = T (DosHeader::*)(void) const; template using setter_abs_t = void (DosHeader::*)(T); using getter_t = getter_abs_t; using setter_t = setter_abs_t; template<> void create(py::module& m) { py::class_(m, "DosHeader") .def(py::init<>()) .def_property("magic", static_cast(&DosHeader::magic), static_cast(&DosHeader::magic)) .def_property("used_bytes_in_the_last_page", static_cast(&DosHeader::used_bytes_in_the_last_page), static_cast(&DosHeader::used_bytes_in_the_last_page)) .def_property("file_size_in_pages", static_cast(&DosHeader::file_size_in_pages), static_cast(&DosHeader::file_size_in_pages)) .def_property("numberof_relocation", static_cast(&DosHeader::numberof_relocation), static_cast(&DosHeader::numberof_relocation)) .def_property("header_size_in_paragraphs", static_cast(&DosHeader::header_size_in_paragraphs), static_cast(&DosHeader::header_size_in_paragraphs)) .def_property("minimum_extra_paragraphs", static_cast(&DosHeader::minimum_extra_paragraphs), static_cast(&DosHeader::minimum_extra_paragraphs)) .def_property("maximum_extra_paragraphs", static_cast(&DosHeader::maximum_extra_paragraphs), static_cast(&DosHeader::maximum_extra_paragraphs)) .def_property("initial_relative_ss", static_cast(&DosHeader::initial_relative_ss), static_cast(&DosHeader::initial_relative_ss)) .def_property("initial_sp", static_cast(&DosHeader::initial_sp), static_cast(&DosHeader::initial_sp)) .def_property("checksum", static_cast(&DosHeader::checksum), static_cast(&DosHeader::checksum)) .def_property("initial_ip", static_cast(&DosHeader::initial_ip), static_cast(&DosHeader::initial_ip)) .def_property("initial_relative_cs", static_cast(&DosHeader::initial_relative_cs), static_cast(&DosHeader::initial_relative_cs)) .def_property("addressof_relocation_table", static_cast(&DosHeader::addressof_relocation_table), static_cast(&DosHeader::addressof_relocation_table)) .def_property("overlay_number", static_cast(&DosHeader::overlay_number), static_cast(&DosHeader::overlay_number)) .def_property("oem_id", static_cast(&DosHeader::oem_id), static_cast(&DosHeader::oem_id)) .def_property("oem_info", static_cast(&DosHeader::oem_info), static_cast(&DosHeader::oem_info)) .def_property("addressof_new_exeheader", static_cast>(&DosHeader::addressof_new_exeheader), static_cast>(&DosHeader::addressof_new_exeheader)) .def("__eq__", &DosHeader::operator==) .def("__ne__", &DosHeader::operator!=) .def("__hash__", [] (const DosHeader& dos_header) { return Hash::hash(dos_header); }) .def("__str__", [] (const DosHeader& header) { std::ostringstream stream; stream << header; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyExport.cpp000066400000000000000000000051151330725006400206260ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/Export.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (Export::*)(void) const; template using setter_t = void (Export::*)(T); template using no_const_getter = T (Export::*)(void); template<> void create(py::module& m) { py::class_(m, "Export") .def(py::init<>()) .def_property("name", [] (const Export& obj) { return safe_string_converter(obj.name()); }, static_cast>(&Export::name)) .def_property("export_flags", static_cast>(&Export::export_flags), static_cast>(&Export::export_flags)) .def_property("timestamp", static_cast>(&Export::timestamp), static_cast>(&Export::timestamp)) .def_property("major_version", static_cast>(&Export::major_version), static_cast>(&Export::major_version)) .def_property("minor_version", static_cast>(&Export::minor_version), static_cast>(&Export::minor_version)) .def_property("ordinal_base", static_cast>(&Export::ordinal_base), static_cast>(&Export::ordinal_base)) .def_property_readonly("entries", static_cast>(&Export::entries), py::return_value_policy::reference_internal) .def("__eq__", &Export::operator==) .def("__ne__", &Export::operator!=) .def("__hash__", [] (const Export& export_) { return Hash::hash(export_); }) .def("__str__", [] (const Export& export_) { std::ostringstream stream; stream << export_; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyExportEntry.cpp000066400000000000000000000041221330725006400216450ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/ExportEntry.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ExportEntry::*)(void) const; template using setter_t = void (ExportEntry::*)(T); template<> void create(py::module& m) { py::class_(m, "ExportEntry") .def(py::init<>()) .def_property("name", [] (const ExportEntry& obj) { return safe_string_converter(obj.name()); }, static_cast>(&ExportEntry::name)) .def_property("ordinal", static_cast>(&ExportEntry::ordinal), static_cast>(&ExportEntry::ordinal)) .def_property("address", static_cast>(&ExportEntry::address), static_cast>(&ExportEntry::address)) .def_property("is_extern", static_cast>(&ExportEntry::is_extern), static_cast>(&ExportEntry::is_extern)) .def("__eq__", &ExportEntry::operator==) .def("__ne__", &ExportEntry::operator!=) .def("__hash__", [] (const ExportEntry& export_entry) { return Hash::hash(export_entry); }) .def("__str__", [] (const ExportEntry& entry) { std::ostringstream stream; stream << entry; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyHeader.cpp000066400000000000000000000107611330725006400205400ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/Header.hpp" #include #include namespace LIEF { namespace PE { 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") .def(py::init<>()) .def_property("signature", static_cast>(&Header::signature), static_cast>(&Header::signature), "PE signature. Should be ``[80, 69, 0, 0]`` (``PE\\0\\0``)") .def_property("machine", static_cast>(&Header::machine), static_cast>(&Header::machine), "Target " RST_CLASS_REF(lief.PE.MACHINE_TYPES) "") .def_property("numberof_sections", static_cast>(&Header::numberof_sections), static_cast>(&Header::numberof_sections), "Number of sections in the binary") .def_property("time_date_stamps", static_cast>(&Header::time_date_stamp), static_cast>(&Header::time_date_stamp), "The low 32 bits of the number of seconds since 00:00 January 1, 1970 that indicates when the file was created.") .def_property("pointerto_symbol_table", static_cast>(&Header::pointerto_symbol_table), static_cast>(&Header::pointerto_symbol_table), "The file offset of the COFF symbol table, or zero if no COFF symbol table is present.\n\n" "This value should be zero for an image because COFF debugging information is deprecated.") .def_property("numberof_symbols", static_cast>(&Header::numberof_symbols), static_cast>(&Header::numberof_symbols), "The number of entries in the symbol table. This " "data can be used to locate the string table, " "which immediately follows the symbol table. " "This value should be zero for an image because " "COFF debugging information is deprecated.") .def_property("sizeof_optional_header", static_cast>(&Header::sizeof_optional_header), static_cast>(&Header::sizeof_optional_header), "The size of the optional header, which is\n" "required for executable files") .def_property("characteristics", static_cast>(&Header::characteristics), static_cast>(&Header::characteristics), "The " RST_CLASS_REF(lief.PE.HEADER_CHARACTERISTICS) " that indicate the attributes of the file.") .def("has_characteristic", &Header::has_characteristic, "``True`` if the header has the given " RST_CLASS_REF(lief.PE.HEADER_CHARACTERISTICS) "", "characteristic"_a) .def("add_characteristic", &Header::add_characteristic, "Add the given " RST_CLASS_REF(lief.PE.HEADER_CHARACTERISTICS) " to the header", "characteristic"_a) .def("remove_characteristic", &Header::remove_characteristic, "Remove the given " RST_CLASS_REF(lief.PE.HEADER_CHARACTERISTICS) " from the header", "characteristic"_a) .def_property_readonly("characteristics_list", &Header::characteristics_list, "Return the " RST_CLASS_REF(lief.PE.HEADER_CHARACTERISTICS) " as a ``list``") .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; }); } } } LIEF-0.9.0/api/python/PE/objects/pyImport.cpp000066400000000000000000000105631330725006400206220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/Import.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (Import::*)(void) const; template using setter_t = void (Import::*)(T); template using no_const_getter = T (Import::*)(void); template using no_const_func = T (Import::*)(P); template<> void create(py::module& m) { py::class_(m, "Import") .def(py::init<>(), "Default constructor with a library name") .def(py::init(), "Constructor with a library name", "library_name"_a) .def_property_readonly("entries", static_cast>(&Import::entries), "Iterator to the imported " RST_CLASS_REF(lief.PE.ImportEntry) " (functions)", py::return_value_policy::reference) .def_property("name", [] (const Import& obj) { return safe_string_converter(obj.name()); }, static_cast>(&Import::name), "Library name (e.g. ``kernel32.dll``)", py::return_value_policy::reference) .def_property_readonly("directory", static_cast>(&Import::directory), "" RST_CLASS_REF(lief.PE.DataDirectory) " associated with the import table", py::return_value_policy::reference) .def_property_readonly("iat_directory", static_cast>(&Import::iat_directory), "" RST_CLASS_REF(lief.PE.DataDirectory) " associated with the ``IAT`` table", py::return_value_policy::reference) .def_property("import_address_table_rva", static_cast>(&Import::import_address_table_rva), static_cast>(&Import::import_address_table_rva), "The RVA of the import address table. The contents of " "this table are **identical** to the contents of the import " "lookup table until the image is bound.") .def_property("import_lookup_table_rva", static_cast>(&Import::import_lookup_table_rva), static_cast>(&Import::import_lookup_table_rva), "The RVA of the import lookup table. This table " "contains a :attr:`~lief.PE.ImportEntry.name` or :attr:`~lief.PE.ImportEntry.ordinal` for each import.") .def("get_function_rva_from_iat", &Import::get_function_rva_from_iat, "Return the relative virtual address of the given function within the *Import Address Table*" "function_name"_a) .def("add_entry", static_cast(&Import::add_entry), "Add an " RST_CLASS_REF(lief.PE.ImportEntry) " (function) to the current import", "entry"_a, py::return_value_policy::reference) .def("add_entry", static_cast(&Import::add_entry), "Add an " RST_CLASS_REF(lief.PE.ImportEntry) " (function) to the current import", "function_name"_a, py::return_value_policy::reference) .def("get_entry", static_cast>(&Import::get_entry), "Return " RST_CLASS_REF(lief.PE.ImportEntry) " with the given name", "function_name"_a, py::return_value_policy::reference) .def("__eq__", &Import::operator==) .def("__ne__", &Import::operator!=) .def("__hash__", [] (const Import& import) { return Hash::hash(import); }) .def("__str__", [] (const Import& import) { std::ostringstream stream; stream << import; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyImportEntry.cpp000066400000000000000000000055001330725006400216370ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/PE/hash.hpp" #include "LIEF/PE/ImportEntry.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { template using getter_t = T (ImportEntry::*)(void) const; template using setter_t = void (ImportEntry::*)(T); template<> void create(py::module& m) { py::class_(m, "ImportEntry") .def(py::init<>()) .def(py::init(), "Constructor by :attr:`~lief.PE.ImportEntry.name`", "import_name"_a) .def(py::init(), "Constructor by :attr:`~lief.PE.ImportEntry.data` and optionally :attr:`~lief.PE.ImportEntry.name`", "data"_a, "name"_a = "") .def_property("name", [] (const ImportEntry& obj) { return safe_string_converter(obj.name()); }, static_cast>(&ImportEntry::name), "Import name if not ordinal") .def_property("data", static_cast>(&ImportEntry::data), static_cast>(&ImportEntry::data), "Raw value") .def_property_readonly("is_ordinal", &ImportEntry::is_ordinal, "``True`` if ordinal is used") .def_property_readonly("ordinal", &ImportEntry::ordinal, "Ordinal value (if any). See: :attr:`~lief.PE.ImportEntry.is_ordinal`") .def_property_readonly("hint", &ImportEntry::hint, "Index into the :attr:`~lief.PE.Export.entries`") .def_property_readonly("iat_value", &ImportEntry::iat_value, "Value of the current entry in the Import Address Table") .def_property_readonly("iat_address", &ImportEntry::iat_address, "**Original** address of the entry in the Import Address Table") .def("__eq__", &ImportEntry::operator==) .def("__ne__", &ImportEntry::operator!=) .def("__hash__", [] (const ImportEntry& import_entry) { return Hash::hash(import_entry); }) .def("__str__", [] (const ImportEntry& importEntry) { std::ostringstream stream; stream << importEntry; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyOptionalHeader.cpp000066400000000000000000000321451330725006400222460ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/OptionalHeader.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (OptionalHeader::*)(void) const; template using setter_t = void (OptionalHeader::*)(T); template<> void create(py::module& m) { py::class_(m, "OptionalHeader") .def(py::init<>()) .def_property("magic", static_cast>(&OptionalHeader::magic), static_cast>(&OptionalHeader::magic), "Magic value (" RST_CLASS_REF(lief.PE.PE_TYPE) ") that identify a ``PE32`` from a ``PE64``") .def_property("major_linker_version", static_cast>(&OptionalHeader::major_linker_version), static_cast>(&OptionalHeader::major_linker_version), "The linker major version number") .def_property("minor_linker_version", static_cast>(&OptionalHeader::minor_linker_version), static_cast>(&OptionalHeader::minor_linker_version), "The linker minor version number") .def_property("sizeof_code", static_cast>(&OptionalHeader::sizeof_code), static_cast>(&OptionalHeader::sizeof_code), "The size of the code (text) section, or the " "sum of all code sections if there are " "multiple sections.") .def_property("sizeof_initialized_data", static_cast>(&OptionalHeader::sizeof_initialized_data), static_cast>(&OptionalHeader::sizeof_initialized_data), "The size of the initialized data section, or " "the sum of all such sections if there are " "multiple data sections.") .def_property("sizeof_uninitialized_data", static_cast>(&OptionalHeader::sizeof_uninitialized_data), static_cast>(&OptionalHeader::sizeof_uninitialized_data), "The size of the uninitialized data section " "(``.bss``), or the sum of all such sections if " "there are multiple ``.bss`` sections.") .def_property("addressof_entrypoint", static_cast>(&OptionalHeader::addressof_entrypoint), static_cast>(&OptionalHeader::addressof_entrypoint), "The address of the entry point relative to " "the image base when the executable file is " "loaded into memory. For program images, " "this is the starting address. For device " "drivers, this is the address of the " "initialization function. An entry point is " "optional for DLLs. When no entry point is " "present, this field must be zero.") .def_property("baseof_code", static_cast>(&OptionalHeader::baseof_code), static_cast>(&OptionalHeader::baseof_code), "The address that is relative to the image " "base of the beginning-of-code section " "when it is loaded into memory.") .def_property("baseof_data", static_cast>(&OptionalHeader::baseof_data), static_cast>(&OptionalHeader::baseof_data), "The address that is relative to the image " "base of the beginning-of-data section " "when it is loaded into memory.\n\n" ".. warning:: This value is not present for ``PE64``") .def_property("imagebase", static_cast>(&OptionalHeader::imagebase), static_cast>(&OptionalHeader::imagebase), "The preferred address of the first " "byte of image when loaded into " "memory. It must be a multiple of ``64K``. " "The default for DLLs is ``0x10000000``. " "The default for Windows CE EXEs " "is ``0x00010000``. The default for " "Windows NT, Windows 2000, " "Windows XP, Windows 95, " "Windows 98, and Windows Me is " "``0x00400000``. ") .def_property("section_alignment", static_cast>(&OptionalHeader::section_alignment), static_cast>(&OptionalHeader::section_alignment), "The alignment (in bytes) of sections " "when they are loaded into memory. " "It must be greater than or equal to " ":attr:`~lief.PE.OptionalHeader.file_alignment`. The default is the " "page size for the architecture.") .def_property("file_alignment", static_cast>(&OptionalHeader::file_alignment), static_cast>(&OptionalHeader::file_alignment), "The alignment factor (in bytes) that " "is used to align the raw data of " "sections in the image file. The value " "should be a **power of 2** between 512 " "and 64 K, inclusive. The default is " "512. If the :attr:`~lief.PE.OptionalHeader.section_alignment` is less " "than the architecture’s page size, " "then :attr:`~lief.PE.OptionalHeader.file_alignment` must match " ":attr:`~lief.PE.OptionalHeader.section_alignment`.") .def_property("major_operating_system_version", static_cast>(&OptionalHeader::major_operating_system_version), static_cast>(&OptionalHeader::major_operating_system_version), "The major version number of the required operating system.") .def_property("minor_operating_system_version", static_cast>(&OptionalHeader::minor_operating_system_version), static_cast>(&OptionalHeader::minor_operating_system_version), "The minor version number of the required operating system.") .def_property("major_image_version", static_cast>(&OptionalHeader::major_image_version), static_cast>(&OptionalHeader::major_image_version), "The major version number of the image.") .def_property("minor_image_version", static_cast>(&OptionalHeader::minor_image_version), static_cast>(&OptionalHeader::minor_image_version), "The minor version number of the image.") .def_property("major_subsystem_version", static_cast>(&OptionalHeader::major_subsystem_version), static_cast>(&OptionalHeader::major_subsystem_version), "The major version number of the subsystem.") .def_property("minor_subsystem_version", static_cast>(&OptionalHeader::minor_subsystem_version), static_cast>(&OptionalHeader::minor_subsystem_version), "The minor version number of the subsystem") .def_property("win32_version_value", static_cast>(&OptionalHeader::win32_version_value), static_cast>(&OptionalHeader::win32_version_value), "Reserved, must be zero.") .def_property("sizeof_image", static_cast>(&OptionalHeader::sizeof_image), static_cast>(&OptionalHeader::sizeof_image), "The size (in bytes) of the image, " "including all headers, as the image " "is loaded in memory. It must be a " "multiple of :attr:`~lief.PE.OptionalHeader.section_alignment` and should match :attr:`~lief.PE.Binary.virtual_size`.") .def_property("sizeof_headers", static_cast>(&OptionalHeader::sizeof_headers), static_cast>(&OptionalHeader::sizeof_headers), "The combined size of an MS-DOS " "stub, PE header, and section " "headers rounded up to a multiple of " ":attr:`~lief.PE.OptionalHeader.file_alignment`.") .def_property("checksum", static_cast>(&OptionalHeader::checksum), static_cast>(&OptionalHeader::checksum), "The image file checksum. The " "algorithm for computing the " "checksum is incorporated into " "``IMAGHELP.DLL``. The following are " "checked for validation at load time: " "all **drivers**, any **DLL loaded at boot** " "time, and any **DLL** that is loaded " "into a **critical** Windows process.") .def_property("subsystem", static_cast>(&OptionalHeader::subsystem), static_cast>(&OptionalHeader::subsystem), "The " RST_CLASS_REF(lief.PE.SUBSYSTEM) " that is required to " "run this image. For more " "information, see “Windows " "Subsystem” later in this " "specification.") .def_property("dll_characteristics", static_cast>(&OptionalHeader::dll_characteristics), static_cast>(&OptionalHeader::dll_characteristics), "The " RST_CLASS_REF(lief.PE.DLL_CHARACTERISTICS) " characteristics") .def("add", static_cast(&OptionalHeader::add), "Add the given " RST_CLASS_REF(lief.PE.DLL_CHARACTERISTICS) "", "characteristic"_a) .def("remove", static_cast(&OptionalHeader::remove), "Remove the given " RST_CLASS_REF(lief.PE.DLL_CHARACTERISTICS) "", "characteristic"_a) .def_property_readonly("dll_characteristics_lists", &OptionalHeader::dll_characteristics_list, "" RST_CLASS_REF(lief.PE.DLL_CHARACTERISTICS) " as a list") .def("has", static_cast(&OptionalHeader::has), "``True`` if the given " RST_CLASS_REF(lief.PE.DLL_CHARACTERISTICS) " is in the " ":attr:`~lief.PE.OptionalHeader.dll_characteristics`", "characteristics"_a) .def_property("sizeof_stack_reserve", static_cast>(&OptionalHeader::sizeof_stack_reserve), static_cast>(&OptionalHeader::sizeof_stack_reserve), "The size of the stack to reserve. " "Only :attr:`~lief.PE.OptionalHeader.sizeof_stack_commit` is " "committed; the rest is made " "available one page at a time until " "the reserve size is reached. ") .def_property("sizeof_stack_commit", static_cast>(&OptionalHeader::sizeof_stack_commit), static_cast>(&OptionalHeader::sizeof_stack_commit), "The size of the stack to commit.") .def_property("sizeof_heap_reserve", static_cast>(&OptionalHeader::sizeof_heap_reserve), static_cast>(&OptionalHeader::sizeof_heap_reserve), "The size of the local heap space to " "reserve. Only :attr:`~lief.PE.OptionalHeader.sizeof_heap_commit` is " "committed; the rest is made " "available one page at a time until " "the reserve size is reached.") .def_property("sizeof_heap_commit", static_cast>(&OptionalHeader::sizeof_heap_commit), static_cast>(&OptionalHeader::sizeof_heap_commit), "The size of the local heap space to commit.") .def_property("loader_flags", static_cast>(&OptionalHeader::loader_flags), static_cast>(&OptionalHeader::loader_flags), "Reserved, must be zero.") .def_property("numberof_rva_and_size", static_cast>(&OptionalHeader::numberof_rva_and_size), static_cast>(&OptionalHeader::numberof_rva_and_size), "The number of " RST_CLASS_REF(lief.PE.DataDirectory) " " "entries in the remainder of the " "optional header. Each describes a " "location and size.") .def("__eq__", &OptionalHeader::operator==) .def("__ne__", &OptionalHeader::operator!=) .def("__hash__", [] (const OptionalHeader& optional_header) { return Hash::hash(optional_header); }) .def(py::self += DLL_CHARACTERISTICS()) .def(py::self -= DLL_CHARACTERISTICS()) .def("__contains__", static_cast(&OptionalHeader::has), "Check if the given " RST_CLASS_REF(lief.PE.DLL_CHARACTERISTICS) " is present") .def("__str__", [] (const OptionalHeader& header) { std::ostringstream stream; stream << header; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyParser.cpp000066400000000000000000000046211330725006400206020ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/Parser.hpp" #include namespace LIEF { namespace PE { template<> void create(py::module& m) { m.def("parse", static_cast (*) (const std::string&)>(&Parser::parse), "Parse the given binary and return a " RST_CLASS_REF(lief.PE.Binary) " object", py::arg("filename"), py::return_value_policy::take_ownership); m.def("parse", static_cast (*) (const std::vector&, const std::string&)>(&Parser::parse), "Parse the given binary and return a " RST_CLASS_REF(lief.PE.Binary) " object", py::arg("raw"), py::arg("name") = "", py::return_value_policy::take_ownership); m.def("parse", [] (py::object byteio, const std::string& name) { auto&& io = py::module::import("io"); auto&& RawIOBase = io.attr("RawIOBase"); auto&& BufferedIOBase = io.attr("BufferedIOBase"); 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::PE::Parser::parse(std::move(raw), name); }, "io"_a, "name"_a = "", py::return_value_policy::take_ownership); } } } LIEF-0.9.0/api/python/PE/objects/pyRelocation.cpp000066400000000000000000000037161330725006400214510ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/Relocation.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (Relocation::*)(void) const; template using setter_t = void (Relocation::*)(T); template using it_t = T (Relocation::*)(void); template<> void create(py::module& m) { py::class_(m, "Relocation") .def(py::init<>()) .def_property("virtual_address", static_cast>(&Relocation::virtual_address), static_cast>(&Relocation::virtual_address)) .def_property_readonly("entries", static_cast>(&Relocation::entries), py::return_value_policy::reference_internal) .def("add_entry", &Relocation::add_entry, "Add a new " RST_CLASS_REF(lief.PE.RelocationEntry) "", "new_entry"_a) .def("__eq__", &Relocation::operator==) .def("__ne__", &Relocation::operator!=) .def("__hash__", [] (const Relocation& relocation) { return Hash::hash(relocation); }) .def("__str__", [] (const Relocation& relocation) { std::ostringstream stream; stream << relocation; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyRelocationEntry.cpp000066400000000000000000000046101330725006400224650ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/RelocationEntry.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (RelocationEntry::*)(void) const; template using setter_t = void (RelocationEntry::*)(T); template<> void create(py::module& m) { py::class_(m, "RelocationEntry") .def(py::init<>()) .def_property("data", static_cast>(&RelocationEntry::data), static_cast>(&RelocationEntry::data), "Raw data of the relocation:\n\n" "\t\t * The **high** 4 bits store the relocation :attr:`~lief.PE.RelocationEntry.type`\n\n" "\t\t * The **low** 12 bits store the relocation offset (:attr:`~lief.PE.RelocationEntry.position`)\n\n" ) .def_property("position", static_cast>(&RelocationEntry::position), static_cast>(&RelocationEntry::position), "Offset - relative to :attr:`~lief.PE.Relocation.virtual_address` - where the relocation occurs") .def_property("type", static_cast>(&RelocationEntry::type), static_cast>(&RelocationEntry::type), "Type of the relocation") .def("__eq__", &RelocationEntry::operator==) .def("__ne__", &RelocationEntry::operator!=) .def("__hash__", [] (const RelocationEntry& relocation_entry) { return Hash::hash(relocation_entry); }) .def("__str__", [] (const RelocationEntry& relocation) { std::ostringstream stream; stream << relocation; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyResourceData.cpp000066400000000000000000000046471330725006400217370ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/ResourceData.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceData::*)(void) const; template using setter_t = void (ResourceData::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceData") .def(py::init<>(), "Default constructor") .def(py::init&, uint32_t>(), "content"_a, "code_page"_a) .def_property("code_page", static_cast>(&ResourceData::code_page), static_cast>(&ResourceData::code_page), "The code page that is used to decode code point " "values within the resource data. Typically, the code " "page would be the Unicode code page") .def_property("content", static_cast&>>(&ResourceData::content), static_cast&>>(&ResourceData::content), "Resource content") .def_property("reserved", static_cast>(&ResourceData::reserved), static_cast>(&ResourceData::reserved), "Reserved value. Should be ``0``") .def_property_readonly("offset", &ResourceData::offset, "Offset of the content within the resource") .def("__eq__", &ResourceData::operator==) .def("__ne__", &ResourceData::operator!=) .def("__hash__", [] (const ResourceData& node) { return Hash::hash(node); }) .def("__str__", [] (const ResourceData& data) { std::ostringstream stream; stream << data; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyResourceDirectory.cpp000066400000000000000000000065111330725006400230220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/ResourceDirectory.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceDirectory::*)(void) const; template using setter_t = void (ResourceDirectory::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceDirectory") .def(py::init<>(), "Default constructor") .def_property("characteristics", static_cast>(&ResourceDirectory::characteristics), static_cast>(&ResourceDirectory::characteristics), "Resource flags. This field is reserved for future use. " "It is currently set to zero.") .def_property("time_date_stamp", static_cast>(&ResourceDirectory::time_date_stamp), static_cast>(&ResourceDirectory::time_date_stamp), "The time that the resource data was created by the " "resource compiler.") .def_property("major_version", static_cast>(&ResourceDirectory::major_version), static_cast>(&ResourceDirectory::major_version), "The major version number, set by the user.") .def_property("minor_version", static_cast>(&ResourceDirectory::minor_version), static_cast>(&ResourceDirectory::minor_version), "The minor version number, set by the user.") .def_property("numberof_name_entries", static_cast>(&ResourceDirectory::numberof_name_entries), static_cast>(&ResourceDirectory::numberof_name_entries), "The number of directory entries immediately " "following the table that use strings to identify Type, " "Name, or Language entries (depending on the level " "of the table") .def_property("numberof_id_entries", static_cast>(&ResourceDirectory::numberof_id_entries), static_cast>(&ResourceDirectory::numberof_id_entries), "The number of directory entries immediately " "following the Name entries that use numeric IDs for " "Type, Name, or Language entries.") .def("__eq__", &ResourceDirectory::operator==) .def("__ne__", &ResourceDirectory::operator!=) .def("__hash__", [] (const ResourceDirectory& node) { return Hash::hash(node); }) .def("__str__", [] (const ResourceDirectory& directory) { std::ostringstream stream; stream << directory; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyResourceNode.cpp000066400000000000000000000072121330725006400217420ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/utils.hpp" #include "LIEF/PE/ResourceNode.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceNode::*)(void) const; template using setter_t = void (ResourceNode::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceNode") .def_property("id", static_cast>(&ResourceNode::id), static_cast>(&ResourceNode::id), "Integer that identifies the Type, Name, or " "Language ID entry.") .def_property_readonly("is_directory", &ResourceNode::is_directory, "``True`` if the current resource is a " RST_CLASS_REF(lief.PE.ResourceDirectory) "") .def_property_readonly("is_data", &ResourceNode::is_data, "``True`` if the current resource is a " RST_CLASS_REF(lief.PE.ResourceData) "") .def_property_readonly("has_name", &ResourceNode::has_name, "``True`` if the current resource uses a name") .def_property("name", [] (const ResourceNode& node) { return safe_string_converter(LIEF::u16tou8(node.name())); }, static_cast(&ResourceNode::name), "Resource name") .def_property_readonly("childs", static_cast(&ResourceNode::childs), "Node's childs") .def("add_directory_node", static_cast(&ResourceNode::add_child), "Add a " RST_CLASS_REF(lief.PE.ResourceDirectory) " to the current node", "resource_directory"_a) .def("add_data_node", static_cast(&ResourceNode::add_child), "Add a " RST_CLASS_REF(lief.PE.ResourceData) " to the current node", "resource_data"_a) .def("delete_child", static_cast(&ResourceNode::delete_child), "Delete the given " RST_CLASS_REF(lief.PE.ResourceNode) " from childs", "node"_a) .def("delete_child", static_cast(&ResourceNode::delete_child), "Delete the " RST_CLASS_REF(lief.PE.ResourceNode) " with the given :attr:`~lief.PE.ResourceNode.id` from childs", "id"_a) .def("sort_by_id", &ResourceNode::sort_by_id, "Sort resource childs by ID") .def_property_readonly("depth", &ResourceNode::depth, "Current depth of the entry in the resource tree") .def("__eq__", &ResourceNode::operator==) .def("__ne__", &ResourceNode::operator!=) .def("__hash__", [] (const ResourceNode& node) { return Hash::hash(node); }) .def("__str__", [] (const ResourceNode& node) { std::ostringstream stream; stream << node; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyResourcesManager.cpp000066400000000000000000000101461330725006400226120ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/ResourcesManager.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourcesManager::*)(void) const; template using setter_t = void (ResourcesManager::*)(T); template using no_const_func = T (ResourcesManager::*)(P); template<> void create(py::module& m) { py::class_(m, "ResourcesManager", "The Resource Manager provides an enhanced API to manipulate the resource tree") .def_property_readonly("has_manifest", &ResourcesManager::has_manifest, "``True`` if resources contain Manifest element") .def_property("manifest", [] (const ResourcesManager& obj) { return safe_string_converter(obj.manifest()); }, static_cast>(&ResourcesManager::manifest), "Manifest as a ``string``") .def_property_readonly("has_version", &ResourcesManager::has_version, "``true`` if resources contain " RST_CLASS_REF(lief.PE.ResourceVersion) "") .def_property_readonly("version", static_cast>(&ResourcesManager::version), "Return the " RST_CLASS_REF(lief.PE.ResourceVersion) "") //static_cast>(&ResourcesManager::version)) .def_property_readonly("has_icons", &ResourcesManager::has_icons, "``true`` if resources contain " RST_CLASS_REF(lief.PE.ResourceIcon) "") .def_property_readonly("icons", &ResourcesManager::icons, "Return the list of the " RST_CLASS_REF(lief.PE.ResourceIcon) " present in the resource") .def("change_icon", &ResourcesManager::change_icon, "Switch the given icons", "old_one"_a, "new_one"_a) .def_property_readonly("has_dialogs", &ResourcesManager::has_dialogs, "``true`` if resources contain " RST_CLASS_REF(lief.PE.ResourceDialog) "") .def_property_readonly("dialogs", &ResourcesManager::dialogs, "Return the list of the " RST_CLASS_REF(lief.PE.ResourceDialog) " present in the resource") .def_property_readonly("types_available", &ResourcesManager::get_types_available, "Return list of " RST_CLASS_REF(lief.PE.RESOURCE_TYPES) " present in the resources") .def_property_readonly("langs_available", &ResourcesManager::get_langs_available, "Return list of " RST_CLASS_REF(lief.PE.RESOURCE_LANGS) " present in the resources") .def_property_readonly("sublangs_available", &ResourcesManager::get_sublangs_available, "Return list of " RST_CLASS_REF(lief.PE.RESOURCE_SUBLANGS) " present in the resources") .def("add_icon", &ResourcesManager::add_icon, "Add an icon to the resources", "icon"_a) .def("has_type", &ResourcesManager::has_type, "``True`` if the resource has the given " RST_CLASS_REF(lief.PE.RESOURCE_TYPES) "", "type"_a) .def("get_node_type", static_cast>(&ResourcesManager::get_node_type), "Return " RST_CLASS_REF(lief.PE.ResourceNode) " with " "the given " RST_CLASS_REF(lief.PE.RESOURCE_TYPES) "", "type"_a, py::return_value_policy::reference) .def("__str__", [] (const ResourcesManager& manager) { std::ostringstream stream; stream << manager; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyRichEntry.cpp000066400000000000000000000042701330725006400212550ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/RichEntry.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (RichEntry::*)(void) const; template using setter_t = void (RichEntry::*)(T); template<> void create(py::module& m) { py::class_(m, "RichEntry") .def(py::init<>()) .def(py::init(), "Contructor from " ":attr:`~lief.PE.RichEntry.id`, " ":attr:`~lief.PE.RichEntry.build_id` and " ":attr:`~lief.PE.RichEntry.count`", "id"_a, "build_id"_a, "count"_a) .def_property("id", static_cast>(&RichEntry::id), static_cast>(&RichEntry::id), "Type of the entry") .def_property("build_id", static_cast>(&RichEntry::build_id), static_cast>(&RichEntry::build_id), "Builder number of the tool (if any)") .def_property("count", static_cast>(&RichEntry::count), static_cast>(&RichEntry::count), "*Occurrence* count") .def("__eq__", &RichEntry::operator==) .def("__ne__", &RichEntry::operator!=) .def("__hash__", [] (const RichEntry& entry) { return Hash::hash(entry); }) .def("__str__", [] (const RichEntry& entry) { std::ostringstream stream; stream << entry; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyRichHeader.cpp000066400000000000000000000047101330725006400213430ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/RichHeader.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (RichHeader::*)(void) const; template using setter_t = void (RichHeader::*)(T); template using no_const_getter = T (RichHeader::*)(void); template<> void create(py::module& m) { py::class_(m, "RichHeader") .def(py::init<>()) .def_property("key", static_cast>(&RichHeader::key), static_cast>(&RichHeader::key), "Key used to encode the header (xor operation)") .def_property_readonly("entries", static_cast>(&RichHeader::entries), "Return binary's " RST_CLASS_REF(lief.PE.RichEntry) " within the header", py::return_value_policy::reference) .def("add_entry", static_cast(&RichHeader::add_entry), "Add a new " RST_CLASS_REF(lief.PE.RichEntry) "", "entry"_a) .def("add_entry", static_cast(&RichHeader::add_entry), "Add a new " RST_CLASS_REF(lief.PE.RichEntry) " given its " ":attr:`~lief.PE.RichEntry.id`, " ":attr:`~lief.PE.RichEntry.build_id`, " ":attr:`~lief.PE.RichEntry.count`", "id"_a, "build_id"_a, "count"_a) .def("__eq__", &RichHeader::operator==) .def("__ne__", &RichHeader::operator!=) .def("__hash__", [] (const RichHeader& rich_header) { return Hash::hash(rich_header); }) .def("__str__", [] (const RichHeader& rich_header) { std::ostringstream stream; stream << rich_header; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pySection.cpp000066400000000000000000000114411330725006400207500ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/Abstract/Section.hpp" #include "LIEF/PE/Section.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (Section::*)(void) const; template using setter_t = void (Section::*)(T); template<> void create
(py::module& m) { py::class_(m, "Section") .def(py::init<>()) .def(py::init&, const std::string&, uint32_t>(), "Constructor from " ":attr:`~lief.PE.Section.content`, " ":attr:`~lief.PE.Section.name` and " ":attr:`~lief.PE.Section.characteristics`", "content"_a, py::arg("name") = "", py::arg("characteristics") = 0) .def(py::init(), "Constructor from " ":attr:`~lief.PE.Section.name`", "name"_a) .def_property("virtual_size", static_cast>(&Section::virtual_size), static_cast>(&Section::virtual_size), "The total size of the section when loaded into " "memory. If this value is greater than " ":attr:`~lief.PE.Section.sizeof_raw_data`, the section is zero-padded. ") .def_property("sizeof_raw_data", static_cast>(&Section::sizeof_raw_data), static_cast>(&Section::sizeof_raw_data), "Alias of :attr:`~lief.PE.Section.size`") .def_property("pointerto_raw_data", static_cast>(&Section::pointerto_raw_data), static_cast>(&Section::pointerto_raw_data), "Alias of :attr:`~lief.PE.Section.offset`") .def_property("pointerto_relocation", static_cast>(&Section::pointerto_relocation), static_cast>(&Section::pointerto_relocation), "The file pointer to the beginning of relocation " "entries for the section. This is set to zero for " "executable images or if there are no " "relocations.") .def_property("pointerto_line_numbers", static_cast>(&Section::pointerto_line_numbers), static_cast>(&Section::pointerto_line_numbers), "The file pointer to the beginning of line-number " "entries for the section. This is set to zero if " "there are no COFF line numbers. This value " "should be zero for an image because COFF " "debugging information is deprecated.") .def_property("numberof_relocations", static_cast>(&Section::numberof_relocations), static_cast>(&Section::numberof_relocations), "The number of relocation entries for the section. " "This is set to zero for executable images.") .def_property("numberof_line_numbers", static_cast>(&Section::numberof_line_numbers), static_cast>(&Section::numberof_line_numbers), "The number of line-number entries for the " "section. This value should be zero for an image " "because COFF debugging information is " "deprecated.") .def_property("characteristics", static_cast>(&Section::characteristics), static_cast>(&Section::characteristics), "The " RST_CLASS_REF(lief.PE.SECTION_CHARACTERISTICS) " that describe the characteristics of the section") .def_property_readonly("characteristics_lists", &Section::characteristics_list, ":attr:`~lief.PE.Section.characteristics` as a ``list``") .def("has_characteristic", &Section::has_characteristic, "``True`` if the a section has the given " RST_CLASS_REF(lief.PE.SECTION_CHARACTERISTICS) "", "characteristic"_a) .def("__eq__", &Section::operator==) .def("__ne__", &Section::operator!=) .def("__hash__", [] (const Section& section) { return Hash::hash(section); }) .def("__str__", [] (const Section& section) { std::ostringstream stream; stream << section; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pySymbol.cpp000066400000000000000000000045671330725006400206240ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/Symbol.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (Symbol::*)(void) const; template using setter_t = void (Symbol::*)(T); template using no_const_getter = T (Symbol::*)(void); template<> void create(py::module& m) { py::class_(m, "Symbol") .def(py::init<>()) .def_property("name", static_cast> (&Symbol::wname), static_cast>(&Symbol::name)) .def_property_readonly("value", &Symbol::value) .def_property_readonly("section_number", &Symbol::section_number) .def_property_readonly("type", &Symbol::type) .def_property_readonly("base_type", &Symbol::base_type) .def_property_readonly("complex_type", &Symbol::complex_type) .def_property_readonly("storage_class", &Symbol::storage_class) .def_property_readonly("numberof_aux_symbols", &Symbol::numberof_aux_symbols) .def_property_readonly("section", static_cast>(&Symbol::section), py::return_value_policy::reference_internal) .def_property_readonly("has_section", &Symbol::has_section, "``True`` if symbols are located in a section") .def("__eq__", &Symbol::operator==) .def("__ne__", &Symbol::operator!=) .def("__hash__", [] (const Symbol& symbol) { return Hash::hash(symbol); }) .def("__str__", [] (const Symbol& symbol) { std::ostringstream stream; stream << symbol; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/pyTLS.cpp000066400000000000000000000120461330725006400200100ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/TLS.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (TLS::*)(void) const; template using setter_t = void (TLS::*)(T); template using no_const_getter = T (TLS::*)(void); template<> void create(py::module& m) { py::class_(m, "TLS") .def(py::init<>(), "Default constructor") .def_property("callbacks", static_cast&>>(&TLS::callbacks), static_cast&>>(&TLS::callbacks), "List of the callbacks called before any other functions") .def_property("addressof_index", static_cast>(&TLS::addressof_index), static_cast>(&TLS::addressof_index), "The location to receive the TLS index, which the " "loader assigns. This location is in an ordinary data " "section, so it can be given a symbolic name that is " "accessible to the program.") .def_property("addressof_callbacks", static_cast>(&TLS::addressof_callbacks), static_cast>(&TLS::addressof_callbacks), "The pointer to an array of TLS callback functions. " "The array is null-terminated, so if no callback " "function is supported, this field points to 4 bytes set " "to zero") .def_property("sizeof_zero_fill", static_cast>(&TLS::sizeof_zero_fill), static_cast>(&TLS::sizeof_zero_fill), "The size in bytes of the template, beyond the " "initialized data delimited by the :attr:`lief.PE.TLS.addressof_raw_data` " "fields. The total template " "size should be the same as the total size of TLS " "data in the image file. The zero fill is the amount of " "data that comes after the initialized nonzero data.") .def_property("characteristics", static_cast>(&TLS::characteristics), static_cast>(&TLS::characteristics), "The four bits [23:20] describe alignment info. " "Possible values are those defined as " "IMAGE_SCN_ALIGN_*, which are also used to " "describe alignment of section in object files. The " "other 28 bits are reserved for future use.") .def_property("addressof_raw_data", static_cast>>(&TLS::addressof_raw_data), static_cast>>(&TLS::addressof_raw_data), "Tuple ``(start address, end address)`` of the TLS template. The " "template is a block of data that is used to initialize " "TLS data. The system copies all of this data each " "time a thread is created, so it must not be " "corrupted. Note that these addresses are not RVA; it is " "addresses for which there should be a base " "relocation in the .reloc section. ") .def_property("data_template", static_cast&>>(&TLS::data_template), static_cast&>>(&TLS::data_template), "The data template content") .def_property_readonly("has_section", &TLS::has_section, "``True`` if there is a " RST_CLASS_REF(lief.PE.Section) " associated with the TLS object") .def_property_readonly("has_data_directory", &TLS::has_data_directory, "``True`` if there is a " RST_CLASS_REF(lief.PE.DataDirectory) " associated with the TLS object") .def_property_readonly("directory", static_cast>(&TLS::directory), "" RST_CLASS_REF(lief.PE.DataDirectory) " associated with the TLS object", py::return_value_policy::reference) .def_property_readonly("section", static_cast>(&TLS::section), "" RST_CLASS_REF(lief.PE.Section) " associated with the TLS object", py::return_value_policy::reference) .def("__eq__", &TLS::operator==) .def("__ne__", &TLS::operator!=) .def("__hash__", [] (const TLS& tls) { return Hash::hash(tls); }) .def("__str__", [] (const TLS& tls) { std::ostringstream stream; stream << tls; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/resources/000077500000000000000000000000001330725006400203005ustar00rootroot00000000000000LIEF-0.9.0/api/python/PE/objects/resources/pyLangCodeItem.cpp000066400000000000000000000071511330725006400236540ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/resources/LangCodeItem.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (LangCodeItem::*)(void) const; template using setter_t = void (LangCodeItem::*)(T); template<> void create(py::module& m) { py::class_(m, "LangCodeItem", "Class which modelize the childs of the " RST_CLASS_REF(lief.PE.ResourceStringFileInfo) "\n\n" "See: https://msdn.microsoft.com/fr-fr/library/windows/desktop/ms646992(v=vs.85).aspx") .def_property("type", static_cast>(&LangCodeItem::type), static_cast>(&LangCodeItem::type), "The type of data in the version resource\n\n" "\t* ``1`` if it contains text data\n\n" "\t* ``0`` if it contains binary data\n\n") .def_property("key", static_cast>(&LangCodeItem::key), static_cast>(&LangCodeItem::key), "A 8-digit hexadecimal number stored as an Unicode string\n\n" "\t* The four most significant digits represent the language identifier.\n\n" "\t* The four least significant digits represent the code page for which the data is formatted.\n\n" "See:\n" "\t* :attr:`~lief.PE.LangCodeItem.code_page`\n\n" "\t* :attr:`~lief.PE.LangCodeItem.lang`\n\n" "\t* :attr:`~lief.PE.LangCodeItem.sublang`\n\n") .def_property("lang", static_cast>(&LangCodeItem::lang), static_cast>(&LangCodeItem::lang), "Lang (" RST_CLASS_REF(lief.PE.RESOURCE_LANGS) ") for which " ":attr:`~lief.PE.LangCodeItem.items` are defined") .def_property("sublang", static_cast>(&LangCodeItem::sublang), static_cast>(&LangCodeItem::sublang), "Sub-lang (" RST_CLASS_REF(lief.PE.RESOURCE_SUBLANGS) ") for which " ":attr:`~lief.PE.LangCodeItem.items` are defined") .def_property("code_page", static_cast>(&LangCodeItem::code_page), static_cast>(&LangCodeItem::code_page), "" RST_CLASS_REF(lief.PE.CODE_PAGES) " for which :attr:`~lief.PE.LangCodeItem.items` are defined") .def_property("items", static_cast& (LangCodeItem::*)(void)>(&LangCodeItem::items), static_cast&>>(&LangCodeItem::items)) .def("__eq__", &LangCodeItem::operator==) .def("__ne__", &LangCodeItem::operator!=) .def("__hash__", [] (const LangCodeItem& item) { return Hash::hash(item); }) .def("__str__", [] (const LangCodeItem& item) { std::ostringstream stream; stream << item; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/resources/pyResourceDialog.cpp000066400000000000000000000141671330725006400242750ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/resources/ResourceDialog.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceDialog::*)(void) const; template using setter_t = void (ResourceDialog::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceDialog") .def_property_readonly("is_extended", &ResourceDialog::is_extended, "``True`` if the dialog is an extended one") .def_property_readonly("version", &ResourceDialog::version, "The version number of the extended dialog box template. This member must be set to 1.") .def_property_readonly("signature", &ResourceDialog::signature, "Indicates whether a template is an extended dialog box template:\n\n" "* ``0xFFFF``: Extended dialog box template\n" "* Other value: Standard dialog box template") .def_property_readonly("help_id", &ResourceDialog::version, "The help context identifier for the dialog box window") .def_property_readonly("x", static_cast>(&ResourceDialog::x), "The x-coordinate, in dialog box units, of the upper-left corner of the dialog box.") .def_property_readonly("y", static_cast>(&ResourceDialog::y), "The y-coordinate, in dialog box units, of the upper-left corner of the dialog box.") .def_property_readonly("cx", static_cast>(&ResourceDialog::cx), "The width, in dialog box units, of the dialog box.") .def_property_readonly("cy", static_cast>(&ResourceDialog::cy), "The height, in dialog box units, of the dialog box.") .def_property_readonly("title", static_cast>(&ResourceDialog::title), "The title of the dialog box") .def_property_readonly("typeface", static_cast>(&ResourceDialog::typeface), "The name of the typeface for the font") .def_property_readonly("weight", static_cast>(&ResourceDialog::weight), "The weight of the font") .def_property_readonly("point_size", static_cast>(&ResourceDialog::point_size), "The point size of the font to use for the text in the dialog box and its controls.") .def_property_readonly("charset", static_cast>(&ResourceDialog::charset), "The character set to be used") .def_property_readonly("style_list", &ResourceDialog::style_list, "Return list of " RST_CLASS_REF(lief.PE.WINDOW_STYLES) " associated with the " ":attr:`~lief.PE.ResourceDialog.style` member") .def_property_readonly("dialogbox_style_list", &ResourceDialog::dialogbox_style_list, "Return list of " RST_CLASS_REF(lief.PE.DIALOG_BOX_STYLES) " associated with the " ":attr:`~lief.PE.ResourceDialog.style` member") .def_property_readonly("extended_style_list", &ResourceDialog::dialogbox_style_list, "Return list of " RST_CLASS_REF(lief.PE.EXTENDED_WINDOW_STYLES) " associated with the " ":attr:`~lief.PE.ResourceDialog.extended_style` member") .def_property_readonly("style", &ResourceDialog::extended_style, "The style of the dialog box. This member can be a combination of " RST_CLASS_REF(lief.PE.WINDOW_STYLES) " and " RST_CLASS_REF(lief.PE.DIALOG_BOX_STYLES) "") .def_property_readonly("extended_style", &ResourceDialog::extended_style, "The extended windows styles (" RST_CLASS_REF(lief.PE.EXTENDED_WINDOW_STYLES) ")") .def_property_readonly("items", &ResourceDialog::items, "Iterator on the controls (" RST_CLASS_REF(lief.PE.ResourceDialogItem) ") that define the Dialog (Button, Label...)") .def("has_style", &ResourceDialog::has_style, "Check if the :attr:`~lief.PE.ResourceDialog.style` member has the given " "" RST_CLASS_REF(lief.PE.WINDOW_STYLES) "", "style"_a) .def("has_dialogbox_style", &ResourceDialog::has_dialogbox_style, "Check if the :attr:`~lief.PE.ResourceDialog.style` member has the given " "" RST_CLASS_REF(lief.PE.DIALOG_BOX_STYLES) "", "style"_a) .def("has_extended_style", &ResourceDialog::has_extended_style, "Check if the :attr:`~lief.PE.ResourceDialog.extended_style` member has the given " "" RST_CLASS_REF(lief.PE.EXTENDED_WINDOW_STYLES) "", "style"_a) .def_property("lang", static_cast>(&ResourceDialog::lang), static_cast>(&ResourceDialog::lang), "Primary " RST_CLASS_REF(lief.PE.RESOURCE_LANGS) " associated with the dialog") .def_property("sub_lang", static_cast>(&ResourceDialog::sub_lang), static_cast>(&ResourceDialog::sub_lang), "Secondary " RST_CLASS_REF(lief.PE.RESOURCE_SUBLANGS) " associated with the dialog") .def("__eq__", &ResourceDialog::operator==) .def("__ne__", &ResourceDialog::operator!=) .def("__hash__", [] (const ResourceDialog& dialog) { return Hash::hash(dialog); }) .def("__str__", [] (const ResourceDialog& dialog) { std::ostringstream stream; stream << dialog; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/resources/pyResourceDialogItem.cpp000066400000000000000000000063041330725006400251060ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/resources/ResourceDialogItem.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceDialogItem::*)(void) const; template using setter_t = void (ResourceDialogItem::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceDialogItem") .def_property_readonly("is_extended", &ResourceDialogItem::is_extended, "``True`` if the control is an extended one") .def_property_readonly("help_id", static_cast>(&ResourceDialogItem::help_id), "The help context identifier for the control") .def_property_readonly("extended_style", static_cast>(&ResourceDialogItem::extended_style), "The extended styles for the window") .def_property_readonly("style", static_cast>(&ResourceDialogItem::style), "The style of the control. This member can be a combination of " "" RST_CLASS_REF(lief.PE.WINDOW_STYLES) " values " "and one or more of the control style values.") .def_property_readonly("x", static_cast>(&ResourceDialogItem::x), "The x-coordinate, in dialog box units, of the upper-left corner of the control") .def_property_readonly("y", static_cast>(&ResourceDialogItem::y), "The y-coordinate, in dialog box units, of the upper-left corner of the control") .def_property_readonly("cx", static_cast>(&ResourceDialogItem::cx), "The width, in dialog box units, of the control") .def_property_readonly("cy", static_cast>(&ResourceDialogItem::cy), "The height, in dialog box units, of the control") .def_property_readonly("id", static_cast>(&ResourceDialogItem::id), "The control identifier") .def_property_readonly("title", static_cast>(&ResourceDialogItem::title), "Initial text of the control") .def("__eq__", &ResourceDialogItem::operator==) .def("__ne__", &ResourceDialogItem::operator!=) .def("__hash__", [] (const ResourceDialogItem& dialog) { return Hash::hash(dialog); }) .def("__str__", [] (const ResourceDialogItem& dialog_item) { std::ostringstream stream; stream << dialog_item; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/resources/pyResourceFixedFileInfo.cpp000066400000000000000000000144361330725006400255500ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/resources/ResourceFixedFileInfo.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceFixedFileInfo::*)(void) const; template using setter_t = void (ResourceFixedFileInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceFixedFileInfo", "Modelization of the `VS_FIXEDFILEINFO `_") .def_property("signature", static_cast>(&ResourceFixedFileInfo::signature), static_cast>(&ResourceFixedFileInfo::signature), "Contains the value ``0xFEEF04BD``") .def_property("struct_version", static_cast>(&ResourceFixedFileInfo::struct_version), static_cast>(&ResourceFixedFileInfo::struct_version), "The binary version number of this structure.\n\n" "\t* The high-order word of this member contains the major version number.\n\n" "\t* The low-order word contains the minor version number\n\n") .def_property("file_version_MS", static_cast>(&ResourceFixedFileInfo::file_version_MS), static_cast>(&ResourceFixedFileInfo::file_version_MS), "The **most** significant 32 bits of the file's binary version number\n\n" "This member is used with :attr:`~lief.PE.ResourceFixedFileInfo.file_version_LS` " "to form a 64-bits value used for numeric comparisons.") .def_property("file_version_LS", static_cast>(&ResourceFixedFileInfo::file_version_LS), static_cast>(&ResourceFixedFileInfo::file_version_LS), "The **least** significant 32 bits of the file's binary version number\n\n" "This member is used with :attr:`~lief.PE.ResourceFixedFileInfo.file_version_MS` " "to form a 64-bits value used for numeric comparisons.") .def_property("product_version_MS", static_cast>(&ResourceFixedFileInfo::product_version_MS), static_cast>(&ResourceFixedFileInfo::product_version_MS), "The **most** significant 32 bits of the product with which this file was distributed\n\n" "This member is used with :attr:`~lief.PE.ResourceFixedFileInfo.product_version_LS` " "to form a 64-bits value used for numeric comparisons.") .def_property("product_version_LS", static_cast>(&ResourceFixedFileInfo::product_version_LS), static_cast>(&ResourceFixedFileInfo::product_version_LS), "The **least** significant 32 bits of the product with which this file was distributed\n\n" "This member is used with :attr:`~lief.PE.ResourceFixedFileInfo.product_version_MS` " "to form a 64-bits value used for numeric comparisons.") .def_property("file_flags_mask", static_cast>(&ResourceFixedFileInfo::file_flags_mask), static_cast>(&ResourceFixedFileInfo::file_flags_mask), "Contains a bitmask that specifies the valid bits in " ":attr:`~lief.PE.ResourceFixedFileInfo.file_flags`.\n\n" "A bit is valid only if it was defined when the file was created.") .def_property("file_flags", static_cast>(&ResourceFixedFileInfo::file_flags), static_cast>(&ResourceFixedFileInfo::file_flags), "Contains a bitmask that specifies the Boolean attributes of the file (" RST_CLASS_REF(lief.PE.FIXED_VERSION_FILE_FLAGS) ")") .def_property("file_os", static_cast>(&ResourceFixedFileInfo::file_os), static_cast>(&ResourceFixedFileInfo::file_os), "The operating system for which this file was designed (" RST_CLASS_REF(lief.PE.FIXED_VERSION_OS) ")") .def_property("file_type", static_cast>(&ResourceFixedFileInfo::file_type), static_cast>(&ResourceFixedFileInfo::file_type), "The general type of file (" RST_CLASS_REF(lief.PE.FIXED_VERSION_FILE_TYPES) ")") .def_property("file_subtype", static_cast>(&ResourceFixedFileInfo::file_subtype), static_cast>(&ResourceFixedFileInfo::file_subtype), "The function of the file (" RST_CLASS_REF(lief.PE.FIXED_VERSION_FILE_SUB_TYPES) ")") .def_property("file_date_MS", static_cast>(&ResourceFixedFileInfo::file_date_MS), static_cast>(&ResourceFixedFileInfo::file_date_MS), "The **most** significant 32 bits of the file's 64-bit binary creation date and time stamp") .def_property("file_date_LS", static_cast>(&ResourceFixedFileInfo::file_date_LS), static_cast>(&ResourceFixedFileInfo::file_date_LS), "The **least** significant 32 bits of the file's 64-bit binary creation date and time stamp") .def("__eq__", &ResourceFixedFileInfo::operator==) .def("__ne__", &ResourceFixedFileInfo::operator!=) .def("__hash__", [] (const ResourceFixedFileInfo& fixed_file_info) { return Hash::hash(fixed_file_info); }) .def("__str__", [] (const ResourceFixedFileInfo& fixed_file_info) { std::ostringstream stream; stream << fixed_file_info; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/resources/pyResourceIcon.cpp000066400000000000000000000072531330725006400237640ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/resources/ResourceIcon.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceIcon::*)(void) const; template using setter_t = void (ResourceIcon::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceIcon") .def(py::init(), "Constructor that takes a icon path as input", "icon_path"_a) .def_property("id", static_cast>(&ResourceIcon::id), static_cast>(&ResourceIcon::id), "Id associated with the icon") .def_property("lang", static_cast>(&ResourceIcon::lang), static_cast>(&ResourceIcon::lang), "Language (" RST_CLASS_REF(lief.PE.RESOURCE_LANGS) ") associated with the icon") .def_property("sublang", static_cast>(&ResourceIcon::sublang), static_cast>(&ResourceIcon::sublang), "Sub language (" RST_CLASS_REF(lief.PE.RESOURCE_SUBLANGS) ") associated with the icon") .def_property("width", static_cast>(&ResourceIcon::width), static_cast>(&ResourceIcon::width), "Width in pixels of the image") .def_property("height", static_cast>(&ResourceIcon::height), static_cast>(&ResourceIcon::height), "Height in pixels of the image") .def_property("color_count", static_cast>(&ResourceIcon::color_count), static_cast>(&ResourceIcon::color_count), "Number of colors in image (0 if >=8bpp)") .def_property("reserved", static_cast>(&ResourceIcon::reserved), static_cast>(&ResourceIcon::reserved), "Reserved (must be 0)") .def_property("planes", static_cast>(&ResourceIcon::planes), static_cast>(&ResourceIcon::planes), "Color Planes") .def_property("bit_count", static_cast>(&ResourceIcon::bit_count), static_cast>(&ResourceIcon::bit_count), "Bits per pixel") .def_property("pixels", static_cast&>>(&ResourceIcon::pixels), static_cast&>>(&ResourceIcon::pixels)) .def("save", &ResourceIcon::save, "Save the icon to the given filepath", "filepath"_a) .def("__eq__", &ResourceIcon::operator==) .def("__ne__", &ResourceIcon::operator!=) .def("__hash__", [] (const ResourceIcon& icon) { return Hash::hash(icon); }) .def("__str__", [] (const ResourceIcon& icon) { std::ostringstream stream; stream << icon; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/resources/pyResourceStringFileInfo.cpp000066400000000000000000000054121330725006400257510ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/resources/ResourceStringFileInfo.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceStringFileInfo::*)(void) const; template using setter_t = void (ResourceStringFileInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceStringFileInfo", "Modelization of the ``StringFileInfo`` structure\n\n" "See: https://msdn.microsoft.com/fr-fr/library/windows/desktop/ms646989(v=vs.85).aspx") .def_property("type", static_cast>(&ResourceStringFileInfo::type), static_cast>(&ResourceStringFileInfo::type), "The type of data in the version resource\n\n" "* ``1`` if it contains text data\n" "* ``0`` if it contains binary data\n") .def_property("key", static_cast>(&ResourceStringFileInfo::key), static_cast>(&ResourceStringFileInfo::key), "Signature of the structure. Must be ``StringFileInfo``") .def_property("langcode_items", static_cast& (ResourceStringFileInfo::*)(void)>(&ResourceStringFileInfo::langcode_items), static_cast&>>(&ResourceStringFileInfo::langcode_items), "List of the LangCodeItem items\n\n" "Each :attr:`~lief.PE.LangCodeItem.key` indicates the appropriate " "language and code page for displaying the ``key: value`` of " ":attr:`~lief.PE.LangCodeItem.items`") .def("__eq__", &ResourceStringFileInfo::operator==) .def("__ne__", &ResourceStringFileInfo::operator!=) .def("__hash__", [] (const ResourceStringFileInfo& string_file_info) { return Hash::hash(string_file_info); }) .def("__str__", [] (const ResourceStringFileInfo& string_file_info) { std::ostringstream stream; stream << string_file_info; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/resources/pyResourceVarFileInfo.cpp000066400000000000000000000054201330725006400252320ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/resources/ResourceVarFileInfo.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceVarFileInfo::*)(void) const; template using setter_t = void (ResourceVarFileInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceVarFileInfo", "This object describes information about languages supported by the application") .def_property("type", static_cast>(&ResourceVarFileInfo::type), static_cast>(&ResourceVarFileInfo::type), "The type of data in the version resource\n\n" "* ``1`` if it contains text data\n" "* ``0`` if it contains binary data\n") .def_property("key", static_cast>(&ResourceVarFileInfo::key), static_cast>(&ResourceVarFileInfo::key), "Signature of the structure. Must be ``VarFileInfo``") .def_property("translations", static_cast& (ResourceVarFileInfo::*)(void)>(&ResourceVarFileInfo::translations), static_cast&>>(&ResourceVarFileInfo::translations), "List of languages that the application supports\n\n" "The **least** significant 16-bits must contain a Microsoft language identifier, " "and the **most** significant 16-bits must contain the " RST_CLASS_REF(lief.PE.CODE_PAGES) "\n" "Either **most** or **least** 16-bits can be zero, indicating that the file is " "language or code page independent.") .def("__eq__", &ResourceVarFileInfo::operator==) .def("__ne__", &ResourceVarFileInfo::operator!=) .def("__hash__", [] (const ResourceVarFileInfo& var_file_info) { return Hash::hash(var_file_info); }) .def("__str__", [] (const ResourceVarFileInfo& var_file_info) { std::ostringstream stream; stream << var_file_info; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/resources/pyResourceVersion.cpp000066400000000000000000000110351330725006400245120ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/hash.hpp" #include "LIEF/PE/resources/ResourceVersion.hpp" #include #include namespace LIEF { namespace PE { template using getter_t = T (ResourceVersion::*)(void) const; template using setter_t = void (ResourceVersion::*)(T); template<> void create(py::module& m) { py::class_(m, "ResourceVersion", "Modelization of the data associated with the ``RT_VERSION`` entry\n" "See: `VS_VERSIONINFO `_") .def_property("type", static_cast>(&ResourceVersion::type), static_cast>(&ResourceVersion::type), "The type of data in the version resource\n\n" "* ``1`` if it contains text data\n" "* ``0`` if it contains binary data\n") .def_property("key", static_cast>(&ResourceVersion::key), static_cast>(&ResourceVersion::key), "Signature of the structure. Must be ``VS_VERSION_INFO``") .def_property("fixed_file_info", static_cast>(&ResourceVersion::fixed_file_info), static_cast>(&ResourceVersion::fixed_file_info), "" RST_CLASS_REF(lief.PE.ResourceFixedFileInfo) " associated with the version (if any).\n\n" "This object describes various information about the application's version") .def_property("string_file_info", static_cast>(&ResourceVersion::string_file_info), static_cast>(&ResourceVersion::string_file_info), "" RST_CLASS_REF(lief.PE.ResourceStringFileInfo) " associated with the version (if any)\n\n" "This object describes various information about the application's version.\n" "The underlying structure is basically a dictionary (key/value)") .def_property("var_file_info", static_cast>(&ResourceVersion::var_file_info), static_cast>(&ResourceVersion::var_file_info), "" RST_CLASS_REF(lief.PE.ResourceVarFileInfo) " associated with the version (if any)\n\n" "This object describes information about languages supported by the application") .def_property_readonly("has_fixed_file_info", &ResourceVersion::has_fixed_file_info, "``True`` if the version contains a " RST_CLASS_REF(lief.PE.ResourceFixedFileInfo) "") .def_property_readonly("has_string_file_info", &ResourceVersion::has_string_file_info, "``True`` if the version contains a " RST_CLASS_REF(lief.PE.ResourceStringFileInfo) "") .def_property_readonly("has_var_file_info", &ResourceVersion::has_var_file_info, "``True`` if the version contains a " RST_CLASS_REF(lief.PE.ResourceVarFileInfo) "") .def("remove_fixed_file_info", &ResourceVersion::remove_fixed_file_info, "Remove the " RST_CLASS_REF(lief.PE.ResourceFixedFileInfo) " from the version") .def("remove_string_file_info", &ResourceVersion::remove_string_file_info, "Remove the " RST_CLASS_REF(lief.PE.ResourceStringFileInfo) " from the version") .def("remove_var_file_info", &ResourceVersion::remove_var_file_info, "Remove the " RST_CLASS_REF(lief.PE.ResourceVarFileInfo) " from the version") .def("__eq__", &ResourceVersion::operator==) .def("__ne__", &ResourceVersion::operator!=) .def("__hash__", [] (const ResourceVersion& version) { return Hash::hash(version); }) .def("__str__", [] (const ResourceVersion& version) { std::ostringstream stream; stream << version; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/signature/000077500000000000000000000000001330725006400202675ustar00rootroot00000000000000LIEF-0.9.0/api/python/PE/objects/signature/pyAuthenticatedAttributes.cpp000066400000000000000000000042171330725006400262010ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/PE/hash.hpp" #include "LIEF/utils.hpp" #include "LIEF/PE/signature/AuthenticatedAttributes.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { template using getter_t = T (AuthenticatedAttributes::*)(void) const; template using setter_t = void (AuthenticatedAttributes::*)(T); template<> void create(py::module& m) { py::class_(m, "AuthenticatedAttributes") .def_property_readonly("content_type", &AuthenticatedAttributes::content_type, "Should return the ``messageDigest`` OID") .def_property_readonly("message_digest", &AuthenticatedAttributes::message_digest, "Return an hash of the signed attributes") .def_property_readonly("program_name", [] (const AuthenticatedAttributes& authenticated_attributes) { return safe_string_converter(LIEF::u16tou8(authenticated_attributes.program_name())); }, "Return the program description (if any)") .def_property_readonly("more_info", [] (const AuthenticatedAttributes& obj) { return safe_string_converter(obj.more_info()); }, "Return an URL to website with more information about the signer") .def("__str__", [] (const AuthenticatedAttributes& authenticated_attributes) { std::ostringstream stream; stream << authenticated_attributes; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/signature/pyContentInfo.cpp000066400000000000000000000034141330725006400235740ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/PE/hash.hpp" #include "LIEF/PE/signature/ContentInfo.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { template using getter_t = T (ContentInfo::*)(void) const; template using setter_t = void (ContentInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "ContentInfo") .def_property_readonly("content_type", &ContentInfo::content_type, "OID of the content type. This value should match ``SPC_INDIRECT_DATA_OBJID``") .def_property_readonly("type", &ContentInfo::type) .def_property_readonly("digest_algorithm", &ContentInfo::digest_algorithm, "Algorithm (OID) used to hash the file. This value should match SignerInfo.digest_algorithm and Signature.digest_algorithm") .def_property_readonly("digest", &ContentInfo::digest, "The digest") .def("__str__", [] (const ContentInfo& content_info) { std::ostringstream stream; stream << content_info; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/signature/pySignature.cpp000066400000000000000000000042621330725006400233110ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/PE/hash.hpp" #include "LIEF/PE/signature/Signature.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { template using getter_t = T (Signature::*)(void) const; template using setter_t = void (Signature::*)(T); template<> void create(py::module& m) { py::class_(m, "Signature") .def_property_readonly("version", &Signature::version, "Should be 1") .def_property_readonly("digest_algorithm", &Signature::digest_algorithm, "Return the algorithm (OID) used to sign the content of " RST_CLASS_REF(lief.PE.ContentInfo) "") .def_property_readonly("content_info", &Signature::content_info, "Return the " RST_CLASS_REF(lief.PE.ContentInfo) "", py::return_value_policy::reference) .def_property_readonly("certificates", &Signature::certificates, "Return an iterator over " RST_CLASS_REF(lief.PE.x509) " certificates", py::return_value_policy::reference) .def_property_readonly("signer_info", &Signature::signer_info, "Return the " RST_CLASS_REF(lief.PE.SignerInfo) "", py::return_value_policy::reference) .def_property_readonly("original_signature", &Signature::original_signature, "Return the raw original signature") .def("__str__", [] (const Signature& signature) { std::ostringstream stream; stream << signature; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/signature/pySignerInfo.cpp000066400000000000000000000043071330725006400234130ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/PE/hash.hpp" #include "LIEF/PE/signature/SignerInfo.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { template using getter_t = T (SignerInfo::*)(void) const; template using setter_t = void (SignerInfo::*)(T); template<> void create(py::module& m) { py::class_(m, "SignerInfo") .def_property_readonly("version", &SignerInfo::version, "Should be 1") .def_property_readonly("issuer", &SignerInfo::issuer, "Issuer and serial number", py::return_value_policy::reference) .def_property_readonly("digest_algorithm", &SignerInfo::digest_algorithm, "Algorithm (OID) used to hash the file. This value should match ContentInfo.digest_algorithm and Signature.digest_algorithm") .def_property_readonly("signature_algorithm", &SignerInfo::signature_algorithm, "Return the signature algorithm (OID)") .def_property_readonly("encrypted_digest", &SignerInfo::encrypted_digest, "Return the signature created by the signing certificate's private key") .def_property_readonly("authenticated_attributes", &SignerInfo::authenticated_attributes, "Return the " RST_CLASS_REF(lief.PE.AuthenticatedAttributes) " object", py::return_value_policy::reference) .def("__str__", [] (const SignerInfo& signer_info) { std::ostringstream stream; stream << signer_info; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/objects/signature/pyx509.cpp000066400000000000000000000041411330725006400220510ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "LIEF/PE/hash.hpp" #include "LIEF/PE/signature/x509.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { template using getter_t = T (x509::*)(void) const; template using setter_t = void (x509::*)(T); template<> void create(py::module& m) { py::class_(m, "x509") .def_property_readonly("version", &x509::version, "X.509 version. (1=v1, 2=v2, 3=v3)") .def_property_readonly("serial_number", &x509::serial_number, "Unique id for certificate issued by a specific CA.") .def_property_readonly("signature_algorithm", &x509::signature_algorithm, "Signature algorithm (OID)") .def_property_readonly("valid_from", &x509::valid_from, "Start time of certificate validity") .def_property_readonly("valid_to", &x509::valid_to, "End time of certificate validity") .def_property_readonly("issuer", [] (const x509& object) { return safe_string_converter(object.issuer()); }, "Issuer informations") .def_property_readonly("subject", [] (const x509& object) { return safe_string_converter(object.subject()); }, "Subject informations") .def("__str__", [] (const x509& x509_crt) { std::ostringstream stream; stream << x509_crt; std::string str = stream.str(); return str; }); } } } LIEF-0.9.0/api/python/PE/pyEnums.cpp000066400000000000000000001604011330725006400170030ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/Structures.hpp" #include "LIEF/PE/EnumToString.hpp" #include "enums_wrapper.hpp" #define PY_ENUM(x) LIEF::PE::to_string(x), x namespace LIEF { namespace PE { void init_enums(py::module& m) { LIEF::enum_(m, "PE_TYPE") .value(PY_ENUM(LIEF::PE::PE_TYPE::PE32)) .value(PY_ENUM(LIEF::PE::PE_TYPE::PE32_PLUS)); LIEF::enum_(m, "MACHINE_TYPES") .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::MT_Invalid)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_UNKNOWN)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_AM33)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_AMD64)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_ARM)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_ARMNT)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_EBC)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_I386)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_IA64)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_M32R)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_MIPS16)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_MIPSFPU)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_MIPSFPU16)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_POWERPC)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_POWERPCFP)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_R4000)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_SH3)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_SH3DSP)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_SH4)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_SH5)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_THUMB)) .value(PY_ENUM(LIEF::PE::MACHINE_TYPES::IMAGE_FILE_MACHINE_WCEMIPSV2)); LIEF::enum_(m, "HEADER_CHARACTERISTICS", py::arithmetic()) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_RELOCS_STRIPPED)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_EXECUTABLE_IMAGE)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_LINE_NUMS_STRIPPED)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_LOCAL_SYMS_STRIPPED)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_AGGRESSIVE_WS_TRIM)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_LARGE_ADDRESS_AWARE)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_BYTES_REVERSED_LO)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_32BIT_MACHINE)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_DEBUG_STRIPPED)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_NET_RUN_FROM_SWAP)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_SYSTEM)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_DLL)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_UP_SYSTEM_ONLY)) .value(PY_ENUM(LIEF::PE::HEADER_CHARACTERISTICS::IMAGE_FILE_BYTES_REVERSED_HI)); LIEF::enum_(m, "SUBSYSTEM") .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_UNKNOWN)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_NATIVE)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_WINDOWS_GUI)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_WINDOWS_CUI)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_OS2_CUI)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_POSIX_CUI)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_NATIVE_WINDOWS)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_WINDOWS_CE_GUI)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_EFI_APPLICATION)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_EFI_ROM)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_XBOX)) .value(PY_ENUM(LIEF::PE::SUBSYSTEM::IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION)); LIEF::enum_(m, "DATA_DIRECTORY") .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::EXPORT_TABLE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::IMPORT_TABLE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::RESOURCE_TABLE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::EXCEPTION_TABLE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::CERTIFICATE_TABLE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::BASE_RELOCATION_TABLE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::DEBUG)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::ARCHITECTURE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::GLOBAL_PTR)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::TLS_TABLE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::LOAD_CONFIG_TABLE)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::BOUND_IMPORT)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::IAT)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::DELAY_IMPORT_DESCRIPTOR)) .value(PY_ENUM(LIEF::PE::DATA_DIRECTORY::CLR_RUNTIME_HEADER)); LIEF::enum_(m, "DLL_CHARACTERISTICS", py::arithmetic()) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_NX_COMPAT)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_NO_SEH)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_NO_BIND)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_APPCONTAINER)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_GUARD_CF)) .value(PY_ENUM(LIEF::PE::DLL_CHARACTERISTICS::IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE)); LIEF::enum_(m, "SECTION_CHARACTERISTICS", py::arithmetic()) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_TYPE_NO_PAD)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_CNT_CODE)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_CNT_INITIALIZED_DATA)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_CNT_UNINITIALIZED_DATA)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_LNK_OTHER)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_LNK_INFO)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_LNK_REMOVE)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_LNK_COMDAT)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_GPREL)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_PURGEABLE)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_16BIT)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_LOCKED)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_PRELOAD)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_1BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_2BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_4BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_8BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_16BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_32BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_64BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_128BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_256BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_512BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_1024BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_2048BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_4096BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_ALIGN_8192BYTES)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_LNK_NRELOC_OVFL)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_DISCARDABLE)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_NOT_CACHED)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_NOT_PAGED)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_SHARED)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_EXECUTE)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_READ)) .value(PY_ENUM(LIEF::PE::SECTION_CHARACTERISTICS::IMAGE_SCN_MEM_WRITE)); LIEF::enum_(m, "SECTION_TYPES") .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::TEXT)) .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::TLS)) .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::IMPORT)) .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::DATA)) .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::BSS)) .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::RESOURCE)) .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::RELOCATION)) .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::EXPORT)) .value(PY_ENUM(LIEF::PE::PE_SECTION_TYPES::UNKNOWN)); LIEF::enum_(m, "SYMBOL_BASE_TYPES") .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_NULL)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_VOID)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_CHAR)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_SHORT)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_INT)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_LONG)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_FLOAT)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_DOUBLE)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_STRUCT)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_UNION)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_ENUM)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_MOE)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_BYTE)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_WORD)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_UINT)) .value(PY_ENUM(LIEF::PE::SYMBOL_BASE_TYPES::IMAGE_SYM_TYPE_DWORD)); LIEF::enum_(m, "SYMBOL_COMPLEX_TYPES") .value(PY_ENUM(LIEF::PE::SYMBOL_COMPLEX_TYPES::IMAGE_SYM_DTYPE_NULL)) .value(PY_ENUM(LIEF::PE::SYMBOL_COMPLEX_TYPES::IMAGE_SYM_DTYPE_POINTER)) .value(PY_ENUM(LIEF::PE::SYMBOL_COMPLEX_TYPES::IMAGE_SYM_DTYPE_FUNCTION)) .value(PY_ENUM(LIEF::PE::SYMBOL_COMPLEX_TYPES::IMAGE_SYM_DTYPE_ARRAY)) .value(PY_ENUM(LIEF::PE::SYMBOL_COMPLEX_TYPES::SCT_COMPLEX_TYPE_SHIFT)); LIEF::enum_(m, "SYMBOL_SECTION_NUMBER") .value(PY_ENUM(LIEF::PE::SYMBOL_SECTION_NUMBER::IMAGE_SYM_DEBUG)) .value(PY_ENUM(LIEF::PE::SYMBOL_SECTION_NUMBER::IMAGE_SYM_ABSOLUTE)) .value(PY_ENUM(LIEF::PE::SYMBOL_SECTION_NUMBER::IMAGE_SYM_UNDEFINED)); LIEF::enum_(m, "SYMBOL_STORAGE_CLASS") .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_END_OF_FUNCTION)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_NULL)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_AUTOMATIC)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_EXTERNAL)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_STATIC)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_REGISTER)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_EXTERNAL_DEF)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_LABEL)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_UNDEFINED_LABEL)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_MEMBER_OF_STRUCT)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_UNION_TAG)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_TYPE_DEFINITION)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_UNDEFINED_STATIC)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_ENUM_TAG)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_MEMBER_OF_ENUM)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_REGISTER_PARAM)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_BIT_FIELD)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_BLOCK)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_FUNCTION)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_END_OF_STRUCT)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_FILE)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_SECTION)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_WEAK_EXTERNAL)) .value(PY_ENUM(LIEF::PE::SYMBOL_STORAGE_CLASS::IMAGE_SYM_CLASS_CLR_TOKEN)); LIEF::enum_(m, "RELOCATIONS_BASE_TYPES") .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_ABSOLUTE)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_HIGH)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_LOW)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_HIGHLOW)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_HIGHADJ)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_MIPS_JMPADDR)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_SECTION)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_REL)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_MIPS_JMPADDR16)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_IA64_IMM64)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_DIR64)) .value(PY_ENUM(LIEF::PE::RELOCATIONS_BASE_TYPES::IMAGE_REL_BASED_HIGH3ADJ)); LIEF::enum_(m, "DEBUG_TYPES") .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_UNKNOWN)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_COFF)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_CODEVIEW)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_FPO)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_MISC)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_EXCEPTION)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_FIXUP)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_OMAP_TO_SRC)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_OMAP_FROM_SRC)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_BORLAND)) .value(PY_ENUM(LIEF::PE::DEBUG_TYPES::IMAGE_DEBUG_TYPE_CLSID)); LIEF::enum_(m, "RESOURCE_TYPES") .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::CURSOR)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::BITMAP)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::ICON)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::MENU)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::DIALOG)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::STRING)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::FONTDIR)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::FONT)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::ACCELERATOR)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::RCDATA)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::MESSAGETABLE)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::GROUP_CURSOR)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::GROUP_ICON)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::VERSION)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::DLGINCLUDE)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::PLUGPLAY)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::VXD)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::ANICURSOR)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::ANIICON)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::HTML)) .value(PY_ENUM(LIEF::PE::RESOURCE_TYPES::MANIFEST)); LIEF::enum_(m, "RESOURCE_LANGS") .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_NEUTRAL)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_INVARIANT)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_AFRIKAANS)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ALBANIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ARABIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ARMENIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ASSAMESE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_AZERI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_BASQUE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_BELARUSIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_BANGLA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_BULGARIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_CATALAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_CHINESE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_CROATIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_BOSNIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_CZECH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_DANISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_DIVEHI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_DUTCH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ENGLISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ESTONIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_FAEROESE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_FARSI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_FINNISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_FRENCH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_GALICIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_GEORGIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_GERMAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_GREEK)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_GUJARATI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_HEBREW)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_HINDI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_HUNGARIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ICELANDIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_INDONESIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ITALIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_JAPANESE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_KANNADA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_KASHMIRI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_KAZAK)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_KONKANI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_KOREAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_KYRGYZ)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_LATVIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_LITHUANIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_MACEDONIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_MALAY)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_MALAYALAM)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_MANIPURI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_MARATHI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_MONGOLIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_NEPALI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_NORWEGIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ORIYA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_POLISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_PORTUGUESE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_PUNJABI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ROMANIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_RUSSIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SANSKRIT)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SERBIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SINDHI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SLOVAK)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SLOVENIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SPANISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SWAHILI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SWEDISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SYRIAC)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_TAMIL)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_TATAR)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_TELUGU)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_THAI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_TURKISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_UKRAINIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_URDU)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_UZBEK)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_VIETNAMESE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_GAELIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_MALTESE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_MAORI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_RHAETO_ROMANCE)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SAMI)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SORBIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_SUTU)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_TSONGA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_TSWANA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_VENDA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_XHOSA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ZULU)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_ESPERANTO)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_WALON)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_CORNISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_WELSH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_BRETON)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_INUKTITUT)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_IRISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_LOWER_SORBIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_PULAR)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_QUECHUA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_TAMAZIGHT)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_TIGRINYA)) .value(PY_ENUM(LIEF::PE::RESOURCE_LANGS::LANG_VALENCIAN)); LIEF::enum_(m, "RESOURCE_SUBLANGS") .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_AFRIKAANS_SOUTH_AFRICA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ALBANIAN_ALBANIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ALSATIAN_FRANCE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_AMHARIC_ETHIOPIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_ALGERIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_BAHRAIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_EGYPT)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_IRAQ)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_JORDAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_KUWAIT)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_LEBANON)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_LIBYA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_MOROCCO)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_OMAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_QATAR)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_SAUDI_ARABIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_SYRIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_TUNISIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_UAE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARABIC_YEMEN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ARMENIAN_ARMENIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ASSAMESE_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_AZERI_CYRILLIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_AZERI_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BASHKIR_RUSSIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BASQUE_BASQUE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BELARUSIAN_BELARUS)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BANGLA_BANGLADESH)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BANGLA_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BRETON_FRANCE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_BULGARIAN_BULGARIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CATALAN_CATALAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CHINESE_HONGKONG)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CHINESE_MACAU)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CHINESE_SIMPLIFIED)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CHINESE_SINGAPORE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CHINESE_TRADITIONAL)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CORSICAN_FRANCE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CROATIAN_CROATIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CUSTOM_DEFAULT)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CUSTOM_UNSPECIFIED)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_CZECH_CZECH_REPUBLIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_DANISH_DENMARK)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_DARI_AFGHANISTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_DEFAULT)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_DIVEHI_MALDIVES)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_DUTCH_BELGIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_DUTCH)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_AUS)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_BELIZE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_CAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_CARIBBEAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_EIRE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_JAMAICA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_MALAYSIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_NZ)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_PHILIPPINES)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_SINGAPORE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_SOUTH_AFRICA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_TRINIDAD)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_UK)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_US)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_ZIMBABWE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ENGLISH_IRELAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ESTONIAN_ESTONIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FAEROESE_FAROE_ISLANDS)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FILIPINO_PHILIPPINES)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FINNISH_FINLAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FRENCH_BELGIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FRENCH_CANADIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FRENCH_LUXEMBOURG)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FRENCH_MONACO)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FRENCH_SWISS)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FRENCH)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_FRISIAN_NETHERLANDS)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GALICIAN_GALICIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GEORGIAN_GEORGIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GERMAN_AUSTRIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GERMAN_LIECHTENSTEIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GERMAN_LUXEMBOURG)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GERMAN_SWISS)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GERMAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GREEK_GREECE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GREENLANDIC_GREENLAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_GUJARATI_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_HAUSA_NIGERIA_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_HEBREW_ISRAEL)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_HINDI_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_HUNGARIAN_HUNGARY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ICELANDIC_ICELAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_IGBO_NIGERIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_INDONESIAN_INDONESIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_INUKTITUT_CANADA_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_INUKTITUT_CANADA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_IRISH_IRELAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ITALIAN_SWISS)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ITALIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_JAPANESE_JAPAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KANNADA_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KASHMIRI_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KASHMIRI_SASIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KAZAK_KAZAKHSTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KHMER_CAMBODIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KICHE_GUATEMALA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KINYARWANDA_RWANDA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KONKANI_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KOREAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_KYRGYZ_KYRGYZSTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_LAO_LAO)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_LATVIAN_LATVIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_LITHUANIAN_CLASSIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_LITHUANIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_LOWER_SORBIAN_GERMANY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_LUXEMBOURGISH_LUXEMBOURG)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MACEDONIAN_MACEDONIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MALAY_BRUNEI_DARUSSALAM)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MALAY_MALAYSIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MALAYALAM_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MALTESE_MALTA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MAORI_NEW_ZEALAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MAPUDUNGUN_CHILE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MARATHI_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MOHAWK_MOHAWK)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_MONGOLIAN_PRC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_NEPALI_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_NEPALI_NEPAL)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_NEUTRAL)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_NORWEGIAN_BOKMAL)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_NORWEGIAN_NYNORSK)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_OCCITAN_FRANCE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ORIYA_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_PASHTO_AFGHANISTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_PERSIAN_IRAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_POLISH_POLAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_PORTUGUESE_BRAZILIAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_PORTUGUESE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_PUNJABI_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_QUECHUA_BOLIVIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_QUECHUA_ECUADOR)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_QUECHUA_PERU)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ROMANIAN_ROMANIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ROMANSH_SWITZERLAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_RUSSIAN_RUSSIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_INARI_FINLAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_LULE_NORWAY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_LULE_SWEDEN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_NORTHERN_FINLAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_NORTHERN_NORWAY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_NORTHERN_SWEDEN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_SKOLT_FINLAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_SOUTHERN_NORWAY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SAMI_SOUTHERN_SWEDEN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SANSKRIT_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SERBIAN_CROATIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SERBIAN_CYRILLIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SERBIAN_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SINDHI_AFGHANISTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SINDHI_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SINDHI_PAKISTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SINHALESE_SRI_LANKA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SLOVAK_SLOVAKIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SLOVENIAN_SLOVENIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_ARGENTINA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_BOLIVIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_CHILE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_COLOMBIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_COSTA_RICA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_DOMINICAN_REPUBLIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_ECUADOR)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_EL_SALVADOR)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_GUATEMALA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_HONDURAS)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_MEXICAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_MODERN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_NICARAGUA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_PANAMA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_PARAGUAY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_PERU)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_PUERTO_RICO)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_URUGUAY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_US)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH_VENEZUELA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SPANISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SWAHILI_KENYA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SWEDISH_FINLAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SWEDISH)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SYRIAC_SYRIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_SYS_DEFAULT)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TAJIK_TAJIKISTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TAMAZIGHT_ALGERIA_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TAMIL_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TATAR_RUSSIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TELUGU_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_THAI_THAILAND)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TIBETAN_PRC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TIGRIGNA_ERITREA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TSWANA_SOUTH_AFRICA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TURKISH_TURKEY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TURKMEN_TURKMENISTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_UI_CUSTOM_DEFAULT)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_UIGHUR_PRC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_UKRAINIAN_UKRAINE)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_UPPER_SORBIAN_GERMANY)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_URDU_INDIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_URDU_PAKISTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_UZBEK_CYRILLIC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_UZBEK_LATIN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_VIETNAMESE_VIETNAM)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_WELSH_UNITED_KINGDOM)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_WOLOF_SENEGAL)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_XHOSA_SOUTH_AFRICA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_YAKUT_RUSSIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_YI_PRC)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_YORUBA_NIGERIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_ZULU_SOUTH_AFRICA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_PULAR_SENEGAL)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_PUNJABI_PAKISTAN)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TSWANA_BOTSWANA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TAMIL_SRI_LANKA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TIGRINYA_ETHIOPIA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_TIGRINYA_ERITREA)) .value(PY_ENUM(LIEF::PE::RESOURCE_SUBLANGS::SUBLANG_VALENCIAN_VALENCIA)); LIEF::enum_(m, "EXTENDED_WINDOW_STYLES") .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_DLGMODALFRAME)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_NOPARENTNOTIFY)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_TOPMOST)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_ACCEPTFILES)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_TRANSPARENT)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_MDICHILD)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_TOOLWINDOW)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_WINDOWEDGE)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_CLIENTEDGE)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_CONTEXTHELP)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_RIGHT)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_LEFT)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_RTLREADING)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_LTRREADING)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_LEFTSCROLLBAR)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_RIGHTSCROLLBAR)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_CONTROLPARENT)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_STATICEDGE)) .value(PY_ENUM(LIEF::PE::EXTENDED_WINDOW_STYLES::WS_EX_APPWINDOW)); LIEF::enum_(m, "WINDOW_STYLES") .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_OVERLAPPED)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_POPUP)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_CHILD)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_MINIMIZE)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_VISIBLE)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_DISABLED)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_CLIPSIBLINGS)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_CLIPCHILDREN)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_MAXIMIZE)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_CAPTION)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_BORDER)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_DLGFRAME)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_VSCROLL)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_HSCROLL)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_SYSMENU)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_THICKFRAME)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_GROUP)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_TABSTOP)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_MINIMIZEBOX)) .value(PY_ENUM(LIEF::PE::WINDOW_STYLES::WS_MAXIMIZEBOX)); LIEF::enum_(m, "DIALOG_BOX_STYLES") .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_ABSALIGN)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_SYSMODAL)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_LOCALEDIT)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_SETFONT)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_MODALFRAME)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_NOIDLEMSG)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_SETFOREGROUND)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_3DLOOK)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_FIXEDSYS)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_NOFAILCREATE)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_CONTROL)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_CENTER)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_CENTERMOUSE)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_CONTEXTHELP)) .value(PY_ENUM(LIEF::PE::DIALOG_BOX_STYLES::DS_SHELLFONT)); LIEF::enum_(m, "FIXED_VERSION_OS") .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_UNKNOWN)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_DOS)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_NT)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS__WINDOWS16)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS__WINDOWS32)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_OS216)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_OS232)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS__PM16)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS__PM32)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_DOS_WINDOWS16)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_DOS_WINDOWS32)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_NT_WINDOWS32)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_OS216_PM16)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_OS::VOS_OS232_PM32)); LIEF::enum_(m, "FIXED_VERSION_FILE_FLAGS") .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_FLAGS::VS_FF_DEBUG)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_FLAGS::VS_FF_INFOINFERRED)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_FLAGS::VS_FF_PATCHED)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_FLAGS::VS_FF_PRERELEASE)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_FLAGS::VS_FF_PRIVATEBUILD)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_FLAGS::VS_FF_SPECIALBUILD)); LIEF::enum_(m, "FIXED_VERSION_FILE_TYPES") .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_TYPES::VFT_APP)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_TYPES::VFT_DLL)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_TYPES::VFT_DRV)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_TYPES::VFT_FONT)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_TYPES::VFT_STATIC_LIB)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_TYPES::VFT_UNKNOWN)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_TYPES::VFT_VXD)); LIEF::enum_(m, "FIXED_VERSION_FILE_SUB_TYPES") .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_COMM)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_DISPLAY)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_INSTALLABLE)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_KEYBOARD)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_LANGUAGE)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_MOUSE)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_NETWORK)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_PRINTER)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_SOUND)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_SYSTEM)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_DRV_VERSIONED_PRINTER)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_FONT_RASTER)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_FONT_TRUETYPE)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_FONT_VECTOR)) .value(PY_ENUM(LIEF::PE::FIXED_VERSION_FILE_SUB_TYPES::VFT2_UNKNOWN)); LIEF::enum_(m, "CODE_PAGES") .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM037)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM437)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM500)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ASMO_708)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_DOS_720)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM737)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM775)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM850)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM852)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM855)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM857)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM00858)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM860)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM861)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_DOS_862)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM863)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM864)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM865)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_CP866)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM869)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM870)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_874)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_CP875)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_SHIFT_JIS)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_GB2312)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_KS_C_5601_1987)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_BIG5)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM1026)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01047)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01140)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01141)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01142)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01143)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01144)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01145)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01146)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01147)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01148)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM01149)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_UTF_16)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_UNICODEFFFE)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1250)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1251)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1252)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1253)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1254)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1255)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1256)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1257)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_WINDOWS_1258)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_JOHAB)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_MACINTOSH)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_JAPANESE)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_CHINESETRAD)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_KOREAN)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_ARABIC)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_HEBREW)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_GREEK)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_CYRILLIC)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_CHINESESIMP)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_ROMANIAN)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_UKRAINIAN)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_THAI)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_CE)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_ICELANDIC)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_TURKISH)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_MAC_CROATIAN)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_UTF_32)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_UTF_32BE)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CHINESE_CNS)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP20001)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CHINESE_ETEN)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP20003)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP20004)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP20005)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_IA5)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_IA5_GERMAN)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_IA5_SWEDISH)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_IA5_NORWEGIAN)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_US_ASCII)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP20261)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP20269)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM273)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM277)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM278)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM280)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM284)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM285)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM290)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM297)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM420)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM423)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM424)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_EBCDIC_KOREANEXTENDED)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM_THAI)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_KOI8_R)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM871)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM880)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM905)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_IBM00924)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_EUC_JP_JIS)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP20936)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP20949)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_CP1025)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_KOI8_U)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_1)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_2)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_3)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_4)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_5)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_6)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_7)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_8)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_9)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_13)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_15)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_EUROPA)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_8859_8_I)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_2022_JP)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_CSISO2022JP)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_2022_JP_JIS)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_ISO_2022_KR)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_CP50227)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_EUC_JP)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_EUC_CN)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_EUC_KR)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_HZ_GB_2312)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_GB18030)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_DE)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_BE)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_TA)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_TE)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_AS)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_OR)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_KA)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_MA)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_GU)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_X_ISCII_PA)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_UTF_7)) .value(PY_ENUM(LIEF::PE::CODE_PAGES::CP_UTF_8)); LIEF::enum_(m, "WIN_VERSION") .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN_UNKNOWN)) .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN_SEH)) .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN8_1)) .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN10_0_9879)) .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN10_0_14286)) .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN10_0_14383)) .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN10_0_14901)) .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN10_0_15002)) .value(PY_ENUM(LIEF::PE::WIN_VERSION::WIN10_0_16237)); LIEF::enum_(m, "GUARD_CF_FLAGS", py::arithmetic()) .value(PY_ENUM(LIEF::PE::GUARD_CF_FLAGS::GCF_NONE)) .value(PY_ENUM(LIEF::PE::GUARD_CF_FLAGS::GCF_INSTRUMENTED)) .value(PY_ENUM(LIEF::PE::GUARD_CF_FLAGS::GCF_W_INSTRUMENTED)) .value(PY_ENUM(LIEF::PE::GUARD_CF_FLAGS::GCF_FUNCTION_TABLE_PRESENT)) .value(PY_ENUM(LIEF::PE::GUARD_CF_FLAGS::GCF_EXPORT_SUPPRESSION_INFO_PRESENT)) .value(PY_ENUM(LIEF::PE::GUARD_CF_FLAGS::GCF_ENABLE_EXPORT_SUPPRESSION)) .value(PY_ENUM(LIEF::PE::GUARD_CF_FLAGS::GCF_LONGJUMP_TABLE_PRESENT)); LIEF::enum_(m, "GUARD_RF_FLAGS", py::arithmetic()) .value(PY_ENUM(LIEF::PE::GUARD_RF_FLAGS::GRF_INSTRUMENTED)) .value(PY_ENUM(LIEF::PE::GUARD_RF_FLAGS::GRF_ENABLE)) .value(PY_ENUM(LIEF::PE::GUARD_RF_FLAGS::GRF_STRICT)); LIEF::enum_(m, "CODE_VIEW_SIGNATURES") .value(PY_ENUM(LIEF::PE::CODE_VIEW_SIGNATURES::CVS_UNKNOWN)) .value(PY_ENUM(LIEF::PE::CODE_VIEW_SIGNATURES::CVS_PDB_70)) .value(PY_ENUM(LIEF::PE::CODE_VIEW_SIGNATURES::CVS_PDB_20)) .value(PY_ENUM(LIEF::PE::CODE_VIEW_SIGNATURES::CVS_CV_50)) .value(PY_ENUM(LIEF::PE::CODE_VIEW_SIGNATURES::CVS_CV_41)); } } } LIEF-0.9.0/api/python/PE/pyPE.cpp000066400000000000000000000050121330725006400162140ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/signature/OIDToString.hpp" #include "pyPE.hpp" namespace LIEF { namespace PE { void init_python_module(py::module& m) { py::module LIEF_PE_module = m.def_submodule("PE", "Python API for PE"); init_enums(LIEF_PE_module); init_objects(LIEF_PE_module); init_utils(LIEF_PE_module); LIEF_PE_module.def("oid_to_string", &oid_to_string, "Convert an OID to a human-readable string"); // Opaque containers py::bind_vector>(m, "ListLangCodeItem"); py::bind_map(m, "DictStringVersion"); } void init_objects(py::module& m) { CREATE(Parser, m); CREATE(Binary, m); CREATE(DosHeader, m); CREATE(Header, m); CREATE(OptionalHeader, m); CREATE(RichHeader, m); CREATE(RichEntry, m); CREATE(DataDirectory, m); CREATE(Section, m); CREATE(Relocation, m); CREATE(RelocationEntry, m); CREATE(Export, m); CREATE(ExportEntry, m); CREATE(TLS, m); CREATE(Symbol, m); CREATE(Debug, m); CREATE(CodeView, m); CREATE(CodeViewPDB, m); CREATE(Import, m); CREATE(ImportEntry, m); CREATE(ResourcesManager, m); CREATE(ResourceNode, m); CREATE(ResourceData, m); CREATE(ResourceDirectory, m); CREATE(ResourceVersion, m); CREATE(ResourceStringFileInfo, m); CREATE(ResourceFixedFileInfo, m); CREATE(ResourceVarFileInfo, m); CREATE(LangCodeItem, m); CREATE(ResourceIcon, m); CREATE(ResourceDialog, m); CREATE(ResourceDialogItem, m); CREATE(Signature, m); CREATE(x509, m); CREATE(SignerInfo, m); CREATE(ContentInfo, m); CREATE(AuthenticatedAttributes, m); CREATE(CodeIntegrity, m); CREATE(LoadConfiguration, m); CREATE(LoadConfigurationV0, m); CREATE(LoadConfigurationV1, m); CREATE(LoadConfigurationV2, m); CREATE(LoadConfigurationV3, m); CREATE(LoadConfigurationV4, m); CREATE(LoadConfigurationV5, m); CREATE(LoadConfigurationV6, m); CREATE(LoadConfigurationV7, m); CREATE(Builder, m); } } } LIEF-0.9.0/api/python/PE/pyPE.hpp000066400000000000000000000057101330725006400162260ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_PE_H_ #define PY_LIEF_PE_H_ #include #include #include #include #include "LIEF/PE.hpp" #include "pyLIEF.hpp" #define SPECIALIZE_CREATE(X) \ template<> \ void create(py::module&) #define CREATE(X,Y) create(Y) namespace LIEF { namespace PE { 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(Binary); SPECIALIZE_CREATE(DosHeader); SPECIALIZE_CREATE(Header); SPECIALIZE_CREATE(OptionalHeader); SPECIALIZE_CREATE(RichHeader); SPECIALIZE_CREATE(RichEntry); SPECIALIZE_CREATE(DataDirectory); SPECIALIZE_CREATE(Section); SPECIALIZE_CREATE(Relocation); SPECIALIZE_CREATE(RelocationEntry); SPECIALIZE_CREATE(Export); SPECIALIZE_CREATE(ExportEntry); SPECIALIZE_CREATE(TLS); SPECIALIZE_CREATE(Symbol); SPECIALIZE_CREATE(Debug); SPECIALIZE_CREATE(CodeView); SPECIALIZE_CREATE(CodeViewPDB); SPECIALIZE_CREATE(Import); SPECIALIZE_CREATE(ImportEntry); SPECIALIZE_CREATE(ResourceNode); SPECIALIZE_CREATE(ResourceData); SPECIALIZE_CREATE(ResourceDirectory); SPECIALIZE_CREATE(ResourcesManager); SPECIALIZE_CREATE(ResourceVersion); SPECIALIZE_CREATE(ResourceStringFileInfo); SPECIALIZE_CREATE(ResourceFixedFileInfo); SPECIALIZE_CREATE(ResourceVarFileInfo); SPECIALIZE_CREATE(LangCodeItem); SPECIALIZE_CREATE(ResourceIcon); SPECIALIZE_CREATE(ResourceDialog); SPECIALIZE_CREATE(ResourceDialogItem); SPECIALIZE_CREATE(Signature); SPECIALIZE_CREATE(x509); SPECIALIZE_CREATE(SignerInfo); SPECIALIZE_CREATE(ContentInfo); SPECIALIZE_CREATE(AuthenticatedAttributes); SPECIALIZE_CREATE(CodeIntegrity); SPECIALIZE_CREATE(LoadConfiguration); SPECIALIZE_CREATE(LoadConfigurationV0); SPECIALIZE_CREATE(LoadConfigurationV1); SPECIALIZE_CREATE(LoadConfigurationV2); SPECIALIZE_CREATE(LoadConfigurationV3); SPECIALIZE_CREATE(LoadConfigurationV4); SPECIALIZE_CREATE(LoadConfigurationV5); SPECIALIZE_CREATE(LoadConfigurationV6); SPECIALIZE_CREATE(LoadConfigurationV7); SPECIALIZE_CREATE(ResourcesManager); SPECIALIZE_CREATE(Builder); } } // Opaque containers PYBIND11_MAKE_OPAQUE(std::vector) using dict_langcode_item = std::map; PYBIND11_MAKE_OPAQUE(dict_langcode_item) #endif LIEF-0.9.0/api/python/PE/pyUtils.cpp000066400000000000000000000043101330725006400170100ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyPE.hpp" #include "LIEF/PE/utils.hpp" namespace LIEF { namespace PE { void init_utils(py::module& m) { m.def("is_pe", static_cast(&is_pe), "Check if the given file is a ``PE``", "file"_a); m.def("is_pe", static_cast&)>(&is_pe), "Check if the given raw data is a ``PE``", "raw"_a); m.def("get_type", static_cast(&get_type), "If the input file is a ``PE`` one, return the " RST_CLASS_REF(lief.PE.PE_TYPE) "", "file"_a); m.def("get_type", static_cast&)>(&get_type), "If the input *raw* data represent a ``PE`` file, return the " RST_CLASS_REF(lief.PE.PE_TYPE) "", "raw"_a); m.def("get_imphash", &get_imphash, "Compute the hash of imported functions\n\n" "Properties of the hash generated:\n" "\t* Order agnostic\n" "\t* Casse agnostic\n" "\t* Ordinal (**in some extent**) agnostic\n\n" ".. seealso::\n\n" "\thttps://www.fireeye.com/blog/threat-research/2014/01/tracking-malware-import-hashing.html\n", "binary"_a); m.def("resolve_ordinals", &resolve_ordinals, "Take an " RST_CLASS_REF(lief.PE.Import) " as entry and try to resolve its ordinal imports\n\n" "The ``strict`` boolean parameter enables to throw a " RST_CLASS_REF(lief.not_found) " exception " "if the ordinal can't be resolved. Otherwise it skips the entry.", "import"_a, "strict"_a = false, py::return_value_policy::copy); } } } LIEF-0.9.0/api/python/README000066400000000000000000000010021330725006400152020ustar00rootroot00000000000000LIEF - Python API ----------------- The purpose of this project is to provide a cross platform library which can parse, modify and abstract ELF, PE and MachO formats. Main features: * Parsing: LIEF can parse ELF, PE, MachO and provides an user-friendly API to access to format internals. * Modify: LIEF enables to modify some parts of these formats * Abstract: Three formats have common features like sections, symbols, entry point... LIEF factors them. * API: LIEF can be used in C, C++ and Python LIEF-0.9.0/api/python/VDEX/000077500000000000000000000000001330725006400150775ustar00rootroot00000000000000LIEF-0.9.0/api/python/VDEX/CMakeLists.txt000066400000000000000000000013401330725006400176350ustar00rootroot00000000000000set(LIEF_PYTHON_VDEX_SRC "${CMAKE_CURRENT_LIST_DIR}/pyVDEX.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyEnums.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyIterators.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_VDEX_HDR "${CMAKE_CURRENT_LIST_DIR}/pyVDEX.hpp") source_group("Source Files\\VDEX" FILES ${LIEF_PYTHON_VDEX_SRC}) source_group("Header Files\\VDEX" FILES ${LIEF_PYTHON_VDEX_HDR}) target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_VDEX_SRC}" "${LIEF_PYTHON_VDEX_HDR}") target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_LIST_DIR}/../") LIEF-0.9.0/api/python/VDEX/objects/000077500000000000000000000000001330725006400165305ustar00rootroot00000000000000LIEF-0.9.0/api/python/VDEX/objects/pyFile.cpp000066400000000000000000000037521330725006400204730ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/VDEX/File.hpp" #include "LIEF/VDEX/hash.hpp" #include "pyVDEX.hpp" namespace LIEF { namespace VDEX { 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", "VDEX File representation") .def_property_readonly("header", static_cast>(&File::header), "Return the VDEX " RST_CLASS_REF(lief.VDEX.Header) "", py::return_value_policy::reference) .def_property_readonly("dex_files", static_cast>(&File::dex_files), "Return an iterator over " RST_CLASS_REF(lief.DEX.File) "", py::return_value_policy::reference) .def_property_readonly("dex2dex_json_info", &File::dex2dex_json_info) .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; }); } } } LIEF-0.9.0/api/python/VDEX/objects/pyHeader.cpp000066400000000000000000000044371330725006400210050ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/VDEX/Header.hpp" #include "LIEF/VDEX/hash.hpp" #include "pyVDEX.hpp" namespace LIEF { namespace VDEX { 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", "VDEX Header representation") .def_property_readonly("magic", static_cast>(&Header::magic), "Magic value used to identify VDEX") .def_property_readonly("version", static_cast>(&Header::version), "VDEX version number") .def_property_readonly("nb_dex_files", static_cast>(&Header::nb_dex_files), "Number of " RST_CLASS_REF(lief.DEX.File) " files registered") .def_property_readonly("dex_size", static_cast>(&Header::dex_size), "Size of **all** " RST_CLASS_REF(lief.DEX.File) "") .def_property_readonly("verifier_deps_size", static_cast>(&Header::verifier_deps_size), "Size of verifier deps section") .def_property_readonly("quickening_info_size", static_cast>(&Header::quickening_info_size), "Size of quickening info section") .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; }); } } } LIEF-0.9.0/api/python/VDEX/objects/pyParser.cpp000066400000000000000000000046331330725006400210470ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyVDEX.hpp" #include "LIEF/VDEX/Parser.hpp" #include namespace LIEF { namespace VDEX { template<> void create(py::module& m) { // Parser (Parser) m.def("parse", static_cast (*) (const std::string&)>(&Parser::parse), "Parse the given filename and return a " RST_CLASS_REF(lief.VDEX.File) " object" "filename"_a, py::return_value_policy::take_ownership); m.def("parse", static_cast (*) (const std::vector&, const std::string&)>(&Parser::parse), "Parse the given raw data and return a " RST_CLASS_REF(lief.VDEX.File) " object\n\n" "raw"_a, py::arg("name") = "", py::return_value_policy::take_ownership); m.def("parse", [] (py::object byteio, const std::string& name) { auto&& io = py::module::import("io"); auto&& RawIOBase = io.attr("RawIOBase"); auto&& BufferedIOBase = io.attr("BufferedIOBase"); 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::VDEX::Parser::parse(std::move(raw), name); }, "io"_a, "name"_a = "", py::return_value_policy::take_ownership); } } } LIEF-0.9.0/api/python/VDEX/pyEnums.cpp000066400000000000000000000015321330725006400172440ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyVDEX.hpp" #include "LIEF/VDEX/Structures.hpp" #include "LIEF/VDEX/enums.hpp" #include "LIEF/VDEX/EnumToString.hpp" #define PY_ENUM(x) to_string(x), x namespace LIEF { namespace VDEX { void init_enums(py::module& m) { } } } LIEF-0.9.0/api/python/VDEX/pyIterators.cpp000066400000000000000000000014201330725006400201250ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyVDEX.hpp" #include "pyIterators.hpp" #include "LIEF/VDEX/type_traits.hpp" namespace LIEF { namespace VDEX { void init_iterators(py::module& m) { } } } LIEF-0.9.0/api/python/VDEX/pyUtils.cpp000066400000000000000000000031241330725006400172540ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyVDEX.hpp" #include "LIEF/VDEX/utils.hpp" namespace LIEF { namespace VDEX { void init_utils(py::module& m) { m.def("is_vdex", static_cast(&is_vdex), "Check if the **file** given in parameter is an VDEX", "path"_a); m.def("is_vdex", static_cast&)>(&is_vdex), "Check if the **raw data** given in parameter is a VDEX", "raw"_a); m.def("version", static_cast(&version), "Return the VDEX version of the **file** given in parameter", "file"_a); m.def("version", static_cast&)>(&version), "Return the VDEX 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 VDEX version ", "vdex_version"_a); } } } LIEF-0.9.0/api/python/VDEX/pyVDEX.cpp000066400000000000000000000020261330725006400167220ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyVDEX.hpp" namespace LIEF { namespace VDEX { void init_python_module(py::module& m) { py::module LIEF_VDEX_module = m.def_submodule("VDEX", "Python API for VDEX format"); init_enums(LIEF_VDEX_module); init_iterators(LIEF_VDEX_module); init_objects(LIEF_VDEX_module); init_utils(LIEF_VDEX_module); } void init_objects(py::module& m) { CREATE(Parser, m); CREATE(File, m); CREATE(Header, m); } } } LIEF-0.9.0/api/python/VDEX/pyVDEX.hpp000066400000000000000000000022571330725006400167350ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_VDEX_H_ #define PY_LIEF_VDEX_H_ #include "LIEF/VDEX.hpp" #include "pyLIEF.hpp" #define SPECIALIZE_CREATE(X) \ template<> \ void create(py::module&) #define CREATE(X,Y) create(Y) namespace LIEF { namespace VDEX { template void create(py::module&); void init_python_module(py::module& m); void init_objects(py::module&); void init_iterators(py::module&); void init_enums(py::module&); void init_utils(py::module&); SPECIALIZE_CREATE(Parser); SPECIALIZE_CREATE(File); SPECIALIZE_CREATE(Header); } } #endif LIEF-0.9.0/api/python/__init__.py.in000066400000000000000000000015231330725006400170500ustar00rootroot00000000000000#!/usr/bin/env python import sys import _pylief from _pylief import * __version__ = _pylief.__version__ if @ENABLE_PE_SUPPORT@: sys.modules.setdefault("lief.PE", _pylief.PE) if @ENABLE_ELF_SUPPORT@: sys.modules.setdefault("lief.ELF", _pylief.ELF) sys.modules.setdefault("lief.ELF.ELF32", _pylief.ELF.ELF32) sys.modules.setdefault("lief.ELF.ELF64", _pylief.ELF.ELF64) if @ENABLE_MACHO_SUPPORT@: sys.modules.setdefault("lief.MachO", _pylief.MachO) if @ENABLE_OAT_SUPPORT@: sys.modules.setdefault("lief.OAT", _pylief.OAT) if @ENABLE_DEX_SUPPORT@: sys.modules.setdefault("lief.DEX", _pylief.DEX) if @ENABLE_VDEX_SUPPORT@: sys.modules.setdefault("lief.VDEX", _pylief.VDEX) if @ENABLE_VDEX_SUPPORT@: sys.modules.setdefault("lief.ART", _pylief.ART) sys.modules.setdefault("lief.Android", _pylief.Android) LIEF-0.9.0/api/python/encoding.cpp000066400000000000000000000050531330725006400166260ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "encoding.hpp" py::object safe_string_converter(const std::string& str) { auto global = py::dict(py::module::import("__main__").attr("__dict__")); auto local = py::dict(); py::bytes name_bytes = py::bytes(str); local["name_bytes"] = name_bytes; #if PY_MAJOR_VERSION >= 3 py::eval(R"( encodings = ["big5", "big5hkscs", "cp037", "cp424", "cp437", "cp500", "cp737", "cp775", "cp850", "cp852", "cp855", "cp856", "cp857", "cp860", "cp861", "cp862", "cp863", "cp864", "cp865", "cp866", "cp869", "cp874", "cp875", "cp932", "cp949", "cp950", "cp1006", "cp1026", "cp1140", "cp1250", "cp1251", "cp1252", "cp1253", "cp1254", "cp1255", "cp1256", "cp1257", "cp1258", "euc_jp", "euc_jis_2004", "euc_jisx0213", "euc_kr", "gb2312", "gbk", "gb18030", "hz", "iso2022_jp", "iso2022_jp_1", "iso2022_jp_2", "iso2022_jp_2004", "iso2022_jp_3", "iso2022_jp_ext", "iso2022_kr", "latin_1", "iso8859_2", "iso8859_3", "iso8859_4", "iso8859_5", "iso8859_6", "iso8859_7", "iso8859_8", "iso8859_9", "iso8859_10", "iso8859_13", "iso8859_14", "iso8859_15", "johab", "koi8_r", "koi8_u", "mac_cyrillic", "mac_greek", "mac_iceland", "mac_latin2", "mac_roman", "mac_turkish", "ptcp154", "shift_jis", "shift_jis_2004", "shift_jisx0213", "utf_32", "utf_32_be", "utf_32_le", "utf_16", "utf_16_be", "utf_16_le", "utf_7", "utf_8_sig" ] for e in encodings: try: name_str = name_bytes.decode(e) break except (UnicodeEncodeError, UnicodeDecodeError) as e: continue name_str = name_bytes.decode('ascii', 'backslashreplace') )", global, local); #else py::eval(R"( def handler(err): start = err.start end = err.end return (u"".join([u"\\x{0:02x}".format(ord(err.object[i])) for i in range(start,end)]),end) import codecs codecs.register_error('backslashreplace_', handler) name_str = name_bytes.decode('ascii', 'backslashreplace_') )", global, local); #endif return local["name_str"]; } LIEF-0.9.0/api/python/encoding.hpp000066400000000000000000000014731330725006400166350ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_ENCODING_H_ #define PY_LIEF_ENCODING_H_ #include #include namespace py = pybind11; py::object safe_string_converter(const std::string& str); #endif LIEF-0.9.0/api/python/enums_wrapper.hpp000066400000000000000000000055241330725006400177370ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_ENUMS_WRAPPER_H_ #define PY_LIEF_ENUMS_WRAPPER_H_ #include #include #include "LIEF/visibility.h" namespace py = pybind11; namespace LIEF { template class LIEF_LOCAL enum_ : public pybind11::enum_ { public: using py::enum_::def; using py::enum_::def_property_readonly_static; using Scalar = typename py::enum_::Scalar; template enum_(const py::handle &scope, const char *name, const Extra&... extra) : py::enum_{scope, name, extra...} { constexpr bool is_arithmetic = py::detail::any_of...>::value; def("__eq__", [](const Type &value, Scalar value2) { return (Scalar) value == value2; }); def("__ne__", [](const Type &value, Scalar value2) { return (Scalar) value != value2; }); if (is_arithmetic) { def("__lt__", [](const Type &value, Scalar value2) { return (Scalar) value < value2; }); def("__gt__", [](const Type &value, Scalar value2) { return (Scalar) value > value2; }); def("__le__", [](const Type &value, Scalar value2) { return (Scalar) value <= value2; }); def("__ge__", [](const Type &value, Scalar value2) { return (Scalar) value >= value2; }); def("__invert__", [](const Type &value) { return ~((Scalar) value); }); def("__and__", [](const Type &value, Scalar value2) { return (Scalar) value & value2; }); def("__or__", [](const Type &value, Scalar value2) { return (Scalar) value | value2; }); def("__xor__", [](const Type &value, Scalar value2) { return (Scalar) value ^ value2; }); def("__rand__", [](const Type &value, Scalar value2) { return (Scalar) value & value2; }); def("__ror__", [](const Type &value, Scalar value2) { return (Scalar) value | value2; }); def("__rxor__", [](const Type &value, Scalar value2) { return (Scalar) value ^ value2; }); def("__and__", [](const Type &value, const Type &value2) { return (Scalar) value & (Scalar) value2; }); def("__or__", [](const Type &value, const Type &value2) { return (Scalar) value | (Scalar) value2; }); def("__xor__", [](const Type &value, const Type &value2) { return (Scalar) value ^ (Scalar) value2; }); } } }; } #endif LIEF-0.9.0/api/python/platforms/000077500000000000000000000000001330725006400163405ustar00rootroot00000000000000LIEF-0.9.0/api/python/platforms/CMakeLists.txt000066400000000000000000000000741330725006400211010ustar00rootroot00000000000000include("${CMAKE_CURRENT_LIST_DIR}/android/CMakeLists.txt") LIEF-0.9.0/api/python/platforms/android/000077500000000000000000000000001330725006400177605ustar00rootroot00000000000000LIEF-0.9.0/api/python/platforms/android/CMakeLists.txt000066400000000000000000000010231330725006400225140ustar00rootroot00000000000000set(LIEF_PYTHON_ANDROID_SRC "${CMAKE_CURRENT_LIST_DIR}/pyAndroid.cpp" "${CMAKE_CURRENT_LIST_DIR}/pyVersion.cpp" ) set(LIEF_PYTHON_ANDROID_HDR "${CMAKE_CURRENT_LIST_DIR}/pyAndroid.hpp") source_group("Source Files\\Android" FILES ${LIEF_PYTHON_ANDROID_SRC}) source_group("Header Files\\Android" FILES ${LIEF_PYTHON_ANDROID_HDR}) target_sources(pyLIEF PRIVATE "${LIEF_PYTHON_ANDROID_SRC}" "${LIEF_PYTHON_ANDROID_HDR}") target_include_directories(pyLIEF PUBLIC "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_CURRENT_LIST_DIR}/../../") LIEF-0.9.0/api/python/platforms/android/pyAndroid.cpp000066400000000000000000000015441330725006400224210ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyAndroid.hpp" namespace LIEF { namespace Android { void init_python_module(py::module& m) { py::module lief_android_module = m.def_submodule("Android", "Python API for Android platform"); init_versions(lief_android_module); } } } LIEF-0.9.0/api/python/platforms/android/pyAndroid.hpp000066400000000000000000000015301330725006400224210ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_ANDROID_H_ #define PY_LIEF_ANDROID_H_ #include "LIEF/platforms/android.hpp" #include "pyLIEF.hpp" namespace LIEF { namespace Android { void init_python_module(py::module&); void init_versions(py::module&); } } #endif LIEF-0.9.0/api/python/platforms/android/pyVersion.cpp000066400000000000000000000031041330725006400224600ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyAndroid.hpp" #include "LIEF/platforms/android/version.hpp" #define PY_ENUM(x) to_string(x), x namespace LIEF { namespace Android { void init_versions(py::module& m) { py::enum_(m, "ANDROID_VERSIONS") .value(PY_ENUM(ANDROID_VERSIONS::VERSION_UNKNOWN)) .value(PY_ENUM(ANDROID_VERSIONS::VERSION_601)) .value(PY_ENUM(ANDROID_VERSIONS::VERSION_700)) .value(PY_ENUM(ANDROID_VERSIONS::VERSION_710)) .value(PY_ENUM(ANDROID_VERSIONS::VERSION_712)) .value(PY_ENUM(ANDROID_VERSIONS::VERSION_800)) .value(PY_ENUM(ANDROID_VERSIONS::VERSION_810)); m.def("code_name", &code_name, "Return the Android code associated with a " RST_CLASS_REF(lief.Android.ANDROID_VERSIONS) ".\n" "For example: ``Nougat``", "version"_a); m.def("version_string", &version_string, "Return the " RST_CLASS_REF(lief.Android.ANDROID_VERSIONS) " as a string.\n" "For example: ``7.0.1``", "version"_a); } } } LIEF-0.9.0/api/python/pyExceptions.cpp000066400000000000000000000037051330725006400175340ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyLIEF.hpp" #include "LIEF/exception.hpp" void init_LIEF_exceptions(py::module& m) { auto&& exception = py::register_exception(m, "exception"); auto&& bad_file = py::register_exception(m, "bad_file", exception.ptr()); py::register_exception(m, "bad_format", bad_file.ptr()); py::register_exception(m, "not_implemented", exception.ptr()); py::register_exception(m, "not_supported", exception.ptr()); py::register_exception(m, "read_out_of_bound", exception.ptr()); py::register_exception(m, "integrity_error", exception.ptr()); py::register_exception(m, "not_found", exception.ptr()); py::register_exception(m, "corrupted", exception.ptr()); py::register_exception(m, "conversion_error", exception.ptr()); py::register_exception(m, "type_error", exception.ptr()); py::register_exception(m, "builder_error", exception.ptr()); py::register_exception(m, "parser_error", exception.ptr()); auto&& pe_error = py::register_exception(m, "pe_error", exception.ptr()); py::register_exception(m, "pe_bad_section_name", pe_error.ptr()); } LIEF-0.9.0/api/python/pyHash.cpp000066400000000000000000000015761330725006400163020ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/config.h" #include "LIEF/hash.hpp" #include "pyLIEF.hpp" void init_hash_functions(py::module& m) { m.def("hash", static_cast(&LIEF::hash)); m.def("hash", static_cast&)>(&LIEF::hash)); } LIEF-0.9.0/api/python/pyIterators.cpp000066400000000000000000000056721330725006400173740ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/config.h" #include "pyLIEF.hpp" #include "pyIterators.hpp" #include "LIEF/PE/signature/types.hpp" void init_LIEF_iterators(py::module& m) { // Abstract // ======== init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); // ELF // === #if defined(LIEF_ELF_SUPPORT) init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator>(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator>(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); #endif // PE // == #if defined(LIEF_PE_SUPPORT) init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); #endif // MachO // ===== #if defined(LIEF_MACHO_SUPPORT) init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator>(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); init_ref_iterator(m); #endif } LIEF-0.9.0/api/python/pyIterators.hpp000066400000000000000000000033551330725006400173750ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_ITERATORS_H_ #define PY_LIEF_ITERATORS_H_ #include #include "LIEF/LIEF.hpp" #include "LIEF/Abstract/type_traits.hpp" #include "LIEF/ELF/type_traits.hpp" #include "LIEF/PE/type_traits.hpp" #include "LIEF/MachO/type_traits.hpp" namespace py = pybind11; void init_LIEF_iterators(py::module&); template void init_ref_iterator(py::module& m, const std::string& it_name = typeid(T).name()) { py::class_(m, it_name.c_str()) .def("__getitem__", [](T& v, size_t i) -> typename T::reference { if (i >= v.size()) throw py::index_error(); return v[i]; }, py::return_value_policy::reference) .def("__len__", [](T& v) { return v.size(); }) .def("__iter__", [](T& v) -> T { return std::begin(v); }, py::return_value_policy::reference_internal) .def("__next__", [] (T& v) -> typename T::reference { if (v == std::end(v)) { throw py::stop_iteration(); } return *(v++); }, py::return_value_policy::reference); } #endif LIEF-0.9.0/api/python/pyJson.cpp000066400000000000000000000015171330725006400163230ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/config.h" #include "LIEF/to_json.hpp" #include "pyLIEF.hpp" void init_json_functions(py::module& m) { m.def("to_json", &LIEF::to_json_str); m.def("to_json_from_abstract", &LIEF::to_json_str_from_abstract); } LIEF-0.9.0/api/python/pyLIEF.cpp000066400000000000000000000050441330725006400161300ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/version.h" #include "pyLIEF.hpp" #if defined(LIEF_ELF_SUPPORT) #include "ELF/pyELF.hpp" #endif #if defined(LIEF_PE_SUPPORT) #include "PE/pyPE.hpp" #endif #if defined(LIEF_MACHO_SUPPORT) #include "MachO/pyMachO.hpp" #endif #if defined(LIEF_OAT_SUPPORT) #include "OAT/pyOAT.hpp" #endif #if defined(LIEF_VDEX_SUPPORT) #include "VDEX/pyVDEX.hpp" #endif #if defined(LIEF_DEX_SUPPORT) #include "DEX/pyDEX.hpp" #endif #if defined(LIEF_ART_SUPPORT) #include "ART/pyART.hpp" #endif #include "platforms/android/pyAndroid.hpp" py::module LIEF_module("_pylief", "Python API for LIEF"); PYBIND11_MODULE(_pylief, LIEF_module) { LIEF_module.attr("__version__") = py::str(LIEF_VERSION); init_LIEF_Object_class(LIEF_module); init_LIEF_iterators(LIEF_module); init_LIEF_Logger(LIEF_module); // Init custom LIEF exceptions init_LIEF_exceptions(LIEF_module); // Init the LIEF module init_LIEF_module(LIEF_module); init_hash_functions(LIEF_module); // Init the ELF module #if defined(LIEF_ELF_SUPPORT) LIEF::ELF::init_python_module(LIEF_module); #endif // Init the PE module #if defined(LIEF_PE_SUPPORT) LIEF::PE::init_python_module(LIEF_module); #endif // Init the MachO module #if defined(LIEF_MACHO_SUPPORT) LIEF::MachO::init_python_module(LIEF_module); #endif // Init the OAT module #if defined(LIEF_OAT_SUPPORT) LIEF::OAT::init_python_module(LIEF_module); #endif // Init the VDEX module #if defined(LIEF_VDEX_SUPPORT) LIEF::VDEX::init_python_module(LIEF_module); #endif // Init the DEX module #if defined(LIEF_DEX_SUPPORT) LIEF::DEX::init_python_module(LIEF_module); #endif // Init the ART module #if defined(LIEF_ART_SUPPORT) LIEF::ART::init_python_module(LIEF_module); #endif LIEF::Android::init_python_module(LIEF_module); // Init util functions init_utils_functions(LIEF_module); #if defined(LIEF_JSON_SUPPORT) init_json_functions(LIEF_module); #endif } LIEF-0.9.0/api/python/pyLIEF.hpp000066400000000000000000000025771330725006400161450ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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_H_ #define PY_LIEF_H_ #include #include #include #include #include #include "encoding.hpp" #include "pyIterators.hpp" #define RST_CLASS_REF(X) ":class:`~"#X"`" #define RST_CLASS_REF_FULL(X) ":class:`"#X"`" #define RST_ATTR_REF(X) ":attr:`~"#X"`" #define RST_ATTR_REF_FULL(X) ":attr:`"#X"`" namespace py = pybind11; using namespace pybind11::literals; void init_LIEF_Object_class(py::module&); void init_LIEF_Logger(py::module&); void init_LIEF_exceptions(py::module&); void init_LIEF_module(py::module&); void init_hash_functions(py::module&); void init_utils_functions(py::module&); #if defined(LIEF_JSON_SUPPORT) void init_json_functions(py::module&); #endif #endif LIEF-0.9.0/api/python/pyLogger.cpp000066400000000000000000000034521330725006400166310ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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 "pyLIEF.hpp" #include "LIEF/logging.hpp" #define PY_ENUM(x) LIEF::to_string(x), x void init_LIEF_Logger(py::module& m) { py::enum_(m, "LOGGING_LEVEL") .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_GLOBAL)) .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_TRACE)) .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_DEBUG)) .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_FATAL)) .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_ERROR)) .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_WARNING)) .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_INFO)) .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_VERBOSE)) .value(PY_ENUM(LIEF::LOGGING_LEVEL::LOG_UNKNOWN)) .export_values(); py::class_(m, "Logger") .def_static("disable", &LIEF::Logger::disable, "Disable the logging module") .def_static("enable", &LIEF::Logger::enable, "Enable the logging module") .def_static("set_level", &LIEF::Logger::set_level, "Change the " RST_CLASS_REF(lief.LOGGING_LEVEL) " (**hierarchical**)", "level"_a) .def_static("set_verbose_level", &LIEF::Logger::set_verbose_level, "Change the verbose level", "level"_a); } LIEF-0.9.0/api/python/pyObject.cpp000066400000000000000000000001571330725006400166170ustar00rootroot00000000000000#include "pyLIEF.hpp" void init_LIEF_Object_class(py::module& m) { py::class_(m, "Object"); } LIEF-0.9.0/api/python/pyUtils.cpp000066400000000000000000000140141330725006400165060ustar00rootroot00000000000000/* Copyright 2017 R. Thomas * Copyright 2017 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/utils.hpp" #include "LIEF/MachO/utils.hpp" #include "LIEF/ELF/utils.hpp" #include "LIEF/OAT.hpp" #include "LIEF/DEX.hpp" #include "LIEF/VDEX.hpp" #include "LIEF/ART.hpp" #include "pyLIEF.hpp" void init_utils_functions(py::module& m) { m.def("shell", [] (void) { auto&& InteractiveShellEmbed = py::module::import("IPython").attr("terminal").attr("embed").attr("InteractiveShellEmbed"); auto&& ipshell = InteractiveShellEmbed("banner1"_a = "Dropping into IPython", "exit_msg"_a = "Leaving Interpreter, back to program."); return ipshell(); }, "Drop into an IPython Interpreter"); m.def("breakp", [] (void) { py::object set_trace = py::module::import("pdb").attr("set_trace"); return set_trace(); }, "Trigger 'pdb.set_trace()'"); #if defined(LIEF_PE_SUPPORT) m.def("is_pe", static_cast(&LIEF::PE::is_pe), "Check if the given file is a ``PE`` (from filename)", "filename"_a); m.def("is_pe", static_cast&)>(&LIEF::PE::is_pe), "Check if the given raw data is a ``PE``", "raw"_a); #endif #if defined(LIEF_ELF_SUPPORT) m.def("is_elf", static_cast(&LIEF::ELF::is_elf), "Check if the given file is an ``ELF``", "filename"_a); m.def("is_elf", static_cast&)>(&LIEF::ELF::is_elf), "Check if the given raw data is an ``ELF``", "raw"_a); #endif #if defined(LIEF_MACHO_SUPPORT) m.def("is_macho", static_cast(&LIEF::MachO::is_macho), "Check if the given file is a ``MachO`` (from filename)", "filename"_a); m.def("is_macho", static_cast&)>(&LIEF::MachO::is_macho), "Check if the given raw data is a ``MachO``", "raw"_a); #endif #if defined(LIEF_OAT_SUPPORT) m.def("is_oat", static_cast(&LIEF::OAT::is_oat), "Check if the given file is an ``OAT`` (from filename)", "filename"_a); m.def("is_oat", static_cast&)>(&LIEF::OAT::is_oat), "Check if the given raw data is an ``OAT``", "raw"_a); m.def("is_oat", static_cast(&LIEF::OAT::is_oat), "Check if the given " RST_CLASS_REF(lief.ELF.Binary) " is an ``OAT``", "elf"_a); m.def("oat_version", static_cast(&LIEF::OAT::version), "Return the OAT version of the given file", "filename"_a); m.def("oat_version", static_cast&)>(&LIEF::OAT::version), "Return the OAT version of the raw data", "raw"_a); m.def("oat_version", static_cast(&LIEF::OAT::version), "Return the OAT version of the given " RST_CLASS_REF(lief.ELF.Binary) "", "elf"_a); #endif #if defined(LIEF_DEX_SUPPORT) m.def("is_dex", static_cast(&LIEF::DEX::is_dex), "Check if the given file is a ``DEX`` (from filename)", "filename"_a); m.def("is_dex", static_cast&)>(&LIEF::DEX::is_dex), "Check if the given raw data is a ``DEX``", "raw"_a); m.def("dex_version", static_cast(&LIEF::DEX::version), "Return the OAT version of the given file", "filename"_a); m.def("dex_version", static_cast&)>(&LIEF::DEX::version), "Return the DEX version of the raw data", "raw"_a); #endif #if defined(LIEF_VDEX_SUPPORT) m.def("is_vdex", static_cast(&LIEF::VDEX::is_vdex), "Check if the given file is a ``VDEX`` (from filename)", "filename"_a); m.def("is_vdex", static_cast&)>(&LIEF::VDEX::is_vdex), "Check if the given raw data is a ``VDEX``", "raw"_a); m.def("vdex_version", static_cast(&LIEF::VDEX::version), "Return the VDEX version of the given file", "filename"_a); m.def("vdex_version", static_cast&)>(&LIEF::VDEX::version), "Return the VDEX version of the raw data", "raw"_a); #endif #if defined(LIEF_ART_SUPPORT) m.def("is_art", static_cast(&LIEF::ART::is_art), "Check if the given file is an ``ART`` (from filename)", "filename"_a); m.def("is_art", static_cast&)>(&LIEF::ART::is_art), "Check if the given raw data is an ``ART``", "raw"_a); m.def("art_version", static_cast(&LIEF::ART::version), "Return the ART version of the given file", "filename"_a); m.def("art_version", static_cast&)>(&LIEF::ART::version), "Return the ART version of the raw data", "raw"_a); #endif } LIEF-0.9.0/api/python/setup.cfg000066400000000000000000000016241330725006400161550ustar00rootroot00000000000000[metadata] name = lief description = LIEF is a library to instrument executable formats author = Romain Thomas author_email = rthomas@quarkslab.com url = https://lief.quarkslab.com license = Apache 2.0 keywords = parser, elf, pe, macho classifiers = License :: OSI Approved :: Apache Software License Development Status :: 4 - Beta Environment :: Console Intended Audience :: Developers Intended Audience :: Science/Research Operating System :: MacOS :: MacOS X Operating System :: POSIX :: Linux Operating System :: Microsoft :: Windows Programming Language :: C++ Programming Language :: Python :: 2 Programming Language :: Python :: 3 Topic :: Software Development :: Libraries Topic :: Security Topic :: Scientific/Engineering :: Information Analysis Topic :: Software Development :: Build Tools [options] zip_safe = False packages = lief LIEF-0.9.0/api/python/setup.py.in000066400000000000000000000222471330725006400164570ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- MIN_SETUPTOOLS_VERSION = "31.0.0" import setuptools from distutils.version import LooseVersion assert (LooseVersion(setuptools.__version__) >= LooseVersion(MIN_SETUPTOOLS_VERSION)), "LIEF requires a setuptools version '{}' or higher (pip install setuptools --upgrade)".format(MIN_SETUPTOOLS_VERSION) from setuptools import setup from setuptools.command.build_ext import build_ext from distutils.dir_util import remove_tree, mkpath from setuptools.command.bdist_egg import bdist_egg from setuptools.command.bdist_egg import log as bdist_egg_log from setuptools.command.sdist import sdist from setuptools.command.sdist import log as sdist_log from setuptools.extension import Extension import re import os import platform import shutil import sys import struct import zipfile try: from urllib.request import urlopen, Request except: from urllib2 import urlopen, Request try: from io import BytesIO except: try: from cStringIO import StringIO as BytesIO except: from StringIO import StringIO as BytesIO package_dir = os.path.dirname(os.path.realpath(__file__)) pkg_info = os.path.join(package_dir, "PKG-INFO") in_source_package = os.path.isfile(pkg_info) # (e.g. pip) is_branch = False libpylief = { 'Windows': "_pylief.pyd", 'Darwin': "_pylief.so", 'Linux': "_pylief.so", 'FreeBSD': "_pylief.so", } version_re = r"Version:\s+(?P\d+)\.(?P\d+)\.(?P\d+)\.?(.*)" if in_source_package: with open(pkg_info, "r") as f: major, minor, patch, branch = re.findall(version_re, f.read(), re.MULTILINE)[0] lief_version = "{:d}.{:d}.{:d}".format(int(major), int(minor), int(patch)) is_branch = len(branch.strip()) > 0 else: lief_version = "@LIEF_VERSION_MAJOR@.@LIEF_VERSION_MINOR@.@LIEF_VERSION_PATCH@" package_description = open(os.path.join(package_dir, "README")).read() def get_lief_platform_name(): system = platform.system() arch = struct.calcsize('P') * 8 if system == 'Windows': return "windows_x64" if arch == 64 else "windows_x32" elif system == 'Darwin': return "osx" if arch == 64 else "osx_x32" elif system == 'Linux': return "linux" if arch == 64 else "linux_x32" elif system == 'FreeBSD': return "freebsd" if arch == 64 else "freebsd_x32" class lief_sdist(sdist): user_options = sdist.user_options + [ ('dev', None, "Add a dev marker") ] def initialize_options(self): sdist.initialize_options(self) self.dev = 0 def run(self): if self.dev: suffix = '.dev-{:s}'.format("@LIEF_COMMIT_HASH@") self.distribution.metadata.version += suffix sdist.run(self) def make_distribution(self): sdist.make_distribution(self) base_dir = self.distribution.get_fullname() base_name = os.path.join(self.dist_dir, base_dir) for fmt in self.formats: if fmt == 'gztar': fmt = 'tar.gz' if fmt == 'bztar': fmt = 'tar.bz2' if fmt == 'ztar': fmt = 'tar.Z' new_name = "py{name}-{version}.{ext}".format( name=self.distribution.get_name(), version=lief_version, ext=fmt) if self.dev: new_name = "py{name}-{version}.dev.{ext}".format( name=self.distribution.get_name(), version=lief_version, ext=fmt) new_name = os.path.join(self.dist_dir, new_name) shutil.move(base_name + "." + fmt, new_name) class lief_bdist_egg(bdist_egg): def initialize_options(self): bdist_egg.initialize_options(self) if not in_source_package: self.plat_name = get_lief_platform_name() def run(self): if in_source_package: self._build_from_source_package() else: bdist_egg.run(self) def _build_from_source_package(self): python_version = sys.version_info python_major_version = python_version[0] os_version = get_lief_platform_name() url_branch_fmt = "https://github.com/lief-project/packages/raw/lief-{branch}-latest/lief-{version}-py{pyversion}-{platform}.{ext}" url_release_fmt = "https://github.com/lief-project/LIEF/releases/download/{version}/lief-{version}-py{pyversion}-{platform}.{ext}" url_userpath = "~/lief-{version}-py{pyversion}-{platform}.{ext}" url = "" if is_branch: url = url_branch_fmt.format( branch='master', platform=os_version, version=lief_version, pyversion="{}.{}".format(python_version[0], python_version[1]), ext="egg") else: url = url_release_fmt.format( platform=os_version, version=lief_version, pyversion="{}.{}".format(python_version[0], python_version[1]), ext="egg") bdist_egg_log.info("Url: {}".format(url)) egg_data = None network_error = None try: egg_data = urlopen(url).read() except Exception as e: network_error = e if network_error is not None: bdist_egg_log.warn(network_error) url = url_userpath.format( platform=os_version, version=lief_version, pyversion="{}.{}".format(python_version[0], python_version[1]), ext="egg") url = os.path.expanduser(url) if os.path.isfile(url): with open(url, 'rb') as f: egg_data = f.read() else: raise Exception("Unable to find {}".format(url)) egg_file = BytesIO(egg_data) mkpath(os.path.dirname(self.egg_output)) bdist_egg_log.info("Output: {}".format(self.egg_output)) with open(self.egg_output, 'wb') as f: f.write(egg_file.getvalue()) getattr(self.distribution, 'dist_files', []).append( ('bdist_egg', "{}.{}".format(python_version[0], python_version[1]), self.egg_output)) class lief_build_ext(build_ext): def build_extension(self, ext): self.target = self.get_ext_fullpath(ext.name) target_dir = os.path.dirname(self.target) try: os.makedirs(target_dir) except: pass if in_source_package: self._install_from_source_package() else: shutil.copyfile(libpylief[platform.system()], self.target) def _install_from_source_package(self): python_version = sys.version_info python_major_version = python_version[0] os_version = get_lief_platform_name() target_extension = os.path.splitext(self.target)[1] url_branch_fmt = "https://github.com/lief-project/packages/raw/lief-{branch}-latest/lief-{version}-py{pyversion}-{platform}.{ext}" url_release_fmt = "https://github.com/lief-project/LIEF/releases/download/{version}/lief-{version}-py{pyversion}-{platform}.{ext}" url_userpath = "~/lief-{version}-py{pyversion}-{platform}.{ext}" url = "" if is_branch: url = url_branch_fmt.format( branch='master', platform=os_version, version=lief_version, pyversion="{}.{}".format(python_version[0], python_version[1]), ext="egg") else: url = url_release_fmt.format( platform=os_version, version=lief_version, pyversion="{}.{}".format(python_version[0], python_version[1]), ext="egg") bdist_egg_log.info("Url: {}".format(url)) egg_data = None network_error = None try: egg_data = urlopen(url).read() except Exception as e: network_error = e if network_error is not None: bdist_egg_log.warn(network_error) url = url_userpath.format( platform=os_version, version=lief_version, pyversion="{}.{}".format(python_version[0], python_version[1]), ext="egg") url = os.path.expanduser(url) if os.path.isfile(url): with open(url, 'rb') as f: egg_data = f.read() else: raise Exception("Unable to find {}".format(url)) egg_file = BytesIO(egg_data) egg_zip = zipfile.ZipFile(egg_file) extension_member = [info for info in egg_zip.infolist() if info.filename.endswith(target_extension)][0] extension_data = egg_zip.read(extension_member) with open(self.target, 'wb') as f: f.write(extension_data) setup( version = lief_version, ext_modules = [Extension('_pylief', [])], cmdclass={ 'build_ext': lief_build_ext, 'bdist_egg': lief_bdist_egg, 'sdist': lief_sdist }, ) LIEF-0.9.0/circle.yml000066400000000000000000000021441330725006400142240ustar00rootroot00000000000000machine: python: version: 2.7.5 environment: PATH: "${HOME}/cmake-3.7.2-Linux-x86_64/bin:${PATH}" PYTHON_VERSION: "2.7" checkout: post: - git fetch && git pull origin ${CIRCLE_BRANCH} compile: pre: - mkdir build - cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DPYTHON_VERSION=${PYTHON_VERSION} -DLIEF_TESTS=on ..: pwd: build override: - make -j3: pwd: build dependencies: pre: - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt-get update; sudo apt-get install gcc-5; sudo apt-get install g++-5 - sudo apt-get install libpython2.7 - sudo apt-get install python2.7-dev - sudo apt-get install python-setuptools - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100 override: - wget --no-check-certificate http://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz - tar -xzf cmake-3.7.2-Linux-x86_64.tar.gz -C ${HOME} test: override: - make check-lief: pwd: build LIEF-0.9.0/cmake/000077500000000000000000000000001330725006400133175ustar00rootroot00000000000000LIEF-0.9.0/cmake/CppcheckTargets.cmake000066400000000000000000000151141330725006400173750ustar00rootroot00000000000000# - Run cppcheck on c++ source files as a custom target and a test # # include(CppcheckTargets) # add_cppcheck( [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [FORCE] [FAIL_ON_WARNINGS]) - # Create a target to check a target's sources with cppcheck and the indicated options # add_cppcheck_sources( [UNUSED_FUNCTIONS] [STYLE] [POSSIBLE_ERROR] [FORCE] [FAIL_ON_WARNINGS]) - # Create a target to check standalone sources with cppcheck and the indicated options # # Requires these CMake modules: # Findcppcheck # # Requires CMake 2.6 or newer (uses the 'function' command) # # Original Author: # 2009-2010 Ryan Pavlik # http://academic.cleardefinition.com # Iowa State University HCI Graduate Program/VRAC # # Copyright Iowa State University 2009-2010. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) if(__add_cppcheck) return() endif() set(__add_cppcheck YES) if(NOT CPPCHECK_FOUND) find_package(cppcheck QUIET) endif() if(CPPCHECK_FOUND) if(NOT TARGET all_cppcheck) add_custom_target(all_cppcheck) set_target_properties(all_cppcheck PROPERTIES EXCLUDE_FROM_ALL TRUE) endif() endif() function(add_cppcheck_sources _targetname) if(CPPCHECK_FOUND) set(_cppcheck_args) set(_input ${ARGN}) list(FIND _input UNUSED_FUNCTIONS _unused_func) if("${_unused_func}" GREATER "-1") list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG}) list(REMOVE_AT _input ${_unused_func}) endif() list(FIND _input STYLE _style) if("${_style}" GREATER "-1") list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG}) list(REMOVE_AT _input ${_style}) endif() list(FIND _input POSSIBLE_ERROR _poss_err) if("${_poss_err}" GREATER "-1") list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG}) list(REMOVE_AT _input ${_poss_err}) endif() list(FIND _input FORCE _force) if("${_force}" GREATER "-1") list(APPEND _cppcheck_args "--force") list(REMOVE_AT _input ${_force}) endif() list(FIND _input FAIL_ON_WARNINGS _fail_on_warn) if("${_fail_on_warn}" GREATER "-1") list(APPEND CPPCHECK_FAIL_REGULAR_EXPRESSION ${CPPCHECK_WARN_REGULAR_EXPRESSION}) list(REMOVE_AT _input ${_fail_on_warn}) endif() set(_files) foreach(_source ${_input}) get_source_file_property(_cppcheck_loc "${_source}" LOCATION) if(_cppcheck_loc) # This file has a source file property, carry on. get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE) if("${_cppcheck_lang}" MATCHES "CXX") list(APPEND _files "${_cppcheck_loc}") endif() else() # This file doesn't have source file properties - figure it out. get_filename_component(_cppcheck_loc "${_source}" ABSOLUTE) if(EXISTS "${_cppcheck_loc}") list(APPEND _files "${_cppcheck_loc}") else() message(FATAL_ERROR "Adding CPPCHECK for file target ${_targetname}: " "File ${_source} does not exist or needs a corrected path location " "since we think its absolute path is ${_cppcheck_loc}") endif() endif() endforeach() if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0") # Older than CMake 2.8.0 add_test(${_targetname}_cppcheck_test "${CPPCHECK_EXECUTABLE}" ${CPPCHECK_TEMPLATE_ARG} ${_cppcheck_args} "--inline-suppr" ${_files}) else() # CMake 2.8.0 and newer add_test(NAME ${_targetname}_cppcheck_test COMMAND "${CPPCHECK_EXECUTABLE}" ${CPPCHECK_TEMPLATE_ARG} ${_cppcheck_args} "--inline-suppr" ${_files}) endif() set_tests_properties(${_targetname}_cppcheck_test PROPERTIES FAIL_REGULAR_EXPRESSION "${CPPCHECK_FAIL_REGULAR_EXPRESSION}") add_custom_command(TARGET all_cppcheck PRE_BUILD COMMAND ${CPPCHECK_EXECUTABLE} ${CPPCHECK_QUIET_ARG} ${CPPCHECK_TEMPLATE_ARG} ${_cppcheck_args} "--inline-suppr" ${_files} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "${_targetname}_cppcheck: Running cppcheck on target ${_targetname}..." VERBATIM) endif() endfunction() function(add_cppcheck _name) if(NOT TARGET ${_name}) message(FATAL_ERROR "add_cppcheck given a target name that does not exist: '${_name}' !") endif() if(CPPCHECK_FOUND) set(_cppcheck_args CACHE STRING "${_cppcheck_args} ") #set(_cppcheck_args "${_cppcheck_args} ") list(FIND ARGN UNUSED_FUNCTIONS _unused_func) if("${_unused_func}" GREATER "-1") list(APPEND _cppcheck_args ${CPPCHECK_UNUSEDFUNC_ARG}) endif() list(FIND ARGN STYLE _style) if("${_style}" GREATER "-1") list(APPEND _cppcheck_args ${CPPCHECK_STYLE_ARG}) endif() list(FIND ARGN POSSIBLE_ERROR _poss_err) if("${_poss_err}" GREATER "-1") list(APPEND _cppcheck_args ${CPPCHECK_POSSIBLEERROR_ARG}) endif() list(FIND ARGN FORCE _force) if("${_force}" GREATER "-1") list(APPEND _cppcheck_args "--force") endif() list(FIND _input FAIL_ON_WARNINGS _fail_on_warn) if("${_fail_on_warn}" GREATER "-1") list(APPEND CPPCHECK_FAIL_REGULAR_EXPRESSION ${CPPCHECK_WARN_REGULAR_EXPRESSION}) list(REMOVE_AT _input ${_unused_func}) endif() get_target_property(_cppcheck_includes "${_name}" INCLUDE_DIRECTORIES) set(_includes) foreach(_include ${_cppcheck_includes}) list(APPEND _includes "-I${_include}") endforeach() get_target_property(_cppcheck_sources "${_name}" SOURCES) set(_files) foreach(_source ${_cppcheck_sources}) get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE) get_source_file_property(_cppcheck_loc "${_source}" LOCATION) if("${_cppcheck_lang}" MATCHES "CXX") list(APPEND _files "${_cppcheck_loc}") endif() endforeach() if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0") # Older than CMake 2.8.0 add_test(${_name}_cppcheck_test "${CPPCHECK_EXECUTABLE}" ${CPPCHECK_TEMPLATE_ARG} ${_cppcheck_args} "--inline-suppr" ${_files}) else() # CMake 2.8.0 and newer add_test(NAME ${_name}_cppcheck_test COMMAND "${CPPCHECK_EXECUTABLE}" ${CPPCHECK_TEMPLATE_ARG} ${_cppcheck_args} "--inline-suppr" ${_files}) endif() set_tests_properties(${_name}_cppcheck_test PROPERTIES FAIL_REGULAR_EXPRESSION "${CPPCHECK_FAIL_REGULAR_EXPRESSION}") MESSAGE(STATUS "CPPCHECKargs: ${_cppcheck_args}") add_custom_command(TARGET all_cppcheck PRE_BUILD COMMAND ${CPPCHECK_EXECUTABLE} ${CPPCHECK_QUIET_ARG} ${CPPCHECK_TEMPLATE_ARG} ${_cppcheck_args} "--inline-suppr" ${_includes} ${_files} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "${_name}_cppcheck: Running cppcheck on target ${_name}..." VERBATIM) endif() endfunction() LIEF-0.9.0/cmake/FindPythonLibsNew.cmake000066400000000000000000000202031330725006400176640ustar00rootroot00000000000000# - Find python libraries # This module finds the libraries corresponding to the Python interpeter # FindPythonInterp provides. # This code sets the following variables: # # PYTHONLIBS_FOUND - have the Python libs been found # PYTHON_PREFIX - path to the Python installation # PYTHON_LIBRARIES - path to the python library # PYTHON_INCLUDE_DIRS - path to where Python.h is found # PYTHON_MODULE_EXTENSION - lib extension, e.g. '.so' or '.pyd' # PYTHON_MODULE_PREFIX - lib name prefix: usually an empty string # PYTHON_SITE_PACKAGES - path to installation site-packages # PYTHON_IS_DEBUG - whether the Python interpreter is a debug build # # Thanks to talljimbo for the patch adding the 'LDVERSION' config # variable usage. #============================================================================= # Copyright 2001-2009 Kitware, Inc. # Copyright 2012 Continuum Analytics, Inc. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # * Neither the names of Kitware, Inc., the Insight Software Consortium, # nor the names of their contributors may be used to endorse or promote # products derived from this software without specific prior written # permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= # Checking for the extension makes sure that `LibsNew` was found and not just `Libs`. if(PYTHONLIBS_FOUND AND PYTHON_MODULE_EXTENSION) return() endif() # Use the Python interpreter to find the libs. if(PythonLibsNew_FIND_REQUIRED) find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED) else() find_package(PythonInterp ${PythonLibsNew_FIND_VERSION}) endif() if(NOT PYTHONINTERP_FOUND) set(PYTHONLIBS_FOUND FALSE) return() endif() # According to http://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter # testing whether sys has the gettotalrefcount function is a reliable, cross-platform # way to detect a CPython debug interpreter. # # The library suffix is from the config var LDVERSION sometimes, otherwise # VERSION. VERSION will typically be like "2.7" on unix, and "27" on windows. execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "from distutils import sysconfig as s;import sys;import struct; print('.'.join(str(v) for v in sys.version_info)); print(sys.prefix); print(s.get_python_inc(plat_specific=True)); print(s.get_python_lib(plat_specific=True)); print(s.get_config_var('SO')); print(hasattr(sys, 'gettotalrefcount')+0); print(struct.calcsize('@P')); print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION')); print(s.get_config_var('LIBDIR') or ''); print(s.get_config_var('MULTIARCH') or ''); " RESULT_VARIABLE _PYTHON_SUCCESS OUTPUT_VARIABLE _PYTHON_VALUES ERROR_VARIABLE _PYTHON_ERROR_VALUE) if(NOT _PYTHON_SUCCESS MATCHES 0) if(PythonLibsNew_FIND_REQUIRED) message(FATAL_ERROR "Python config failure:\n${_PYTHON_ERROR_VALUE}") endif() set(PYTHONLIBS_FOUND FALSE) return() endif() # Convert the process output into a list string(REGEX REPLACE ";" "\\\\;" _PYTHON_VALUES ${_PYTHON_VALUES}) string(REGEX REPLACE "\n" ";" _PYTHON_VALUES ${_PYTHON_VALUES}) list(GET _PYTHON_VALUES 0 _PYTHON_VERSION_LIST) list(GET _PYTHON_VALUES 1 PYTHON_PREFIX) list(GET _PYTHON_VALUES 2 _PYTHON_INCLUDE_DIR) list(GET _PYTHON_VALUES 3 PYTHON_SITE_PACKAGES) list(GET _PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION) list(GET _PYTHON_VALUES 5 PYTHON_IS_DEBUG) list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P) list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX) list(GET _PYTHON_VALUES 8 PYTHON_LIBDIR) list(GET _PYTHON_VALUES 9 PYTHON_MULTIARCH) # Make sure the Python has the same pointer-size as the chosen compiler # Skip if CMAKE_SIZEOF_VOID_P is not defined if(CMAKE_SIZEOF_VOID_P AND (NOT "${PYTHON_SIZEOF_VOID_P}" STREQUAL "${CMAKE_SIZEOF_VOID_P}")) if(PythonLibsNew_FIND_REQUIRED) math(EXPR _PYTHON_BITS "${PYTHON_SIZEOF_VOID_P} * 8") math(EXPR _CMAKE_BITS "${CMAKE_SIZEOF_VOID_P} * 8") message(FATAL_ERROR "Python config failure: Python is ${_PYTHON_BITS}-bit, " "chosen compiler is ${_CMAKE_BITS}-bit") endif() set(PYTHONLIBS_FOUND FALSE) return() endif() # The built-in FindPython didn't always give the version numbers string(REGEX REPLACE "\\." ";" _PYTHON_VERSION_LIST ${_PYTHON_VERSION_LIST}) list(GET _PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR) list(GET _PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR) list(GET _PYTHON_VERSION_LIST 2 PYTHON_VERSION_PATCH) # Make sure all directory separators are '/' string(REGEX REPLACE "\\\\" "/" PYTHON_PREFIX ${PYTHON_PREFIX}) string(REGEX REPLACE "\\\\" "/" _PYTHON_INCLUDE_DIR ${_PYTHON_INCLUDE_DIR}) string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES}) if(CMAKE_HOST_WIN32) set(_PYTHON_LIBRARY "${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib") # when run in a venv, PYTHON_PREFIX points to it. But the libraries remain in the # original python installation. They may be found relative to PYTHON_INCLUDE_DIR. if(NOT EXISTS "${_PYTHON_LIBRARY}") get_filename_component(_PYTHON_ROOT ${_PYTHON_INCLUDE_DIR} DIRECTORY) set(_PYTHON_LIBRARY "${_PYTHON_ROOT}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib") endif() # raise an error if the python libs are still not found. if(NOT EXISTS "${PYTHON_LIBRARY}") message(FATAL_ERROR "Python libraries not found") endif() else() if(PYTHON_MULTIARCH) set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}/${PYTHON_MULTIARCH}" "${PYTHON_LIBDIR}") else() set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}") endif() #message(STATUS "Searching for Python libs in ${_PYTHON_LIBS_SEARCH}") # Probably this needs to be more involved. It would be nice if the config # information the python interpreter itself gave us were more complete. find_library(_PYTHON_LIBRARY NAMES "python${PYTHON_LIBRARY_SUFFIX}" PATHS ${_PYTHON_LIBS_SEARCH} NO_DEFAULT_PATH) # If all else fails, just set the name/version and let the linker figure out the path. if(NOT _PYTHON_LIBRARY) set(_PYTHON_LIBRARY python${PYTHON_LIBRARY_SUFFIX}) endif() endif() MARK_AS_ADVANCED( PYTHON_LIBRARY PYTHON_INCLUDE_DIR ) # We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the # cache entries because they are meant to specify the location of a single # library. We now set the variables listed by the documentation for this # module. SET(PYTHON_INCLUDE_DIRS "${_PYTHON_INCLUDE_DIR}" CACHE PATH "") SET(PYTHON_INCLUDE_DIR "${_PYTHON_INCLUDE_DIR}" CACHE PATH "") SET(PYTHON_LIBRARIES "${_PYTHON_LIBRARY}" CACHE PATH "") SET(PYTHON_LIBRARY "${_PYTHON_LIBRARY}" CACHE PATH "") SET(PYTHON_DEBUG_LIBRARIES "${_PYTHON_DEBUG_LIBRARY}" CACHE PATH "") find_package_message(PYTHON "Found PythonLibs: ${_PYTHON_LIBRARY}" "${PYTHON_EXECUTABLE}${PYTHON_VERSION}") set(PYTHONLIBS_FOUND TRUE) LIEF-0.9.0/cmake/FindSphinx.cmake000066400000000000000000000016531330725006400164000ustar00rootroot00000000000000# CMake find_package() Module for Sphinx documentation generator # http://sphinx-doc.org/ # # Example usage: # # find_package(Sphinx) # # If successful the following variables will be defined # SPHINX_FOUND # SPHINX_EXECUTABLE find_program(SPHINX_EXECUTABLE NAMES sphinx-build sphinx-build2 DOC "Path to sphinx-build executable") # Handle REQUIRED and QUIET arguments # this will also set SPHINX_FOUND to true if SPHINX_EXECUTABLE exists include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Sphinx "Failed to locate sphinx-build executable" SPHINX_EXECUTABLE) # Provide options for controlling different types of output option(SPHINX_OUTPUT_HTML "Output standalone HTML files" ON) option(SPHINX_OUTPUT_MAN "Output man pages" ON) option(SPHINX_WARNINGS_AS_ERRORS "When building documentation treat warnings as errors" ON) LIEF-0.9.0/cmake/Findcppcheck.cmake000066400000000000000000000120011330725006400166740ustar00rootroot00000000000000# - try to find cppcheck tool # # Cache Variables: # CPPCHECK_EXECUTABLE # # Non-cache variables you might use in your CMakeLists.txt: # CPPCHECK_FOUND # CPPCHECK_POSSIBLEERROR_ARG # CPPCHECK_UNUSEDFUNC_ARG # CPPCHECK_STYLE_ARG # CPPCHECK_QUIET_ARG # CPPCHECK_INCLUDEPATH_ARG # CPPCHECK_FAIL_REGULAR_EXPRESSION # CPPCHECK_WARN_REGULAR_EXPRESSION # CPPCHECK_MARK_AS_ADVANCED - whether to mark our vars as advanced even # if we don't find this program. # # Requires these CMake modules: # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) # # Original Author: # 2009-2010 Ryan Pavlik # http://academic.cleardefinition.com # Iowa State University HCI Graduate Program/VRAC # # Copyright Iowa State University 2009-2010. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) file(TO_CMAKE_PATH "${CPPCHECK_ROOT_DIR}" CPPCHECK_ROOT_DIR) set(CPPCHECK_ROOT_DIR "${CPPCHECK_ROOT_DIR}" CACHE PATH "Path to search for cppcheck") # cppcheck app bundles on Mac OS X are GUI, we want command line only set(_oldappbundlesetting ${CMAKE_FIND_APPBUNDLE}) set(CMAKE_FIND_APPBUNDLE NEVER) if(CPPCHECK_EXECUTABLE AND NOT EXISTS "${CPPCHECK_EXECUTABLE}") set(CPPCHECK_EXECUTABLE "notfound" CACHE PATH FORCE "") endif() # If we have a custom path, look there first. if(CPPCHECK_ROOT_DIR) find_program(CPPCHECK_EXECUTABLE NAMES cppcheck cli PATHS "${CPPCHECK_ROOT_DIR}" PATH_SUFFIXES cli NO_DEFAULT_PATH) endif() find_program(CPPCHECK_EXECUTABLE NAMES cppcheck) # Restore original setting for appbundle finding set(CMAKE_FIND_APPBUNDLE ${_oldappbundlesetting}) # Find out where our test file is get_filename_component(_cppcheckmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) set(_cppcheckdummyfile "${_cppcheckmoddir}/Findcppcheck.cpp") if(NOT EXISTS "${_cppcheckdummyfile}") message(FATAL_ERROR "Missing file ${_cppcheckdummyfile} - should be alongside Findcppcheck.cmake, can be found at https://github.com/rpavlik/cmake-modules") endif() function(_cppcheck_test_arg _resultvar _arg) if(NOT CPPCHECK_EXECUTABLE) set(${_resultvar} NO) return() endif() execute_process(COMMAND "${CPPCHECK_EXECUTABLE}" "${_arg}" "--quiet" "${_cppcheckdummyfile}" RESULT_VARIABLE _cppcheck_result OUTPUT_QUIET ERROR_QUIET) if("${_cppcheck_result}" EQUAL 0) set(${_resultvar} YES PARENT_SCOPE) else() set(${_resultvar} NO PARENT_SCOPE) endif() endfunction() function(_cppcheck_set_arg_var _argvar _arg) if("${${_argvar}}" STREQUAL "") _cppcheck_test_arg(_cppcheck_arg "${_arg}") if(_cppcheck_arg) set(${_argvar} "${_arg}" PARENT_SCOPE) endif() endif() endfunction() if(CPPCHECK_EXECUTABLE) # Check for the two types of command line arguments by just trying them _cppcheck_set_arg_var(CPPCHECK_STYLE_ARG "--enable=style") _cppcheck_set_arg_var(CPPCHECK_STYLE_ARG "--style") if("${CPPCHECK_STYLE_ARG}" STREQUAL "--enable=style") _cppcheck_set_arg_var(CPPCHECK_UNUSEDFUNC_ARG "--enable=unusedFunction") _cppcheck_set_arg_var(CPPCHECK_INFORMATION_ARG "--enable=information") _cppcheck_set_arg_var(CPPCHECK_MISSINGINCLUDE_ARG "--enable=missingInclude") _cppcheck_set_arg_var(CPPCHECK_POSIX_ARG "--enable=posix") _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG "--enable=possibleError") _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG "--enable=all") if(MSVC) set(CPPCHECK_TEMPLATE_ARG --template vs) set(CPPCHECK_FAIL_REGULAR_EXPRESSION "[(]error[)]") set(CPPCHECK_WARN_REGULAR_EXPRESSION "[(]style[)]") elseif(CMAKE_COMPILER_IS_GNUCXX) set(CPPCHECK_TEMPLATE_ARG --template gcc) set(CPPCHECK_FAIL_REGULAR_EXPRESSION " error: ") set(CPPCHECK_WARN_REGULAR_EXPRESSION " style: ") else() set(CPPCHECK_TEMPLATE_ARG --template gcc) set(CPPCHECK_FAIL_REGULAR_EXPRESSION " error: ") set(CPPCHECK_WARN_REGULAR_EXPRESSION " style: ") endif() elseif("${CPPCHECK_STYLE_ARG}" STREQUAL "--style") # Old arguments _cppcheck_set_arg_var(CPPCHECK_UNUSEDFUNC_ARG "--unused-functions") _cppcheck_set_arg_var(CPPCHECK_POSSIBLEERROR_ARG "--all") set(CPPCHECK_FAIL_REGULAR_EXPRESSION "error:") set(CPPCHECK_WARN_REGULAR_EXPRESSION "[(]style[)]") else() # No idea - some other issue must be getting in the way message(STATUS "WARNING: Can't detect whether CPPCHECK wants new or old-style arguments!") endif() set(CPPCHECK_QUIET_ARG "--quiet") set(CPPCHECK_INCLUDEPATH_ARG "-I") endif() set(CPPCHECK_ALL "${CPPCHECK_EXECUTABLE} ${CPPCHECK_POSSIBLEERROR_ARG} ${CPPCHECK_UNUSEDFUNC_ARG} ${CPPCHECK_STYLE_ARG} ${CPPCHECK_QUIET_ARG} ${CPPCHECK_INCLUDEPATH_ARG} some/include/path") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(cppcheck DEFAULT_MSG CPPCHECK_ALL CPPCHECK_EXECUTABLE CPPCHECK_POSSIBLEERROR_ARG CPPCHECK_UNUSEDFUNC_ARG CPPCHECK_STYLE_ARG CPPCHECK_INCLUDEPATH_ARG CPPCHECK_QUIET_ARG) if(CPPCHECK_FOUND OR CPPCHECK_MARK_AS_ADVANCED) mark_as_advanced(CPPCHECK_ROOT_DIR) endif() mark_as_advanced(CPPCHECK_EXECUTABLE) LIEF-0.9.0/cmake/Findcppcheck.cpp000066400000000000000000000004111330725006400164000ustar00rootroot00000000000000/** * \file Findcppcheck.cpp * \brief Dummy C++ source file used by CMake module Findcppcheck.cmake * * \author * Ryan Pavlik, 2009-2010 * * http://academic.cleardefinition.com/ * */ int main(int argc, char* argv[]) { return 0; } LIEF-0.9.0/cmake/LIEFApi.cmake000066400000000000000000000033761330725006400155030ustar00rootroot00000000000000if(__add_lief_api) return() endif() set(__add_lief_api ON) # Python # ------ if (LIEF_PYTHON_API) if(WIN32) set(PYTHON_BUILD_LIEF_DIRECTORY "${CMAKE_BINARY_DIR}/api/python/Release") else() set(PYTHON_BUILD_LIEF_DIRECTORY "${CMAKE_BINARY_DIR}/api/python") endif() add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/api/python") endif() # C API # ----- if(LIEF_C_API) # ELF configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/enums.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/ELF/enums.h" @ONLY ) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/structures.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/ELF/structures.h" @ONLY ) # PE configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/enums.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/PE/enums.h" @ONLY ) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/structures.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/PE/structures.h" @ONLY ) # MachO configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/enums.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/MachO/enums.h" @ONLY ) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/structures.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/MachO/structures.h" @ONLY ) target_include_directories(LIB_LIEF_STATIC PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include" PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include") target_include_directories(LIB_LIEF_SHARED PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include" PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include") include("${CMAKE_CURRENT_SOURCE_DIR}/api/c/CMakeLists.txt") endif() LIEF-0.9.0/cmake/LIEFCompilerDetection.cmake000066400000000000000000000010721330725006400203720ustar00rootroot00000000000000if(__add_lief_compiler_detection) return() endif() set(__add_lief_compiler_detection ON) set(LIEF_SUPPORT_CXX11 0) set(LIEF_SUPPORT_CXX14 0) set(LIEF_SUPPORT_CXX17 0) if (cxx_std_11 IN_LIST CMAKE_CXX_COMPILE_FEATURES) set(LIEF_SUPPORT_CXX11 1) endif() if (cxx_std_14 IN_LIST CMAKE_CXX_COMPILE_FEATURES) set(LIEF_SUPPORT_CXX14 1) endif() if (cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES) set(LIEF_SUPPORT_CXX17 1) endif() configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/src/compiler_support.h.in" "${CMAKE_CURRENT_BINARY_DIR}/compiler_support.h" @ONLY ) LIEF-0.9.0/cmake/LIEFCompilerFlags.cmake000066400000000000000000000174331330725006400175200ustar00rootroot00000000000000include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) if(__add_lief_compiler_flags) return() endif() set(__add_lief_compiler_flags ON) function(append value) foreach(variable ${ARGN}) set(${variable} "${${variable}} ${value}" PARENT_SCOPE) endforeach(variable) endfunction() function(append_if condition value) if (${condition}) foreach(variable ${ARGN}) set(${variable} "${${variable}} ${value}" PARENT_SCOPE) endforeach(variable) endif() endfunction() macro(ADD_FLAG_IF_SUPPORTED flag name) CHECK_C_COMPILER_FLAG("${flag}" "C_SUPPORTS_${name}") CHECK_CXX_COMPILER_FLAG("${flag}" "CXX_SUPPORTS_${name}") if (C_SUPPORTS_${name}) target_compile_options(LIB_LIEF_STATIC PRIVATE ${flag}) target_compile_options(LIB_LIEF_SHARED PRIVATE ${flag}) endif() if (CXX_SUPPORTS_${name}) target_compile_options(LIB_LIEF_STATIC PRIVATE ${flag}) target_compile_options(LIB_LIEF_SHARED PRIVATE ${flag}) endif() endmacro() if (MSVC) add_definitions(-DNOMINMAX) target_compile_options(LIB_LIEF_STATIC PUBLIC /FIiso646.h) target_compile_options(LIB_LIEF_SHARED PUBLIC /FIiso646.h) if (CMAKE_BUILD_TYPE MATCHES "Debug") target_compile_options(LIB_LIEF_STATIC PUBLIC /MTd) else() target_compile_options(LIB_LIEF_STATIC PUBLIC /MT) endif() endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (UNIX) if (LIEF_FORCE32) target_compile_options(LIB_LIEF_STATIC PRIVATE -m32) target_compile_options(LIB_LIEF_SHARED PRIVATE -m32) set_property(TARGET LIB_LIEF_STATIC LIB_LIEF_SHARED PROPERTY LINK_FLAGS -m32) endif() endif() endif() if (NOT MSVC) ADD_FLAG_IF_SUPPORTED("-Wall" WALL) ADD_FLAG_IF_SUPPORTED("-Wextra" WEXTRA) ADD_FLAG_IF_SUPPORTED("-Wpedantic" WPEDANTIC) ADD_FLAG_IF_SUPPORTED("-fno-stack-protector" NO_STACK_PROTECTOR) ADD_FLAG_IF_SUPPORTED("-fomit-frame-pointer" OMIT_FRAME_POINTER) ADD_FLAG_IF_SUPPORTED("-fno-strict-aliasing" NO_STRICT_ALIASING) ADD_FLAG_IF_SUPPORTED("-fexceptions" EXCEPTION) ADD_FLAG_IF_SUPPORTED("-fvisibility=hidden" VISIBILITY) ADD_FLAG_IF_SUPPORTED("-Wno-expansion-to-defined" NO_EXPANSION_TO_DEFINED) endif() #ADD_FLAG_IF_SUPPORTED("-Wduplicated-cond" HAS_DUPLICATED_COND) #ADD_FLAG_IF_SUPPORTED("-Wduplicated-branches" HAS_DUPLICATED_BRANCHES) #ADD_FLAG_IF_SUPPORTED("-Wlogical-op" HAS_LOGICAL_OP) #ADD_FLAG_IF_SUPPORTED("-Wshadow" HAS_SHADOW) # ========================================= # MSVC FLAGS # This part is inspired from LLVM: # https://github.com/llvm-mirror/llvm/blob/a86576d8771c89502d239f0b85a1a6992020aa47/cmake/modules/HandleLLVMOptions.cmake # ========================================= set(msvc_warning_flags # Disabled warnings. -wd4141 # Suppress ''modifier' : used more than once' (because of __forceinline combined with inline) -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned' -wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored' -wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data' -wd4258 # Suppress ''var' : definition from the for loop is ignored; the definition from the enclosing scope is used' -wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data' -wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception' -wd4345 # Suppress 'behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized' -wd4351 # Suppress 'new behavior: elements of array 'array' will be default initialized' -wd4355 # Suppress ''this' : used in base member initializer list' -wd4456 # Suppress 'declaration of 'var' hides local variable' -wd4457 # Suppress 'declaration of 'var' hides function parameter' -wd4458 # Suppress 'declaration of 'var' hides class member' -wd4459 # Suppress 'declaration of 'var' hides global declaration' -wd4503 # Suppress ''identifier' : decorated name length exceeded, name was truncated' -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible' -wd4722 # Suppress 'function' : destructor never returns, potential memory leak -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)' -wd4100 # Suppress 'unreferenced formal parameter' -wd4127 # Suppress 'conditional expression is constant' -wd4512 # Suppress 'assignment operator could not be generated' -wd4505 # Suppress 'unreferenced local function has been removed' -wd4610 # Suppress ' can never be instantiated' -wd4510 # Suppress 'default constructor could not be generated' -wd4702 # Suppress 'unreachable code' -wd4245 # Suppress 'signed/unsigned mismatch' -wd4706 # Suppress 'assignment within conditional expression' -wd4310 # Suppress 'cast truncates constant value' -wd4701 # Suppress 'potentially uninitialized local variable' -wd4703 # Suppress 'potentially uninitialized local pointer variable' -wd4389 # Suppress 'signed/unsigned mismatch' -wd4611 # Suppress 'interaction between '_setjmp' and C++ object destruction is non-portable' -wd4805 # Suppress 'unsafe mix of type and type in operation' -wd4204 # Suppress 'nonstandard extension used : non-constant aggregate initializer' -wd4577 # Suppress 'noexcept used with no exception handling mode specified; termination on exception is not guaranteed' -wd4091 # Suppress 'typedef: ignored on left of '' when no variable is declared' # C4592 is disabled because of false positives in Visual Studio 2015 # Update 1. Re-evaluate the usefulness of this diagnostic with Update 2. -wd4592 # Suppress ''var': symbol will be dynamically initialized (implementation limitation) -wd4319 # Suppress ''operator' : zero extending 'type' to 'type' of greater size' -wd4710 # Suppress 'function not inlined' -wd4820 # Suppress 'XXX bytes padding added after data member' -wd4514 # Suppress 'unreferenced inline function has been removed' # Ideally, we'd like this warning to be enabled, but MSVC 2013 doesn't # support the 'aligned' attribute in the way that clang sources requires (for # any code that uses the LLVM_ALIGNAS macro), so this is must be disabled to # avoid unwanted alignment warnings. # When we switch to requiring a version of MSVC that supports the 'alignas' # specifier (MSVC 2015?) this warning can be re-enabled. -wd4324 # Suppress 'structure was padded due to __declspec(align())' # Promoted warnings. -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning. # Promoted warnings to errors. -we4238 # Promote 'nonstandard extension used : class rvalue used as lvalue' to error. ) if (MSVC) set(msvc_warning_flags "/W4 ${msvc_warning_flags}") string(REGEX REPLACE " /W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REGEX REPLACE " /W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") #foreach(flag ${msvc_warning_flags}) # target_compile_options(LIB_LIEF_STATIC PRIVATE ${flag}) # target_compile_options(LIB_LIEF_SHARED PRIVATE ${flag}) #endforeach(flag) endif() # Speed up MSVC build if (MSVC_IDE) set(LIEF_COMPILER_JOBS "0" CACHE STRING "Number of parallel compiler jobs. 0 means use all processors. Default is 0.") if (NOT LIEF_COMPILER_JOBS STREQUAL "1") if(LIEF_COMPILER_JOBS STREQUAL "0") message(STATUS "Number of parallel compiler jobs set to /MP") add_definitions(/MP) else() message(STATUS "Number of parallel compiler jobs set to /MP${LIEF_COMPILER_JOBS}") add_definitions(/MP${LIEF_COMPILER_JOBS}) endif() else() message(STATUS "Parallel compilation disabled") endif() endif() LIEF-0.9.0/cmake/LIEFDependencies.cmake000066400000000000000000000221451330725006400173530ustar00rootroot00000000000000if(__add_lief_dependencies) return() endif() set(__add_lief_dependencies ON) # Json # ---- if (LIEF_ENABLE_JSON) set(LIBJSON_VERSION 3.1.1) set(LIBJSON_SHA256 SHA256=8ccdc36563c714bd5e9e3944b1f210285b7401bce3f2fba6e7b87ef06704401b) set(LIBJSON_URL "${THIRD_PARTY_DIRECTORY}/json-${LIBJSON_VERSION}.zip" CACHE STRING "URL to the JSON lib repo") ExternalProject_Add(lief_libjson URL ${LIBJSON_URL} URL_HASH ${LIBJSON_SHA256} UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "") ExternalProject_get_property(lief_libjson SOURCE_DIR) set(LIBJSON_SOURCE_DIR "${SOURCE_DIR}") message(STATUS "Enable JSON support") set(ENABLE_JSON_SUPPORT 1) else() message(STATUS "Disable JSON support") set(ENABLE_JSON_SUPPORT 0) endif() # Rang # ---- set(LIBRANG_VERSION 2.1) set(LIBRANG_SHA256 SHA256=32e0af3d3d4f628a26e7330d4384a93b16677e5fed57fbdf45ea267c525deba0) set(LIBRANG_URL "${THIRD_PARTY_DIRECTORY}/rang-${LIBRANG_VERSION}.zip") ExternalProject_Add(lief_rang_cpp_color URL ${LIBRANG_URL} URL_HASH ${LIBRANG_SHA256} UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "") ExternalProject_get_property(lief_rang_cpp_color SOURCE_DIR) set(LIBRANG_SOURCE_DIR "${SOURCE_DIR}") # mbed TLS # -------- set(MBED_TLS_VERSION 2.6.0) set(MBED_TLS_SHA256 SHA256=695e88deb49373bed2a4dd53ce693066eb079135d59d5f30ec5a7a2603fd26ff) set(MBED_TLS_URL "${THIRD_PARTY_DIRECTORY}/mbedtls-${MBED_TLS_VERSION}.zip" CACHE STRING "URL to MbedTLS") set(MBED_TLS_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/mbed_tls") ExternalProject_Add(lief_mbed_tls PREFIX ${MBED_TLS_PREFIX} CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" URL ${MBED_TLS_URL} URL_HASH ${MBED_TLS_SHA256} UPDATE_COMMAND "" # repetitive update are a pain BUILD_BYPRODUCTS ${MBED_TLS_PREFIX}) ExternalProject_get_property(lief_mbed_tls SOURCE_DIR) set(MBEDTLS_SOURCE_DIR "${SOURCE_DIR}") set(MBEDTLS_INCLUDE_DIRS "${MBEDTLS_SOURCE_DIR}/include") set(mbedtls_src_crypto "${MBEDTLS_SOURCE_DIR}/library/aes.c" "${MBEDTLS_SOURCE_DIR}/library/aesni.c" "${MBEDTLS_SOURCE_DIR}/library/arc4.c" "${MBEDTLS_SOURCE_DIR}/library/asn1parse.c" "${MBEDTLS_SOURCE_DIR}/library/asn1write.c" "${MBEDTLS_SOURCE_DIR}/library/base64.c" "${MBEDTLS_SOURCE_DIR}/library/bignum.c" "${MBEDTLS_SOURCE_DIR}/library/blowfish.c" "${MBEDTLS_SOURCE_DIR}/library/camellia.c" "${MBEDTLS_SOURCE_DIR}/library/ccm.c" "${MBEDTLS_SOURCE_DIR}/library/cipher.c" "${MBEDTLS_SOURCE_DIR}/library/cipher_wrap.c" "${MBEDTLS_SOURCE_DIR}/library/cmac.c" "${MBEDTLS_SOURCE_DIR}/library/ctr_drbg.c" "${MBEDTLS_SOURCE_DIR}/library/des.c" "${MBEDTLS_SOURCE_DIR}/library/dhm.c" "${MBEDTLS_SOURCE_DIR}/library/ecdh.c" "${MBEDTLS_SOURCE_DIR}/library/ecdsa.c" "${MBEDTLS_SOURCE_DIR}/library/ecjpake.c" "${MBEDTLS_SOURCE_DIR}/library/ecp.c" "${MBEDTLS_SOURCE_DIR}/library/ecp_curves.c" "${MBEDTLS_SOURCE_DIR}/library/entropy.c" "${MBEDTLS_SOURCE_DIR}/library/entropy_poll.c" "${MBEDTLS_SOURCE_DIR}/library/error.c" "${MBEDTLS_SOURCE_DIR}/library/gcm.c" "${MBEDTLS_SOURCE_DIR}/library/havege.c" "${MBEDTLS_SOURCE_DIR}/library/hmac_drbg.c" "${MBEDTLS_SOURCE_DIR}/library/md.c" "${MBEDTLS_SOURCE_DIR}/library/md2.c" "${MBEDTLS_SOURCE_DIR}/library/md4.c" "${MBEDTLS_SOURCE_DIR}/library/md5.c" "${MBEDTLS_SOURCE_DIR}/library/md_wrap.c" "${MBEDTLS_SOURCE_DIR}/library/memory_buffer_alloc.c" "${MBEDTLS_SOURCE_DIR}/library/oid.c" "${MBEDTLS_SOURCE_DIR}/library/padlock.c" "${MBEDTLS_SOURCE_DIR}/library/pem.c" "${MBEDTLS_SOURCE_DIR}/library/pk.c" "${MBEDTLS_SOURCE_DIR}/library/pk_wrap.c" "${MBEDTLS_SOURCE_DIR}/library/pkcs12.c" "${MBEDTLS_SOURCE_DIR}/library/pkcs5.c" "${MBEDTLS_SOURCE_DIR}/library/pkparse.c" "${MBEDTLS_SOURCE_DIR}/library/pkwrite.c" "${MBEDTLS_SOURCE_DIR}/library/platform.c" "${MBEDTLS_SOURCE_DIR}/library/ripemd160.c" "${MBEDTLS_SOURCE_DIR}/library/rsa.c" "${MBEDTLS_SOURCE_DIR}/library/sha1.c" "${MBEDTLS_SOURCE_DIR}/library/sha256.c" "${MBEDTLS_SOURCE_DIR}/library/sha512.c" "${MBEDTLS_SOURCE_DIR}/library/threading.c" "${MBEDTLS_SOURCE_DIR}/library/timing.c" "${MBEDTLS_SOURCE_DIR}/library/version.c" "${MBEDTLS_SOURCE_DIR}/library/version_features.c" "${MBEDTLS_SOURCE_DIR}/library/xtea.c" ) set(mbedtls_src_x509 "${MBEDTLS_SOURCE_DIR}/library/certs.c" "${MBEDTLS_SOURCE_DIR}/library/pkcs11.c" "${MBEDTLS_SOURCE_DIR}/library/x509.c" "${MBEDTLS_SOURCE_DIR}/library/x509_create.c" "${MBEDTLS_SOURCE_DIR}/library/x509_crl.c" "${MBEDTLS_SOURCE_DIR}/library/x509_crt.c" "${MBEDTLS_SOURCE_DIR}/library/x509_csr.c" "${MBEDTLS_SOURCE_DIR}/library/x509write_crt.c" "${MBEDTLS_SOURCE_DIR}/library/x509write_csr.c" ) set(mbedtls_src_tls "${MBEDTLS_SOURCE_DIR}/library/debug.c" "${MBEDTLS_SOURCE_DIR}/library/net_sockets.c" "${MBEDTLS_SOURCE_DIR}/library/ssl_cache.c" "${MBEDTLS_SOURCE_DIR}/library/ssl_ciphersuites.c" "${MBEDTLS_SOURCE_DIR}/library/ssl_cli.c" "${MBEDTLS_SOURCE_DIR}/library/ssl_cookie.c" "${MBEDTLS_SOURCE_DIR}/library/ssl_srv.c" "${MBEDTLS_SOURCE_DIR}/library/ssl_ticket.c" "${MBEDTLS_SOURCE_DIR}/library/ssl_tls.c" ) #set_source_files_properties("${MBEDTLS_SOURCE_DIR}/library/bignum.c" PROPERTIES COMPILE_FLAGS -Wno-overlength-strings) # easyloggingpp # ------------- if (LIEF_LOGGING) set(ELG_VERSION 9.94.2) set(ELG_SHA256 SHA256=f99adeb098e28cd6c97ebb7dfe8ddd55bf6b79578aa65b55c34b4b2527f1f235) set(ELG_URL "${THIRD_PARTY_DIRECTORY}/easyloggingpp-${ELG_VERSION}.zip" CACHE STRING "URL to the easyloggingpp lib repo") ExternalProject_Add(lief_easyloggingpp URL ${ELG_URL} URL_HASH ${ELG_SHA256} CONFIGURE_COMMAND "" BUILD_COMMAND "" UPDATE_COMMAND "" INSTALL_COMMAND "") ExternalProject_get_property(lief_easyloggingpp SOURCE_DIR) set(ELG_SOURCE_DIR "${SOURCE_DIR}/src") endif() # Fuzzing # ~~~~~~~ set(FUZZING_FLAGS -fno-omit-frame-pointer -g -O1) set(FUZZING_LINKER_FLAGS) list(APPEND FUZZING_FLAGS -fsanitize=address -fsanitize-coverage=trace-pc-guard) list(APPEND FUZZING_LINKER_FLAGS -fsanitize=address -fsanitize-coverage=trace-pc-guard) set(LIBFUZZER_SRC_FILES) if (LIEF_FUZZING) message(STATUS "Fuzzing Enabled") set(LIBFUZZER_VERSION 8ff5640b48c4c4a3b974daa10a5f445e86ed7428) set(LIBFUZZER_SHA256 SHA256=ed067ebc72b993571854edb113e9f3ef74367dfb8bab1a252009aff72e287614) set(LIBFUZZER_URL "${THIRD_PARTY_DIRECTORY}/LibFuzzer-${LIBFUZZER_VERSION}.zip") ExternalProject_Add(lief_libfuzzer URL ${LIBFUZZER_URL} URL_HASH ${LIBFUZZER_SHA256} CONFIGURE_COMMAND "" UPDATE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "") ExternalProject_get_property(lief_libfuzzer SOURCE_DIR) set(LIBFUZZER_SOURCE_DIR "${SOURCE_DIR}") set(LIBFUZZER_SRC_FILES "${LIBFUZZER_SOURCE_DIR}/FuzzerSHA1.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerUtilLinux.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerIO.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerMain.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerShmemWindows.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerUtilWindows.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerUtil.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerExtFunctionsDlsym.cpp" #${LIBFUZZER_SOURCE_DIR}/afl/afl_driver.cpp "${LIBFUZZER_SOURCE_DIR}/FuzzerShmemPosix.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerUtilDarwin.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerIOWindows.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerExtFunctionsDlsymWin.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerCrossOver.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerDriver.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerExtFunctionsWeak.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerUtilPosix.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerExtFunctionsWeakAlias.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerIOPosix.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerMerge.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerTracePC.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerMutate.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerExtraCounters.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerLoop.cpp" "${LIBFUZZER_SOURCE_DIR}/FuzzerClangCounters.cpp" ) list(APPEND LIBLIEF_SOURCE_FILES ${LIBFUZZER_SRC_FILES}) set_source_files_properties(${LIBFUZZER_SRC_FILES} PROPERTIES GENERATED TRUE) add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/fuzzing") endif() # Frozen # ------ set(LIEF_FROZEN_ENABLED 0) if (LIEF_SUPPORT_CXX14 AND NOT LIEF_DISABLE_FROZEN) message(STATUS "Enable Frozen (C++14 support)") set(LIEF_FROZEN_ENABLED 1) set(FROZEN_VERSION 2f608b5) set(FROZEN_SHA256 SHA256=e72a59976beb55f4d608d195745b9fbd51f8bcff20a23060b18f20a46873bddf) set(FROZEN_URL "${THIRD_PARTY_DIRECTORY}/frozen-${FROZEN_VERSION}.zip" CACHE STRING "URL to Frozen") ExternalProject_Add(lief_frozen URL ${FROZEN_URL} URL_HASH ${FROZEN_SHA256} CONFIGURE_COMMAND "" BUILD_COMMAND "" UPDATE_COMMAND "" INSTALL_COMMAND "") ExternalProject_get_property(lief_frozen SOURCE_DIR) set(FROZEN_INCLUDE_DIR "${SOURCE_DIR}/include") endif() LIEF-0.9.0/cmake/LIEFGit.cmake000066400000000000000000000026501330725006400155070ustar00rootroot00000000000000if(__add_lief_git) return() endif() set(__add_lief_git ON) execute_process( COMMAND ${GIT_EXECUTABLE} log -1 --format=%h WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE LIEF_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND ${GIT_EXECUTABLE} rev-list --count ${LIEF_COMMIT_HASH} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE LIEF_COMMIT_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE LIEF_GIT_TAG OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND ${GIT_EXECUTABLE} tag --list --points-at=HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE LIEF_GIT_COMMIT_TAGGED OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE LIEF_GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) string(COMPARE NOTEQUAL "${LIEF_GIT_COMMIT_TAGGED}" "" LIEF_IS_TAGGED) STRING(REGEX MATCHALL "([0-9]+)" VERSION_STRING "${LIEF_GIT_TAG}") message(STATUS "Tagged: ${LIEF_IS_TAGGED}") if (${LIEF_IS_TAGGED}) message(STATUS "Tag: ${LIEF_GIT_TAG}") endif() message(STATUS "Current branch: ${LIEF_GIT_BRANCH}") list(GET VERSION_STRING 0 LIEF_VERSION_MAJOR) list(GET VERSION_STRING 1 LIEF_VERSION_MINOR) list(GET VERSION_STRING 2 LIEF_VERSION_PATCH) LIEF-0.9.0/cmake/LIEFOptions.cmake000066400000000000000000000037321330725006400164210ustar00rootroot00000000000000if(__add_lief_options) return() endif() set(__add_lief_options ON) option(LIEF_TESTS "Enable tests" OFF) option(LIEF_DOC "Enable documentation" OFF) option(LIEF_PYTHON_API "Enable Python API" ON) option(LIEF_INSTALL_PYTHON "Install Python bindings" OFF) option(LIEF_C_API "C API" ON) option(LIEF_EXAMPLES "Build LIEF C++ examples" ON) option(LIEF_FORCE32 "Force build LIEF 32 bits version" OFF) option(LIEF_COVERAGE "Perform code coverage" OFF) option(LIEF_USE_CCACHE "Use ccache to speed up compilation" ON) option(LIEF_EXTRA_WARNINGS "Enable extra warning from the compiler" OFF) option(LIEF_LOGGING "Enable logging" ON) option(LIEF_ENABLE_JSON "Enable JSON-related APIs" ON) option(LIEF_SHARED_LIB "Enable shared lib" ON) option(LIEF_DISABLE_FROZEN "Disable Frozen even if it is supported" OFF) option(LIEF_ELF "Build LIEF with ELF module" ON) option(LIEF_PE "Build LIEF with PE module" ON) option(LIEF_MACHO "Build LIEF with MachO module" ON) option(LIEF_OAT "Build LIEF with OAT module" ON) option(LIEF_DEX "Build LIEF with DEX module" ON) option(LIEF_VDEX "Build LIEF with VDEX module" ON) option(LIEF_ART "Build LIEF with ART module" ON) # Sanitizer option(LIEF_ASAN "Enable Address sanitizer" OFF) option(LIEF_LSAN "Enable Leak sanitizer" OFF) option(LIEF_TSAN "Enable Thread sanitizer" OFF) option(LIEF_USAN "Enable undefined sanitizer" OFF) # Fuzzer option(LIEF_FUZZING "Fuzz LIEF" OFF) # Profiling option(LIEF_PROFILING "Enable performance profiling" OFF) LIEF-0.9.0/doc/000077500000000000000000000000001330725006400130045ustar00rootroot00000000000000LIEF-0.9.0/doc/CMakeLists.txt000066400000000000000000000063111330725006400155450ustar00rootroot00000000000000find_package(Doxygen) find_package(Sphinx) if(NOT DOXYGEN_FOUND) message(STATUS "Doc disabled: doxygen not found") elseif(NOT SPHINX_FOUND) message(FATAL "Doc disabled: sphinx-build not found") elseif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) message(STATUS "You have to build the doc in another directory !") else() configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doxygen/Doxyfile @ONLY) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/conf.py @ONLY) file(GLOB PACKER_DOC_RST RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/sphinx" "${CMAKE_CURRENT_SOURCE_DIR}/sphinx/*.rst") file( COPY ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src PATTERN "*.in" EXCLUDE) file( COPY ${CMAKE_CURRENT_SOURCE_DIR}/sphinx/_static DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static ) ################### # FIND PACKAGE #################### file( COPY ${CMAKE_SOURCE_DIR}/examples/cmake/find_package/CMakeLists.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/ ) file( RENAME ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/CMakeLists.txt ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/CMakeFindPackage.cmake ) # Find Package Readme file( COPY ${CMAKE_SOURCE_DIR}/examples/cmake/find_package/README.rst DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/ ) file( RENAME ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/README.rst ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/ReadmeFindPackage.rst ) #################### # EXTERNAL PROJECT #################### file( COPY ${CMAKE_SOURCE_DIR}/examples/cmake/external_project/CMakeLists.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/ ) file( RENAME ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/CMakeLists.txt ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/CMakeExternalProject.cmake ) file( COPY ${CMAKE_SOURCE_DIR}/examples/cmake/external_project/README.rst DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/ ) file( RENAME ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/README.rst ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src/_static/ReadmeExternalProject.rst ) #################### add_custom_target(doc-lief ALL COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen/Doxyfile COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${PROJECT_BINARY_DIR}/api/python:$ENV{PYTHONPATH}" ${SPHINX_EXECUTABLE} -a -E ${CMAKE_CURRENT_BINARY_DIR}/sphinx-src sphinx-doc DEPENDS pyLIEF LIB_LIEF_STATIC WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating documentation with Doxygen and Sphinx" VERBATIM) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html/ DESTINATION share/LIEF/doc/doxygen COMPONENT doc) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sphinx-doc/ DESTINATION share/LIEF/doc/sphinx COMPONENT doc) endif() LIEF-0.9.0/doc/doxygen/000077500000000000000000000000001330725006400144615ustar00rootroot00000000000000LIEF-0.9.0/doc/doxygen/Doxyfile.in000066400000000000000000003176271330725006400166140ustar00rootroot00000000000000# Doxyfile 1.8.10 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = "Library to Instrument Executable Formats (LIEF)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = "Version @LIEF_VERSION_MAJOR@.@LIEF_VERSION_MINOR@.@LIEF_VERSION_PATCH@ - @LIEF_COMMIT_HASH@" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = @PROJECT_SOURCE_DIR@/doc/doxygen/logo_lief_55.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = ./doxygen # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = YES # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = NO # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = NO # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = \ @PROJECT_SOURCE_DIR@/src \ @PROJECT_SOURCE_DIR@/include/LIEF \ @PROJECT_SOURCE_DIR@/api/c \ @PROJECT_BINARY_DIR@/include/LIEF # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, # *.vhdl, *.ucf, *.qsf, *.as and *.js. FILE_PATTERNS = *.cpp *.hpp *.h *.c *.def *.tcc # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). # EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/doc/doxygen/welcome.html # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. #USE_MDFILE_AS_MAINPAGE = index.md #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. #HTML_HEADER = @CMAKE_CURRENT_BINARY_DIR@/doxygen/header.html HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. #HTML_FOOTER = @CMAKE_CURRENT_BINARY_DIR@/doxygen/footer.html HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = #HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_BINARY_DIR@/doxygen/customdoxygen.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = YES # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = YES # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = lief.qch # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.lief # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = liefdoc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = /usr/bin/qhelpgenerator # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /