Full Code of quarkslab/QBDI for AI

dev-next f317a31f852b cached
604 files
4.1 MB
1.1M tokens
1775 symbols
1 requests
Download .txt
Showing preview only (4,454K chars total). Download the full file or copy to clipboard to get everything.
Repository: quarkslab/QBDI
Branch: dev-next
Commit: f317a31f852b
Files: 604
Total size: 4.1 MB

Directory structure:
gitextract_s0w1pbjr/

├── .clang-format
├── .clang-format.exclude-list.txt
├── .cmake_format.conf.py
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── assistance_request.md
│   │   ├── assistance_request_new.yml
│   │   ├── bug_report.md
│   │   ├── bug_report_new.yml
│   │   └── config.yml
│   ├── format_check.sh
│   └── workflows/
│       ├── android.yml
│       ├── ccache.conf
│       ├── clang_format.yml
│       ├── ios.yml
│       ├── linux.yml
│       ├── macos.yml
│       ├── python.yml
│       ├── python_linux.yml
│       ├── python_macos.yml
│       ├── python_windows.yml
│       └── windows.yml
├── .gitignore
├── .readthedocs.condaenv.yml
├── .readthedocs.yml
├── CHANGELOG
├── CMakeLists.txt
├── LICENSE.txt
├── MANIFEST.in
├── README-pypi.rst
├── README.rst
├── cmake/
│   ├── QBDIConfig.cmake
│   ├── QBDIDependencies.cmake
│   ├── QBDIOptions.cmake
│   ├── config/
│   │   ├── config-android-X86.sh
│   │   ├── config-android-X86_64.sh
│   │   ├── config-android-aarch64.sh
│   │   ├── config-android-armv7.sh
│   │   ├── config-ios-aarch64.sh
│   │   ├── config-linux-X86.sh
│   │   ├── config-linux-X86_64.sh
│   │   ├── config-linux-aarch64.sh
│   │   ├── config-macOS-AARCH64.sh
│   │   ├── config-macOS-AARCH64e.sh
│   │   ├── config-macOS-X86.sh
│   │   ├── config-macOS-X86_64.sh
│   │   ├── config-win-X86.py
│   │   ├── config-win-X86_64.py
│   │   └── ios.toolchain.cmake
│   ├── dummy.c
│   ├── llvm/
│   │   ├── QBDI_llvm.cmake
│   │   ├── QBDI_llvm_tblgen.cmake
│   │   └── rename_object.py
│   └── merge_archives.cmake
├── docker/
│   ├── .gitignore
│   ├── archlinux/
│   │   ├── Dockerfile.X86
│   │   ├── Dockerfile.X86_64
│   │   ├── PKGBUILD.X86
│   │   ├── PKGBUILD.X86_64
│   │   └── build.sh
│   ├── ci_linux/
│   │   ├── Dockerfile
│   │   ├── build-qbdi.sh
│   │   ├── img_build.sh
│   │   └── qbdi.sh
│   ├── ci_linux_arm/
│   │   ├── .gitignore
│   │   ├── build_qbdi_linux.sh
│   │   ├── docker_internal_script/
│   │   │   └── build-test-linux.sh
│   │   └── images/
│   │       ├── Dockerfile.dockcross
│   │       └── img_build.sh
│   ├── ci_python_linux/
│   │   ├── Dockerfile
│   │   ├── build_whl.sh
│   │   ├── img_build.sh
│   │   └── whl_build.sh
│   ├── common.sh
│   ├── linux_arm_natif/
│   │   ├── .gitignore
│   │   ├── build_qbdi_linux.sh
│   │   ├── docker_internal_script/
│   │   │   └── build-test-linux.sh
│   │   └── images/
│   │       ├── Dockerfile
│   │       └── build_docker_img.sh
│   ├── python_linux_arm/
│   │   ├── docker_internal_script/
│   │   │   └── build_wheel.sh
│   │   ├── images/
│   │   │   ├── Dockerfile
│   │   │   └── build_docker_img.sh
│   │   └── whl_build.sh
│   ├── release.sh
│   ├── ubuntu_debian/
│   │   ├── Dockerfile
│   │   └── build.sh
│   └── ubuntu_debian_devel/
│       ├── Dockerfile
│       └── build.sh
├── docs/
│   ├── CMakeLists.txt
│   ├── qbdi_c.doxygen.in
│   ├── qbdi_cpp.doxygen.in
│   ├── qbdipreload.doxygen.in
│   ├── requirements.txt
│   ├── rtd_pyqbdi_artifact/
│   │   └── setup.py
│   └── source/
│       ├── _static/
│       │   └── style.css
│       ├── _templates/
│       │   └── layout.html
│       ├── api.rst
│       ├── api_c.rst
│       ├── api_cpp.rst
│       ├── api_description.rst
│       ├── api_js.rst
│       ├── api_pyqbdi.rst
│       ├── api_pyqbdipreload.rst
│       ├── api_qbdipreload.rst
│       ├── architecture_support.rst
│       ├── changelog.rst
│       ├── compilation.rst
│       ├── conf.py
│       ├── dev.rst
│       ├── execblock.rst
│       ├── get_started-PyQBDIPreload.rst
│       ├── get_started-QBDIPreload.rst
│       ├── get_started-c.rst
│       ├── get_started-cpp.rst
│       ├── get_started-frida.rst
│       ├── get_started-pyqbdi.rst
│       ├── get_started.rst
│       ├── index.rst
│       ├── installation_and_integration.rst
│       ├── instrumentation_process.rst
│       ├── intro.rst
│       ├── patchdsl.rst
│       ├── references.rst
│       ├── repo_organization.rst
│       ├── techref.rst
│       ├── testing.rst
│       ├── tutorial.rst
│       ├── tutorial_BBVMEvent.rst
│       └── tutorial_ExecBrokerEvent.rst
├── examples/
│   ├── CMakeLists.txt
│   ├── Dockerfile
│   ├── c/
│   │   ├── CMakeLists.txt
│   │   ├── fibonacci.c
│   │   └── tracer_preload.c
│   ├── cpp/
│   │   ├── CMakeLists.txt
│   │   ├── fibonacci.cpp
│   │   └── tracer_preload.cpp
│   ├── cryptolock.c
│   ├── cryptolock.cpp
│   ├── mnemonicFilter.cpp
│   ├── modules.c
│   ├── modules.cpp
│   ├── pyqbdi/
│   │   ├── coverage.py
│   │   ├── trace_preload.py
│   │   └── trace_sin.py
│   ├── thedude.c
│   └── thedude.cpp
├── include/
│   ├── QBDI/
│   │   ├── Bitmask.h
│   │   ├── Callback.h
│   │   ├── Config.h.in
│   │   ├── Errors.h
│   │   ├── InstAnalysis.h
│   │   ├── Logs.h
│   │   ├── Memory.h
│   │   ├── Memory.hpp
│   │   ├── Platform.h
│   │   ├── PtrAuth.h
│   │   ├── Range.h
│   │   ├── VM.h
│   │   ├── VM_C.h
│   │   ├── Version.h.in
│   │   └── arch/
│   │       ├── AARCH64/
│   │       │   ├── Options.h
│   │       │   └── State.h
│   │       ├── ARM/
│   │       │   ├── Options.h
│   │       │   └── State.h
│   │       ├── X86/
│   │       │   ├── Options.h
│   │       │   └── State.h
│   │       └── X86_64/
│   │           ├── Options.h
│   │           └── State.h
│   └── QBDI.h
├── package/
│   ├── .dockerignore
│   ├── CMakeLists.txt
│   ├── Readme.txt
│   ├── Welcome.txt
│   ├── launch_docker_packager.sh
│   ├── qbdi-frida-template.in
│   ├── qbdi-preload-template.in
│   ├── qbdi-template.in
│   └── qbdi.pc.in
├── pyproject.toml
├── setup.cfg
├── setup.py
├── src/
│   ├── CMakeLists.txt
│   ├── Engine/
│   │   ├── CMakeLists.txt
│   │   ├── Engine.cpp
│   │   ├── Engine.h
│   │   ├── LLVMCPU.cpp
│   │   ├── LLVMCPU.h
│   │   ├── VM.cpp
│   │   ├── VM_C.cpp
│   │   └── VM_internal.h
│   ├── ExecBlock/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── Context_AARCH64.h
│   │   │   ├── ExecBlock_AARCH64.cpp
│   │   │   ├── ScratchRegisterInfo_AARCH64.h
│   │   │   ├── ios_AARCH64.s
│   │   │   ├── ios_AARCH64e.s
│   │   │   ├── linux-android_AARCH64.s
│   │   │   ├── macos_AARCH64.s
│   │   │   └── macos_AARCH64e.s
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── Context_ARM.h
│   │   │   ├── ExecBlock_ARM.cpp
│   │   │   ├── ScratchRegisterInfo_ARM.h
│   │   │   ├── ios_ARM.s
│   │   │   └── linux-android_ARM.s
│   │   ├── CMakeLists.txt
│   │   ├── Context.h
│   │   ├── ExecBlock.cpp
│   │   ├── ExecBlock.h
│   │   ├── ExecBlockManager.cpp
│   │   ├── ExecBlockManager.h
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── Context_X86_64.h
│   │       ├── ExecBlock_X86_64.cpp
│   │       ├── ScratchRegisterInfo_X86_64.h
│   │       ├── linux_X86.s
│   │       ├── linux_X86_64.s
│   │       ├── macos_X86.s
│   │       ├── macos_X86_64.s
│   │       ├── windows_X86.asm
│   │       └── windows_X86_64.asm
│   ├── ExecBroker/
│   │   ├── AARCH64/
│   │   │   ├── ExecBroker_AARCH64.cpp
│   │   │   └── ExecBroker_AARCH64.h
│   │   ├── ARM/
│   │   │   ├── ExecBroker_ARM.cpp
│   │   │   └── ExecBroker_ARM.h
│   │   ├── CMakeLists.txt
│   │   ├── ExecBroker.cpp
│   │   ├── ExecBroker.h
│   │   └── X86_64/
│   │       ├── ExecBroker_X86_64.cpp
│   │       └── ExecBroker_X86_64.h
│   ├── Patch/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ExecBlockFlags_AARCH64.cpp
│   │   │   ├── ExecBlockFlags_AARCH64.h
│   │   │   ├── ExecBlockPatch_AARCH64.cpp
│   │   │   ├── ExecBlockPatch_AARCH64.h
│   │   │   ├── InstInfo_AARCH64.cpp
│   │   │   ├── InstInfo_AARCH64.h
│   │   │   ├── InstMetadata_AARCH64.h
│   │   │   ├── InstrRules_AARCH64.cpp
│   │   │   ├── Layer2_AARCH64.cpp
│   │   │   ├── Layer2_AARCH64.h
│   │   │   ├── MemoryAccess_AARCH64.cpp
│   │   │   ├── MemoryAccess_AARCH64.h
│   │   │   ├── PatchCondition_AARCH64.cpp
│   │   │   ├── PatchCondition_AARCH64.h
│   │   │   ├── PatchGenerator_AARCH64.cpp
│   │   │   ├── PatchGenerator_AARCH64.h
│   │   │   ├── PatchRuleAssembly_AARCH64.cpp
│   │   │   ├── PatchRuleAssembly_AARCH64.h
│   │   │   ├── Register_AARCH64.cpp
│   │   │   ├── RelocatableInst_AARCH64.cpp
│   │   │   ├── RelocatableInst_AARCH64.h
│   │   │   ├── TempManagerImpl_AARCH64.h
│   │   │   └── TempManager_AARCH64.cpp
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ExecBlockFlags_ARM.cpp
│   │   │   ├── ExecBlockFlags_ARM.h
│   │   │   ├── ExecBlockPatch_ARM.cpp
│   │   │   ├── ExecBlockPatch_ARM.h
│   │   │   ├── InstInfo_ARM.cpp
│   │   │   ├── InstInfo_ARM.h
│   │   │   ├── InstMetadata_ARM.h
│   │   │   ├── InstrRules_ARM.cpp
│   │   │   ├── Layer2_ARM.cpp
│   │   │   ├── Layer2_ARM.h
│   │   │   ├── MemoryAccess_ARM.cpp
│   │   │   ├── MemoryAccess_ARM.h
│   │   │   ├── PatchCondition_ARM.cpp
│   │   │   ├── PatchCondition_ARM.h
│   │   │   ├── PatchGenerator_ARM.cpp
│   │   │   ├── PatchGenerator_ARM.h
│   │   │   ├── PatchRuleAssembly_ARM.cpp
│   │   │   ├── PatchRuleAssembly_ARM.h
│   │   │   ├── Register_ARM.cpp
│   │   │   ├── RelocatableInst_ARM.cpp
│   │   │   ├── RelocatableInst_ARM.h
│   │   │   ├── TempManagerImpl_ARM.h
│   │   │   ├── TempManager_ARM.cpp
│   │   │   └── TempManager_ARM.h
│   │   ├── CMakeLists.txt
│   │   ├── ExecBlockFlags.h
│   │   ├── ExecBlockPatch.h
│   │   ├── InstInfo.h
│   │   ├── InstMetadata.h
│   │   ├── InstTransform.cpp
│   │   ├── InstTransform.h
│   │   ├── InstrRule.cpp
│   │   ├── InstrRule.h
│   │   ├── InstrRules.cpp
│   │   ├── InstrRules.h
│   │   ├── MemoryAccess.h
│   │   ├── Patch.cpp
│   │   ├── Patch.h
│   │   ├── PatchCondition.cpp
│   │   ├── PatchCondition.h
│   │   ├── PatchGenerator.cpp
│   │   ├── PatchGenerator.h
│   │   ├── PatchRule.cpp
│   │   ├── PatchRule.h
│   │   ├── PatchRuleAssembly.h
│   │   ├── PatchRuleAssemblyBase.h
│   │   ├── PatchUtils.h
│   │   ├── Register.cpp
│   │   ├── Register.h
│   │   ├── RelocatableInst.h
│   │   ├── TempManager.cpp
│   │   ├── TempManager.h
│   │   ├── Types.h
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── ExecBlockFlags_X86_64.cpp
│   │       ├── ExecBlockFlags_X86_64.h
│   │       ├── ExecBlockPatch_X86_64.cpp
│   │       ├── InstInfo_X86_64.cpp
│   │       ├── InstInfo_X86_64.h
│   │       ├── InstMetadata_X86_64.h
│   │       ├── InstrRules_X86_64.cpp
│   │       ├── Layer2_X86_64.cpp
│   │       ├── Layer2_X86_64.h
│   │       ├── MemoryAccess_X86_64.cpp
│   │       ├── PatchGenerator_X86_64.cpp
│   │       ├── PatchGenerator_X86_64.h
│   │       ├── PatchRuleAssembly_X86_64.cpp
│   │       ├── PatchRuleAssembly_X86_64.h
│   │       ├── Register_X86_64.cpp
│   │       ├── RelocatableInst_X86_64.cpp
│   │       ├── RelocatableInst_X86_64.h
│   │       ├── TempManagerImpl_X86_64.h
│   │       └── TempManager_X86_64.cpp
│   ├── Utility/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysis_AARCH64.cpp
│   │   │   ├── System_OSX.cpp
│   │   │   ├── System_darwin.cpp
│   │   │   ├── System_iOS.cpp
│   │   │   ├── ios-AARCH64.s
│   │   │   ├── ios-AARCH64e.s
│   │   │   ├── linux-android-AARCH64.s
│   │   │   ├── macos-AARCH64.s
│   │   │   └── macos-AARCH64e.s
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysis_ARM.cpp
│   │   │   ├── System_darwin.cpp
│   │   │   ├── System_iOS.cpp
│   │   │   ├── ios_ARM.s
│   │   │   ├── linux-android_ARM.s
│   │   │   ├── server-iOS-jit-user.c
│   │   │   └── server-iOS-jit-user.h
│   │   ├── CMakeLists.txt
│   │   ├── InstAnalysis.cpp
│   │   ├── InstAnalysis_prive.h
│   │   ├── LogSys.cpp
│   │   ├── LogSys.h
│   │   ├── Memory.cpp
│   │   ├── Memory_linux.cpp
│   │   ├── Memory_macos.cpp
│   │   ├── Memory_windows.cpp
│   │   ├── MovableDoubleLinkedList.h
│   │   ├── StackSwitch.cpp
│   │   ├── StackSwitch.h
│   │   ├── String.cpp
│   │   ├── String.h
│   │   ├── System.h
│   │   ├── System_generic.cpp
│   │   ├── Version.cpp
│   │   ├── Version_commit.h.in
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── InstAnalysis_X86_64.cpp
│   │       ├── linux-X86.s
│   │       ├── linux-X86_64.s
│   │       ├── macos-X86.s
│   │       ├── macos-X86_64.s
│   │       ├── windows-X86.asm
│   │       └── windows-X86_64.asm
│   ├── devVariable.h
│   ├── fridaStubs.cpp
│   └── windowsDllMain.cpp
├── templates/
│   ├── qbdi_frida_template/
│   │   ├── CMakeLists.txt
│   │   ├── FridaQBDI_sample.js
│   │   └── SimpleXOR.c
│   ├── qbdi_preload_template/
│   │   ├── CMakeLists.txt.in
│   │   ├── README.txt
│   │   └── qbdi_preload_template.c
│   └── qbdi_template/
│       ├── CMakeLists.txt.in
│       ├── README.txt
│       └── qbdi_template.c
├── test/
│   ├── API/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysisTest_AARCH64.cpp
│   │   │   ├── MemoryAccessTest_AARCH64.cpp
│   │   │   ├── VMTest_AARCH64.cpp
│   │   │   ├── VMTest_AARCH64.h
│   │   │   ├── VMTest_AARCH64_LDRL.cpp
│   │   │   ├── VMTest_AARCH64_LocalMonitor.cpp
│   │   │   └── VMTest_AARCH64_X28.cpp
│   │   ├── APITest.cpp
│   │   ├── APITest.h
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysisTest_ARM.cpp
│   │   │   ├── InstAnalysisTest_Thumb.cpp
│   │   │   ├── MemoryAccessTest_ARM.cpp
│   │   │   ├── MemoryAccessTest_ARM_LDM_STM.cpp
│   │   │   ├── MemoryAccessTest_Thumb.cpp
│   │   │   ├── MemoryAccessTest_Thumb_LDM_STM.cpp
│   │   │   ├── VMTest_ARM.cpp
│   │   │   └── VMTest_ARM.h
│   │   ├── AllocTest.cpp
│   │   ├── CMakeLists.txt
│   │   ├── MemoryAccessTest.cpp
│   │   ├── OptionsTest.h
│   │   ├── RangeTest.cpp
│   │   ├── VMTest.cpp
│   │   ├── X86/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysisTest_X86.cpp
│   │   │   ├── MemoryAccessTest_X86.cpp
│   │   │   ├── OptionsTest_X86.cpp
│   │   │   ├── VMTest_X86.cpp
│   │   │   └── VMTest_X86.h
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── InstAnalysisTest_X86_64.cpp
│   │       ├── MemoryAccessTest_X86_64.cpp
│   │       ├── OptionsTest_X86_64.cpp
│   │       ├── VMTest_X86_64.cpp
│   │       └── VMTest_X86_64.h
│   ├── Benchmark/
│   │   ├── CMakeLists.txt
│   │   ├── Fibonacci.cpp
│   │   └── SHA256.cpp
│   ├── CMakeLists.txt
│   ├── ExecBlock/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   └── PatchEmptyAARCH64.cpp
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   └── PatchEmptyARM.cpp
│   │   ├── CMakeLists.txt
│   │   ├── ExecBlockManagerTest.cpp
│   │   ├── ExecBlockManagerTest.h
│   │   ├── ExecBlockTest.cpp
│   │   ├── ExecBlockTest.h
│   │   ├── PatchEmpty.h
│   │   ├── X86/
│   │   │   ├── CMakeLists.txt
│   │   │   └── PatchEmptyX86.cpp
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       └── PatchEmptyX86_64.cpp
│   ├── Miscs/
│   │   ├── CMakeLists.txt
│   │   └── StringTest.cpp
│   ├── Patch/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ComparedExecutor_AARCH64.cpp
│   │   │   ├── ComparedExecutor_AARCH64.h
│   │   │   ├── LLVMOperandInfo_AARCH64.cpp
│   │   │   └── MemoryAccessTable_AARCH64.cpp
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ComparedExecutor_ARM.cpp
│   │   │   ├── ComparedExecutor_ARM.h
│   │   │   ├── ComparedExecutor_Thumb.cpp
│   │   │   ├── ComparedExecutor_Thumb.h
│   │   │   ├── Instr_Test_ARM.cpp
│   │   │   ├── Instr_Test_Thumb.cpp
│   │   │   ├── Instr_Test_Thumb.h
│   │   │   ├── LLVMOperandInfo_ARM.cpp
│   │   │   ├── MemoryAccessTable_ARM.cpp
│   │   │   ├── Patch_Test_ARM.cpp
│   │   │   ├── Patch_Test_Thumb.cpp
│   │   │   └── Patch_Test_Thumb.h
│   │   ├── CMakeLists.txt
│   │   ├── Instr_Test.cpp
│   │   ├── Instr_Test.h
│   │   ├── MemoryAccessTable.h
│   │   ├── Patch_Test.cpp
│   │   ├── Patch_Test.h
│   │   ├── Utils.cpp
│   │   ├── Utils.h
│   │   ├── X86/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ComparedExecutor_X86.cpp
│   │   │   ├── ComparedExecutor_X86.h
│   │   │   ├── Instr_Test_X86.cpp
│   │   │   ├── Patch_Test_X86.cpp
│   │   │   └── WIN86_RunRealExec.asm
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── ComparedExecutor_X86_64.cpp
│   │       ├── ComparedExecutor_X86_64.h
│   │       ├── Instr_Test_X86_64.cpp
│   │       ├── LLVMOperandInfo_X86_64.cpp
│   │       ├── MemoryAccessTable_X86_64.cpp
│   │       ├── Patch_Test_X86_64.cpp
│   │       └── WIN64_RunRealExec.asm
│   ├── QBDIBenchmark.cpp
│   ├── QBDITest.cpp
│   └── TestSetup/
│       ├── AARCH64/
│       │   ├── CMakeLists.txt
│       │   └── InMemoryAssembler_AARCH64.cpp
│       ├── ARM/
│       │   ├── CMakeLists.txt
│       │   └── InMemoryAssembler_ARM.cpp
│       ├── CMakeLists.txt
│       ├── InMemoryAssembler.cpp
│       ├── InMemoryAssembler.h
│       ├── LLVMTestEnv.h
│       ├── ShellcodeTester.cpp
│       ├── ShellcodeTester.h
│       ├── X86/
│       │   ├── CMakeLists.txt
│       │   └── InMemoryAssembler_X86.cpp
│       └── X86_64/
│           ├── CMakeLists.txt
│           └── InMemoryAssembler_X86_64.cpp
└── tools/
    ├── CMakeLists.txt
    ├── QBDIPreload/
    │   ├── CMakeLists.txt
    │   ├── include/
    │   │   └── QBDIPreload.h
    │   └── src/
    │       ├── AARCH64/
    │       │   ├── CMakeLists.txt
    │       │   ├── linux_AARCH64.c
    │       │   ├── linux_AARCH64.h
    │       │   ├── macos_AARCH64.c
    │       │   └── macos_AARCH64.h
    │       ├── ARM/
    │       │   ├── CMakeLists.txt
    │       │   ├── linux_ARM.c
    │       │   └── linux_ARM.h
    │       ├── CMakeLists.txt
    │       ├── X86/
    │       │   ├── CMakeLists.txt
    │       │   ├── linux_X86.c
    │       │   ├── linux_X86.h
    │       │   ├── macos_X86.c
    │       │   ├── macos_X86.h
    │       │   └── win_x86.asm
    │       ├── X86_64/
    │       │   ├── CMakeLists.txt
    │       │   ├── linux_X86_64.c
    │       │   ├── linux_X86_64.h
    │       │   ├── macos_X86_64.c
    │       │   ├── macos_X86_64.h
    │       │   └── win_X86_64.asm
    │       ├── darwin_exceptd.c
    │       ├── darwin_exceptd.h
    │       ├── darwin_exception.defs
    │       ├── darwin_preload.c
    │       ├── linux_preload.c
    │       └── win_preload.c
    ├── QBDIWinPreloader/
    │   ├── CMakeLists.txt
    │   └── src/
    │       └── QBDIWinPreloader.c
    ├── frida-qbdi.js
    ├── pyqbdi/
    │   ├── CMakeLists.txt
    │   ├── binding/
    │   │   ├── AARCH64/
    │   │   │   ├── CMakeLists.txt
    │   │   │   ├── Options_AARCH64.cpp
    │   │   │   └── State_AARCH64.cpp
    │   │   ├── ARM/
    │   │   │   ├── CMakeLists.txt
    │   │   │   ├── Options_ARM.cpp
    │   │   │   └── State_ARM.cpp
    │   │   ├── CMakeLists.txt
    │   │   ├── Callback.cpp
    │   │   ├── Enum.hpp
    │   │   ├── Errors.cpp
    │   │   ├── InstAnalysis.cpp
    │   │   ├── Logs.cpp
    │   │   ├── Memory.cpp
    │   │   ├── Range.cpp
    │   │   ├── VM.cpp
    │   │   ├── X86/
    │   │   │   ├── CMakeLists.txt
    │   │   │   ├── Options_X86.cpp
    │   │   │   └── State_X86.cpp
    │   │   ├── X86_64/
    │   │   │   ├── CMakeLists.txt
    │   │   │   ├── Options_X86_64.cpp
    │   │   │   └── State_X86_64.cpp
    │   │   └── callback_python.h
    │   ├── fix_preload_lib_macos.py
    │   ├── preload.cpp
    │   ├── pyqbdi.hpp
    │   ├── pyqbdi_module.cpp
    │   ├── pyqbdipreload.py
    │   └── utils/
    │       ├── CMakeLists.txt
    │       ├── Float.cpp
    │       └── Memory.cpp
    ├── validation_runner/
    │   ├── RunConfig.py
    │   ├── RunOrchestrator.py
    │   ├── RunResult.py
    │   ├── SQLite.py
    │   ├── TestResult.py
    │   ├── ValidationRunner.py
    │   ├── buildbot.cfg
    │   ├── coverage.cfg
    │   ├── example.cfg
    │   ├── testfiles/
    │   │   └── hamlet.txt
    │   └── travis.cfg
    └── validator/
        ├── AARCH64/
        │   ├── CMakeLists.txt
        │   ├── linux_AARCH64.cpp
        │   ├── linux_AARCH64.h
        │   └── validatorengine_AARCH64.cpp
        ├── ARM/
        │   ├── CMakeLists.txt
        │   ├── linux_ARM.cpp
        │   ├── linux_ARM.h
        │   └── validatorengine_ARM.cpp
        ├── CMakeLists.txt
        ├── X86/
        │   ├── CMakeLists.txt
        │   ├── linux_X86.cpp
        │   ├── linux_X86.h
        │   └── validatorengine_X86.cpp
        ├── X86_64/
        │   ├── CMakeLists.txt
        │   ├── linux_X86_64.cpp
        │   ├── linux_X86_64.h
        │   └── validatorengine_X86_64.cpp
        ├── darwin_process.cpp
        ├── darwin_process.h
        ├── darwin_validator.cpp
        ├── instrumented.cpp
        ├── instrumented.h
        ├── linux_process.cpp
        ├── linux_process.h
        ├── linux_validator.cpp
        ├── master.cpp
        ├── master.h
        ├── pipes.cpp
        ├── pipes.h
        ├── process.h
        ├── validator.h
        ├── validatorengine.cpp
        └── validatorengine.h

================================================
FILE CONTENTS
================================================

================================================
FILE: .clang-format
================================================
---
BasedOnStyle: LLVM
IndentWidth: 2
---
Language: Cpp
AlignConsecutiveBitFields: true
AlignEscapedNewlines: Left
AlwaysBreakTemplateDeclarations: Yes
IncludeCategories:
  - Regex:           '^"(llvm|catch2|spdlog)/'
    Priority:        5
    SortPriority:    0
  - Regex:           '^"QBDI'
    Priority:        3
    SortPriority:    0
  - Regex:           '^"(Engine|ExecBlock|ExecBroker|Patch|Utility)/'
    Priority:        4
    SortPriority:    0
  - Regex:           '^<'
    Priority:        1
    SortPriority:    0
  - Regex:           '.*'
    Priority:        2
    SortPriority:    0
IndentCaseLabels: true
AlwaysBreakBeforeMultilineStrings: true
---



================================================
FILE: .clang-format.exclude-list.txt
================================================
cmake/llvm/.*\.patch\.txt
cmake/config/ios.toolchain.cmake


================================================
FILE: .cmake_format.conf.py
================================================
with section("format"):

  line_width = 80
  tab_size = 2
  use_tabchars = False

with section("markup"):
  enable_markup = False

additional_commands = {
  "FetchContent_Declare": {
    "pargs": 1,
    "flags": [],
    "kwargs": {
      "URL": '1',
      "URL_HASH": '1',
      "GIT_REPOSITORY": '1',
      "GIT_PROGRESS": '1',
      "GIT_TAG": '1',
      "DOWNLOAD_DIR": '1',
    }
  }
}


================================================
FILE: .github/ISSUE_TEMPLATE/assistance_request.md
================================================
---
name: Assistance Request
about: Ask for help for using QBDI
title: ''
labels: ''
assignees: ''
---

**Description of the problem**
A clear description of what your problem is.

**Compilation or execution log**
Any relevant log that illustrate your problem.
Please use [distinct block]https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code) to format this section.

**QBDI/PyQBDI/Frida script**
Insert your script/code that use QBDI here.

**Code of the target of the instrumentation**
Insert the script/code that you try to instrument with QBDI.
If the instrumented code is a public library/binary, you may provide a link to download it.

**Specific command to reproduce your problem on other laptop**
List all the command (if possible shell) that should be run the get the same output as you.

**Information about the environment**
Version of your environment and any tools that is needed to reproduce your problem

If you use multiples devices (like a computer and a smartphone), please provide the information for each of them.

- OS: (with version) [e.g. Windows 11, Debian 12.4, Android 14, ...]
- Architecture: [e.g. X86, X64, AARCH64, ARM32]
- QBDI version (returned by getVersion) and commit hash (if not a release version)
- Frida version on the Host and on the target (in case of android device) (for frida/QBDI issue)
- Python version (for PyQBDI issue)

**Additional context or informations**
Any other context about the problem here.

Thanks for taking the time to fill out all information! This will help us to reproduce your issue on our side.


================================================
FILE: .github/ISSUE_TEMPLATE/assistance_request_new.yml
================================================
name: Assistance Request (new)
description: Ask for help for using QBDI
body:
  - type: markdown
    attributes:
      label: Description of the problem
      value: |
        A clear description of what your problem is.
  - type: markdown
    attributes:
      label: Compilation or execution log
      value: |
        Any relevant log that illustrate your problem.
        Please use [distinct block]https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code) to format this section.
  - type: markdown
    attributes:
      label: QBDI/PyQBDI/Frida script
      value: |
        Insert your script/code that use QBDI here.
  - type: markdown
    attributes:
      label: Code of the target of the instrumentation
      value: |
        Insert the script/code that you try to instrument with QBDI.
        If the instrumented code is a public library/binary, you may provide a link to download it.
  - type: markdown
    attributes:
      label: Specific command to reproduce your problem on other laptop
      value: |
        List all the command (if possible shell) that should be run the get the same output as you.
  - type: markdown
    attributes:
      label: Information about the environment
      value: |
        Version of your environment and any tools that is needed to reproduce your problem
        
        If you use multiples devices (like a computer and a smartphone), please provide the information for each of them.

        - OS: (with version) [e.g. Windows 11, Debian 12.4, Android 14, ...] 
        - Architecture: [e.g. X86, X64, AARCH64, ARM32]
        - QBDI version (returned by getVersion) and commit hash (if not a release version)
        - Frida version on the Host and on the target (in case of android device) (for frida/QBDI issue)
        - Python version (for PyQBDI issue)
  - type: markdown
    attributes:
      label: Additional context or informations
      value: |
        Any other context about the problem here.

        Thanks for taking the time to fill out all information! This will help us to reproduce your issue on our side.


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a bug report
title: ''
labels: ''
assignees: ''
---

** Description of the problem **
A clear description of what the bug is, including the expected and actual behavior.


**Compilation or execution log**
Any relevant log that may help to understand the bug.
Please use [distinct block]https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code) to format this section.

**Minimal code/script to reproduce the problem**
Insert your script/code that use QBDI here.

**Code of the target of the instrumentation**
Insert your script/code that you try to instrument with QBDI.
If the instrumented code is a public library/binary, you may provide a link to download it.

**Specific command to reproduce your issue**
  Can you list all the command (if possible shell) that should be run to reproduce the bug.

**Information about the environment**
Version of your environment and any tools that is needed to reproduce the bug
If you use multiples devices (like a computer and a smartphone), please provide the information for each of them.

- OS: (with version) [e.g. Windows 11, Debian 12.4, Android 14, ...]
- Architecture: [e.g. X86, X64, AARCH64, ARM32]
- QBDI version (returned by getVersion) and commit hash (if not a release version)
- Frida version on the Host and on the target (in case of android device) (for frida/QBDI issue)
- Python version (for PyQBDI issue)

**Additional context or informations**
Any other context about the problem here.

Thanks for taking the time to fill out this report!


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report_new.yml
================================================
name: Bug Report (new)
description: Create a bug report
body:
  - type: markdown
    attributes:
      label: Description of the problem
      value: |
        A clear description of what the bug is, including the expected and actual behavior.
  - type: markdown
    attributes:
      label: Compilation or execution log
      value: |
        Any relevant log that may help to understand the bug.
        Please use [distinct block]https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code) to format this section.
  - type: markdown
    attributes:
      label: Minimal code/script to reproduce the problem
      value: |
        Insert your script/code that use QBDI here.
  - type: markdown
    attributes:
      label: Code of the target of the instrumentation
      value: |
        Insert your script/code that you try to instrument with QBDI.
        If the instrumented code is a public library/binary, you may provide a link to download it.
  - type: markdown
    attributes:
      label: Specific command to reproduce your issue
      value: |
        Can you list all the command (if possible shell) that should be run to reproduce the bug.
  - type: markdown
    attributes:
      label: Information about the environment
      value: |
        Version of your environment and any tools that is needed to reproduce the bug
        
        If you use multiples devices (like a computer and a smartphone), please provide the information for each of them.

        - OS: (with version) [e.g. Windows 11, Debian 12.4, Android 14, ...] 
        - Architecture: [e.g. X86, X64, AARCH64, ARM32]
        - QBDI version (returned by getVersion) and commit hash (if not a release version)
        - Frida version on the Host and on the target (in case of android device) (for frida/QBDI issue)
        - Python version (for PyQBDI issue)
  - type: markdown
    attributes:
      label: Additional context or informations
      value: |
        Any other context about the problem here.

        Thanks for taking the time to fill out this report!


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: true


================================================
FILE: .github/format_check.sh
================================================
#!/usr/bin/env bash

set -e

cd $(dirname "$0")
RETURN_CODE=0
BASEDIR=$(pwd -P)
GITDIR=$(git rev-parse --show-toplevel)
cd $GITDIR

for file in $(git ls-files | grep -v -f "${GITDIR}/.clang-format.exclude-list.txt" | grep '\.\(cpp\|c\|h\|hpp\)$'); do
  if [[ -n "${CLANG_FORMAT_VERSION}" ]]; then
    clang-format-"${CLANG_FORMAT_VERSION}" -Werror --style=file --verbose -n "${file}" || RETURN_CODE=1
  else
    clang-format -Werror --style=file --verbose -n "${file}" || RETURN_CODE=1
  fi
done

cmake-format -c .cmake_format.conf.py -l info --check $(git ls-files | grep -v -f "${GITDIR}/.clang-format.exclude-list.txt" | grep '\(CMakeLists.txt\|\.cmake\)$')


exit ${RETURN_CODE}


================================================
FILE: .github/workflows/android.yml
================================================
name: Package Android

on:
  push:
    branches:
      - master
      - dev-next
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-22.04
    strategy:
      matrix: 
        include:
          - QBDI_ARCH: 'X86_64'
            ANDROID_ABI: 'x86_64'
          - QBDI_ARCH: 'X86'
            ANDROID_ABI: 'x86'
          - QBDI_ARCH: 'AARCH64'
            ANDROID_ABI: 'arm64-v8a'
          - QBDI_ARCH: 'ARM'
            ANDROID_ABI: 'armeabi-v7a'
      fail-fast: false
    env:
      QBDI_PLATFORM: 'android'
      NDK_VERSION: 'r26c'
      ANDROID_PLATFORM: 23
    steps:
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache
        with:
          path: |
            ~/.ccache
          key: ccache-android-${{ matrix.QBDI_ARCH }}-${{ env.NDK_VERSION }}-${{ env.ANDROID_PLATFORM }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            ccache-android-${{ matrix.QBDI_ARCH }}-${{ env.NDK_VERSION }}-${{ env.ANDROID_PLATFORM }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache android NDK ${{ env.NDK_VERSION }}
        uses: actions/cache@v4
        id: cache-ndk
        with:
          path: |
            android-ndk-${{ env.NDK_VERSION }}/
          key: ndk-${{ env.NDK_VERSION }}-linux
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install build-essential ccache cmake g++ libstdc++-10-dev make ninja-build pkg-config python3 unzip wget zlib1g-dev
      - name: Install android NDK ${{ env.NDK_VERSION }}
        if: steps.cache-ndk.outputs.cache-hit != 'true'
        run: |
          wget --no-verbose https://dl.google.com/android/repository/android-ndk-${{ env.NDK_VERSION }}-linux.zip
          unzip -q android-ndk-${{ env.NDK_VERSION }}-linux.zip
          rm android-ndk-${{ env.NDK_VERSION }}-linux.zip
      - run: mkdir -p build
      - name: Build Package
        working-directory: ./build
        run: |
          cmake -DQBDI_PLATFORM=${{ env.QBDI_PLATFORM }} \
                -DQBDI_ARCH=${{ matrix.QBDI_ARCH }} \
                -DCMAKE_BUILD_TYPE=Release \
                -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/android-ndk-${{ env.NDK_VERSION }}/build/cmake/android.toolchain.cmake \
                -DANDROID_ABI=${{ matrix.ANDROID_ABI }} \
                -DANDROID_PLATFORM=${{ env.ANDROID_PLATFORM }} \
                -DQBDI_TEST=OFF \
                -G Ninja \
                ..
          ninja
          cpack
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: package_android_${{ matrix.QBDI_ARCH }}
          path: build/QBDI-*-android-${{ matrix.QBDI_ARCH }}.tar.gz





================================================
FILE: .github/workflows/ccache.conf
================================================
max_size = 512 M


================================================
FILE: .github/workflows/clang_format.yml
================================================
name: Code format

on: [push, pull_request]

jobs:
  check:
    runs-on: ubuntu-24.04
    env:
      CLANG_FORMAT_VERSION: 19
    steps:
      - name: checkout
        uses: actions/checkout@v4
      - name: Set up Python env
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Install system dependencies
        run: |
          sudo apt install -y --no-install-recommends clang-format-${{ env.CLANG_FORMAT_VERSION }}
          python3 -m pip install cmakelang
      - name: Check format
        run: bash ./.github/format_check.sh




================================================
FILE: .github/workflows/ios.yml
================================================
name: Package iOS

on:
  push:
    branches:
      - master
      - dev-next
  workflow_dispatch:

jobs:
  build:
    runs-on: macos-15
    env:
      QBDI_ARCH: 'AARCH64'
      QBDI_PLATFORM: 'ios'
      MACOSX_DEPLOYMENT_TARGET: '15.0'
    steps:
      - name: Set up Python env
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Install system dependencies
        run: |
          brew install cmake ninja ccache
          python3 -m pip install --upgrade pip setuptools wheel
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache
        with:
          path: |
            ~/.ccache
          key: ccache-ios-${{ env.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            ccache-ios-${{ env.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - run: mkdir -p build
      - name: build QBDI
        working-directory: ./build
        run: |
          cmake -G Ninja \
                -DCMAKE_BUILD_TYPE=Release \
                -DQBDI_PLATFORM=${{ env.QBDI_PLATFORM }} \
                -DQBDI_ARCH=${{ env.QBDI_ARCH }} \
                -DCMAKE_TOOLCHAIN_FILE="../cmake/config/ios.toolchain.cmake" \
                ..
          ninja
          cpack
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: package_iOS_${{ env.QBDI_ARCH }}
          path: build/QBDI-*.tar.gz


================================================
FILE: .github/workflows/linux.yml
================================================
name: Tests and Package Linux

on:
  push:
    branches:
      - master
      - dev-next
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix: 
        QBDI_ARCH: ['X86_64', 'X86']
      fail-fast: false
    env:
      QBDI_PLATFORM: 'linux'
    steps:
      - name: checkout
        uses: actions/checkout@v4
      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache
        with:
          path: |
            ~/.ccache
          key: ccache-linux-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            ccache-linux-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - name: Cache test result
        uses: actions/cache@v4
        with:
          path: |
            tools/validation_runner/travis_db
          key: test-linux-${{ matrix.QBDI_ARCH }}
      - name: Create build image
        env:
          QBDI_ARCH: ${{ matrix.QBDI_ARCH }}
        run: bash ./docker/ci_linux/img_build.sh
      - name: Build and test QBDI
        env:
          QBDI_ARCH: ${{ matrix.QBDI_ARCH }}
        run: bash ./docker/ci_linux/qbdi.sh
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: package_linux_${{ matrix.QBDI_ARCH }}
          path: build/QBDI-*-linux-${{ matrix.QBDI_ARCH }}.tar.gz

  build_ARM_AARCH64:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        QBDI_ARCH: ['AARCH64', 'ARM']
      fail-fast: false
    env:
      QBDI_PLATFORM: 'linux'
    steps:
      - name: checkout
        uses: actions/checkout@v4
      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache
        with:
          path: |
            ~/.ccache
          key: ccache-linux-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            ccache-linux-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - name: Cache test result
        uses: actions/cache@v4
        with:
          path: |
            tools/validation_runner/travis_db
          key: test-linux-${{ matrix.QBDI_ARCH }}

      - name: Create build image
        run: bash ./docker/ci_linux_arm/images/img_build.sh ${{ matrix.QBDI_ARCH }}

      - name: Build and test QBDI
        run: bash ./docker/ci_linux_arm/build_qbdi_linux.sh ${{ matrix.QBDI_ARCH }}

      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: package_linux_${{ matrix.QBDI_ARCH }}
          path: build-docker-*/QBDI-*-linux-*.tar.gz




================================================
FILE: .github/workflows/macos.yml
================================================
name: Tests and Package macOS

on:
  push:
    branches:
      - master
      - dev-next
  pull_request:
  workflow_dispatch:

jobs:
  build-x86:
    runs-on: macos-15-intel
    env:
      QBDI_ARCH: 'X86_64'
      QBDI_PLATFORM: 'macos'
      MACOSX_DEPLOYMENT_TARGET: '10.14'
      CMAKE_OSX_ARCHITECTURES: "x86_64"
    steps:
      - name: Set up Python env
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Install system dependencies
        run: |
          brew install cmake ninja ccache
          python3 -m pip install --upgrade pip setuptools wheel
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache
        with:
          path: |
            ~/.ccache
          key: ccache-macos-${{ env.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            ccache-macos-${{ env.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - run: mkdir -p build
      - name: build QBDI
        working-directory: ./build
        run: |
          cmake -G Ninja \
                -DCMAKE_BUILD_TYPE=Release \
                -DQBDI_PLATFORM=${{ env.QBDI_PLATFORM }} \
                -DQBDI_ARCH=${{ env.QBDI_ARCH }} \
                -DQBDI_TOOLS_VALIDATOR=ON \
                -DQBDI_EXAMPLES=ON \
                ..
          ninja
          cpack
      - name: test QBDI
        working-directory: ./build/test
        run: |
          ./QBDITest
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: package_macOS_${{ env.QBDI_ARCH }}
          path: build/QBDI-*.pkg

  build-aarch64:
    runs-on: macos-15
    env:
      QBDI_ARCH: 'AARCH64'
      QBDI_PLATFORM: 'macos'
      MACOSX_DEPLOYMENT_TARGET: '10.14'
      CMAKE_OSX_ARCHITECTURES: "arm64"
    steps:
      - name: Set up Python env
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Install system dependencies
        run: |
          brew install cmake ninja ccache
          python3 -m pip install --upgrade pip setuptools wheel
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache
        with:
          path: |
            ~/.ccache
          key: ccache-macos-${{ env.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            ccache-macos-${{ env.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - run: mkdir -p build
      - name: build QBDI
        working-directory: ./build
        run: |
          cmake -G Ninja \
                -DCMAKE_BUILD_TYPE=Release \
                -DQBDI_PLATFORM=${{ env.QBDI_PLATFORM }} \
                -DQBDI_ARCH=${{ env.QBDI_ARCH }} \
                -DQBDI_TOOLS_VALIDATOR=ON \
                -DQBDI_EXAMPLES=ON \
                ..
          ninja
          cpack
      - name: test QBDI
        working-directory: ./build/test
        run: |
          ./QBDITest
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: package_macOS_${{ env.QBDI_ARCH }}
          path: build/QBDI-*.pkg

  build-aarch64-arm64e:
    runs-on: macos-15
    env:
      QBDI_ARCH: 'AARCH64'
      QBDI_PLATFORM: 'macos'
      MACOSX_DEPLOYMENT_TARGET: '10.14'
      CMAKE_OSX_ARCHITECTURES: "arm64e"
    steps:
      - name: Set up Python env
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Install system dependencies
        run: |
          brew install cmake ninja ccache
          python3 -m pip install --upgrade pip setuptools wheel
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache
        with:
          path: |
            ~/.ccache
          key: ccache-macos-${{ env.QBDI_ARCH }}-arm64e-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            ccache-macos-${{ env.QBDI_ARCH }}-arm64e-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - run: mkdir -p build
      - name: build QBDI
        working-directory: ./build
        run: |
          echo 'set("CMAKE_OSX_ARCHITECTURES" "arm64" CACHE STRING "" FORCE)' > QBDI_llvm_tblgen.cmake
          cmake -G Ninja \
                -DCMAKE_BUILD_TYPE=Release \
                -DQBDI_PLATFORM=${{ env.QBDI_PLATFORM }} \
                -DQBDI_ARCH=${{ env.QBDI_ARCH }} \
                -DQBDI_PTRAUTH=ON \
                -DQBDI_TOOLS_VALIDATOR=ON \
                -DQBDI_EXAMPLES=ON \
                -DQBDI_LLVM_TABLEN_TOOLSCHAIN=$(pwd)/QBDI_llvm_tblgen.cmake \
                ..
          ninja
          cpack
      # github action doesn't seems to be able to execute arm64e binary
      # - name: test QBDI
      #   working-directory: ./build/test
      #   run: |
      #     ./QBDITest
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: package_macOS_${{ env.QBDI_ARCH }}_arm64e
          path: build/QBDI-*.pkg


================================================
FILE: .github/workflows/python.yml
================================================
name: PyQBDI package

on:
  push:
    branches:
      - master
      - dev-next
    tags:
      - 'v*'
  workflow_dispatch:

jobs:
  build_pyqbdi_linux:
    uses: ./.github/workflows/python_linux.yml
    secrets: inherit
  build_pyqbdi_macos:
    uses: ./.github/workflows/python_macos.yml
    secrets: inherit
  build_pyqbdi_windows:
    uses: ./.github/workflows/python_windows.yml
    secrets: inherit

  trigger-rtd:
    runs-on: ubuntu-latest
    needs: build_pyqbdi_linux
    steps:
      - name: trigger Read The docs build
        if: github.event_name == 'push'
        run: |
          curl -X POST -d "branches=${BRANCH}" -d "token=${RTD_TOKEN}" https://readthedocs.org/api/v2/webhook/qbdi/145608/
        env:
          RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
          BRANCH: ${{ github.ref_name }}

  all-in-one:
    name: All PyQBDI whell
    needs:
    - build_pyqbdi_linux
    - build_pyqbdi_macos
    - build_pyqbdi_windows
    runs-on: ubuntu-latest

    steps:
    - name: Download all wheel
      uses: actions/download-artifact@v4
      with:
        pattern: PyQBDI_*
        path: dist/
        merge-multiple: true

    - name: Export All wheels
      uses: actions/upload-artifact@v4
      with:
        name: All_PyQBDI
        path: dist/*

  publish-to-testpypi:
    name: Publish to TestPyPI
    needs:
    - build_pyqbdi_linux
    - build_pyqbdi_macos
    - build_pyqbdi_windows
    runs-on: ubuntu-latest

    if: ${{ github.event_name == 'push' && github.ref_name == 'dev-next' && github.ref_type == 'branch' }}

    environment:
      name: test
      url: https://test.pypi.org/p/PyQBDI

    permissions:
      id-token: write

    steps:
    - name: Download all wheel
      uses: actions/download-artifact@v4
      with:
        pattern: PyQBDI_*
        path: dist/
        merge-multiple: true

    - name: Publish to TestPyPI
      uses: pypa/gh-action-pypi-publish@release/v1
      with:
        repository-url: https://test.pypi.org/legacy/
        skip-existing: true

  publish-to-pypi:
    name: Publish to PyPI
    needs:
    - build_pyqbdi_linux
    - build_pyqbdi_macos
    - build_pyqbdi_windows
    runs-on: ubuntu-latest

    if: startsWith(github.ref, 'refs/tags/v')

    environment:
      name: release
      url: https://pypi.org/p/PyQBDI

    permissions:
      id-token: write

    steps:
    - name: Download all wheel
      uses: actions/download-artifact@v4
      with:
        pattern: PyQBDI_*
        path: dist/
        merge-multiple: true

    - name: Publish to PyPI
      uses: pypa/gh-action-pypi-publish@release/v1


================================================
FILE: .github/workflows/python_linux.yml
================================================
name: PyQBDI Linux package

on:
  workflow_call:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix: 
        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
        QBDI_ARCH: ['X86_64', 'X86']
      fail-fast: false
    env:
      QBDI_PLATFORM: 'linux'
    steps:
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache
        with:
          path: |
            ~/.ccache
          key: ccache-pyqbdi-linux-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            ccache-pyqbdi-linux-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - name: Create build image
        env:
          QBDI_ARCH: ${{ matrix.QBDI_ARCH }}
        run: bash ./docker/ci_python_linux/img_build.sh
      - name: Build Wheel for python ${{ matrix.python-version }}
        env:
          QBDI_ARCH: ${{ matrix.QBDI_ARCH }}
        run: bash ./docker/ci_python_linux/whl_build.sh ${{ matrix.python-version }}
      - name: Export wheel ${{ matrix.python-version }}
        uses: actions/upload-artifact@v4
        with:
          name: PyQBDI_linux_${{ matrix.QBDI_ARCH }}_python_${{ matrix.python-version }}
          path: outwheel/*



================================================
FILE: .github/workflows/python_macos.yml
================================================
name: PyQBDI macOS package

on:
  workflow_call:
  workflow_dispatch:

jobs:
  build-pyqbdi-x64:
    runs-on: macos-15-intel
    strategy:
      matrix:
        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
      fail-fast: false
    env:
      QBDI_PLATFORM: 'macos'
      QBDI_ARCH: 'X86_64'
      MACOSX_DEPLOYMENT_TARGET: '10.14'
      _PYTHON_HOST_PLATFORM: "macosx-10.14-x86_64"
      CMAKE_OSX_ARCHITECTURES: "x86_64"
    steps:
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}
          allow-prereleases: ${{ matrix.python-version == '3.15' }}
      - name: Install system dependencies
        run: |
          brew install cmake ninja ccache
          python3 -m pip install --upgrade pip setuptools wheel build
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache-python
        with:
          path: |
            ~/.ccache
          key: ccache-macos-X86_64-${{ hashFiles('.github/workflows/ccache.conf') }}-python-${{ matrix.python-version }}-${{ github.run_number }}
          restore-keys: |
            ccache-macos-X86_64-${{ hashFiles('.github/workflows/ccache.conf') }}-python-${{ matrix.python-version }}-
            ccache-macos-X86_64-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache-python.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - name: Build PyQBDI ${{ matrix.python-version }}
        run: |
          python3 --version
          python3 -m build -w
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: PyQBDI_macOS_X86_64_${{ matrix.python-version }}
          path: dist/*

  build-pyqbdi-aarch64:
    runs-on: macos-15
    strategy:
      matrix:
        python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
      fail-fast: false
    env:
      QBDI_ARCH: 'AARCH64'
      QBDI_PLATFORM: 'macos'
      MACOSX_DEPLOYMENT_TARGET: '11.0'
      _PYTHON_HOST_PLATFORM: "macosx-11.0-arm64"
      CMAKE_OSX_ARCHITECTURES: "arm64"
    steps:
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}
          allow-prereleases: ${{ matrix.python-version == '3.15' }}
      - name: Install system dependencies
        run: |
          brew install cmake ninja ccache
          python3 -m pip install --upgrade pip setuptools wheel build
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache ccache
        uses: actions/cache@v4
        id: cache-ccache-python
        with:
          path: |
            ~/.ccache
          key: ccache-macos-AARCH64-${{ hashFiles('.github/workflows/ccache.conf') }}-python-${{ matrix.python-version }}-${{ github.run_number }}
          restore-keys: |
            ccache-macos-AARCH64-${{ hashFiles('.github/workflows/ccache.conf') }}-python-${{ matrix.python-version }}-
            ccache-macos-AARCH64-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - if: steps.cache-ccache-python.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/.ccache
          cp .github/workflows/ccache.conf ~/.ccache/ccache.conf
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - name: Build PyQBDI ${{ matrix.python-version }}
        run: |
          python3 --version
          python3 -m build -w
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: PyQBDI_macOS_AARCH64_${{ matrix.python-version }}
          path: dist/*

#  build-pyqbdi-aarch64-arm64e:
#    runs-on: macos-15
#    env:
#      QBDI_ARCH: 'AARCH64'
#      QBDI_PLATFORM: 'macos'
#      MACOSX_DEPLOYMENT_TARGET: '11.0'
#      _PYTHON_HOST_PLATFORM: 'macosx-11.0-arm64'
#      CMAKE_OSX_ARCHITECTURES: 'arm64e'
#      OPENSSL_VERSION: '3.5.4'
#      OPENSSL_PREFIX: ${{ github.workspace }}/openssl-build
#      PYTHON_VERSION: '3.14.0'
#      PYTHON_PREFIX: ${{ github.workspace }}/python-build
#      PYTHON_VENV: ${{ github.workspace }}/python-venv
#    steps:
#      - name: Download OpenSSL
#        run: |
#          wget -O- https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz | tar xJf -
#      - name: Build OpenSSL for arm64e
#        working-directory: openssl-${{ env.OPENSSL_VERSION }}
#        run: |
#          sed -i'' -e 's/-arch arm64/-arch arm64e/g' Configurations/10-main.conf
#          ./configure --prefix=${OPENSSL_PREFIX} --openssldir=${OPENSSL_PREFIX}/ssl
#          make -j$(nproc)
#          make install
#      - name: Download Python
#        run: |
#          wget -O- https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz | tar xJf -
#      - name: Build Python for arm64e
#        working-directory: Python-${{ env.PYTHON_VERSION }}
#        run: |
#          ./configure --prefix=${PYTHON_PREFIX} --with-pydebug --with-openssl=${OPENSSL_PREFIX} \
#            CFLAGS='-arch arm64e' LDFLAGS='-arch arm64e'
#          make -j$(nproc)
#          make install
#      - name: Checkout QBDI
#        uses: actions/checkout@v4
#      - name: Install system dependencies
#        run: |
#          brew install cmake
#      - name: Create Python virtual environment
#        run: |
#          ${PYTHON_PREFIX}/bin/python3 -m venv ${PYTHON_VENV}
#          ${PYTHON_VENV}/bin/python3 -m pip install --upgrade pip setuptools wheel build
#      - name: Build PyQBDI ${PYTHON_VERSION}
#        run: |
#          ${PYTHON_VENV}/bin/python3 -m build -w
#      - name: Export package
#        uses: actions/upload-artifact@v4
#        with:
#          name: PyQBDI_macOS_AARCH64_arm64e_${PYTHON_VERSION}
#          path: dist/*


================================================
FILE: .github/workflows/python_windows.yml
================================================
name: PyQBDI Windows Package

on:
  workflow_call:
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    strategy:
      matrix:
        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
        QBDI_ARCH: ['X86_64', 'X86']
        include:
          - QBDI_ARCH: 'X86_64'
            WINDOWS_ARCH: 'x64'
          - QBDI_ARCH: 'X86'
            WINDOWS_ARCH: 'x86'
      fail-fast: false
    env:
      QBDI_PLATFORM: 'windows'
      SCCACHE_CACHE_SIZE: "1G"
      SCCACHE_DIR: "C:\\Users\\runner\\AppData\\Local\\Mozilla\\sccache"
    steps:
      - name: Install system dependencies
        run: |
          choco install sccache
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache sccache
        uses: actions/cache@v4
        id: cache-sccache
        with:
          path: |
            ${{ env.SCCACHE_DIR }}
          key: sccache-win-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ matrix.python-version }}-${{ github.run_number }}
          restore-keys: |
            sccache-win-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ matrix.python-version }}-
            sccache-win-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - name: Create sccache directory
        if: steps.cache-sccache.outputs.cache-hit != 'true'
        shell: powershell
        run: |
          If(!(test-path -PathType container ${env:SCCACHE_DIR}))
          {
            New-Item -ItemType Directory -Path ${env:SCCACHE_DIR}
          }
      - uses: ilammy/msvc-dev-cmd@v1
        with:
          arch: ${{ matrix.WINDOWS_ARCH }}
      - name: Start sccache server
        run: sccache --start-server
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}
          allow-prereleases: ${{ matrix.python-version == '3.15' }}
          architecture: ${{ matrix.WINDOWS_ARCH }}
      - name: build PyQBDI ${{ matrix.python-version }}
        run: |
          python --version
          python -m pip --version
          python -m pip install --upgrade pip
          python -m pip install setuptools wheel build
          python -m build -w

      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: PyQBDI_windows_${{ matrix.QBDI_ARCH }}_python_${{ matrix.python-version }}
          path: dist\PyQBDI-*.whl
      - name: Stop sccache server
        run: sccache --stop-server



================================================
FILE: .github/workflows/windows.yml
================================================
name: Tests and Package Windows

on:
  push:
    branches:
      - master
      - dev-next
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    strategy:
      matrix:
        include:
          - QBDI_ARCH: 'X86_64'
            WINDOWS_ARCH: 'x64'
          - QBDI_ARCH: 'X86'
            WINDOWS_ARCH: 'x86'
      fail-fast: false
    env:
      QBDI_PLATFORM: 'windows'
      SCCACHE_CACHE_SIZE: "1G"
      SCCACHE_DIR: "C:\\Users\\runner\\AppData\\Local\\Mozilla\\sccache"
    steps:
      - name: Install system dependencies
        run: |
          choco install sccache nsis
      - name: checkout
        uses: actions/checkout@v4
      - name: Cache sccache
        uses: actions/cache@v4
        id: cache-sccache
        with:
          path: |
            ${{ env.SCCACHE_DIR }}
          key: sccache-win-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }}
          restore-keys: |
            sccache-win-${{ matrix.QBDI_ARCH }}-${{ hashFiles('.github/workflows/ccache.conf') }}-
      - name: Create sccache directory
        if: steps.cache-sccache.outputs.cache-hit != 'true'
        shell: powershell
        run: |
          If(!(test-path -PathType container ${env:SCCACHE_DIR}))
          {
            New-Item -ItemType Directory -Path ${env:SCCACHE_DIR}
          }
      - uses: ilammy/msvc-dev-cmd@v1
        with:
          arch: ${{ matrix.WINDOWS_ARCH }}
      - name: Start sccache server
        run: sccache --start-server
      - name: Cache third-party
        uses: actions/cache@v4
        with:
          path: |
            third-party
          key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }}
      - run: mkdir build
      - name: Configure
        working-directory: .\build
        run: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING=FALSE -DQBDI_PLATFORM=${{ env.QBDI_PLATFORM }} -DQBDI_ARCH=${{ matrix.QBDI_ARCH }} -DQBDI_TOOLS_VALIDATOR=OFF -DQBDI_TOOLS_PYQBDI=OFF -DQBDI_EXAMPLES=ON ..
      - name: build QBDI
        working-directory: .\build
        run: ninja
      - name: package QBDI
        working-directory: .\build
        run: cpack
      - name: test QBDI
        working-directory: .\build\test
        run: |
          .\QBDITest
      - name: Export package
        uses: actions/upload-artifact@v4
        with:
          name: package_Windows_${{ matrix.WINDOWS_ARCH }}
          path: build/QBDI-*.exe
      - name: Stop sccache server
        run: sccache --stop-server



================================================
FILE: .gitignore
================================================
**/.DS_Store
TODO
build*/*

dist
outwheel

docs/build
docs/doxygen_c
docs/doxygen_cpp
docs/doxygen_qbdipreload
docs/qbdi_c.doxygen
docs/qbdi_cpp.doxygen
docs/qbdipreload.doxygen

qbdi-deps.tar.gz
qbdi.tar.gz
package/QBDI-*
package/package-*

third-party

tools/validation_runner/.*_coverage
tools/validation_runner/.*_output
tools/validation_runner/.*_result
tools/validation_runner/*.db
tools/validation_runner/travis_db

__pycache__
*.pyc
*.egg-info


================================================
FILE: .readthedocs.condaenv.yml
================================================
name: RTD
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.11
  - doxygen=1.9.8
  - pip
  - pip:
    - python-dateutil
    - pygit2
    - requests
    - Sphinx==5.3.0
    - docutils==0.18.1
    - breathe==4.35.0
    - sphinx-js==3.2.1
    - markupsafe==2.0.1
    - sphinx_rtd_theme==1.3.0


================================================
FILE: .readthedocs.yml
================================================
version: 2

build:
  os: ubuntu-24.04
  tools:
    python: "miniconda3-4.7"
    nodejs: "20"
  jobs:
    post_create_environment:
      - npm install -g jsdoc

# install doxygen >= 1.9.2
conda:
  environment: .readthedocs.condaenv.yml

# Build documentation in the docs/ directory with Sphinx
sphinx:
  configuration: docs/source/conf.py

formats:
  - htmlzip
  - pdf

python:
  install:
    - method: setuptools
      path: docs/rtd_pyqbdi_artifact


================================================
FILE: CHANGELOG
================================================
Changelog
=========

see docs/source/changelog.rst or https://qbdi.readthedocs.io/en/stable/changelog.html


================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.28)
project(QBDI)

include(GNUInstallDirs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")

# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
cmake_policy(SET CMP0135 NEW)

# Config platform & arch
include(QBDIConfig)
# Option
include(QBDIOptions)

# Force find system utils (strip)
include(CMakeFindBinUtils)

# Macros
include(merge_archives)

# CCACHE
# ======
if(QBDI_CCACHE)
  if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    find_program(SCCACHE_FOUND sccache)
    if(SCCACHE_FOUND)
      set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_FOUND})
      set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_FOUND})
      message(STATUS "found SCCACHE at ${SCCACHE_FOUND}")
    else()
      set(QBDI_CCACHE OFF)
      message(WARNING "CCACHE or SCCACHE not found: disabled")
    endif()
  else()
    find_program(CCACHE_FOUND ccache)
    if(CCACHE_FOUND)
      set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_FOUND})
      set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_FOUND})
      message(STATUS "found CCACHE at ${CCACHE_FOUND}")
    else()
      set(QBDI_CCACHE OFF)
      message(WARNING "CCACHE or SCCACHE not found: disabled")
    endif()
  endif()
endif()

include(CheckCCompilerFlag)

if(QBDI_ASAN)
  set(CMAKE_REQUIRED_FLAGS "-Werror -fsanitize=address")
  check_c_compiler_flag("-fsanitize=address" HAVE_FLAG_SANITIZE_ADDRESS)
  unset(CMAKE_REQUIRED_FLAGS)
  if(HAVE_FLAG_SANITIZE_ADDRESS)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
    message(STATUS "ASAN is activated")
  else()
    message(WARNING "ASAN can't be activated")
  endif()
endif()

# Configure RPATH on OS X

if(APPLE)
  set(CMAKE_MACOSX_RPATH TRUE)

  # use, i.e. don't skip the full RPATH for the build tree
  set(CMAKE_SKIP_BUILD_RPATH FALSE)

  # when building, don't use the install RPATH already
  # (but later on when installing)
  set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

  # add the automatically determined parts of the RPATH
  # which point to directories outside the build tree to the install RPATH
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

  # the RPATH to be used when installing, but only if it's not a system directory
  list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
       "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
  if("${isSystemDir}" STREQUAL "-1")
    set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
  endif("${isSystemDir}" STREQUAL "-1")
endif()

set(QBDI_EXPORT_SYM 1)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/QBDI/Config.h.in"
               "${CMAKE_CURRENT_BINARY_DIR}/include-shared/QBDI/Config.h" @ONLY)
unset(QBDI_EXPORT_SYM)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/QBDI/Config.h.in"
               "${CMAKE_CURRENT_BINARY_DIR}/include-static/QBDI/Config.h" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/QBDI/Version.h.in"
               "${CMAKE_CURRENT_BINARY_DIR}/include/QBDI/Version.h" @ONLY)
configure_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/include/QBDI/arch/${QBDI_ARCH}/State.h"
  "${CMAKE_CURRENT_BINARY_DIR}/include/QBDI/State.h" COPYONLY)
configure_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/include/QBDI/arch/${QBDI_ARCH}/Options.h"
  "${CMAKE_CURRENT_BINARY_DIR}/include/QBDI/Options.h" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/Utility/Version_commit.h.in"
               "${CMAKE_CURRENT_BINARY_DIR}/src/Utility/Version_commit.h" @ONLY)

# log debug
set(QBDI_COMMON_DEFINITION)
if(QBDI_LOG_DEBUG)
  message(STATUS "Compiling with QBDI_LOG_DEBUG")
  set(QBDI_COMMON_DEFINITION ${QBDI_COMMON_DEFINITION} -D_QBDI_LOG_DEBUG)
endif()

if(QBDI_PLATFORM_WINDOWS)
  set(QBDI_COMMON_C_FLAGS
      /DWIN32
      /D_WINDOWS
      /W3
      /MP
      /permissive-
      -D_CRT_SECURE_NO_DEPRECATE
      -D_CRT_SECURE_NO_WARNINGS
      -D_CRT_NONSTDC_NO_DEPRECATE
      -D_CRT_NONSTDC_NO_WARNINGS
      -D_SCL_SECURE_NO_DEPRECATE
      -D_SCL_SECURE_NO_WARNINGS
      -D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
      -w14062
      -wd4141
      -wd4146
      -wd4180
      -wd4244
      -wd4258
      -wd4267
      -wd4291
      -wd4345
      -wd4351
      -wd4355
      -wd4456
      -wd4457
      -wd4458
      -wd4459
      -wd4503
      -wd4624
      -wd4722
      -wd4800
      -we4238
      -D__STDC_CONSTANT_MACROS
      -D__STDC_FORMAT_MACROS
      -D__STDC_LIMIT_MACROS)
  set(QBDI_COMMON_CXX_FLAGS
      /DWIN32
      /D_WINDOWS
      /W3
      /MP
      /permissive-
      -D_CRT_SECURE_NO_DEPRECATE
      -D_CRT_SECURE_NO_WARNINGS
      -D_CRT_NONSTDC_NO_DEPRECATE
      -D_CRT_NONSTDC_NO_WARNINGS
      -D_SCL_SECURE_NO_DEPRECATE
      -D_SCL_SECURE_NO_WARNINGS
      -D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
      -w14062
      -wd4141
      -wd4146
      -wd4180
      -wd4244
      -wd4258
      -wd4267
      -wd4291
      -wd4345
      -wd4351
      -wd4355
      -wd4456
      -wd4457
      -wd4458
      -wd4459
      -wd4503
      -wd4624
      -wd4722
      -wd4800
      -we4238
      -D__STDC_CONSTANT_MACROS
      -D__STDC_FORMAT_MACROS
      -D__STDC_LIMIT_MACROS)
  # set _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING for llvm compile
  set(CMAKE_CXX_FLAGS
      "${CMAKE_CXX_FLAGS} -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING"
  )
else()
  set(QBDI_COMMON_C_FLAGS -Wall -ffunction-sections -fdata-sections
                          -fvisibility-inlines-hidden -fvisibility=hidden -fPIC)
  set(QBDI_COMMON_CXX_FLAGS
      -Wall
      -ffunction-sections
      -fdata-sections
      -fvisibility-inlines-hidden
      -fvisibility=hidden
      -fPIC
      -fno-rtti)
  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    list(APPEND QBDI_COMMON_C_FLAGS -Wno-missing-template-keyword)
    list(APPEND QBDI_COMMON_CXX_FLAGS -Wno-missing-template-keyword)
    check_c_compiler_flag(-Wno-psabi HAS_NO_PSABI)
    if(HAS_NO_PSABI)
      list(APPEND QBDI_COMMON_C_FLAGS -Wno-psabi)
      list(APPEND QBDI_COMMON_CXX_FLAGS -Wno-psabi)
    endif()
  endif()
  if(NOT QBDI_PLATFORM_ANDROID)
    set(QBDI_COMMON_DEFINITION
        ${QBDI_COMMON_DEFINITION} -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
        -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS)
  endif()
endif()

# AVX
if(QBDI_DISABLE_AVX)
  set(QBDI_COMMON_DEFINITION ${QBDI_COMMON_DEFINITION}
                             -D_QBDI_FORCE_DISABLE_AVX)
endif()

# Force 32bit
if(QBDI_PLATFORM_MACOS AND QBDI_ARCH_X86)
  set(CMAKE_C_FLAGS "-arch i386 ${CMAKE_C_FLAGS}")
  set(CMAKE_CXX_FLAGS "-arch i386 ${CMAKE_CXX_FLAGS}")
elseif((QBDI_PLATFORM_LINUX OR QBDI_PLATFORM_ANDROID) AND QBDI_ARCH_X86)
  set(CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
  set(CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
endif()

# Disable thumb on ARM (until we support it)
if(QBDI_ARCH_ARM)
  # detect if -mthumb-interwork is needed
  check_c_compiler_flag(-mthumb-interwork HAS_THUMB_INTERWORK)
  if(HAS_THUMB_INTERWORK)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb-interwork")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mthumb-interwork")
    set(CMAKE_SHARED_LINKER_FLAGS
        "${CMAKE_SHARED_LINKER_FLAGS} -mthumb-interwork")
    set(CMAKE_MODULE_LINKER_FLAGS
        "${CMAKE_MODULE_LINKER_FLAGS} -mthumb-interwork")
  endif()
endif()

# Dependencies
# ============
include(QBDIDependencies)

# Setup assembly compile
if(QBDI_PLATFORM_WINDOWS)
  enable_language(ASM_MASM)
  set(ASM_EXT "asm")
elseif(QBDI_ARCH_X86 OR QBDI_ARCH_X86_64)
  if(NOT QBDI_PLATFORM_ANDROID)
    set(CMAKE_ASM-ATT_COMPILER ${AS_BINARY})
    enable_language(ASM-ATT)
  else()
    enable_language(ASM)
  endif()
  set(ASM_EXT "s")
  if(QBDI_PLATFORM_MACOS AND QBDI_ARCH_X86)
    set(CMAKE_ASM-ATT_FLAGS "-arch i386")
  elseif((QBDI_PLATFORM_LINUX OR QBDI_PLATFORM_ANDROID) AND QBDI_ARCH_X86)
    set(CMAKE_ASM-ATT_FLAGS "--32")
  endif()
else()
  enable_language(ASM)
  if(QBDI_PLATFORM_IOS)
    if(QBDI_ARCH_AARCH64)
      set(CMAKE_ASM_FLAGS "-arch arm64")
    else()
      set(CMAKE_ASM_FLAGS "-arch armv7")
    endif()
  endif()
endif()

# Add QBDI source file in QBDI_obj
add_library(QBDI_src INTERFACE)
add_library(QBDI_shared_src INTERFACE)

target_link_libraries(QBDI_src INTERFACE qbdi-llvm spdlog)

include("${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt")

target_compile_features(QBDI_src INTERFACE cxx_std_17)
target_compile_options(
  QBDI_src INTERFACE $<$<COMPILE_LANGUAGE:C>:${QBDI_COMMON_C_FLAGS}>)
target_compile_options(
  QBDI_src INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${QBDI_COMMON_CXX_FLAGS}>)
target_compile_definitions(QBDI_src INTERFACE ${QBDI_COMMON_DEFINITION})
target_include_directories(
  QBDI_src
  INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/include"
            "${CMAKE_CURRENT_SOURCE_DIR}/include"
            "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}/src")

target_include_directories(
  QBDI_shared_src INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/include"
                            "${CMAKE_CURRENT_SOURCE_DIR}/include")

if(QBDI_STATIC_LIBRARY)
  add_library(QBDI_obj STATIC)
  target_link_libraries(QBDI_obj PRIVATE QBDI_src)
  set_target_properties(QBDI_obj PROPERTIES POSITION_INDEPENDENT_CODE ON)
  target_include_directories(
    QBDI_obj PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/include-static")

  set(qbdi_static_libs qbdi-llvm QBDI_obj spdlog)

  merge_static_libs(QBDI_static QBDI \${qbdi_static_libs})

  add_library(QBDI::QBDI_static ALIAS QBDI_static)
  target_include_directories(
    QBDI_static
    PUBLIC $<INSTALL_INTERFACE:include>
           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
           $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
           $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include-static>)

  target_link_libraries(QBDI_static PUBLIC ${QBDI_LLVM_LINK_LIBRARY})
  if(QBDI_PLATFORM_ANDROID)
    target_link_libraries(QBDI_static PUBLIC log)
  endif()
  add_dependencies(QBDI_static QBDI_obj)

  if(QBDI_PLATFORM_WINDOWS)
    set_target_properties(QBDI_static PROPERTIES OUTPUT_NAME QBDI_static)
  endif()

  install(
    TARGETS QBDI_static
    EXPORT QBDI_targets
    COMPONENT QBDI
    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}")

endif()

# QBDI as a shared library
if(QBDI_SHARED_LIBRARY)
  add_library(QBDI SHARED)
  add_library(QBDI::QBDI ALIAS QBDI)

  target_include_directories(
    QBDI
    PUBLIC $<INSTALL_INTERFACE:include>
           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
           $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
    INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include-static>
    PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include-shared>)

  target_link_libraries(QBDI PRIVATE QBDI_src QBDI_shared_src qbdi-llvm)

  set_target_properties(QBDI PROPERTIES OUTPUT_NAME QBDI)

  if(DEFINED STRIP_PATH)
    # Force a strip cmd
    set(CMAKE_STRIP ${STRIP_PATH})
  endif()
  if(DEFINED CMAKE_STRIP
     AND NOT CMAKE_STRIP STREQUAL "CMAKE_STRIP-NOTFOUND"
     AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
     AND NOT QBDI_ENABLE_LOG_DEBUG)

    set(STRIP_ARGS "")
    if(APPLE)
      set(STRIP_ARGS ${STRIP_ARGS} -un)
    elseif(UNIX)
      set(STRIP_ARGS ${STRIP_ARGS} -x)
    endif()
    add_custom_command(
      TARGET QBDI
      POST_BUILD
      COMMAND ${CMAKE_STRIP} ${STRIP_ARGS} "$<TARGET_FILE:QBDI>")
  endif()

  # Install QBDI targets
  install(
    TARGETS QBDI
    EXPORT QBDI_targets
    COMPONENT QBDI
    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    RUNTIME DESTINATION "${CMAKE_INSTALL_LIBDIR}")

  if(QBDI_PLATFORM_WINDOWS)
    install(
      FILES ${CMAKE_CURRENT_BINARY_DIR}/QBDI.exp
      COMPONENT QBDI
      DESTINATION "${CMAKE_INSTALL_LIBDIR}")
  endif()

endif()

set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "QBDI")
install(
  DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/QBDI"
  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
  PATTERN "*.in" EXCLUDE
  PATTERN "arch" EXCLUDE)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/QBDI"
        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include-static/QBDI"
        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/QBDI.h"
        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

if(QBDI_INSTALL)
  # Configure install
  if(UNIX)
    set(FULL_PACKAGE true)
  else()
    set(FULL_PACKAGE false)
  endif()

  if(FULL_PACKAGE)
    #string(REPLACE ";" " " LLVM_LIBS_STR "${LLVM_LIBS}")
    #configure_file("${CMAKE_CURRENT_SOURCE_DIR}/package/qbdi.pc.in"
    #               "${CMAKE_CURRENT_BINARY_DIR}/package/qbdi.pc" @ONLY)
    #install(FILES "${CMAKE_CURRENT_BINARY_DIR}/package/qbdi.pc"
    #        DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")

    set(RESOURCES_PREFIX "${CMAKE_INSTALL_DATADIR}/qbdi${QBDI_ARCH}")

    install(
      FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt"
      DESTINATION "${RESOURCES_PREFIX}"
      COMPONENT QBDI)

    install(
      EXPORT QBDI_targets
      FILE QBDIConfig.cmake
      NAMESPACE QBDI::
      DESTINATION ${RESOURCES_PREFIX}/cmake)

    install(
      EXPORT QBDI_targets
      FILE QBDI${QBDI_ARCH}Config.cmake
      NAMESPACE QBDI::${QBDI_ARCH}::
      DESTINATION ${RESOURCES_PREFIX}/cmake)

    # QBDI template
    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/package/qbdi-template.in"
                   "${CMAKE_CURRENT_BINARY_DIR}/package/qbdi-template")
    configure_file(
      "${CMAKE_CURRENT_SOURCE_DIR}/templates/qbdi_template/CMakeLists.txt.in"
      "${CMAKE_CURRENT_BINARY_DIR}/templates/qbdi_template/CMakeLists.txt"
      @ONLY)
    install(
      DIRECTORY templates/qbdi_template
      DESTINATION "${RESOURCES_PREFIX}"
      COMPONENT QBDITemplate
      PATTERN "CMakeLists.txt.in" EXCLUDE)
    install(
      FILES "${CMAKE_CURRENT_BINARY_DIR}/templates/qbdi_template/CMakeLists.txt"
      DESTINATION "${RESOURCES_PREFIX}/qbdi_template")
    install(
      PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/package/qbdi-template"
      DESTINATION "${CMAKE_INSTALL_BINDIR}"
      COMPONENT QBDITemplate
      RENAME "qbdi-template-${QBDI_ARCH}")

    set(PRELOAD_RESOURCES_PREFIX
        "${CMAKE_INSTALL_DATADIR}/qbdipreload${QBDI_ARCH}")
    # QBDI preload template
    if(QBDI_TOOLS_QBDIPRELOAD)
      configure_file(
        "${CMAKE_CURRENT_SOURCE_DIR}/package/qbdi-preload-template.in"
        "${CMAKE_CURRENT_BINARY_DIR}/package/qbdi-preload-template")
      configure_file(
        "${CMAKE_CURRENT_SOURCE_DIR}/templates/qbdi_preload_template/CMakeLists.txt.in"
        "${CMAKE_CURRENT_BINARY_DIR}/templates/qbdi_preload_template/CMakeLists.txt"
        @ONLY)
      install(
        DIRECTORY templates/qbdi_preload_template
        DESTINATION "${PRELOAD_RESOURCES_PREFIX}"
        COMPONENT QBDITemplate
        PATTERN "CMakeLists.txt.in" EXCLUDE)
      install(
        FILES
          "${CMAKE_CURRENT_BINARY_DIR}/templates/qbdi_preload_template/CMakeLists.txt"
        DESTINATION "${PRELOAD_RESOURCES_PREFIX}/qbdi_preload_template")
      install(
        PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/package/qbdi-preload-template"
        DESTINATION "${CMAKE_INSTALL_BINDIR}"
        COMPONENT QBDITemplate
        RENAME "qbdi-preload-template-${QBDI_ARCH}")
    endif()

    # Frida template
    if(QBDI_TOOLS_FRIDAQBDI)
      configure_file(package/qbdi-frida-template.in package/qbdi-frida-template)
      install(
        DIRECTORY templates/qbdi_frida_template
        DESTINATION "${RESOURCES_PREFIX}"
        COMPONENT QBDIFridaTemplate)
      install(
        PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/package/qbdi-frida-template
        DESTINATION "${CMAKE_INSTALL_BINDIR}"
        COMPONENT QBDIFridaTemplate
        RENAME "qbdi-frida-template-${QBDI_ARCH}")
      install(FILES tools/frida-qbdi.js DESTINATION "${RESOURCES_PREFIX}")
    endif()

  else()
    install(
      EXPORT QBDI_targets
      FILE QBDIConfig.cmake
      NAMESPACE QBDI::
      DESTINATION cmake)

    install(
      EXPORT QBDI_targets
      FILE QBDI${QBDI_ARCH}Config.cmake
      NAMESPACE QBDI::${QBDI_ARCH}::
      DESTINATION cmake)

    install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt" DESTINATION .)

    install(DIRECTORY templates/qbdi_template/
            DESTINATION templates/qbdi_template)

    if(QBDI_TOOLS_QBDIPRELOAD)
      install(DIRECTORY templates/qbdi_preload_template
              DESTINATION templates/qbdi_preload_template)
    endif()

    if(QBDI_TOOLS_FRIDAQBDI)
      install(DIRECTORY templates/qbdi_frida_template
              DESTINATION templates/qbdi_frida_template)
      install(FILES tools/frida-qbdi.js DESTINATION .)
    endif()

    install(FILES LICENSE.txt package/Readme.txt DESTINATION .)

    set(PRELOAD_RESOURCES_PREFIX qbdipreload)
  endif()
endif()

# Configure iOS code signature
if(QBDI_PLATFORM_IOS)
  # Find codesign executable
  execute_process(
    COMMAND xcrun -f codesign
    OUTPUT_STRIP_TRAILING_WHITESPACE
    OUTPUT_VARIABLE CODESIGN)
  # Define a code signature macro
  macro(ADD_SIGNATURE target_name)
    add_custom_command(
      TARGET ${target_name}
      POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E env ${CODESIGN} -f -s -
              $<TARGET_FILE:${target_name}>)
  endmacro()
else()
  # Define a dummy code signature macro
  macro(ADD_SIGNATURE target_name)

  endmacro()
endif()

# Add tests
if(QBDI_TEST OR QBDI_BENCHMARK)
  enable_testing()
  add_subdirectory(test)
endif()

# Add tools
add_subdirectory(tools)

# Add examples
if(QBDI_EXAMPLES)
  add_subdirectory(examples)
endif()

# Add documentation
if(QBDI_INCLUDE_DOCS)
  add_subdirectory(docs)
endif()

# Add packaging
if(QBDI_INCLUDE_PACKAGE)
  add_subdirectory(package)
endif()


================================================
FILE: LICENSE.txt
================================================
################################################################################
QBDI package license
################################################################################

QBDI binaries and packages can be statically linked with the followed source:

- QBDI under the Apache License v2.0
- LLVM under the Apache License v2.0 with LLVM Exceptions
    https://releases.llvm.org/10.0.0/LICENSE.TXT
- spdlog under the MIT License
    https://github.com/gabime/spdlog/blob/v1.x/LICENSE
- fmtlib under the MIT License
    https://github.com/fmtlib/fmt/blob/master/LICENSE.rst
- Catch2 under the Boost Software License 1.0
    https://github.com/catchorg/Catch2/blob/devel/LICENSE.txt
- Pybind11 under a BSD-style license
    https://github.com/pybind/pybind11/blob/master/LICENSE
- A sha256 implementation under GPLv3 / Apache License v2.0
    https://github.com/aguinet/sha256_literal#licensing

################################################################################
QBDI source code is under the Apache License v2.0
################################################################################

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright 2017 - 2025 Quarkslab

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: MANIFEST.in
================================================

## include any cmake file

include CMakeLists.txt
recursive-include cmake *
recursive-exclude cmake config/*

## include tools

include tools/CMakeLists.txt
recursive-include tools/pyqbdi *
recursive-include tools/QBDIPreload *

## include code

recursive-include src *
recursive-include include *

include README-pypi.rst


================================================
FILE: README-pypi.rst
================================================
Introduction
============

.. image:: https://readthedocs.org/projects/qbdi/badge/?version=stable
    :target: https://qbdi.readthedocs.io/en/stable/?badge=stable
    :alt: Documentation Status

.. image:: https://img.shields.io/github/v/release/QBDI/QBDI
    :target: https://github.com/QBDI/QBDI/releases

.. image:: https://img.shields.io/pypi/pyversions/PyQBDI
    :target: https://pypi.org/project/PyQBDI/

.. image:: https://img.shields.io/pypi/v/PyQBDI
    :target: https://pypi.org/project/PyQBDI/

QuarkslaB Dynamic binary Instrumentation (QBDI) is a modular, cross-platform and cross-architecture
DBI framework. It aims to support Linux, macOS, Android, iOS and Windows operating systems running on
x86, x86-64, ARM and AArch64 architectures. In addition of C/C++ API, Python and JS/frida bindings are
available to script QBDI. Information about what is a DBI framework and how QBDI
works can be found in the `documentation introduction <https://qbdi.readthedocs.io/en/stable/intro.html>`_.

QBDI modularity means it doesn't contain a preferred injection method and it is designed to be
used in conjunction with an external injection tool. QBDI includes a tiny (``LD_PRELOAD`` based)
Linux and macOS injector for dynamic executables (QBDIPreload).
QBDI is also fully integrated with `Frida <https://frida.re>`_, a reference dynamic instrumentation toolkit,
allowing anybody to use their combined powers.

A current limitation is that QBDI doesn't handle signals, multithreading (it doesn't deal with new
threads creation) and C++ exception mechanisms.
However, those system-dependent features will probably not be part of the core library (KISS),
and should be integrated as a new layer (to be determined how).

Status
++++++

.. role:: green
.. role:: yellow
.. role:: orange
.. role:: red

=======   ==============================   ==================   =========================
CPU       Operating Systems                Execution            Memory Access Information
=======   ==============================   ==================   =========================
x86-64    Android, Linux, macOS, Windows   :green:`Supported`   :green:`Supported`
x86       Android, Linux, macOS, Windows   :green:`Supported`   :green:`Supported`
ARM       Android, Linux                   :green:`Supported`   :green:`Supported`
AArch64   Android, Linux, macOS, iOS (*)   :green:`Supported`   :green:`Supported`
=======   ==============================   ==================   =========================

\* iOS support is unstable and need a jailbroken device.

Installation
============

Python API (PyQBDI)
+++++++++++++++++++

PyQBDI is available through PyPI. The wheel package can be either `downloaded <https://pypi.org/project/PyQBDI/#files>`__ or installed with the following command:

    pip install PyQBDI

The PyQBDI package is self-contained so completely independent from the C/C++ package.

Devel packages
++++++++++++++

There is no strict development timeline or scheduled release plan for the QBDI project.
All the new features and fixes are merged onto the ``dev-next`` branch.
Devel packages can be downloaded in the artefacts of `GitHub Actions <https://github.com/QBDI/QBDI/actions/workflows/python.yml?query=branch%3Adev-next>`__.

Compilation
===========

The PyQDBI library (apart from the wheel package) can be built by solely passing the **'-DQBDI_TOOLS_PYQBDI=ON'** option to the CMake build system.

However, if you want to build the wheel package, you can run these commands::

    git clone https://github.com/QBDI/QBDI.git
    python -m pip install --upgrade pip
    python -m pip install setuptools wheel build
    python -m build -w

A 32-bit version of Python is mandatory for the X86 architecture whereas a 64-bit one is required for the X86-64 architecture.


================================================
FILE: README.rst
================================================
.. image:: https://readthedocs.org/projects/qbdi/badge/?version=stable
    :target: https://qbdi.readthedocs.io/en/stable/?badge=stable
    :alt: Documentation Status

.. image:: https://img.shields.io/github/v/release/QBDI/QBDI
    :target: https://github.com/QBDI/QBDI/releases

.. image:: https://img.shields.io/pypi/pyversions/PyQBDI
    :target: https://pypi.org/project/PyQBDI/

.. image:: https://img.shields.io/pypi/v/PyQBDI
    :target: https://pypi.org/project/PyQBDI/

Introduction
============
.. intro

QuarkslaB Dynamic binary Instrumentation (QBDI) is a modular, cross-platform and cross-architecture
DBI framework. It aims to support Linux, macOS, Android, iOS and Windows operating systems running on
x86, x86-64, ARM and AArch64 architectures. In addition of C/C++ API, Python and JS/frida bindings are
available to script QBDI. Information about what is a DBI framework and how QBDI
works can be found in the `documentation introduction <https://qbdi.readthedocs.io/en/stable/intro.html>`_.

QBDI modularity means it doesn't contain a preferred injection method and it is designed to be
used in conjunction with an external injection tool. QBDI includes a tiny (``LD_PRELOAD`` based)
Linux and macOS injector for dynamic executables (QBDIPreload).
QBDI is also fully integrated with `Frida <https://frida.re>`_, a reference dynamic instrumentation toolkit,
allowing anybody to use their combined powers.

A current limitation is that QBDI doesn't handle signals, multithreading (it doesn't deal with new
threads creation) and C++ exception mechanisms.
However, those system-dependent features will probably not be part of the core library (KISS),
and should be integrated as a new layer (to be determined how).

Status
++++++

.. role:: green
.. role:: yellow
.. role:: orange
.. role:: red

=======   ==============================   ==================   =========================
CPU       Operating Systems                Execution            Memory Access Information
=======   ==============================   ==================   =========================
x86-64    Android, Linux, macOS, Windows   :green:`Supported`   :green:`Supported`
x86       Android, Linux, macOS, Windows   :green:`Supported`   :green:`Supported`
ARM       Android, Linux                   :green:`Supported`   :green:`Supported`
AArch64   Android, Linux, macOS, iOS (*)   :green:`Supported`   :green:`Supported`
=======   ==============================   ==================   =========================

\* iOS support is unstable and need a jailbroken device.

**stable**

.. image:: https://readthedocs.org/projects/qbdi/badge/?version=stable
    :target: https://qbdi.readthedocs.io/en/stable/
    :alt: Documentation Status

.. image:: https://github.com/QBDI/QBDI/actions/workflows/windows.yml/badge.svg?branch=master
    :target: https://github.com/QBDI/QBDI/actions/workflows/windows.yml?query=branch%3Amaster

.. image:: https://github.com/QBDI/QBDI/actions/workflows/linux.yml/badge.svg?branch=master
    :target: https://github.com/QBDI/QBDI/actions/workflows/linux.yml?query=branch%3Amaster

.. image:: https://github.com/QBDI/QBDI/actions/workflows/macos.yml/badge.svg?branch=master
    :target: https://github.com/QBDI/QBDI/actions/workflows/macos.yml?query=branch%3Amaster

**dev**

.. image:: https://readthedocs.org/projects/qbdi/badge/?version=dev-next
    :target: https://qbdi.readthedocs.io/en/dev-next/
    :alt: Documentation Status

.. image:: https://github.com/QBDI/QBDI/actions/workflows/windows.yml/badge.svg?branch=dev-next
    :target: https://github.com/QBDI/QBDI/actions/workflows/windows.yml?query=branch%3Adev-next

.. image:: https://github.com/QBDI/QBDI/actions/workflows/linux.yml/badge.svg?branch=dev-next
    :target: https://github.com/QBDI/QBDI/actions/workflows/linux.yml?query=branch%3Adev-next

.. image:: https://github.com/QBDI/QBDI/actions/workflows/macos.yml/badge.svg?branch=dev-next
    :target: https://github.com/QBDI/QBDI/actions/workflows/macos.yml?query=branch%3Adev-next

.. intro-end

Installation
============

C/C++/Frida APIs
++++++++++++++++

Every new QBDI version is compiled and made available on the GitHub `release page <https://github.com/QBDI/QBDI/releases>`_.

Python API (PyQBDI)
+++++++++++++++++++

PyQBDI is available through PyPI. The wheel package can be either `downloaded <https://pypi.org/project/PyQBDI/#files>`__ or installed with the following command:

    pip install PyQBDI

The PyQBDI package is self-contained so completely independent from the C/C++ package.

Devel packages
++++++++++++++

There is no strict development timeline or scheduled release plan for the QBDI project.
All the new features and fixes are merged onto the ``dev-next`` branch.
Devel packages can be downloaded in the artefacts of:

- `GitHub Actions <https://github.com/QBDI/QBDI/actions/workflows/android.yml?query=branch%3Adev-next>`__ for Android C/C++/frida API
- `GitHub Actions <https://github.com/QBDI/QBDI/actions/workflows/linux.yml?query=branch%3Adev-next>`__ for Linux C/C++/frida API (based on ubuntu)
- `GitHub Actions <https://github.com/QBDI/QBDI/actions/workflows/macos.yml?query=branch%3Adev-next>`__ for macOS C/C++/frida API
- `GitHub Actions <https://github.com/QBDI/QBDI/actions/workflows/windows.yml?query=branch%3Adev-next>`__ for Windows packages C/C++ API
- `GitHub Actions <https://github.com/QBDI/QBDI/actions/workflows/python.yml?query=branch%3Adev-next>`__ for PyQBDI

Compilation
===========
.. compil

To build this project, the following dependencies are needed on your system:

- cmake >= 3.12
- ninja or make
- C++17 toolchain (gcc, clang, Visual Studio 2019, ...)

A local version of llvm is statically built within QBDI because QBDI uses private APIs
not exported by regular LLVM installations and because our code is only compatible
with a specific version of those APIs.

QBDI build system relies on CMake and requires to pass build configuration flags. To help with
this step we provide shell scripts for common build configurations which follow the naming pattern
``config-OS-ARCH.sh``. Modifying these scripts is necessary if you want to compile in debug mode or
cross-compile QBDI.

Linux
+++++

x86-64
^^^^^^

Create a new directory at the root of the source tree, and execute the Linux configuration script::

    mkdir build
    cd build
    ../cmake/config/config-linux-X86_64.sh
    ninja

x86
^^^

You can follow the same instructions as for x86-64 but instead, use the ``config-linux-X86.sh`` configuration script.

macOS
+++++

Compiling QBDI on macOS requires a few things:

* A modern version of **macOS** (like Sierra)
* **Xcode** (from the *App Store* or *Apple Developer Tools*)
* the **Command Line Tools** (``xcode-select --install``)
* a package manager (preferably **MacPorts**, but *HomeBrew* should also be fine)
* some packages (``port install cmake wget ninja``)

Once requirements are met, create a new directory at the root of the source tree, and execute the macOS configuration script::

    mkdir build
    cd build
    ../cmake/config/config-macOS-X86_64.sh
    ninja

Windows
+++++++

Building on Windows requires a pure Windows installation of *Python 3*
(from the official packages, this is mandatory) in order to build our dependencies
(we really hope to improve this in the future).
It also requires an up-to-date CMake and Ninja.

First of all, the Visual Studio environment must be set up. This can be done with a command such as::

    "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64


Then, the following commands must be run::

    mkdir build
    cd build
    python ../cmake/config/config-win-X86_64.py
    ninja

Android
+++++++

Cross-compiling for Android requires the NDK (or the SDK) to be installed on your workstation.
For now, it has only been tested under Linux.
If not already installed, you can download the latest Android NDK package
through the `official website <https://developer.android.com/ndk/downloads>`__
and extract it.
Afterwards, the ``config-android-*.sh`` configuration script needs to be
customised to match your NDK installation directory and the target platform.::

    # Configure and compile QBDI X86_64 with a NDK
    mkdir build && cd build
    NDK_PATH=<your_NDK_PATH> ../cmake/config/config-android-X86_64.sh
    ninja

    # Configure and compile QBDI X86 with a SDK
    mkdir build && cd build
    ANDROID_SDK_ROOT=<your_SDK_PATH> ../cmake/config/config-android-X86.sh
    ninja

PyQBDI compilation
++++++++++++++++++

The PyQDBI library (apart from the wheel package) can be built by solely passing the **'-DQBDI_TOOLS_PYQBDI=ON'** option to the CMake build system.

However, if you want to build the wheel package, you can run these commands::

    python -m pip install --upgrade pip
    python -m pip install setuptools wheel build
    python -m build -w

A 32-bit version of Python is mandatory for the X86 architecture whereas a 64-bit one is required for the X86-64 architecture.

.. compil-end


================================================
FILE: cmake/QBDIConfig.cmake
================================================
if(__add_qbdi_config)
  return()
endif()
set(__add_qbdi_config ON)

# ========================
# CMAKE build type
# ========================

set(DEFAULT_BUILD_TYPE Release)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(
    STATUS
      "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
  set(CMAKE_BUILD_TYPE
      "${DEFAULT_BUILD_TYPE}"
      CACHE STRING "Used default build type (${DEFAULT_BUILD_TYPE})." FORCE)
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release" "Debug"
                                               "MinSizeRel" "RelWithDebInfo")
endif()

# ========================
# QBDI Version
# ========================
# note: the version should also be changed in the followed files:
# - docker/archlinux/PKGBUILD.{X86|X86_64}
# - docker/common.sh
# - setup.cfg
# - tools/frida-qbdi.js
set(QBDI_VERSION_MAJOR 0)
set(QBDI_VERSION_MINOR 12)
set(QBDI_VERSION_PATCH 2)
set(QBDI_VERSION_DEV 1)

set(QBDI_VERSION_STRING
    "${QBDI_VERSION_MAJOR}.${QBDI_VERSION_MINOR}.${QBDI_VERSION_PATCH}")
if(QBDI_VERSION_DEV)
  set(QBDI_VERSION_STRING "${QBDI_VERSION_STRING}-devel")
  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git"
     AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
    set_property(
      DIRECTORY
      APPEND
      PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
    find_package(Git REQUIRED)
    execute_process(
      COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
      OUTPUT_VARIABLE COMMIT_HASH
      OUTPUT_STRIP_TRAILING_WHITESPACE)
    set(QBDI_VERSION_FULL_STRING "${QBDI_VERSION_STRING}-${COMMIT_HASH}")
  elseif(DEFINED ENV{APPVEYOR_REPO_COMMIT})
    set(QBDI_VERSION_FULL_STRING
        "${QBDI_VERSION_STRING}-$ENV{APPVEYOR_REPO_COMMIT}")
  else()
    set(QBDI_VERSION_FULL_STRING "${QBDI_VERSION_STRING}")
  endif()
else()
  set(QBDI_VERSION_FULL_STRING "${QBDI_VERSION_STRING}")
endif()

# ========================
# QBDI Platform
# ========================
set(QBDI_SUPPORTED_PLATFORMS "android" "linux" "windows" "macos" "ios")

set(QBDI_SUPPORTED_ARCH "ARM" "AARCH64" "X86" "X86_64")

set(QBDI_PLATFORM_WINDOWS 0)
set(QBDI_PLATFORM_LINUX 0)
set(QBDI_PLATFORM_ANDROID 0)
set(QBDI_PLATFORM_MACOS 0)
set(QBDI_PLATFORM_IOS 0)

set(QBDI_ARCH_X86 0)
set(QBDI_ARCH_X86_64 0)
set(QBDI_ARCH_ARM 0)
set(QBDI_ARCH_AARCH64 0)

set(QBDI_BITS_32 0)
set(QBDI_BITS_64 0)

# Check platform
if(NOT DEFINED QBDI_PLATFORM)
  message(
    FATAL_ERROR
      "Please set 'QBDI_PLATFORM'\nSupported platform: ${QBDI_SUPPORTED_PLATFORMS}"
  )
elseif(QBDI_PLATFORM STREQUAL "windows")
  set(QBDI_PLATFORM_WINDOWS 1)
elseif(QBDI_PLATFORM STREQUAL "linux")
  set(QBDI_PLATFORM_LINUX 1)
elseif(QBDI_PLATFORM STREQUAL "android")
  set(QBDI_PLATFORM_ANDROID 1)
elseif(QBDI_PLATFORM STREQUAL "osx")
  set(QBDI_PLATFORM_MACOS 1)
elseif(QBDI_PLATFORM STREQUAL "macos")
  set(QBDI_PLATFORM_MACOS 1)
elseif(QBDI_PLATFORM STREQUAL "ios")
  set(QBDI_PLATFORM_IOS 1)
else()
  message(
    FATAL_ERROR
      "${QBDI_PLATFORM} is not a supported platform.\nCurrently supported: ${QBDI_SUPPORTED_PLATFORMS}"
  )
endif()

# Check arch
if(NOT DEFINED QBDI_ARCH)
  message(
    FATAL_ERROR
      "Please set 'QBDI_ARCH'\nSupported architecture: ${QBDI_SUPPORTED_ARCH}")
elseif(QBDI_ARCH STREQUAL "ARM")
  set(QBDI_ARCH_ARM 1)
  set(QBDI_BITS_32 1)
  set(QBDI_LLVM_ARCH "ARM")
  set(QBDI_BASE_ARCH "ARM")
elseif(QBDI_ARCH STREQUAL "AARCH64")
  set(QBDI_ARCH_AARCH64 1)
  set(QBDI_BITS_64 1)
  set(QBDI_LLVM_ARCH "AArch64")
  set(QBDI_BASE_ARCH "AARCH64")
elseif(QBDI_ARCH STREQUAL "X86")
  set(QBDI_ARCH_X86 1)
  set(QBDI_BITS_32 1)
  set(QBDI_LLVM_ARCH "X86")
  set(QBDI_BASE_ARCH "X86_64")
elseif(QBDI_ARCH STREQUAL "X86_64")
  set(QBDI_ARCH_X86_64 1)
  set(QBDI_BITS_64 1)
  set(QBDI_LLVM_ARCH "X86")
  set(QBDI_BASE_ARCH "X86_64")
else()
  message(
    FATAL_ERROR
      "${QBDI_ARCH} is not a supported architecture.\nCurrently supported: ${QBDI_SUPPORTED_ARCH}"
  )
endif()

if(QBDI_PLATFORM_WINDOWS AND NOT (QBDI_ARCH_X86 OR QBDI_ARCH_X86_64))
  message(
    FATAL_ERROR
      "Windows platform is only supported for X86 and X86_64 architectures.")
endif()

if(QBDI_PLATFORM_MACOS
   AND NOT
       (QBDI_ARCH_X86
        OR QBDI_ARCH_X86_64
        OR QBDI_ARCH_AARCH64))
  message(
    FATAL_ERROR
      "OSX platform is only supported for X86 and X86_64 architectures.")
endif()

if(QBDI_PLATFORM_IOS AND NOT (QBDI_ARCH_ARM OR QBDI_ARCH_AARCH64))
  message(
    FATAL_ERROR
      "IOS platform is only supported for ARM and AARCH64 architecture.")
endif()

if(QBDI_PLATFORM_MACOS)
  if(QBDI_ARCH_X86_64 AND NOT ("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL
                               "x86_64"))
    set(CMAKE_OSX_ARCHITECTURES
        "x86_64"
        CACHE STRING "" FORCE)
    set(CMAKE_CROSSCOMPILING
        "TRUE"
        CACHE STRING "" FORCE)
  elseif(QBDI_ARCH_AARCH64 AND NOT ("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL
                                    "arm64"))
    set(CMAKE_OSX_ARCHITECTURES
        "arm64"
        CACHE STRING "" FORCE)
    set(CMAKE_CROSSCOMPILING
        "TRUE"
        CACHE STRING "" FORCE)
  endif()
endif()

if(QBDI_PTRAUTH AND NOT ((QBDI_PLATFORM_MACOS OR QBDI_PLATFORM_IOS)
                         AND QBDI_ARCH_AARCH64))
  message(
    FATAL_ERROR
      "PTRAUTH is only supported for iOS and macOS platforms and AARCH64 architecture."
  )
endif()

message(STATUS "")
message(STATUS "== QBDI Target ==")
message(STATUS "QBDI Platform:      ${QBDI_PLATFORM}")
message(STATUS "QBDI ARCH:          ${QBDI_ARCH}")
message(STATUS "LLVM ARCH:          ${QBDI_LLVM_ARCH}")
message(STATUS "Version:            ${QBDI_VERSION_FULL_STRING}")
message(STATUS "")


================================================
FILE: cmake/QBDIDependencies.cmake
================================================
if(__add_qbdi_deps)
  return()
endif()
set(__add_qbdi_deps ON)
include(FetchContent)

if(NOT DEFINED QBDI_THIRD_PARTY_DIRECTORY)
  set(QBDI_THIRD_PARTY_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/third-party/")
endif()
set(qbdi_deps)

# Custom FetchContent Command
# ===========================

# since CMAKE 3.30, FetchContent_Declare doesn't support DOWNLOAD_DIR, which is
# used in order to cache the downloaded archive during CI.
# The followed function are used to keep this functionnality

function(DOWNLOAD_PACKAGE PACKAGE_NAME)

  string(TOLOWER "${PACKAGE_NAME}" PACKAGE_NAME_LOWER)
  set(FetchName "qbdi_deps_${PACKAGE_NAME_LOWER}")

  FetchContent_Populate(
    ${FetchName}
    DOWNLOAD_DIR "${QBDI_THIRD_PARTY_DIRECTORY}/${PACKAGE_NAME}_download"
    SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/${PACKAGE_NAME_LOWER}-src"
    BINARY_DIR "${FETCHCONTENT_BASE_DIR}/${PACKAGE_NAME_LOWER}-build"
    SUBBUILD_DIR "${FETCHCONTENT_BASE_DIR}/${PACKAGE_NAME_LOWER}-subbuild"
    QUIET ${ARGN})

  set("${PACKAGE_NAME}_EXTRACT_PATH"
      "${${FetchName}_SOURCE_DIR}"
      PARENT_SCOPE)
endfunction()

function(PREPARE_PACKAGE PACKAGE_NAME)

  cmake_parse_arguments(ARG "" "URL;URL_HASH" "" ${ARGN})

  if(NOT ((DEFINED ARG_URL) AND (DEFINED ARG_URL_HASH)))
    message(FATAL_ERROR "missing URL or URL_HASH in function argument")
  endif()

  download_package(${PACKAGE_NAME} URL "${ARG_URL}" URL_HASH "${ARG_URL_HASH}")

  FetchContent_Declare(
    ${PACKAGE_NAME} SOURCE_DIR "${${PACKAGE_NAME}_EXTRACT_PATH}"
                    ${ARG_UNPARSED_ARGUMENTS})
endfunction()

# Spdlog
# ======
set(SPDLOG_VERSION 1.15.0)

prepare_package(
  spdlog
  URL
  "https://github.com/gabime/spdlog/archive/v${SPDLOG_VERSION}.zip"
  URL_HASH
  "SHA256=076f3b4d452b95433083bcc66d07f79addba2d3fcb2b9177abeb7367d47aefbb"
  EXCLUDE_FROM_ALL)

list(APPEND qbdi_deps spdlog)

set(SPDLOG_NO_EXCEPTIONS
    ON
    CACHE BOOL "Enable SPDLOG_NO_EXCEPTIONS")
set(SPDLOG_NO_TLS
    ON
    CACHE BOOL "Enable SPDLOG_NO_TLS")
set(SPDLOG_NO_THREAD_ID
    ON
    CACHE BOOL "Enable SPDLOG_NO_THREAD_ID")
if(QBDI_LOG_DEBUG)
  set(SPDLOG_ACTIVE_LEVEL
      SPDLOG_LEVEL_DEBUG
      CACHE BOOL "Enable SPDLOG_LEVEL_DEBUG level")
endif()

# Catch2
# ======
if((QBDI_TEST) OR (QBDI_BENCHMARK))
  prepare_package(
    Catch2
    URL
    "https://github.com/catchorg/Catch2/archive/refs/tags/v3.3.1.zip"
    URL_HASH
    "SHA256=5e5283bf93b2693f6877bba3eaa76d66588955374d0cec5b40117066c044ad5e"
    EXCLUDE_FROM_ALL)
  list(APPEND qbdi_deps Catch2)
endif()

# Pybind11
# ========
if(QBDI_TOOLS_PYQBDI)
  if(DEFINED QBDI_TOOLS_PYQBDI_TARGET_PYTHON_VERSION)
    find_package(
      Python3 "${QBDI_TOOLS_PYQBDI_TARGET_PYTHON_VERSION}" EXACT REQUIRED
      COMPONENTS Interpreter Development.Module
      OPTIONAL_COMPONENTS Development.Embed)
  else()
    find_package(
      Python3 REQUIRED
      COMPONENTS Interpreter Development.Module
      OPTIONAL_COMPONENTS Development.Embed)
  endif()

  if(NOT Python3_FOUND)
    message(FATAL_ERROR "Python not found")
  endif()

  set(PYBIND11_FINDPYTHON ON)

  prepare_package(
    pybind11
    URL
    "https://github.com/pybind/pybind11/archive/v3.0.1.zip"
    URL_HASH
    "SHA256=20fb420fe163d0657a262a8decb619b7c3101ea91db35f1a7227e67c426d4c7e"
    EXCLUDE_FROM_ALL)
  list(APPEND qbdi_deps pybind11)
endif()

# Fetch all deps
# ==============
FetchContent_MakeAvailable(${qbdi_deps})

# Fetch LLVM
# ==========
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/llvm")
include(QBDI_llvm)

# Spdlog Configure
# ================
set_property(TARGET spdlog PROPERTY POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(
  spdlog INTERFACE SPDLOG_NO_TLS=1 SPDLOG_NO_THREAD_ID=1 SPDLOG_NO_EXCEPTIONS=1)

if(QBDI_LOG_DEBUG)
  target_compile_definitions(spdlog
                             INTERFACE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG)
else()
  target_compile_definitions(spdlog
                             INTERFACE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO)
endif()

# remove Threads::Threads for android
if(ANDROID)
  get_target_property(SPDLOG_LIB spdlog INTERFACE_LINK_LIBRARIES)
  list(REMOVE_ITEM SPDLOG_LIB Threads::Threads)
  set_property(TARGET spdlog PROPERTY INTERFACE_LINK_LIBRARIES "${SPDLOG_LIB}")
endif()

if(QBDI_PLATFORM_WINDOWS)
  target_compile_definitions(spdlog PUBLIC _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)

else()
  set(SPDLOG_QBDI_CXX_FLAGS
      -ffunction-sections -fdata-sections -fvisibility-inlines-hidden
      -fvisibility=hidden -fPIC -fno-rtti)
  target_compile_options(
    spdlog PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${SPDLOG_QBDI_CXX_FLAGS}>)
endif()


================================================
FILE: cmake/QBDIOptions.cmake
================================================
if(__add_qbdi_options)
  return()
endif()
set(__add_qbdi_options ON)

# Enable compilation using ccache
option(QBDI_CCACHE "Enable CCACHE or SCCACHE" ON)

# FORCE_DISABLE_AVX - default is OFF
if(QBDI_ARCH_X86_64 OR QBDI_ARCH_X86)
  option(QBDI_DISABLE_AVX
         "Force disable AVX support in case dynamic support detection is buggy"
         OFF)
else()
  # AVX only available on X86 and X86-64
  set(QBDI_DISABLE_AVX OFF)
endif()

# ASAN option
option(QBDI_ASAN
       "Enable AddressSanitizer (ASAN) for debugging (May be slow down)" OFF)

# Enable the logging level debug
option(QBDI_LOG_DEBUG "Enable Debug log level" OFF)

# Compile static Library
option(QBDI_STATIC_LIBRARY "Build the static library" ON)

# Compile shared Library
option(QBDI_SHARED_LIBRARY "Build the shared library" ON)

if(NOT QBDI_PLATFORM_ANDROID)
  # test
  option(QBDI_TEST "Compile tests" ON)

  # benchmark
  option(QBDI_BENCHMARK "Compile benchmark" OFF)
else()
  set(QBDI_TEST OFF)
  set(QBDI_BENCHMARK OFF)
endif()

# example
option(QBDI_EXAMPLES "Compile examples" OFF)

# docs
option(QBDI_INCLUDE_DOCS "Include cmake docs" ON)

# package
option(QBDI_INCLUDE_PACKAGE "Include cmake package (for cpack)" ON)

# package
option(QBDI_INSTALL "Prepare install target" ON)

# tools
if(NOT (QBDI_PLATFORM_IOS OR QBDI_PLATFORM_ANDROID))

  option(QBDI_TOOLS_QBDIPRELOAD "Compile QBDIPRELOAD" ON)

  if(QBDI_PLATFORM_WINDOWS)
    set(QBDI_TOOLS_VALIDATOR OFF)
  else()
    # Validator (compare execution between QBDIPreload and ptrace)
    option(QBDI_TOOLS_VALIDATOR
           "Compile the validator (need QBDI_TOOLS_QBDIPRELOAD)" OFF)
  endif()
else()
  set(QBDI_TOOLS_QBDIPRELOAD OFF)
  set(QBDI_TOOLS_VALIDATOR OFF)
endif()

# PYQBDI (need a python 32bit for 32bit architecture)
if(QBDI_BITS_64
   AND (QBDI_PLATFORM_WINDOWS
        OR QBDI_PLATFORM_LINUX
        OR QBDI_PLATFORM_MACOS))
  option(QBDI_TOOLS_PYQBDI "Compile python binding" ON)
else()
  option(QBDI_TOOLS_PYQBDI "Compile python binding" OFF)
endif()

# binding QBDI for frida
option(QBDI_TOOLS_FRIDAQBDI "Install frida-qbdi" ON)

# verify options
if(NOT QBDI_STATIC_LIBRARY)
  if(QBDI_TEST)
    message(FATAL_ERROR "Need QBDI_STATIC_LIBRARY to compile QBDI_TEST")
  endif()
  if(QBDI_BENCHMARK)
    message(FATAL_ERROR "Need QBDI_STATIC_LIBRARY to compile QBDI_BENCHMARK")
  endif()
  if(QBDI_TOOLS_PYQBDI)
    message(FATAL_ERROR "Need QBDI_STATIC_LIBRARY to compile QBDI_TOOLS_PYQBDI")
  endif()
  if(QBDI_TOOLS_QBDIPRELOAD)
    message(
      FATAL_ERROR "Need QBDI_STATIC_LIBRARY to compile QBDI_TOOLS_QBDIPRELOAD")
  endif()
  if(QBDI_TOOLS_VALIDATOR)
    message(
      FATAL_ERROR "Need QBDI_STATIC_LIBRARY to compile QBDI_TOOLS_VALIDATOR")
  endif()
endif()

if(NOT QBDI_SHARED_LIBRARY)
  if(QBDI_EXAMPLES)
    message(FATAL_ERROR "Need QBDI_SHARED_LIBRARY to compile QBDI_EXAMPLES")
  endif()
endif()

if(QBDI_TOOLS_VALIDATOR AND NOT QBDI_TOOLS_QBDIPRELOAD)
  message(
    FATAL_ERROR "Need QBDI_TOOLS_QBDIPRELOAD to compile QBDI_TOOLS_VALIDATOR")
endif()

# display resulted options
message(STATUS "== QBDI Options ==")
message(STATUS "QBDI_CCACHE:           ${QBDI_CCACHE}")

if(QBDI_ARCH_X86_64 OR QBDI_ARCH_X86)
  message(STATUS "QBDI_DISABLE_AVX:      ${QBDI_DISABLE_AVX}")
endif()

message(STATUS "QBDI_ASAN:             ${QBDI_ASAN}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  set(QBDI_LOG_DEBUG ON)
  message(
    STATUS
      "QBDI_LOG_DEBUG:        ${QBDI_LOG_DEBUG} (by CMAKE_BUILD_TYPE=Debug)")
else()
  message(STATUS "QBDI_LOG_DEBUG:        ${QBDI_LOG_DEBUG}")
endif()
message(STATUS "QBDI_STATIC_LIBRARY:   ${QBDI_STATIC_LIBRARY}")
message(STATUS "QBDI_SHARED_LIBRARY:   ${QBDI_SHARED_LIBRARY}")
message(STATUS "QBDI_TEST:             ${QBDI_TEST}")
message(STATUS "QBDI_BENCHMARK:        ${QBDI_BENCHMARK}")
message(STATUS "QBDI_EXAMPLES:         ${QBDI_EXAMPLES}")
message(STATUS "QBDI_TOOLS_QBDIPRELOAD: ${QBDI_TOOLS_QBDIPRELOAD}")
message(STATUS "QBDI_TOOLS_VALIDATOR:  ${QBDI_TOOLS_VALIDATOR}")
message(STATUS "QBDI_TOOLS_PYQBDI:     ${QBDI_TOOLS_PYQBDI}")
message(STATUS "QBDI_TOOLS_FRIDAQBDI:  ${QBDI_TOOLS_FRIDAQBDI}")

message(STATUS "")

if(QBDI_LOG_DEBUG)
  set(QBDI_ENABLE_LOG_DEBUG 1)
else()
  set(QBDI_ENABLE_LOG_DEBUG 0)
endif()


================================================
FILE: cmake/config/config-android-X86.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

if [ -z "${NDK_PATH}" ]; then
  if [ -z "${ANDROID_SDK_ROOT}" ]; then
    echo "ANDROID_SDK_ROOT or NDK_PATH variable should be set to configure cmake."
    exit 1
  fi
  if [ ! -d "${ANDROID_SDK_ROOT}" ]; then
    echo "'${ANDROID_SDK_ROOT}' is not valid!"
    exit 1
  fi
  export NDK_PATH="${ANDROID_SDK_ROOT}/ndk-bundle/"
fi

if [ ! -d "${NDK_PATH}" ]; then
  echo "'${NDK_PATH}' is not valid!"
  exit 1
fi

cmake "${GITDIR}"                        \
      -DQBDI_PLATFORM=android            \
      -DQBDI_ARCH=X86                    \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_TOOLCHAIN_FILE="${NDK_PATH}/build/cmake/android.toolchain.cmake" \
      -DANDROID_ABI=x86                  \
      -DANDROID_PLATFORM=23              \
      -G Ninja




================================================
FILE: cmake/config/config-android-X86_64.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

if [ -z "${NDK_PATH}" ]; then
  if [ -z "${ANDROID_SDK_ROOT}" ]; then
    echo "ANDROID_SDK_ROOT or NDK_PATH variable should be set to configure cmake."
    exit 1
  fi
  if [ ! -d "${ANDROID_SDK_ROOT}" ]; then
    echo "'${ANDROID_SDK_ROOT}' is not valid!"
    exit 1
  fi
  export NDK_PATH="${ANDROID_SDK_ROOT}/ndk-bundle/"
fi

if [ ! -d "${NDK_PATH}" ]; then
  echo "'${NDK_PATH}' is not valid!"
  exit 1
fi

cmake "${GITDIR}"                        \
      -DQBDI_PLATFORM=android            \
      -DQBDI_ARCH=X86_64                 \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_TOOLCHAIN_FILE="${NDK_PATH}/build/cmake/android.toolchain.cmake" \
      -DANDROID_ABI=x86_64               \
      -DANDROID_PLATFORM=23              \
      -G Ninja




================================================
FILE: cmake/config/config-android-aarch64.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

if [ -z "${NDK_PATH}" ]; then
  if [ -z "${ANDROID_SDK_ROOT}" ]; then
    echo "ANDROID_SDK_ROOT or NDK_PATH variable should be set to configure cmake."
    exit 1
  fi
  if [ ! -d "${ANDROID_SDK_ROOT}" ]; then
    echo "'${ANDROID_SDK_ROOT}' is not valid!"
    exit 1
  fi
  export NDK_PATH="${ANDROID_SDK_ROOT}/ndk-bundle/"
fi

if [ ! -d "${NDK_PATH}" ]; then
  echo "'${NDK_PATH}' is not valid!"
  exit 1
fi

cmake "${GITDIR}"                        \
      -DQBDI_PLATFORM=android            \
      -DQBDI_ARCH=AARCH64                \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo  \
      -DCMAKE_TOOLCHAIN_FILE="${NDK_PATH}/build/cmake/android.toolchain.cmake" \
      -DANDROID_ABI="arm64-v8a"          \
      -DANDROID_PLATFORM=24              \
      -G Ninja



================================================
FILE: cmake/config/config-android-armv7.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

if [ -z "${NDK_PATH}" ]; then
  if [ -z "${ANDROID_SDK_ROOT}" ]; then
    echo "ANDROID_SDK_ROOT or NDK_PATH variable should be set to configure cmake."
    exit 1
  fi
  if [ ! -d "${ANDROID_SDK_ROOT}" ]; then
    echo "'${ANDROID_SDK_ROOT}' is not valid!"
    exit 1
  fi
  export NDK_PATH="${ANDROID_SDK_ROOT}/ndk-bundle/"
fi

if [ ! -d "${NDK_PATH}" ]; then
  echo "'${NDK_PATH}' is not valid!"
  exit 1
fi

cmake "${GITDIR}"                        \
      -DQBDI_PLATFORM=android            \
      -DQBDI_ARCH=ARM                    \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo  \
      -DCMAKE_TOOLCHAIN_FILE="${NDK_PATH}/build/cmake/android.toolchain.cmake" \
      -DANDROID_ABI="armeabi-v7a"        \
      -DANDROID_PLATFORM=24              \
      -G Ninja


================================================
FILE: cmake/config/config-ios-aarch64.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

cmake "${GITDIR}"                        \
      -DQBDI_PLATFORM=ios                \
      -DQBDI_ARCH=AARCH64                \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_TOOLCHAIN_FILE="${GITDIR}/cmake/config/ios.toolchain.cmake" \
      -DCMAKE_OSX_DEPLOYMENT_TARGET="15.0" \
      -G Ninja



================================================
FILE: cmake/config/config-linux-X86.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

cmake "${GITDIR}"                        \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_CROSSCOMPILING=FALSE       \
      -DQBDI_PLATFORM=linux              \
      -DQBDI_ARCH=X86                    \
      -G Ninja


================================================
FILE: cmake/config/config-linux-X86_64.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

cmake "${GITDIR}"                        \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_CROSSCOMPILING=FALSE       \
      -DQBDI_PLATFORM=linux              \
      -DQBDI_ARCH=X86_64                 \
      -G Ninja


================================================
FILE: cmake/config/config-linux-aarch64.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

cmake "${GITDIR}"                        \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_CROSSCOMPILING=FALSE       \
      -DQBDI_PLATFORM=linux              \
      -DQBDI_ARCH=X86_64                 \
      -G Ninja


================================================
FILE: cmake/config/config-macOS-AARCH64.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

cmake "${GITDIR}"                        \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_CROSSCOMPILING=FALSE       \
      -DQBDI_PLATFORM=macos              \
      -DQBDI_ARCH=AARCH64                \
      -G Ninja


================================================
FILE: cmake/config/config-macOS-AARCH64e.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

cmake "${GITDIR}"                        \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_CROSSCOMPILING=FALSE       \
      -DQBDI_PLATFORM=macos              \
      -DQBDI_ARCH=AARCH64                \
      -DCMAKE_OSX_ARCHITECTURES="arm64e" \
      -DQBDI_PTRAUTH=ON                  \
      -G Ninja


================================================
FILE: cmake/config/config-macOS-X86.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

cmake "${GITDIR}"                        \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_CROSSCOMPILING=FALSE       \
      -DQBDI_PLATFORM=macos              \
      -DQBDI_ARCH=X86                    \
      -G Ninja


================================================
FILE: cmake/config/config-macOS-X86_64.sh
================================================
#!/bin/sh
set -e

BASEDIR="$(cd "$(dirname "$0")" && pwd -P)"
GITDIR="$(realpath "${BASEDIR}/../..")"

cmake "${GITDIR}"                        \
      -DCMAKE_BUILD_TYPE=Release         \
      -DCMAKE_CROSSCOMPILING=FALSE       \
      -DQBDI_PLATFORM=macos              \
      -DQBDI_ARCH=X86_64                 \
      -G Ninja


================================================
FILE: cmake/config/config-win-X86.py
================================================
import subprocess
import os

# be sure to run "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 before

subprocess.check_call(["cmake", os.path.realpath(os.path.join(os.path.dirname(__file__), ".." , "..")),
                       "-G", "Ninja",
                       "-DCMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING",
                       "-DCMAKE_BUILD_TYPE=Release",
                       "-DCMAKE_CROSSCOMPILING=FALSE",
                       "-DQBDI_PLATFORM=windows",
                       "-DQBDI_ARCH=X86"])


================================================
FILE: cmake/config/config-win-X86_64.py
================================================
import subprocess
import os

# be sure to run "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 before

subprocess.check_call(["cmake", os.path.realpath(os.path.join(os.path.dirname(__file__), ".." , "..")),
                       "-G", "Ninja",
                       "-DCMAKE_BUILD_TYPE=Release",
                       "-DCMAKE_CROSSCOMPILING=FALSE",
                       "-DQBDI_PLATFORM=windows",
                       "-DQBDI_ARCH=X86_64"])


================================================
FILE: cmake/config/ios.toolchain.cmake
================================================
# from https://github.com/llvm/llvm-project/blob/release/19.x/llvm/cmake/platforms/iOS.cmake

# LICENSE : Apache License v2.0 with LLVM Exceptions
# see https://github.com/llvm/llvm-project/blob/release/19.x/LICENSE.TXT

# Toolchain config for iOS.

SET(CMAKE_SYSTEM_NAME Darwin)
SET(CMAKE_SYSTEM_VERSION 13)
SET(CMAKE_CXX_COMPILER_WORKS True)
SET(CMAKE_C_COMPILER_WORKS True)
SET(IOS True)

if(NOT CMAKE_OSX_SYSROOT)
  execute_process(COMMAND xcodebuild -version -sdk iphoneos Path
    OUTPUT_VARIABLE SDKROOT
    ERROR_QUIET
    OUTPUT_STRIP_TRAILING_WHITESPACE)

  IF(NOT EXISTS ${SDKROOT})
    MESSAGE(FATAL_ERROR "SDKROOT could not be detected!")
  ENDIF()

  message(STATUS "Using SDKROOT ${SDKROOT}")
  set(CMAKE_OSX_SYSROOT ${SDKROOT})
endif()

IF(NOT CMAKE_C_COMPILER)
  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang
   OUTPUT_VARIABLE CMAKE_C_COMPILER
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
  message(STATUS "Using C compiler ${CMAKE_C_COMPILER}")
ENDIF()

IF(NOT CMAKE_CXX_COMPILER)
  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang++
   OUTPUT_VARIABLE CMAKE_CXX_COMPILER
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
  message(STATUS "Using C++ compiler ${CMAKE_CXX_COMPILER}")
ENDIF()

IF(NOT CMAKE_AR)
  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find ar
   OUTPUT_VARIABLE CMAKE_AR_val
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
  SET(CMAKE_AR ${CMAKE_AR_val} CACHE FILEPATH "Archiver")
  message(STATUS "Using ar ${CMAKE_AR}")
ENDIF()

IF(NOT CMAKE_RANLIB)
  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find ranlib
   OUTPUT_VARIABLE CMAKE_RANLIB_val
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
  SET(CMAKE_RANLIB ${CMAKE_RANLIB_val} CACHE FILEPATH "Ranlib")
  message(STATUS "Using ranlib ${CMAKE_RANLIB}")
ENDIF()

IF(NOT CMAKE_STRIP)
  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find strip
   OUTPUT_VARIABLE CMAKE_STRIP_val
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
  SET(CMAKE_STRIP ${CMAKE_STRIP_val} CACHE FILEPATH "Strip")
  message(STATUS "Using strip ${CMAKE_STRIP}")
ENDIF()

IF(NOT CMAKE_DSYMUTIL)
  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find dsymutil
   OUTPUT_VARIABLE CMAKE_DSYMUTIL_val
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
  SET(CMAKE_DSYMUTIL ${CMAKE_DSYMUTIL_val} CACHE FILEPATH "Dsymutil")
  message(STATUS "Using dsymutil ${CMAKE_DSYMUTIL}")
ENDIF()

IF(NOT CMAKE_LIBTOOL)
  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find libtool
   OUTPUT_VARIABLE CMAKE_LIBTOOL_val
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
  SET(CMAKE_LIBTOOL ${CMAKE_LIBTOOL_val} CACHE FILEPATH "Libtool")
  message(STATUS "Using libtool ${CMAKE_LIBTOOL}")
ENDIF()

IF(NOT CMAKE_CODESIGN)
  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find codesign
   OUTPUT_VARIABLE CMAKE_CODESIGN_val
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
  SET(CMAKE_CODESIGN ${CMAKE_CODESIGN_val} CACHE FILEPATH "Codesign")
  message(STATUS "Using codesign ${CMAKE_CODESIGN}")
ENDIF()

IF(NOT CMAKE_CODESIGN_ALLOCATE)
  execute_process(
    COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find codesign_allocate
    OUTPUT_VARIABLE CMAKE_CODESIGN_ALLOCATE_val
    ERROR_QUIET
    OUTPUT_STRIP_TRAILING_WHITESPACE)
  SET(CMAKE_CODESIGN_ALLOCATE ${CMAKE_CODESIGN_ALLOCATE_val} CACHE
      FILEPATH "Codesign_Allocate")
  message(STATUS "Using codesign_allocate ${CMAKE_CODESIGN_ALLOCATE}")
ENDIF()


================================================
FILE: cmake/dummy.c
================================================
int dummy() { return 42; }


================================================
FILE: cmake/llvm/QBDI_llvm.cmake
================================================
if(__add_qbdi_llvm)
  return()
endif()
set(__add_qbdi_llvm ON)

include(FetchContent)

# configure FetchContent
set(QBDI_LLVM_MAJOR_VERSION 19)
set(QBDI_LLVM_VERSION 19.1.5)

# download and include llvm cmake module
option(QBDI_INCLUDE_LLVM_CMAKE_MODUKE "Include llvm cmake module" ON)
if(QBDI_INCLUDE_LLVM_CMAKE_MODUKE)
  FetchContent_Populate(
    llvm_cmake
    URL "https://github.com/llvm/llvm-project/releases/download/llvmorg-${QBDI_LLVM_VERSION}/cmake-${QBDI_LLVM_VERSION}.src.tar.xz"
    URL_HASH
      "SHA256=a08ae477571fd5e929c27d3d0d28c6168d58dd00b6354c2de3266ae0d86ad44f"
    DOWNLOAD_DIR "${QBDI_THIRD_PARTY_DIRECTORY}/llvm-cmake-download"
    SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/qbdi_llvm/cmake"
    BINARY_DIR "${FETCHCONTENT_BASE_DIR}/llvm_cmake-build"
    SUBBUILD_DIR "${FETCHCONTENT_BASE_DIR}/llvm_cmake-subbuild"
    QUIET)
endif()

# Variable also use in QBDI_llvm_tblgen
set(QBDI_LLVM_URL
    "https://github.com/llvm/llvm-project/releases/download/llvmorg-${QBDI_LLVM_VERSION}/llvm-${QBDI_LLVM_VERSION}.src.tar.xz"
)
set(QBDI_LLVM_URL_HASH
    "SHA256=7d71635948e4da1814ce8e15ec45399e4094a5442e86d352c96ded0f2b3171b6")

FetchContent_Populate(
  llvm
  URL "${QBDI_LLVM_URL}"
  URL_HASH "${QBDI_LLVM_URL_HASH}"
  DOWNLOAD_DIR "${QBDI_THIRD_PARTY_DIRECTORY}/llvm-download"
  SOURCE_DIR "${FETCHCONTENT_BASE_DIR}/qbdi_llvm/llvm"
  BINARY_DIR "${FETCHCONTENT_BASE_DIR}/llvm-build"
  SUBBUILD_DIR "${FETCHCONTENT_BASE_DIR}/llvm-subbuild"
  QUIET)

set(CMAKE_CXX_STANDARD
    17
    CACHE STRING "USE CPP 17")
set(LLVM_BUILD_TOOLS
    OFF
    CACHE BOOL "Disable LLVM_BUILD_TOOLS")
set(LLVM_BUILD_UTILS
    OFF
    CACHE BOOL "Disable LLVM_BUILD_UTILS")
set(LLVM_BUILD_TESTS
    OFF
    CACHE BOOL "Disable LLVM_BUILD_TESTS")
set(LLVM_BUILD_BENCHMARKS
    OFF
    CACHE BOOL "Disable LLVM_BUILD_BENCHMARKS")
set(LLVM_BUILD_EXAMPLES
    OFF
    CACHE BOOL "Disable LLVM_BUILD_EXAMPLES")
set(LLVM_INCLUDE_TOOLS
    OFF
    CACHE BOOL "Disable LLVM_INCLUDE_TOOLS")
set(LLVM_INCLUDE_UTILS
    OFF
    CACHE BOOL "Disable LLVM_INCLUDE_UTILS")
set(LLVM_INCLUDE_TESTS
    OFF
    CACHE BOOL "Disable LLVM_INCLUDE_TESTS")
set(LLVM_INCLUDE_BENCHMARKS
    OFF
    CACHE BOOL "Disable LLVM_INCLUDE_BENCHMARKS")
set(LLVM_INCLUDE_EXAMPLES
    OFF
    CACHE BOOL "Disable LLVM_INCLUDE_EXAMPLES")
set(LLVM_ENABLE_TERMINFO
    OFF
    CACHE BOOL "Disable LLVM_ENABLE_TERMINFO")
set(LLVM_ENABLE_BINDINGS
    OFF
    CACHE BOOL "Disable LLVM_ENABLE_BINDINGS")
set(LLVM_ENABLE_RTTI
    OFF
    CACHE BOOL "Disable LLVM_ENABLE_RTTI")
set(LLVM_APPEND_VC_REV
    OFF
    CACHE BOOL "Disable LLVM_APPEND_VC_REV")
set(LLVM_ENABLE_Z3_SOLVER
    OFF
    CACHE BOOL "Disable LLVM_ENABLE_Z3_SOLVER")
set(LLVM_ENABLE_ZLIB
    OFF
    CACHE BOOL "Disable LLVM_ENABLE_ZLIB")
set(LLVM_ENABLE_ZSTD
    OFF
    CACHE BOOL "Disable LLVM_ENABLE_ZSTD")
set(LLVM_TARGET_ARCH
    ${QBDI_LLVM_ARCH}
    CACHE STRING "set LLVM_ARCH")
set(LLVM_TARGETS_TO_BUILD
    ${QBDI_LLVM_ARCH}
    CACHE STRING "set LLVM_TARGETS_TO_BUILD")

set(QBDI_LLVM_TRIPLE "")
if(QBDI_ARCH_ARM)
  if(QBDI_PLATFORM_ANDROID)
    set(QBDI_LLVM_TRIPLE armv7-linux-androideabi)
  else()
    set(QBDI_LLVM_TRIPLE armv7-linux-gnu)
  endif()
elseif(QBDI_ARCH_AARCH64)
  if(QBDI_PLATFORM_ANDROID)
    set(QBDI_LLVM_TRIPLE aarch64-linux-android)
  elseif(QBDI_PLATFORM_IOS)
    set(LLVM_ENABLE_LIBCXX
        ON
        CACHE INTERNAL "set LLVM_ENABLE_LIBCXX")
    set(QBDI_LLVM_TRIPLE arm64-apple-darwin)
  else()
    set(QBDI_LLVM_TRIPLE aarch64-linux-gnu)
  endif()
elseif(QBDI_ARCH_X86)
  set(LLVM_BUILD_32_BITS
      ON
      CACHE INTERNAL "set LLVM_BUILD_32_BITS")
  if(QBDI_PLATFORM_MACOS)
    set(LLVM_ENABLE_LIBCXX
        ON
        CACHE INTERNAL "set LLVM_ENABLE_LIBCXX")
    set(QBDI_LLVM_TRIPLE i386-apple-darwin17.7.0)
  elseif(QBDI_PLATFORM_LINUX OR QBDI_PLATFORM_ANDROID)
    set(QBDI_LLVM_TRIPLE i386-pc-linux)
  endif()
elseif(QBDI_ARCH_X86_64)
  if(QBDI_PLATFORM_LINUX)
    set(QBDI_LLVM_TRIPLE x86_64-pc-linux-gnu)
  endif()
else()
  message(FATAL_ERROR "Unsupported LLVM Architecture.")
endif()

if(QBDI_PLATFORM_WINDOWS)
  add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
endif()

if(NOT ("${QBDI_LLVM_TRIPLE}" STREQUAL ""))
  set(LLVM_HOST_TRIPLE
      "${QBDI_LLVM_TRIPLE}"
      CACHE STRING "set LLVM_HOST_TRIPLE")
endif()

# build llvm with visibility hidden
if(DEFINED CMAKE_C_VISIBILITY_PRESET)
  set(QBDI_CACHE_CMAKE_C_VISIBILITY_PRESET ${CMAKE_C_VISIBILITY_PRESET})
endif()
if(DEFINED CMAKE_CXX_VISIBILITY_PRESET)
  set(QBDI_CACHE_CMAKE_CXX_VISIBILITY_PRESET ${CMAKE_CXX_VISIBILITY_PRESET})
endif()
set(CMAKE_C_VISIBILITY_PRESET
    "hidden"
    CACHE STRING "set CMAKE_C_VISIBILITY_PRESET" FORCE)
set(CMAKE_CXX_VISIBILITY_PRESET
    "hidden"
    CACHE STRING "set CMAKE_CXX_VISIBILITY_PRESET" FORCE)

if(NOT ("${NATIVE_TABLEGEN_PATH}" STREQUAL ""))
  set(LLVM_TABLEGEN
      "${NATIVE_TABLEGEN_PATH}"
      CACHE INTERNAL "force tablegen")
elseif(NOT ("${QBDI_LLVM_TABLEN_TOOLSCHAIN}" STREQUAL ""))
  # create a second directory to build the native llvm-tblgen
  # mostly use when crosscompile and need another compiler to create a native
  # target
  include(QBDI_llvm_tblgen)
  set(LLVM_TABLEGEN
      "${QBDI_LLVM_NATIVE_TBLGEN}"
      CACHE INTERNAL "force tablegen")
else()
  # check if llvm-tblgen-X is available
  find_program(LLVM_TABLEN_BIN NAMES llvm-tblgen-${QBDI_LLVM_MAJOR_VERSION})
  message(STATUS "LLVM Table Gen found: ${LLVM_TABLEN_BIN}")
  if(${LLVM_TABLEN_BIN_FOUND})
    set(LLVM_TABLEGEN
        "${LLVM_TABLEN_BIN}"
        CACHE STRING "force tablegen")
  endif()
endif()

if(QBDI_PLATFORM_IOS AND "${LLVM_TABLEGEN}" STREQUAL "")
  # llvm fail to compile in this platform. Force to compile tablegen
  # with native toolchains
  set(QBDI_LLVM_TABLEN_TOOLSCHAIN
      "${CMAKE_CURRENT_BINARY_DIR}/QBDI_empty_toolchains.cmake")
  file(TOUCH "${QBDI_LLVM_TABLEN_TOOLSCHAIN}")
  include(QBDI_llvm_tblgen)
  set(LLVM_TABLEGEN
      "${QBDI_LLVM_NATIVE_TBLGEN}"
      CACHE INTERNAL "force tablegen")
endif()

if(QBDI_CCACHE AND CCACHE_FOUND)
  set(LLVM_CCACHE_BUILD
      ON
      CACHE BOOL "Enable CCACHE in llvm")
else()
  set(LLVM_CCACHE_BUILD
      OFF
      CACHE BOOL "Enable CCACHE in llvm")
endif()

if(QBDI_ASAN AND HAVE_FLAG_SANITIZE_ADDRESS)
  set(LLVM_USE_SANITIZER
      Address
      CACHE STRING "Enable ASAN")
endif()

add_subdirectory(${llvm_SOURCE_DIR} ${llvm_BINARY_DIR} EXCLUDE_FROM_ALL)

# restore visibility
if(DEFINED QBDI_CACHE_CMAKE_C_VISIBILITY_PRESET)
  set(CMAKE_C_VISIBILITY_PRESET
      ${QBDI_CACHE_CMAKE_C_VISIBILITY_PRESET}
      CACHE INTERNAL "set CMAKE_C_VISIBILITY_PRESET" FORCE)
else()
  unset(CMAKE_C_VISIBILITY_PRESET CACHE)
endif()
if(DEFINED QBDI_CACHE_CMAKE_CXX_VISIBILITY_PRESET)
  set(CMAKE_CXX_VISIBILITY_PRESET
      ${QBDI_CACHE_CMAKE_CXX_VISIBILITY_PRESET}
      CACHE INTERNAL "set CMAKE_CXX_VISIBILITY_PRESET" FORCE)
else()
  unset(CMAKE_CXX_VISIBILITY_PRESET CACHE)
endif()

# list of LLVM library to build
set(QBDI_LLVM_TARGET_LIBRARY)
set(QBDI_LLVM_LINK_LIBRARY)
macro(add_llvm_lib)
  foreach(LIB ${ARGV})
    if("${LIB}" MATCHES "^::@")
      continue()
    endif()
    string(FIND "${LIB}" "::@" pos)
    if("${pos}" EQUAL -1)
      set(TARGETLIB "${LIB}")
    else()
      string(SUBSTRING "${LIB}" 0 "${pos}" TARGETLIB)
    endif()
    if((TARGET ${TARGETLIB}) AND NOT (${TARGETLIB} IN_LIST
                                      QBDI_LLVM_TARGET_LIBRARY))
      list(APPEND QBDI_LLVM_TARGET_LIBRARY ${TARGETLIB})
      get_target_property(_LIB_LINK ${TARGETLIB} INTERFACE_LINK_LIBRARIES)
      if(_LIB_LINK)
        add_llvm_lib(${_LIB_LINK})
      endif()
    elseif(NOT (TARGET ${TARGETLIB}) AND NOT (${TARGETLIB} IN_LIST
                                              QBDI_LLVM_LINK_LIBRARY))
      list(APPEND QBDI_LLVM_LINK_LIBRARY ${TARGETLIB})
    endif()
  endforeach()
endmacro()

add_llvm_lib(
  LLVMBinaryFormat
  LLVMMCDisassembler
  LLVMMCParser
  LLVMMC
  LLVMSupport
  LLVMObject
  LLVMTextAPI
  LLVMCore
  LLVMBitReader
  LLVMBitstreamReader
  LLVMRemarks)

if(QBDI_PLATFORM_MACOS OR QBDI_PLATFORM_IOS)
  add_llvm_lib(LLVMDemangle)
endif()

if(QBDI_ARCH_ARM)
  add_llvm_lib(LLVMARMAsmParser LLVMARMDisassembler LLVMARMDesc LLVMARMInfo
               LLVMARMUtils)
elseif(QBDI_ARCH_AARCH64)
  add_llvm_lib(LLVMAArch64AsmParser LLVMAArch64Desc LLVMAArch64Disassembler
               LLVMAArch64Info LLVMAArch64Utils)
elseif(QBDI_ARCH_X86_64 OR QBDI_ARCH_X86)
  add_llvm_lib(LLVMX86AsmParser LLVMX86Disassembler LLVMX86Desc LLVMX86Info)
else()
  message(FATAL_ERROR "Unsupported LLVM Architecture.")
endif()

if(QBDI_PLATFORM_MACOS)
  find_package(Python3 REQUIRED COMPONENTS Interpreter)

  set(LLVMSupportFixName "${llvm_BINARY_DIR}/libLLVMSupportFix.a")
  add_custom_command(
    OUTPUT "${LLVMSupportFixName}"
    COMMAND
      "${Python3_EXECUTABLE}"
      "${CMAKE_CURRENT_SOURCE_DIR}/cmake/llvm/rename_object.py" -i
      $<TARGET_FILE:LLVMSupport> -o "${LLVMSupportFixName}" -r Memory.cpp.o 1 -r
      Error.cpp.o 1
    COMMENT "Fix LLVMSupport library"
    DEPENDS LLVMSupport
    VERBATIM)
  list(REMOVE_ITEM QBDI_LLVM_TARGET_LIBRARY LLVMSupport)
  list(APPEND QBDI_LLVM_TARGET_LIBRARY "${LLVMSupportFixName}")

  set(LLVMObjectFixName "${llvm_BINARY_DIR}/libLLVMObjectFix.a")
  add_custom_command(
    OUTPUT "${LLVMObjectFixName}"
    COMMAND
      "${Python3_EXECUTABLE}"
      "${CMAKE_CURRENT_SOURCE_DIR}/cmake/llvm/rename_object.py" -i
      $<TARGET_FILE:LLVMObject> -o "${LLVMObjectFixName}" -r Minidump.cpp.o 1
    COMMENT "Fix LLVMObject library"
    DEPENDS LLVMObject
    VERBATIM)
  list(REMOVE_ITEM QBDI_LLVM_TARGET_LIBRARY LLVMObject)
  list(APPEND QBDI_LLVM_TARGET_LIBRARY "${LLVMObjectFixName}")

  list(APPEND QBDI_LLVM_LINK_LIBRARY -lc++)
elseif(QBDI_PLATFORM_LINUX)
  list(APPEND QBDI_LLVM_LINK_LIBRARY -lstdc++)
endif()

merge_static_libs(qbdi-llvm qbdi-llvm \${QBDI_LLVM_TARGET_LIBRARY})
target_link_libraries(qbdi-llvm INTERFACE ${QBDI_LLVM_LINK_LIBRARY})

target_include_directories(
  qbdi-llvm
  INTERFACE ${llvm_SOURCE_DIR}/include
  INTERFACE ${llvm_BINARY_DIR}/include
  INTERFACE ${llvm_SOURCE_DIR}/lib/Target/${QBDI_LLVM_ARCH}
  INTERFACE ${llvm_BINARY_DIR}/lib/Target/${QBDI_LLVM_ARCH}
  INTERFACE ${llvm_SOURCE_DIR}/lib
  INTERFACE ${llvm_BINARY_DIR}/lib)

add_custom_target(llvm DEPENDS qbdi-llvm)


================================================
FILE: cmake/llvm/QBDI_llvm_tblgen.cmake
================================================
if(__add_qbdi_llvm_tblgen)
  return()
endif()
set(__add_qbdi_llvm_tblgen ON)
include(ExternalProject)

set(NATIVE_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/QBDI_llvm_tblgen_native")

if(CMAKE_CONFIGURATION_TYPES)
  set(QBDI_LLVM_NATIVE_TBLGEN "${NATIVE_BUILD_DIR}/Release/bin/llvm-tblgen")
else()
  set(QBDI_LLVM_NATIVE_TBLGEN "${NATIVE_BUILD_DIR}/bin/llvm-tblgen")
endif()

ExternalProject_Add(
  llvm_tblgen
  URL "${QBDI_LLVM_URL}"
  URL_HASH "${QBDI_LLVM_URL_HASH}"
  DOWNLOAD_DIR "${QBDI_THIRD_PARTY_DIRECTORY}/llvm-download"
  SOURCE_DIR "${llvm_cmake_SOURCE_DIR}/../llvm_tblgen_source_dir"
  BINARY_DIR "${NATIVE_BUILD_DIR}"
  CONFIGURE_COMMAND
    "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" -S <SOURCE_DIR> -B <BINARY_DIR>
    "-DCMAKE_MAKE_PROGRAM='${CMAKE_MAKE_PROGRAM}'"
    "-DCMAKE_TOOLCHAIN_FILE='${QBDI_LLVM_TABLEN_TOOLSCHAIN}'"
    -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
    "-DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}'"
    "-DLLVM_TARGET_ARCH='${LLVM_TARGET_ARCH}'" -DCMAKE_BUILD_TYPE=Release
    "-DLLVM_CCACHE_BUILD='${LLVM_CCACHE_BUILD}'" -DLLVM_INCLUDE_TESTS=OFF
    -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF
  BUILD_COMMAND "${CMAKE_COMMAND}" --build <BINARY_DIR> --target llvm-tblgen
  BUILD_BYPRODUCTS "${QBDI_LLVM_NATIVE_TBLGEN}"
  INSTALL_COMMAND "")


================================================
FILE: cmake/llvm/rename_object.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import tempfile
import os
import sys

LIPO = "lipo"
IOS_LIPO="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo"

if os.path.exists(IOS_LIPO):
    LIPO = IOS_LIPO

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

def listArchs(archive):
    try:
        out = subprocess.check_output([LIPO, "-info", archive]).decode("utf-8")
    except:
        out = ""

    xs = out.split(":")

    if (len(xs)) != 3:
        raise RuntimeError("invalid lipo -info output")

    return xs[2].strip().split()


def extractArch(archive, arch, path):
    name = arch + "-" + os.path.basename(archive)
    fpath = os.path.join(path, name)
    try:
        t = subprocess.check_call([LIPO, "-thin", arch, archive, "-output", fpath])
    except:
        t = 1
    if t != 0:
        return ""
    return fpath


def extractObjs(archive, path):
    try:
        t = subprocess.check_call(["ar", "-x", archive], cwd=path)
    except:
        t = 1
    if t != 0:
        return False
    return True


def archiveObjs(archive, path):
    vext = lambda x: x[-2:] == ".o" or x[-3:] == ".o2"
    files = filter(vext, os.listdir(path))
    try:
        t = subprocess.check_call(["libtool", "-static", "-o", archive] + files, cwd=path)
    except:
        t = 1
    if t != 0:
        return False
    return True


def mergeArch(archives, outpath):
    if not archives:
        return
    try:
        t = subprocess.check_call([LIPO, "-create"] + archives + ["-output", outpath])
    except:
        t = 1
    if t != 0:
        return False
    return True


def rename_object(archive, ofname, suffix="", remove=False):
    root, ext = os.path.splitext(ofname)
    nfname = "{}_{}{}".format(root, suffix, ext)
    altofname = "{}.o2".format(root)
    altnfname = "{}_{}.o2".format(root, suffix)

    archs = listArchs(archive)
    isFat = len(archs) > 1

    # Create tmp dir
    with tempfile.TemporaryDirectory() as tdir:
        marchives = []

        for arch in archs:
            # Extract arch from universal binary
            thinar = archive
            if isFat:
                thinar = extractArch(archive, arch, tdir)
                if not thinar:
                    eprint("Cannot extract arch " + arch)
                    continue
            # Create tmp dir for extracted objects
            arname = os.path.basename(thinar)
            xdir = os.path.join(tdir, arname) + ".dir"
            os.mkdir(xdir)
            # Extract objects
            if not extractObjs(thinar, xdir):
                eprint("Cannot extract objects for " + arch)
                continue
            ofpath = os.path.join(xdir, ofname)
            nfpath = os.path.join(xdir, nfname)
            altofpath = os.path.join(xdir, altofname)
            altnfpath = os.path.join(xdir, altnfname)
            if remove:
                os.unlink(ofpath)
            else:
                # Rename object
                rename = False
                if os.path.exists(ofpath):
                    print("Move {} to {}".format(ofpath, nfpath))
                    os.rename(ofpath, nfpath)
                    rename = True
                if os.path.exists(altofpath):
                    print("Move {} to {}".format(altofpath, altnfpath))
                    os.rename(altofpath, altnfpath)
                    rename = True
                if not rename:
                    eprint("Cannot find object {} for arch {}".format(ofname, arch))
                    continue
            # Archive objects
            archiveObjs(thinar, xdir)
            # Add archive to modified archive list
            marchives.append(thinar)

        if isFat:
            # Merge all subarch into original file
            if not mergeArch(marchives, archive):
                raise RuntimeError("Cannot update original file")

if __name__ == '__main__':
    import argparse
    import shutil
    parser = argparse.ArgumentParser()

    parser.add_argument("-i", "--input", type=str, help="input archive", required=True)
    parser.add_argument("-o", "--output", type=str, help="output archive", required=True)
    parser.add_argument("-r", "--rename-object", type=str, help="Object to rename", action='append', default=[],
            metavar=('name','suffix'), nargs=2)
    parser.add_argument("-R", "--remove-object", type=str, help="Object to remove", action='append', default=[])

    args = parser.parse_args()

    assert os.path.exists(args.input), "Input file not found ({})".format(args.input)
    if args.input != args.output:
        os.makedirs(os.path.split(os.path.realpath(args.input))[0], exist_ok=True)
        shutil.copy2(args.input, args.output)
        removeOnFail = True
    else:
        removeOnFail = False

    try:
        for oname, suffix in args.rename_object:
            rename_object(args.output, oname, suffix=suffix)
        for oname in args.remove_object:
            rename_object(args.output, oname, remove=True)
        removeOnFail = False
    finally:
        if removeOnFail:
            os.unlink(args.output)



================================================
FILE: cmake/merge_archives.cmake
================================================
set(MERGE_LIBS_DUMMY_FILE ${CMAKE_CURRENT_LIST_DIR}/dummy.c)

macro(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)

  set(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.c)

  add_custom_command(
    OUTPUT ${SOURCE_FILE}
    COMMAND ${CMAKE_COMMAND} -E copy ${MERGE_LIBS_DUMMY_FILE} ${SOURCE_FILE}
    DEPENDS ${LIBS_TO_MERGE})

  add_library(${TARGET} STATIC ${SOURCE_FILE})
  set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME})

  set(LIBS_PATH "")
  foreach(LIB ${LIBS_TO_MERGE})
    if(TARGET ${LIB})
      add_dependencies(${TARGET} ${LIB})
      set(LIBS_PATH ${LIBS_PATH} $<TARGET_FILE:${LIB}>)
    else()
      set(LIBS_PATH ${LIBS_PATH} ${LIB})
    endif()
  endforeach()
  list(REMOVE_DUPLICATES LIBS_PATH)

  if(WIN32)

    set(LIB_COMMAND_ARGS_FILE
        "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_lib_exe_args")
    string(JOIN " " LINK_LIBS ${LIBS_PATH})
    file(
      GENERATE
      OUTPUT ${LIB_COMMAND_ARGS_FILE}
      CONTENT "/OUT:$<TARGET_FILE:${TARGET}> ${LINK_LIBS}")

    add_custom_command(
      TARGET ${TARGET}
      POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E remove $<TARGET_FILE:${TARGET}>
      COMMAND "LIB.EXE" "@${LIB_COMMAND_ARGS_FILE}")

  elseif(APPLE)
    add_custom_command(
      TARGET ${TARGET}
      POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E remove $<TARGET_FILE:${TARGET}>
      COMMAND /usr/bin/libtool -static -o $<TARGET_FILE:${TARGET}> ${LIBS_PATH})

  elseif(UNIX)
    set(AR_COMMAND_ARGS_FILE
        "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_ar_script_file")

    set(AR_SCRIPT "")
    foreach(LIB ${LIBS_PATH})
      set(AR_SCRIPT "${AR_SCRIPT}\naddlib ${LIB}")
    endforeach()

    file(
      GENERATE
      OUTPUT ${AR_COMMAND_ARGS_FILE}
      CONTENT "create $<TARGET_FILE:${TARGET}>\n${AR_SCRIPT}\nsave\nend\n")

    add_custom_command(
      TARGET ${TARGET}
      POST_BUILD
      COMMAND ${CMAKE_COMMAND} -E remove $<TARGET_FILE:${TARGET}>
      COMMAND ${CMAKE_AR} "-M" "<${AR_COMMAND_ARGS_FILE}")

  else()
    message(
      FATAL_ERROR "Static llvm library: unsupported system ${CMAKE_SYSTEM_NAME}"
    )
  endif()

endmacro()


================================================
FILE: docker/.gitignore
================================================
image.hash


================================================
FILE: docker/archlinux/Dockerfile.X86
================================================
FROM archlinux:base-devel
LABEL maintainer="QBDI Team <qbdi@quarkslab.com>"

ENV USER="docker" \
    HOME="/home/docker" \
    PREFIX="/usr" \
    QBDI_PLATFORM="linux" \
    QBDI_ARCH="X86"

# Get latest package list, upgrade packages, install required packages 
# and cleanup to keep container as small as possible
RUN echo "[multilib]" >> /etc/pacman.conf && \
    echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf && \
    pacman -Suy --noconfirm && \
    pacman -S --noconfirm \
        base-devel \
        sudo \
        gcc \
        git \
        ninja \
        cmake \
        python3 \
        wget \
        multilib-devel && \
    (pacman -Sc --noconfirm || true)

# create a user
RUN useradd -Groot $USER && \
    echo '%root ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# switch to new user
USER $USER

# build / test / install QBDI

# git archive -o qbdi.tar.gz --prefix=qbdi/ HEAD .
ADD qbdi.tar.gz $HOME/

WORKDIR $HOME/qbdi

RUN sudo chown -R $USER:$USER . && \
    rm -rf deps && \
    ln -s $HOME/qbdi-deps/deps deps && \
    mkdir build && \
    cd build && \
    cp ../docker/archlinux/PKGBUILD.$QBDI_ARCH PKGBUILD && \
    makepkg -fc && \
    sudo pacman -U --noconfirm QBDI-*.pkg.tar.zst

WORKDIR "$HOME/"
CMD ["/bin/bash"]


================================================
FILE: docker/archlinux/Dockerfile.X86_64
================================================
FROM archlinux:base-devel
LABEL maintainer="QBDI Team <qbdi@quarkslab.com>"

ENV USER="docker" \
    HOME="/home/docker" \
    PREFIX="/usr" \
    QBDI_PLATFORM="linux" \
    QBDI_ARCH="X86_64"

# Get latest package list, upgrade packages, install required packages 
# and cleanup to keep container as small as possible
RUN pacman -Suy --noconfirm && \
    pacman -S --noconfirm \
        base-devel \
        sudo \
        gcc \
        git \
        ninja \
        cmake \
        python3 \
        wget && \
    (pacman -Sc --noconfirm || true)

# create a user
RUN useradd -Groot $USER && \
    echo '%root ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# switch to new user
USER $USER

# build / test / install QBDI

# git archive -o qbdi.tar.gz --prefix=qbdi/ HEAD .
ADD qbdi.tar.gz $HOME/

WORKDIR $HOME/qbdi

RUN sudo chown -R $USER:$USER . && \
    rm -rf deps && \
    ln -s $HOME/qbdi-deps/deps deps && \
    mkdir build && \
    cd build && \
    cp ../docker/archlinux/PKGBUILD.$QBDI_ARCH PKGBUILD && \
    makepkg -fc && \
    sudo pacman -U --noconfirm QBDI-*.pkg.tar.zst

WORKDIR "$HOME/"
CMD ["/bin/bash"]


================================================
FILE: docker/archlinux/PKGBUILD.X86
================================================
# Maintainer: Charles Hubain <chubain@quarkslab.com>
# Maintainer: QBDI Team <qbdi@quarkslab.com>

pkgname=QBDI-X86
pkgver=0.12.2_devel
pkgrel=1
epoch=
pkgdesc="QuarkslaB Dynamic binary Instrumentation for linux-X86"
arch=('x86_64' 'i686')
url="https://qbdi.quarkslab.com/"
license=('apache2')
options=(staticlibs)
makedepends=('cmake' 'ninja' 'gcc' 'python' 'git')

prepare() {
    mkdir "$pkgname-$pkgver"
}

build() {
    cd "$pkgname-$pkgver"
    cmake -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_CROSSCOMPILING=FALSE \
          -DQBDI_PLATFORM=linux \
          -DQBDI_ARCH=X86 \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -DQBDI_TOOLS_PYQBDI=OFF \
          -DQBDI_CCACHE=OFF \
          -G Ninja \
          ../../../
    cmake --build .
}

check() {
    cd "$pkgname-$pkgver"
    ./test/QBDITest
}

package() {
    cd "$pkgname-$pkgver"
    DESTDIR="$pkgdir/" cmake --build . --target install
}


================================================
FILE: docker/archlinux/PKGBUILD.X86_64
================================================
# Maintainer: Charles Hubain <chubain@quarkslab.com>
# Maintainer: QBDI Team <qbdi@quarkslab.com>

pkgname=QBDI-X86_64
pkgver=0.12.2_devel
pkgrel=1
epoch=
pkgdesc="QuarkslaB Dynamic binary Instrumentation for linux-X86_64"
arch=('x86_64')
url="https://qbdi.quarkslab.com/"
license=('apache2')
options=(staticlibs)
makedepends=('cmake' 'ninja' 'gcc' 'python' 'git')

prepare() {
    mkdir "$pkgname-$pkgver"
}

build() {
    cd "$pkgname-$pkgver"
    cmake -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_CROSSCOMPILING=FALSE \
          -DQBDI_PLATFORM=linux \
          -DQBDI_ARCH=X86_64 \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -DQBDI_TOOLS_PYQBDI=OFF \
          -DQBDI_CCACHE=OFF \
          -G Ninja \
          ../../../
    cmake --build .
}

check() {
    cd "$pkgname-$pkgver"
    ./test/QBDITest
}

package() {
    cd "$pkgname-$pkgver"
    DESTDIR="$pkgdir/" cmake --build . --target install
}


================================================
FILE: docker/archlinux/build.sh
================================================
#!/usr/bin/bash

set -e
set -x

BASEDIR=$(cd $(dirname "$0") && pwd -P)
GITDIR=$(git rev-parse --show-toplevel)

. "${BASEDIR}/../common.sh"

ARCH="X86_64"

if [[ "$1" = "X86" || "$1" = "x86" ]]; then
    ARCH="X86"
fi

DOCKER_TAG="qbdi:x${ARCH: -2}_archlinux"

prepare_archive

docker build "${BASEDIR}" -t "${DOCKER_TAG}" -f "${BASEDIR}/Dockerfile.${ARCH}"

delete_archive

echo "Success build ${DOCKER_TAG}"


================================================
FILE: docker/ci_linux/Dockerfile
================================================
ARG DOCKER_IMG="debian:13"

FROM $DOCKER_IMG

ENV USER="docker" \
    HOME="/home/docker" \
    PREFIX="/usr" \
    CLICOLOR_FORCE=1

ARG USER_ID=1000

# Get latest package list, upgrade packages, install required packages 
# and cleanup to keep container as small as possible
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        adduser \
        bash \
        git \
        build-essential \
        ccache \
        cmake \
        g++ \
        g++-multilib \
        libstdc++-13-dev \
        make \
        ninja-build \
        pkg-config \
        wget \
        ca-certificates \
        python3 \
        python3-dev \
        python3-yaml \
        zip \
        git \
        xxd && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# create a user
RUN adduser --uid "$USER_ID" --disabled-password --gecos '' --home "$HOME" "$USER"

WORKDIR $HOME

USER $USER



================================================
FILE: docker/ci_linux/build-qbdi.sh
================================================
#!/usr/bin/env bash

set -ex

cd "${HOME}/qbdi/"
mkdir -p build
cd build

cmake .. \
      -G Ninja \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_CROSSCOMPILING=FALSE \
      -DQBDI_PLATFORM=${QBDI_PLATFORM} \
      -DQBDI_ARCH=${QBDI_ARCH} \
      -DCMAKE_INSTALL_PREFIX=$PREFIX \
      -DQBDI_EXAMPLES=ON \
      -DQBDI_TOOLS_VALIDATOR=ON \
      -DQBDI_TOOLS_PYQBDI=ON

ninja

cpack

./test/QBDITest

set +e

cd "${HOME}/qbdi/"
mkdir -p tools/validation_runner/travis_db

python3 tools/validation_runner/ValidationRunner.py tools/validation_runner/travis.cfg

exit 0


================================================
FILE: docker/ci_linux/img_build.sh
================================================
#!/usr/bin/env bash

set -ex

cd $(dirname "$0")
BASEDIR=$(pwd -P)
GITDIR=$(git rev-parse --show-toplevel)

if [[ "${QBDI_ARCH}" = "X86_64" ]]; then
    DOCKER_IMG="amd64/debian:13"
elif [[ "${QBDI_ARCH}" = "X86" ]]; then
    DOCKER_IMG="i386/debian:13"
else
    echo "Unknown QBDI_ARCH : ${QBDI_ARCH}"
    exit 1
fi

docker build "${BASEDIR}" -t qbdi_build:base_${QBDI_ARCH} --build-arg USER_ID="$(id -u)" --build-arg DOCKER_IMG="${DOCKER_IMG}" -f "${BASEDIR}/Dockerfile"


================================================
FILE: docker/ci_linux/qbdi.sh
================================================
#!/usr/bin/env bash

set -ex

cd $(dirname "$0")
BASEDIR=$(pwd -P)
GITDIR=$(git rev-parse --show-toplevel)

./img_build.sh

docker run --rm \
    -e QBDI_PLATFORM="${QBDI_PLATFORM}" \
    -e QBDI_ARCH="${QBDI_ARCH}" \
    --mount type=bind,source="${GITDIR}",target=/home/docker/qbdi \
    --mount type=bind,source="${HOME}/.ccache",target=/home/docker/.ccache \
    --cap-add=SYS_PTRACE --security-opt seccomp:unconfined \
    qbdi_build:base_${QBDI_ARCH} \
    /bin/bash /home/docker/qbdi/docker/ci_linux/build-qbdi.sh




================================================
FILE: docker/ci_linux_arm/.gitignore
================================================
.dockcross-linux-AARCH64-latest
.dockcross-linux-ARM-latest



================================================
FILE: docker/ci_linux_arm/build_qbdi_linux.sh
================================================
#!/usr/bin/env bash

set -ex

cd "$(dirname "$0")"
BASEDIR="$(pwd -P)"
GITDIR="$(git rev-parse --show-toplevel)"

TAG_PREFIX="qbdi-linux/qbdi_test"
QBDI_PLATFORM="linux"
QBDI_ARCH="$1"

./images/img_build.sh "${QBDI_ARCH}"

IMG_BUILD="${TAG_PREFIX}:dockcross_${QBDI_PLATFORM}_${QBDI_ARCH}"

#1 get dockcross script
SCRIPT_PATH="${BASEDIR}/.dockcross-${QBDI_PLATFORM}-${QBDI_ARCH}-latest"
docker run --rm "${IMG_BUILD}" > "${SCRIPT_PATH}"
chmod +x "${SCRIPT_PATH}"

#2 Don't mount .ssh in docker
export SSH_DIR=/var/empty/.ssh

#3 use docker to run the package
export OCI_EXE=docker

#4 compile and test QBDI in dockcross
pushd "${GITDIR}"
"${SCRIPT_PATH}" \
    -i "${IMG_BUILD}" \
    -a "-v ${HOME}/.ccache:${HOME}/.ccache" \
    -- env QBDI_PLATFORM="${QBDI_PLATFORM}" \
           QBDI_ARCH="${QBDI_ARCH}" \
           ./docker/ci_linux_arm/docker_internal_script/build-test-linux.sh
popd



================================================
FILE: docker/ci_linux_arm/docker_internal_script/build-test-linux.sh
================================================
#!/usr/bin/env bash

set -ex

mkdir -p "build-docker-${QBDI_PLATFORM}-${QBDI_ARCH}"
cd "build-docker-${QBDI_PLATFORM}-${QBDI_ARCH}"

# generate clean toolchains file
TOOLCHAIN_FILE="QBDI_${QBDI_ARCH}_Toolchain.cmake"
cat "${CMAKE_TOOLCHAIN_FILE}" > "${TOOLCHAIN_FILE}"
sed -e "s#\$ENV{CROSS_TRIPLE}#${CROSS_TRIPLE}#" \
    -e "s#\$ENV{CROSS_ROOT}#${CROSS_ROOT}#" \
    -e "s#\$ENV{CC}#${CC}#" \
    -e "s#\$ENV{CXX}#${CXX}#" \
    -e "s#\$ENV{FC}#${FC}#" \
    -i "${TOOLCHAIN_FILE}"

# create an empty toolchains to break the propagation of crosscompile
# environment when compile llvm-tblgen
EMPTY_TOOLCHAINS="$(pwd)/QBDI_empty_toolchains.cmake"
touch "${EMPTY_TOOLCHAINS}"

# need to have a clear env to avoid crosscompiler
# to be used to compile llvm-tblgen
clean_env() {
  env -i \
    PATH="${PATH}" \
    HOME="${HOME}" \
    CLICOLOR_FORCE="1" \
    "$@"
}

clean_env \
    cmake -G Ninja \
      -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" \
      -DCMAKE_BUILD_TYPE=Release \
      -DQBDI_LLVM_TABLEN_TOOLSCHAIN="${EMPTY_TOOLCHAINS}" \
      -DQBDI_PLATFORM="${QBDI_PLATFORM}" \
      -DQBDI_ARCH="${QBDI_ARCH}" \
      -DQBDI_EXAMPLES=ON \
      -DQBDI_TOOLS_VALIDATOR=OFF \
      -DQBDI_TOOLS_PYQBDI=OFF \
      ..

clean_env ninja

if [[ "${QBDI_ARCH}" = "ARM" ]]; then
  qemu-arm-static ./test/QBDITest
elif [[ "${QBDI_ARCH}" = "AARCH64" ]]; then
  qemu-aarch64-static ./test/QBDITest
fi

clean_env cpack

exit 0


================================================
FILE: docker/ci_linux_arm/images/Dockerfile.dockcross
================================================
ARG DOCKER_IMG="dockcross/linux-arm64"

FROM $DOCKER_IMG

ENV CLICOLOR_FORCE=1

# setup backport to use cmake >= 3.28
RUN echo 'deb http://deb.debian.org/debian bookworm-backports main contrib non-free' > /etc/apt/sources.list.d/backports.list

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        bash \
        ca-certificates \
        ccache \
        cmake/bookworm-backports \
        git \
        python3 \
        qemu-user-static \
        wget \
        zip && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*



================================================
FILE: docker/ci_linux_arm/images/img_build.sh
================================================
#!/usr/bin/env bash

set -ex

cd "$(dirname "$0")"
BASEDIR="$(pwd -P)"
TAG_PREFIX="qbdi-linux/qbdi_test"
TARGET_ARCH="$1"

if [[ -n "$TARGET_ARCH" ]] && [[ "$TARGET_ARCH" != "AARCH64" ]] && [[ "$TARGET_ARCH" != "ARM" ]]; then
  echo "Unrecognized architecture."
  echo "Supported : AARCH64, ARM"
  exit 1
fi

build_linux() {
  QBDI_PLATFORM="linux"
  QBDI_ARCH="$1"
  if [[ "$QBDI_ARCH" = "AARCH64" ]]; then
    DOCKCROSS_IMG="dockcross/linux-arm64"
  elif [[ "$QBDI_ARCH" = "ARM" ]]; then
    DOCKCROSS_IMG="dockcross/linux-armv7"
  fi
  docker pull "${DOCKCROSS_IMG}"
  docker build "${BASEDIR}" -f "${BASEDIR}/Dockerfile.dockcross" -t "${TAG_PREFIX}:dockcross_${QBDI_PLATFORM}_${QBDI_ARCH}" --build-arg DOCKER_IMG="${DOCKCROSS_IMG}"
}

if [[ -n "$TARGET_ARCH" ]]; then
  build_linux "$TARGET_ARCH"
else
  build_linux AARCH64
  build_linux ARM
fi



================================================
FILE: docker/ci_python_linux/Dockerfile
================================================
ARG DOCKER_IMG="quay.io/pypa/manylinux2014"

FROM $DOCKER_IMG

ENV USER="docker" \
    HOME="/home/docker" \
    PREFIX="/usr" \
    QBDI_PLATFORM="linux" \
    PYTHON_OPT="/opt/python" \
    CLICOLOR_FORCE=1 \
    CCACHE_VERSION="4.11.3" \
    CCACHE_HASH="28a407314f03a7bd7a008038dbaffa83448bc670e2fc119609b1d99fb33bb600"

ARG USER_ID=1000

# create a user
RUN adduser --uid "$USER_ID" --password '' -m "$USER"

# Get latest package list, upgrade packages, install required packages
# and cleanup to keep container as small as possible
RUN yum update -y && \
    yum install -y \
        bash \
        wget \
        ca-certificates && \
    (yum install -y ccache || true) && \
    yum clean all

RUN /opt/python/cp38-cp38/bin/pip install ninja==1.10.0.post2

ENV PATH=$PATH:/opt/python/cp38-cp38/bin/ \
    CCACHE_URL="https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz" \
    CCACHE_ARCHIVE="ccache-${CCACHE_VERSION}.tar.gz" 

RUN if ! which ccache >/dev/null 2>&1; then \
        set -ex; \
        cd /tmp; \
        wget "${CCACHE_URL}" -O "${CCACHE_ARCHIVE}"; \
        (echo "${CCACHE_HASH} ${CCACHE_ARCHIVE}" | sha256sum -c -) || exit 1; \
        tar xf "${CCACHE_ARCHIVE}"; \
        cd "/tmp/ccache-${CCACHE_VERSION}"; \
        mkdir build && cd build; \
        cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON; \
        ninja install; \
        cd /; \
        rm -rf "/tmp/ccache-${CCACHE_VERSION}" "/tmp/${CCACHE_ARCHIVE}"; \
    fi

WORKDIR $HOME

USER $USER



================================================
FILE: docker/ci_python_linux/build_whl.sh
================================================
#!/usr/bin/env bash

set -ex

cd ~/qbdi

PYTHON_VERSION="${1:-all}"

if [[ "${PYTHON_VERSION}" = "all" ]] || [[ "${PYTHON_VERSION}" = "3.8" ]]; then
  /opt/python/cp38-cp38/bin/python -m build -w
fi
if [[ "${PYTHON_VERSION}" = "all" ]] || [[ "${PYTHON_VERSION}" = "3.9" ]]; then
  /opt/python/cp39-cp39/bin/python -m build -w
fi
if [[ "${PYTHON_VERSION}" = "all" ]] || [[ "${PYTHON_VERSION}" = "3.10" ]]; then
  /opt/python/cp310-cp310/bin/python -m build -w
fi
if [[ "${PYTHON_VERSION}" = "all" ]] || [[ "${PYTHON_VERSION}" = "3.11" ]]; then
  /opt/python/cp311-cp311/bin/python -m build -w
fi
if [[ "${PYTHON_VERSION}" = "all" ]] || [[ "${PYTHON_VERSION}" = "3.12" ]]; then
  /opt/python/cp312-cp312/bin/python -m build -w
fi
if [[ "${PYTHON_VERSION}" = "all" ]] || [[ "${PYTHON_VERSION}" = "3.13" ]]; then
  /opt/python/cp313-cp313/bin/python -m build -w
fi
if [[ "${PYTHON_VERSION}" = "all" ]] || [[ "${PYTHON_VERSION}" = "3.14" ]]; then
  /opt/python/cp314-cp314/bin/python -m build -w
fi

if [[ "${QBDI_ARCH}" = "X86_64" ]]; then
    for i in dist/*_x86_64.whl; do
        auditwheel repair $i -w outwheel;
    done
elif [[ "${QBDI_ARCH}" = "X86" ]]; then
    for i in dist/*_i686.whl; do
        auditwheel repair $i -w outwheel;
    done
elif [[ "${QBDI_ARCH}" = "AARCH64" ]]; then
    for i in dist/*_aarch64.whl; do
        auditwheel repair $i -w outwheel;
    done
else
    echo "Unknown QBDI_ARCH : ${QBDI_ARCH}"
    exit 1
fi



================================================
FILE: docker/ci_python_linux/img_build.sh
================================================
#!/usr/bin/env bash

set -ex

cd $(dirname "$0")
BASEDIR=$(pwd -P)
GITDIR=$(git rev-parse --show-toplevel)

if [[ "${QBDI_ARCH}" = "X86_64" ]]; then
    DOCKER_IMG="quay.io/pypa/manylinux2014_x86_64"
elif [[ "${QBDI_ARCH}" = "X86" ]]; then
    DOCKER_IMG="quay.io/pypa/manylinux2014_i686"
elif [[ "${QBDI_ARCH}" = "AARCH64" ]]; then
    DOCKER_IMG="quay.io/pypa/manylinux2014_aarch64"
else
    echo "Unknown QBDI_ARCH : ${QBDI_ARCH}"
    exit 1
fi


docker build "${BASEDIR}" -t pyqbdi_build:base_${QBDI_ARCH} \
        --build-arg DOCKER_IMG="${DOCKER_IMG}" \
        --build-arg USER_ID="$(id -u)" \
        -f "${BASEDIR}/Dockerfile"



================================================
FILE: docker/ci_python_linux/whl_build.sh
================================================
#!/usr/bin/env bash

set -ex

cd $(dirname "$0")
BASEDIR=$(pwd -P)
GITDIR=$(git rev-parse --show-toplevel)

PYTHON_VERSION="${1:-all}"

./img_build.sh

docker run --rm \
    -e QBDI_PLATFORM="${QBDI_PLATFORM}" \
    -e QBDI_ARCH="${QBDI_ARCH}" \
    --mount type=bind,source="${GITDIR}",target=/home/docker/qbdi \
    --mount type=bind,source="${HOME}/.ccache",target=/home/docker/.ccache \
    pyqbdi_build:base_${QBDI_ARCH} \
    /bin/bash /home/docker/qbdi/docker/ci_python_linux/build_whl.sh "${PYTHON_VERSION}"



================================================
FILE: docker/common.sh
================================================

QBDI_VERSION="0.12.2-devel"
DOCKERHUB_REPO="qbdi/qbdi"
DOCKER_BUILD_DIR="/home/docker/qbdi/build"

DEBIAN_TARGET="trixie"
UBUNTU_LTS_TARGET="24.04"
UBUNTU_LAST_TARGET="25.10"

prepare_archive (){
    pushd "$(git rev-parse --show-toplevel)" >/dev/null

    git archive -o "${BASEDIR}/qbdi.tar.gz" --prefix=qbdi/ HEAD .

    popd >/dev/null
}

delete_archive() {
    rm -f "${BASEDIR}/qbdi.tar.gz"
}



================================================
FILE: docker/linux_arm_natif/.gitignore
================================================
.dockcross-linux-AARCH64-latest
.dockcross-linux-ARM-latest



================================================
FILE: docker/linux_arm_natif/build_qbdi_linux.sh
================================================
#!/usr/bin/env bash

set -ex

cd "$(dirname "$0")"
BASEDIR="$(pwd -P)"
GITDIR="$(git rev-parse --show-toplevel)"

TAG_PREFIX="qbdi-linux/qbdi_test"
QBDI_PLATFORM="linux"
QBDI_ARCH="$1"

if [[ "$QBDI_ARCH" != "AARCH64" ]] && [[ "$QBDI_ARCH" != "ARM" ]]; then
  echo "Unrecognized architecture."
  echo "Supported : AARCH64, ARM"
  exit 1
fi

./images/build_docker_img.sh "${QBDI_ARCH}"

IMG_BUILD="${TAG_PREFIX}:native_${QBDI_PLATFORM}_${QBDI_ARCH}"

docker run -it --rm \
    -v "${HOME}/.ccache:/home/docker/.ccache" \
    -v "${GITDIR}:/home/docker/QBDI" \
    -e QBDI_PLATFORM="${QBDI_PLATFORM}" \
    -e QBDI_ARCH="${QBDI_ARCH}" \
    "${IMG_BUILD}" \
    /home/docker/QBDI/docker/linux_arm_natif/docker_internal_script/build-test-linux.sh



================================================
FILE: docker/linux_arm_natif/docker_internal_script/build-test-linux.sh
================================================
#!/usr/bin/env bash

set -ex

mkdir -p "build-docker-native-${QBDI_PLATFORM}-${QBDI_ARCH}"
cd "build-docker-native-${QBDI_PLATFORM}-${QBDI_ARCH}"


cmake -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DQBDI_PLATFORM="${QBDI_PLATFORM}" \
  -DQBDI_ARCH="${QBDI_ARCH}" \
  -DQBDI_EXAMPLES=ON \
  -DQBDI_TOOLS_VALIDATOR=ON \
  -DQBDI_TOOLS_PYQBDI=ON \
  ..

ninja

./test/QBDITest

cpack

cd ../tools/validation_runner
#./ValidationRunner.py coverage.cfg -l "../../build-docker-native-${QBDI_PLATFORM}-${QBDI_ARCH}/tools/validator/libvalidator.so"

exit 0


================================================
FILE: docker/linux_arm_natif/images/Dockerfile
================================================
ARG DOCKER_IMG="debian:latest"
FROM $DOCKER_IMG

ARG QBDI_ARCH="AARCH64"

ENV USER="docker" \
    HOME="/home/docker" \
    PREFIX="/usr" \
    QBDI_PLATFORM="linux" \
    CLICOLOR_FORCE=1

# Get latest package list, upgrade packages, install required packages
# and cleanup to keep container as small as possible
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        adduser \
        bash \
        build-essential \
        ca-certificates \
        ccache \
        cmake \
        file \
        g++ \
        git \
        gzip \
        imagemagick \
        libstdc++-13-dev \
        ninja-build \
        openssl \
        pkg-config \
        python3 \
        python3-dev \
        python3-pip \
        python3-yaml \
        wget \
        xxd \
        zip \
        && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# create a user
RUN adduser --disabled-password --gecos '' --home "$HOME" "$USER"

# switch to new user
USER $USER

RUN mkdir "$HOME/QBDI"

WORKDIR $HOME/QBDI


================================================
FILE: docker/linux_arm_natif/images/build_docker_img.sh
================================================
#!/usr/bin/env bash

set -ex

cd "$(dirname "$0")"
BASEDIR="$(pwd -P)"
TAG_PREFIX="qbdi-linux/qbdi_test"
TARGET_ARCH="$1"

if [[ -n "$TARGET_ARCH" ]] && [[ "$TARGET_ARCH" != "AARCH64" ]] && [[ "$TARGET_ARCH" != "ARM" ]]; then
  echo "Unrecognized architecture."
  echo "Supported : AARCH64, ARM"
  exit 1
fi

build_linux() {
  QBDI_PLATFORM="linux"
  QBDI_ARCH="$1"
  if [[ "$QBDI_ARCH" = "AARCH64" ]]; then
    BASE_IMG="arm64v8/debian:latest"
  elif [[ "$QBDI_ARCH" = "ARM" ]]; then
    BASE_IMG="arm32v7/debian:latest"
  fi
  docker build "${BASEDIR}" -f "${BASEDIR}/Dockerfile" -t "${TAG_PREFIX}:native_${QBDI_PLATFORM}_${QBDI_ARCH}" --build-arg DOCKER_IMG="${BASE_IMG}"
}

if [[ -n "$TARGET_ARCH" ]]; then
  build_linux "$TARGET_ARCH"
else
  build_linux AARCH64
  build_linux ARM
fi



================================================
FILE: docker/python_linux_arm/docker_internal_script/build_wheel.sh
================================================
#!/usr/bin/env bash

# change python host platform to armv7 arch
# This is needed when compile on X86 or AARCH64 platform, inside a ARM docker
export _PYTHON_HOST_PLATFORM="linux-armv7l"

# run with --skip-dependency-check and --no-isolation to
# avoid compile cmake.whl and ninja.whl that isn't prebuild for armv7
python -m build --skip-dependency-check --no-isolation -w


================================================
FILE: docker/python_linux_arm/images/Dockerfile
================================================
ARG DOCKER_IMG="arm32v7/python:3"

FROM $DOCKER_IMG

ENV USER="docker" \
    HOME="/home/docker" \
    PREFIX="/usr" \
    QBDI_PLATFORM="linux"

# Get latest package list, upgrade packages, install required packages
# and cleanup to keep container as small as possible
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        adduser \
        bash \
        build-essential \
        ca-certificates \
        ccache \
        cmake \
        g++ \
        git \
        ninja-build \
        pkg-config \
        python3 \
        python3-dev \
        python3-pip \
        wget \
        xxd \
        zip \
        && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# create a user
RUN adduser --disabled-password --gecos '' --home "$HOME" "$USER"

# switch to new user
USER $USER

ENV PATH="${PATH}:${HOME}/.local/bin"

RUN mkdir "${HOME}/QBDI" && \
    pip install --upgrade --user pip build setuptools

WORKDIR $HOME/QBDI

ARG USER_ID=1000



================================================
FILE: docker/python_linux_arm/images/build_docker_img.sh
================================================
#!/usr/bin/env bash

set -ex

cd "$(dirname "$0")"
BASEDIR="$(pwd -P)"
TAG_PREFIX="pyqbdi/wheel_arm_building"
BASE_DEBIAN="trixie"
PYTHON_VERSION="$1"

build_python_image() {
  QBDI_PLATFORM="linux"
  QBDI_ARCH="ARM"
  PYTHON_VERSION="$1"
  BASE_IMG="arm32v7/python:${PYTHON_VERSION}-${BASE_DEBIAN}"
  docker build "${BASEDIR}" -f "${BASEDIR}/Dockerfile" \
               --platform="linux/arm/v7" \
               -t "${TAG_PREFIX}:${QBDI_PLATFORM}_${QBDI_ARCH}_${PYTHON_VERSION}" \
               --build-arg DOCKER_IMG="${BASE_IMG}"
}

if [[ -n "$PYTHON_VERSION" ]]; then
  build_python_image "$PYTHON_VERSION"
else
  build_python_image 3.9
  build_python_image 3.10
  build_python_image 3.11
  build_python_image 3.12
  build_python_image 3.13
  build_python_image 3.14
fi




================================================
FILE: docker/python_linux_arm/whl_build.sh
================================================
#!/usr/bin/env bash

set -ex

cd $(dirname "$0")
BASEDIR=$(pwd -P)
GITDIR=$(git rev-parse --show-toplevel)
TAG_PREFIX="pyqbdi/wheel_arm_building"
BASE_DEBIAN="trixie"
PYTHON_VERSION="$1"

./images/build_docker_img.sh "${PYTHON_VERSION}"

build_wheel() {
  QBDI_PLATFORM="linux"
  QBDI_ARCH="ARM"
  PYTHON_VERSION="$1"

  docker run --rm -it \
      --platform="linux/arm/v7" \
      -e QBDI_PLATFORM="${QBDI_PLATFORM}" \
      -e QBDI_ARCH="${QBDI_ARCH}" \
      --mount type=bind,source="${GITDIR}",target=/home/docker/QBDI \
      --mount type=bind,source="${HOME}/.ccache",target=/home/docker/.ccache \
      "${TAG_PREFIX}:${QBDI_PLATFORM}_${QBDI_ARCH}_${PYTHON_VERSION}" \
      bash /home/docker/QBDI/docker/python_linux_arm/docker_internal_script/build_wheel.sh
}


if [[ -n "$PYTHON_VERSION" ]]; then
  build_wheel "$PYTHON_VERSION"
else
  build_wheel 3.9
  build_wheel 3.10
  build_wheel 3.11
  build_wheel 3.12
  build_wheel 3.13
  build_wheel 3.14
fi



================================================
FILE: docker/release.sh
================================================
#!/usr/bin/bash

set -e

HASHFILE="image.hash"
PUSH_IMAGE=0
TARGET_ARCH="$1"

BASEDIR=$(cd $(dirname "$0") && pwd -P)
GITDIR=$(git rev-parse --show-toplevel)

touch "$HASHFILE"
. "${BASEDIR}/common.sh"

docker_login() {
    if [[ "${PUSH_IMAGE}" -ne 0 ]]; then
        docker login
    fi
}

push_image() {
    if [[ "${PUSH_IMAGE}" -ne 0 ]]; then
        docker push "$1"
    fi
}

docker_logout() {
    if [[ "${PUSH_IMAGE}" -ne 0 ]]; then
        docker logout
    fi
}

push_images() {
    TAG="$1"
    shift
    while [[ -n "$1" ]]; do
        docker tag "$TAG" "${DOCKERHUB_REPO}:$1"
        push_image "${DOCKERHUB_REPO}:$1"
        if [[ "$1" != "latest" ]]; then
            docker tag "$TAG" "${DOCKERHUB_REPO}:${QBDI_VERSION}_$1"
            push_image "${DOCKERHUB_REPO}:${QBDI_VERSION}_$1"
        fi
        shift
    done
}

print_hash() {
    IMG="${DOCKERHUB_REPO}:${QBDI_VERSION}_$1"
    echo -n "${IMG} " >> "$HASHFILE"
    docker inspect --format='{{.Id}}' "${IMG}" >> "$HASHFILE"
}

perform_action() {
    ACTION="$1"; shift
    ARCH="$1"; shift
    DOCKER_IMG_BASE="$1"; shift

    INTERNAL_DOCKER_TAG="qbdi:${ARCH}_${DOCKER_IMG_BASE%%:*}_${DOCKER_IMG_BASE##*:}"
    TARGET_DOCKER_TAG="$1"

    if [[ -n "$TARGET_ARCH" ]] && [[ "$ARCH" != "$TARGET_ARCH" ]]; then
        return
    fi

    if [[ "${ACTION}" = "build" ]]; then
        "${BASEDIR}/ubuntu_debian/build.sh" "${ARCH}" "${DOCKER_IMG_BASE}"
    elif [[ "${ACTION}" = "push" ]]; then
        push_images "${INTERNAL_DOCKER_TAG}" "$@"
    elif [[ "${ACTION}" = "hash" ]]; then
        print_hash "${TARGET_DOCKER_TAG}"
    else
        echo "Unknown action ${ACTION}"
        exit 1
    fi
}


perform_action_by_image() {
    ACTION="$1"

    perform_action "$ACTION" "ARM" "debian:${DEBIAN_TARGET}" "armv7_debian_${DEBIAN_TARGET}" "armv7_debian" "armv7"
    perform_action "$ACTION" "AARCH64" "debian:${DEBIAN_TARGET}" "arm64_debian_${DEBIAN_TARGET}" "arm64_debian" "arm64"
    perform_action "$ACTION" "X86" "debian:${DEBIAN_TARGET}" "x86_debian_${DEBIAN_TARGET}" "x86_debian" "x86"
    perform_action "$ACTION" "X86_64" "debian:${DEBIAN_TARGET}" "x64_debian_${DEBIAN_TARGET}" "x64_debian" "x64" "latest"

    perform_action "$ACTION" "ARM" "ubuntu:${UBUNTU_LTS_TARGET}" "armv7_ubuntu_${UBUNTU_LTS_TARGET}" "armv7_ubuntu_lts" "armv7_ubuntu"
    perform_action "$ACTION" "AARCH64" "ubuntu:${UBUNTU_LTS_TARGET}" "arm64_ubuntu_${UBUNTU_LTS_TARGET}" "arm64_ubuntu_lts" "arm64_ubuntu"
    perform_action "$ACTION" "X86_64" "ubuntu:${UBUNTU_LTS_TARGET}" "x64_ubuntu_${UBUNTU_LTS_TARGET}" "x64_ubuntu_lts" "x64_ubuntu"

    perform_action "$ACTION" "ARM" "ubuntu:${UBUNTU_LAST_TARGET}" "armv7_ubuntu_${UBUNTU_LAST_TARGET}"
    perform_action "$ACTION" "AARCH64" "ubuntu:${UBUNTU_LAST_TARGET}" "arm64_ubuntu_${UBUNTU_LAST_TARGET}"
    perform_action "$ACTION" "X86_64" "ubuntu:${UBUNTU_LAST_TARGET}" "x64_ubuntu_${UBUNTU_LAST_TARGET}"
}

perform_action_by_image "build"
docker_login
perform_action_by_image "push"
docker_logout
perform_action_by_image "hash"

cat "$HASHFILE"



================================================
FILE: docker/ubuntu_debian/Dockerfile
================================================
ARG DOCKER_IMG="ubuntu:latest"

FROM $DOCKER_IMG AS builder

ARG QBDI_ARCH="X86_64"

ENV USER="docker" \
    HOME="/home/docker" \
    PREFIX="/usr" \
    QBDI_PLATFORM="linux"

# setup backport to use cmake >= 3.28
RUN ( cat /etc/debian_version | grep -v -q 12 ) || \
    ( echo 'deb http://deb.debian.org/debian bookworm-backports main contrib non-free' > /etc/apt/sources.list.d/backports.list )

# Get latest package list, upgrade packages, install required packages
# and cleanup to keep container as small as possible
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        adduser \
        bash \
        build-essential \
        cmake \
        g++ \
        git \
        libstdc++-13-dev \
        ninja-build \
        pkg-config \
        wget \
        ca-certificates \
        python3 \
        python3-dev && \
    ( ( cat /etc/debian_version | grep -v -q 12 ) || ( apt-get install -y --no-install-recommends cmake/bookworm-backports ) ) && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# create a user
RUN adduser --disabled-password --gecos '' --home "$HOME" "$USER"

# build / test / install QBDI
ARG CMAKE_ARGUMENT=""

# git archive -o qbdi.tar.gz --prefix=qbdi/ HEAD .
ADD qbdi.tar.gz $HOME/

WORKDIR $HOME/qbdi

RUN chown -R $USER:$USER .

# switch to new user
USER $USER

RUN mkdir build && \
    cd build && \
    cmake -G Ninja \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_CROSSCOMPILING=FALSE \
          -DQBDI_PLATFORM=$QBDI_PLATFORM \
          -DQBDI_ARCH=$QBDI_ARCH \
          -DCMAKE_INSTALL_PREFIX=$PREFIX \
          -DQBDI_TOOLS_PYQBDI=OFF \
          -DQBDI_CCACHE=OFF \
          $CMAKE_ARGUMENT \
          ../ && \
    ninja && \
    # test
    ./test/QBDITest && \
    # create package and install
    rm -f QBDI-*-$QBDI_PLATFORM.deb && \
    cpack -G DEB


FROM $DOCKER_IMG

WORKDIR /root

COPY --from=builder /home/docker/qbdi/build/*.deb .
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y ./*.deb && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

CMD ["/bin/bash"]


================================================
FILE: docker/ubuntu_debian/build.sh
================================================
#!/usr/bin/bash

set -e
set -x

BASEDIR=$(cd $(dirname "$0") && pwd -P)
GITDIR=$(git rev-parse --show-toplevel)

. "${BASEDIR}/../common.sh"

ARCH="X86_64"
DOCKER_IMG="ubuntu"
TAG="latest"
DOCKER_PLATFORM="linux/amd64"

if [[ -n "$2" ]]; then
    TAG="${2##*:}"
    DOCKER_IMG="${2%%:*}"
fi

if [[ "$1" = "X86" ]] || [[ "$1" = "x86" ]]; then
    ARCH="X86"
    DOCKER_IMG="i386/$DOCKER_IMG"
    DOCKER_PLATFORM="linux/386"
elif [[ "$1" = "ARM" ]] || [[ "$1" = "arm" ]] || [[ "$1" = "arm32" ]]; then
    ARCH="ARM"
    DOCKER_IMG="arm32v7/$DOCKER_IMG"
    DOCKER_PLATFORM="linux/arm/v7"
elif [[ "$1" = "AARCH64" ]] || [[ "$1" = "aarch64" ]] || [[ "$1" = "arm64" ]]; then
    ARCH="AARCH64"
    DOCKER_IMG="arm64v8/$DOCKER_IMG"
    DOCKER_PLATFORM="linux/arm64/v8"
fi

CMAKE_ARGUMENT="$3"

DISTRIB="${DOCKER_IMG##*/}"

DOCKER_TAG="qbdi:${ARCH}_${DOCKER_IMG##*/}_${TAG}"

DOCKERFILE="${BASEDIR}/Dockerfile"

prepare_archive

docker build "${BASEDIR}" -t "${DOCKER_TAG}" -f "${DOCKERFILE}" \
             --platform="$DOCKER_PLATFORM" \
             --build-arg DOCKER_IMG="${DOCKER_IMG}:${TAG}" \
             --build-arg QBDI_ARCH="$ARCH" \
             --build-arg CMAKE_ARGUMENT="${CMAKE_ARGUMENT}"

delete_archive

echo "Success build ${DOCKER_TAG}"


================================================
FILE: docker/ubuntu_debian_devel/Dockerfile
================================================
ARG DOCKER_IMG="ubuntu:latest"

FROM $DOCKER_IMG

ARG QBDI_ARCH="X86_64"

ENV USER="docker" \
    HOME="/home/docker" \
    PREFIX="/usr" \
    QBDI_PLATFORM="linux"

# Get latest package list, upgrade packages, install required packages
# and cleanup to keep container as small as possible
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        adduser \
        bash \
        sudo \
        build-essential \
        cmake \
        g++ \
        git \
        libstdc++-13-dev \
        ninja-build \
        pkg-config \
        wget \
        ca-certificates \
        python3 \
        python3-dev \
        python3-yaml \
        imagemagick \
        zip \
        less \
        file \
        xxd \
        git && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# create a user and add user in sudo to ease debug
RUN adduser --disabled-password --gecos '' --home "$HOME" "$USER" && \
    adduser $USER sudo && \
    echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# build / test / install QBDI
ARG CMAKE_ARGUMENT=""

# git archive -o qbdi.tar.gz --prefix=qbdi/ HEAD .
ADD qbdi.tar.gz $HOME/

WORKDIR $HOME/qbdi

RUN chown -R $USER:$USER .

# switch to new user
USER $USER

RUN mkdir build && \
    cd build && \
    cmake -G Ninja \
          -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_CROSSCOMPILING=FALSE \
          -DQBDI_PLATFORM=$QBDI_PLATFORM \
          -DQBDI_ARCH=$QBDI_ARCH \
          -DCMAKE_INSTALL_PREFIX=$PREFIX \
          -DQBDI_CCACHE=OFF \
          -DQBDI_LOG_DEBUG=ON \
          -DQBDI_EXAMPLES=ON \
          -DQBDI_TOOLS_PYQBDI=ON \
          -DQBDI_TOOLS_VALIDATOR=ON \
          $CMAKE_ARGUMENT \
          ../ && \
    ninja && \
    # test
    ./test/QBDITest && \
    # create package and install
    rm -f QBDI-*-$QBDI_PLATFORM.deb && \
    cpack -G DEB && \
    sudo dpkg -i QBDI-*-$QBDI_PLATFORM-$QBDI_ARCH.deb

WORKDIR $HOME

CMD ["/bin/bash"]


================================================
FILE: docker/ubuntu_debian_devel/build.sh
================================================
#!/usr/bin/bash

set -e

BASEDIR=$(cd $(dirname "$0") && pwd -P)
GITDIR=$(git rev-parse --show-toplevel)

. "${BASEDIR}/../common.sh"

ARCH="X86_64"
DOCKER_IMG="ubuntu"
TAG="latest"
DOCKER_PLATFORM="linux/amd64"

if [[ -n "$2" ]]; then
    TAG="${2##*:}"
    DOCKER_IMG="${2%%:*}"
fi

if [[ "$1" = "X86" || "$1" = "x86" ]]; then
    ARCH="X86"
    DOCKER_IMG="i386/$DOCKER_IMG"
    DOCKER_PLATFORM="linux/386"
elif [[ "$1" = "ARM" ]] || [[ "$1" = "arm" ]] || [[ "$1" = "arm32" ]]; then
    ARCH="ARM"
    DOCKER_IMG="arm32v7/$DOCKER_IMG"
    DOCKER_PLATFORM="linux/arm/v7"
elif [[ "$1" = "AARCH64" ]] || [[ "$1" = "aarch64" ]] || [[ "$1" = "arm64" ]]; then
    ARCH="AARCH64"
    DOCKER_IMG="arm64v8/$DOCKER_IMG"
    DOCKER_PLATFORM="linux/arm64/v8"
fi

CMAKE_ARGUMENT="$3"

DISTRIB="${DOCKER_IMG##*/}"

DOCKER_TAG="qbdi:${ARCH}_${DOCKER_IMG##*/}_${TAG}_devel"

DOCKERFILE="${BASEDIR}/Dockerfile"

prepare_archive

docker build "${BASEDIR}" -t "${DOCKER_TAG}" \
             --platform="$DOCKER_PLATFORM" \
             --build-arg DOCKER_IMG="${DOCKER_IMG}:${TAG}" \
             --build-arg QBDI_ARCH="$ARCH" \
             --build-arg CMAKE_ARGUMENT="$CMAKE_ARGUMENT"

delete_archive

echo "Success build ${DOCKER_TAG}"


================================================
FILE: docs/CMakeLists.txt
================================================
configure_file(qbdi_cpp.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/qbdi_cpp.doxygen
               @ONLY)
configure_file(qbdi_c.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/qbdi_c.doxygen
               @ONLY)
configure_file(qbdipreload.doxygen.in
               ${CMAKE_CURRENT_BINARY_DIR}/qbdipreload.doxygen @ONLY)

add_custom_target(docs DEPENDS docs-doxygen docs-sphinx)

add_custom_target(
  docs-doxygen
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  COMMAND doxygen qbdi_cpp.doxygen
  COMMAND doxygen qbdi_c.doxygen
  COMMAND doxygen qbdipreload.doxygen)

add_custom_target(
  docs-install-jsdoc
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  COMMAND npm install jsdoc)

execute_process(COMMAND npm install jsdoc
                WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
execute_process(
  COMMAND npm root
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  OUTPUT_VARIABLE NPM_JSDOC_ROOT
  OUTPUT_STRIP_TRAILING_WHITESPACE)

add_custom_target(
  docs-sphinx
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/source
  DEPENDS docs-doxygen pyqbdi
  COMMAND
    ${CMAKE_COMMAND} -E env
    "PYTHONPATH=${PROJECT_BINARY_DIR}/docs:$ENV{PYTHONPATH}"
    "SPHINX_JS_NODE_MODULES=${NPM_JSDOC_ROOT}"
    "QBDI_DOXYGEN_DIRS=${CMAKE_CURRENT_BINARY_DIR}" sphinx-build -a -b html .
    "${CMAKE_CURRENT_BINARY_DIR}/build")

add_custom_target(
  docs-sphinx-fast
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/source
  DEPENDS pyqbdi
  COMMAND
    ${CMAKE_COMMAND} -E env
    "PYTHONPATH=${PROJECT_BINARY_DIR}/docs:$ENV{PYTHONPATH}"
    "QBDI_DOXYGEN_DIRS=${CMAKE_CURRENT_BINARY_DIR}" sphinx-build -a -b html .
    "${CMAKE_CURRENT_BINARY_DIR}/build")


================================================
FILE: docs/qbdi_c.doxygen.in
================================================
# Doxyfile 1.9.2

# 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 configuration
# 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
# https://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           = QBDI

# 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         = @QBDI_VERSION_MAJOR@.@QBDI_VERSION_MINOR@.@QBDI_VERSION_PATCH@

# 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           =

# 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       = @CMAKE_CURRENT_BINARY_DIR@/doxygen_c

# 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 JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
# such as
# /***************
# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
# Javadoc-style will behave just like regular comments and it will not be
# interpreted by doxygen.
# The default value is: NO.

JAVADOC_BANNER         = 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

# By default Python docstrings are displayed as preformatted text and doxygen's
# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
# doxygen's special commands can be used and the contents of the docstring
# documentation blocks is shown as doxygen documentation.
# The default value is: YES.

PYTHON_DOCSTRING       = YES

# 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:^^"
# 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:". Note that you cannot put \n's in the value part of an alias
# to insert newlines (in the resulting output). You can put ^^ in the value part
# of an alias to insert a newline as if a physical newline was in the original
# file. When you need a literal { or } or , in the value part of an alias you
# have to escape them by means of a backslash (\), this can lead to conflicts
# with the commands \{ and \} for these it is advised to use the version @{ and
# @} or use a double escape (\\{ and \\})

ALIASES                =

# 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

# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
# sources only. Doxygen will then generate output that is more tailored for that
# language. For instance, namespaces will be presented as modules, types will be
# separated into more groups, etc.
# The default value is: NO.

OPTIMIZE_OUTPUT_SLICE  = 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,
# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
# VHDL, 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). 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. When specifying no_extension you should add
# * to the FILE_PATTERNS.
#
# Note see also the list of default file extension mappings.

EXTENSION_MAPPING      = in=C

# 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 https://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 the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
# Minimum value: 0, maximum value: 99, default value: 5.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.

TOC_INCLUDE_HEADINGS   = 5

# 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    = YES

# 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:
# https://www.riverbankcomputing.com/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

# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
# during processing. When set to 0 doxygen will based this on the number of
# cores available in the system. You can set it explicitly to a value larger
# than 0 to get more control over the balance between CPU load and processing
# speed. At this moment only the input processing can be done using multiple
# threads. Since this is still an experimental feature the default is set to 1,
# which effectively disables parallel processing. Please report any issues you
# encounter. Generating dot graphs in parallel is controlled by the
# DOT_NUM_THREADS setting.
# Minimum value: 0, maximum value: 32, default value: 1.

NUM_PROC_THREADS       = 1

#---------------------------------------------------------------------------
# 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            = YES

# 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        = YES

# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
# methods of a class will be included in the documentation.
# The default value is: NO.

EXTRACT_PRIV_VIRTUAL   = 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 this flag is set to YES, the name of an unnamed parameter in a declaration
# will be determined by the corresponding definition. By default unnamed
# parameters remain unnamed in the output.
# The default value is: YES.

RESOLVE_UNNAMED_PARAMS = YES

# 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_
Download .txt
gitextract_s0w1pbjr/

├── .clang-format
├── .clang-format.exclude-list.txt
├── .cmake_format.conf.py
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── assistance_request.md
│   │   ├── assistance_request_new.yml
│   │   ├── bug_report.md
│   │   ├── bug_report_new.yml
│   │   └── config.yml
│   ├── format_check.sh
│   └── workflows/
│       ├── android.yml
│       ├── ccache.conf
│       ├── clang_format.yml
│       ├── ios.yml
│       ├── linux.yml
│       ├── macos.yml
│       ├── python.yml
│       ├── python_linux.yml
│       ├── python_macos.yml
│       ├── python_windows.yml
│       └── windows.yml
├── .gitignore
├── .readthedocs.condaenv.yml
├── .readthedocs.yml
├── CHANGELOG
├── CMakeLists.txt
├── LICENSE.txt
├── MANIFEST.in
├── README-pypi.rst
├── README.rst
├── cmake/
│   ├── QBDIConfig.cmake
│   ├── QBDIDependencies.cmake
│   ├── QBDIOptions.cmake
│   ├── config/
│   │   ├── config-android-X86.sh
│   │   ├── config-android-X86_64.sh
│   │   ├── config-android-aarch64.sh
│   │   ├── config-android-armv7.sh
│   │   ├── config-ios-aarch64.sh
│   │   ├── config-linux-X86.sh
│   │   ├── config-linux-X86_64.sh
│   │   ├── config-linux-aarch64.sh
│   │   ├── config-macOS-AARCH64.sh
│   │   ├── config-macOS-AARCH64e.sh
│   │   ├── config-macOS-X86.sh
│   │   ├── config-macOS-X86_64.sh
│   │   ├── config-win-X86.py
│   │   ├── config-win-X86_64.py
│   │   └── ios.toolchain.cmake
│   ├── dummy.c
│   ├── llvm/
│   │   ├── QBDI_llvm.cmake
│   │   ├── QBDI_llvm_tblgen.cmake
│   │   └── rename_object.py
│   └── merge_archives.cmake
├── docker/
│   ├── .gitignore
│   ├── archlinux/
│   │   ├── Dockerfile.X86
│   │   ├── Dockerfile.X86_64
│   │   ├── PKGBUILD.X86
│   │   ├── PKGBUILD.X86_64
│   │   └── build.sh
│   ├── ci_linux/
│   │   ├── Dockerfile
│   │   ├── build-qbdi.sh
│   │   ├── img_build.sh
│   │   └── qbdi.sh
│   ├── ci_linux_arm/
│   │   ├── .gitignore
│   │   ├── build_qbdi_linux.sh
│   │   ├── docker_internal_script/
│   │   │   └── build-test-linux.sh
│   │   └── images/
│   │       ├── Dockerfile.dockcross
│   │       └── img_build.sh
│   ├── ci_python_linux/
│   │   ├── Dockerfile
│   │   ├── build_whl.sh
│   │   ├── img_build.sh
│   │   └── whl_build.sh
│   ├── common.sh
│   ├── linux_arm_natif/
│   │   ├── .gitignore
│   │   ├── build_qbdi_linux.sh
│   │   ├── docker_internal_script/
│   │   │   └── build-test-linux.sh
│   │   └── images/
│   │       ├── Dockerfile
│   │       └── build_docker_img.sh
│   ├── python_linux_arm/
│   │   ├── docker_internal_script/
│   │   │   └── build_wheel.sh
│   │   ├── images/
│   │   │   ├── Dockerfile
│   │   │   └── build_docker_img.sh
│   │   └── whl_build.sh
│   ├── release.sh
│   ├── ubuntu_debian/
│   │   ├── Dockerfile
│   │   └── build.sh
│   └── ubuntu_debian_devel/
│       ├── Dockerfile
│       └── build.sh
├── docs/
│   ├── CMakeLists.txt
│   ├── qbdi_c.doxygen.in
│   ├── qbdi_cpp.doxygen.in
│   ├── qbdipreload.doxygen.in
│   ├── requirements.txt
│   ├── rtd_pyqbdi_artifact/
│   │   └── setup.py
│   └── source/
│       ├── _static/
│       │   └── style.css
│       ├── _templates/
│       │   └── layout.html
│       ├── api.rst
│       ├── api_c.rst
│       ├── api_cpp.rst
│       ├── api_description.rst
│       ├── api_js.rst
│       ├── api_pyqbdi.rst
│       ├── api_pyqbdipreload.rst
│       ├── api_qbdipreload.rst
│       ├── architecture_support.rst
│       ├── changelog.rst
│       ├── compilation.rst
│       ├── conf.py
│       ├── dev.rst
│       ├── execblock.rst
│       ├── get_started-PyQBDIPreload.rst
│       ├── get_started-QBDIPreload.rst
│       ├── get_started-c.rst
│       ├── get_started-cpp.rst
│       ├── get_started-frida.rst
│       ├── get_started-pyqbdi.rst
│       ├── get_started.rst
│       ├── index.rst
│       ├── installation_and_integration.rst
│       ├── instrumentation_process.rst
│       ├── intro.rst
│       ├── patchdsl.rst
│       ├── references.rst
│       ├── repo_organization.rst
│       ├── techref.rst
│       ├── testing.rst
│       ├── tutorial.rst
│       ├── tutorial_BBVMEvent.rst
│       └── tutorial_ExecBrokerEvent.rst
├── examples/
│   ├── CMakeLists.txt
│   ├── Dockerfile
│   ├── c/
│   │   ├── CMakeLists.txt
│   │   ├── fibonacci.c
│   │   └── tracer_preload.c
│   ├── cpp/
│   │   ├── CMakeLists.txt
│   │   ├── fibonacci.cpp
│   │   └── tracer_preload.cpp
│   ├── cryptolock.c
│   ├── cryptolock.cpp
│   ├── mnemonicFilter.cpp
│   ├── modules.c
│   ├── modules.cpp
│   ├── pyqbdi/
│   │   ├── coverage.py
│   │   ├── trace_preload.py
│   │   └── trace_sin.py
│   ├── thedude.c
│   └── thedude.cpp
├── include/
│   ├── QBDI/
│   │   ├── Bitmask.h
│   │   ├── Callback.h
│   │   ├── Config.h.in
│   │   ├── Errors.h
│   │   ├── InstAnalysis.h
│   │   ├── Logs.h
│   │   ├── Memory.h
│   │   ├── Memory.hpp
│   │   ├── Platform.h
│   │   ├── PtrAuth.h
│   │   ├── Range.h
│   │   ├── VM.h
│   │   ├── VM_C.h
│   │   ├── Version.h.in
│   │   └── arch/
│   │       ├── AARCH64/
│   │       │   ├── Options.h
│   │       │   └── State.h
│   │       ├── ARM/
│   │       │   ├── Options.h
│   │       │   └── State.h
│   │       ├── X86/
│   │       │   ├── Options.h
│   │       │   └── State.h
│   │       └── X86_64/
│   │           ├── Options.h
│   │           └── State.h
│   └── QBDI.h
├── package/
│   ├── .dockerignore
│   ├── CMakeLists.txt
│   ├── Readme.txt
│   ├── Welcome.txt
│   ├── launch_docker_packager.sh
│   ├── qbdi-frida-template.in
│   ├── qbdi-preload-template.in
│   ├── qbdi-template.in
│   └── qbdi.pc.in
├── pyproject.toml
├── setup.cfg
├── setup.py
├── src/
│   ├── CMakeLists.txt
│   ├── Engine/
│   │   ├── CMakeLists.txt
│   │   ├── Engine.cpp
│   │   ├── Engine.h
│   │   ├── LLVMCPU.cpp
│   │   ├── LLVMCPU.h
│   │   ├── VM.cpp
│   │   ├── VM_C.cpp
│   │   └── VM_internal.h
│   ├── ExecBlock/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── Context_AARCH64.h
│   │   │   ├── ExecBlock_AARCH64.cpp
│   │   │   ├── ScratchRegisterInfo_AARCH64.h
│   │   │   ├── ios_AARCH64.s
│   │   │   ├── ios_AARCH64e.s
│   │   │   ├── linux-android_AARCH64.s
│   │   │   ├── macos_AARCH64.s
│   │   │   └── macos_AARCH64e.s
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── Context_ARM.h
│   │   │   ├── ExecBlock_ARM.cpp
│   │   │   ├── ScratchRegisterInfo_ARM.h
│   │   │   ├── ios_ARM.s
│   │   │   └── linux-android_ARM.s
│   │   ├── CMakeLists.txt
│   │   ├── Context.h
│   │   ├── ExecBlock.cpp
│   │   ├── ExecBlock.h
│   │   ├── ExecBlockManager.cpp
│   │   ├── ExecBlockManager.h
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── Context_X86_64.h
│   │       ├── ExecBlock_X86_64.cpp
│   │       ├── ScratchRegisterInfo_X86_64.h
│   │       ├── linux_X86.s
│   │       ├── linux_X86_64.s
│   │       ├── macos_X86.s
│   │       ├── macos_X86_64.s
│   │       ├── windows_X86.asm
│   │       └── windows_X86_64.asm
│   ├── ExecBroker/
│   │   ├── AARCH64/
│   │   │   ├── ExecBroker_AARCH64.cpp
│   │   │   └── ExecBroker_AARCH64.h
│   │   ├── ARM/
│   │   │   ├── ExecBroker_ARM.cpp
│   │   │   └── ExecBroker_ARM.h
│   │   ├── CMakeLists.txt
│   │   ├── ExecBroker.cpp
│   │   ├── ExecBroker.h
│   │   └── X86_64/
│   │       ├── ExecBroker_X86_64.cpp
│   │       └── ExecBroker_X86_64.h
│   ├── Patch/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ExecBlockFlags_AARCH64.cpp
│   │   │   ├── ExecBlockFlags_AARCH64.h
│   │   │   ├── ExecBlockPatch_AARCH64.cpp
│   │   │   ├── ExecBlockPatch_AARCH64.h
│   │   │   ├── InstInfo_AARCH64.cpp
│   │   │   ├── InstInfo_AARCH64.h
│   │   │   ├── InstMetadata_AARCH64.h
│   │   │   ├── InstrRules_AARCH64.cpp
│   │   │   ├── Layer2_AARCH64.cpp
│   │   │   ├── Layer2_AARCH64.h
│   │   │   ├── MemoryAccess_AARCH64.cpp
│   │   │   ├── MemoryAccess_AARCH64.h
│   │   │   ├── PatchCondition_AARCH64.cpp
│   │   │   ├── PatchCondition_AARCH64.h
│   │   │   ├── PatchGenerator_AARCH64.cpp
│   │   │   ├── PatchGenerator_AARCH64.h
│   │   │   ├── PatchRuleAssembly_AARCH64.cpp
│   │   │   ├── PatchRuleAssembly_AARCH64.h
│   │   │   ├── Register_AARCH64.cpp
│   │   │   ├── RelocatableInst_AARCH64.cpp
│   │   │   ├── RelocatableInst_AARCH64.h
│   │   │   ├── TempManagerImpl_AARCH64.h
│   │   │   └── TempManager_AARCH64.cpp
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ExecBlockFlags_ARM.cpp
│   │   │   ├── ExecBlockFlags_ARM.h
│   │   │   ├── ExecBlockPatch_ARM.cpp
│   │   │   ├── ExecBlockPatch_ARM.h
│   │   │   ├── InstInfo_ARM.cpp
│   │   │   ├── InstInfo_ARM.h
│   │   │   ├── InstMetadata_ARM.h
│   │   │   ├── InstrRules_ARM.cpp
│   │   │   ├── Layer2_ARM.cpp
│   │   │   ├── Layer2_ARM.h
│   │   │   ├── MemoryAccess_ARM.cpp
│   │   │   ├── MemoryAccess_ARM.h
│   │   │   ├── PatchCondition_ARM.cpp
│   │   │   ├── PatchCondition_ARM.h
│   │   │   ├── PatchGenerator_ARM.cpp
│   │   │   ├── PatchGenerator_ARM.h
│   │   │   ├── PatchRuleAssembly_ARM.cpp
│   │   │   ├── PatchRuleAssembly_ARM.h
│   │   │   ├── Register_ARM.cpp
│   │   │   ├── RelocatableInst_ARM.cpp
│   │   │   ├── RelocatableInst_ARM.h
│   │   │   ├── TempManagerImpl_ARM.h
│   │   │   ├── TempManager_ARM.cpp
│   │   │   └── TempManager_ARM.h
│   │   ├── CMakeLists.txt
│   │   ├── ExecBlockFlags.h
│   │   ├── ExecBlockPatch.h
│   │   ├── InstInfo.h
│   │   ├── InstMetadata.h
│   │   ├── InstTransform.cpp
│   │   ├── InstTransform.h
│   │   ├── InstrRule.cpp
│   │   ├── InstrRule.h
│   │   ├── InstrRules.cpp
│   │   ├── InstrRules.h
│   │   ├── MemoryAccess.h
│   │   ├── Patch.cpp
│   │   ├── Patch.h
│   │   ├── PatchCondition.cpp
│   │   ├── PatchCondition.h
│   │   ├── PatchGenerator.cpp
│   │   ├── PatchGenerator.h
│   │   ├── PatchRule.cpp
│   │   ├── PatchRule.h
│   │   ├── PatchRuleAssembly.h
│   │   ├── PatchRuleAssemblyBase.h
│   │   ├── PatchUtils.h
│   │   ├── Register.cpp
│   │   ├── Register.h
│   │   ├── RelocatableInst.h
│   │   ├── TempManager.cpp
│   │   ├── TempManager.h
│   │   ├── Types.h
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── ExecBlockFlags_X86_64.cpp
│   │       ├── ExecBlockFlags_X86_64.h
│   │       ├── ExecBlockPatch_X86_64.cpp
│   │       ├── InstInfo_X86_64.cpp
│   │       ├── InstInfo_X86_64.h
│   │       ├── InstMetadata_X86_64.h
│   │       ├── InstrRules_X86_64.cpp
│   │       ├── Layer2_X86_64.cpp
│   │       ├── Layer2_X86_64.h
│   │       ├── MemoryAccess_X86_64.cpp
│   │       ├── PatchGenerator_X86_64.cpp
│   │       ├── PatchGenerator_X86_64.h
│   │       ├── PatchRuleAssembly_X86_64.cpp
│   │       ├── PatchRuleAssembly_X86_64.h
│   │       ├── Register_X86_64.cpp
│   │       ├── RelocatableInst_X86_64.cpp
│   │       ├── RelocatableInst_X86_64.h
│   │       ├── TempManagerImpl_X86_64.h
│   │       └── TempManager_X86_64.cpp
│   ├── Utility/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysis_AARCH64.cpp
│   │   │   ├── System_OSX.cpp
│   │   │   ├── System_darwin.cpp
│   │   │   ├── System_iOS.cpp
│   │   │   ├── ios-AARCH64.s
│   │   │   ├── ios-AARCH64e.s
│   │   │   ├── linux-android-AARCH64.s
│   │   │   ├── macos-AARCH64.s
│   │   │   └── macos-AARCH64e.s
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysis_ARM.cpp
│   │   │   ├── System_darwin.cpp
│   │   │   ├── System_iOS.cpp
│   │   │   ├── ios_ARM.s
│   │   │   ├── linux-android_ARM.s
│   │   │   ├── server-iOS-jit-user.c
│   │   │   └── server-iOS-jit-user.h
│   │   ├── CMakeLists.txt
│   │   ├── InstAnalysis.cpp
│   │   ├── InstAnalysis_prive.h
│   │   ├── LogSys.cpp
│   │   ├── LogSys.h
│   │   ├── Memory.cpp
│   │   ├── Memory_linux.cpp
│   │   ├── Memory_macos.cpp
│   │   ├── Memory_windows.cpp
│   │   ├── MovableDoubleLinkedList.h
│   │   ├── StackSwitch.cpp
│   │   ├── StackSwitch.h
│   │   ├── String.cpp
│   │   ├── String.h
│   │   ├── System.h
│   │   ├── System_generic.cpp
│   │   ├── Version.cpp
│   │   ├── Version_commit.h.in
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── InstAnalysis_X86_64.cpp
│   │       ├── linux-X86.s
│   │       ├── linux-X86_64.s
│   │       ├── macos-X86.s
│   │       ├── macos-X86_64.s
│   │       ├── windows-X86.asm
│   │       └── windows-X86_64.asm
│   ├── devVariable.h
│   ├── fridaStubs.cpp
│   └── windowsDllMain.cpp
├── templates/
│   ├── qbdi_frida_template/
│   │   ├── CMakeLists.txt
│   │   ├── FridaQBDI_sample.js
│   │   └── SimpleXOR.c
│   ├── qbdi_preload_template/
│   │   ├── CMakeLists.txt.in
│   │   ├── README.txt
│   │   └── qbdi_preload_template.c
│   └── qbdi_template/
│       ├── CMakeLists.txt.in
│       ├── README.txt
│       └── qbdi_template.c
├── test/
│   ├── API/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysisTest_AARCH64.cpp
│   │   │   ├── MemoryAccessTest_AARCH64.cpp
│   │   │   ├── VMTest_AARCH64.cpp
│   │   │   ├── VMTest_AARCH64.h
│   │   │   ├── VMTest_AARCH64_LDRL.cpp
│   │   │   ├── VMTest_AARCH64_LocalMonitor.cpp
│   │   │   └── VMTest_AARCH64_X28.cpp
│   │   ├── APITest.cpp
│   │   ├── APITest.h
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysisTest_ARM.cpp
│   │   │   ├── InstAnalysisTest_Thumb.cpp
│   │   │   ├── MemoryAccessTest_ARM.cpp
│   │   │   ├── MemoryAccessTest_ARM_LDM_STM.cpp
│   │   │   ├── MemoryAccessTest_Thumb.cpp
│   │   │   ├── MemoryAccessTest_Thumb_LDM_STM.cpp
│   │   │   ├── VMTest_ARM.cpp
│   │   │   └── VMTest_ARM.h
│   │   ├── AllocTest.cpp
│   │   ├── CMakeLists.txt
│   │   ├── MemoryAccessTest.cpp
│   │   ├── OptionsTest.h
│   │   ├── RangeTest.cpp
│   │   ├── VMTest.cpp
│   │   ├── X86/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── InstAnalysisTest_X86.cpp
│   │   │   ├── MemoryAccessTest_X86.cpp
│   │   │   ├── OptionsTest_X86.cpp
│   │   │   ├── VMTest_X86.cpp
│   │   │   └── VMTest_X86.h
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── InstAnalysisTest_X86_64.cpp
│   │       ├── MemoryAccessTest_X86_64.cpp
│   │       ├── OptionsTest_X86_64.cpp
│   │       ├── VMTest_X86_64.cpp
│   │       └── VMTest_X86_64.h
│   ├── Benchmark/
│   │   ├── CMakeLists.txt
│   │   ├── Fibonacci.cpp
│   │   └── SHA256.cpp
│   ├── CMakeLists.txt
│   ├── ExecBlock/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   └── PatchEmptyAARCH64.cpp
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   └── PatchEmptyARM.cpp
│   │   ├── CMakeLists.txt
│   │   ├── ExecBlockManagerTest.cpp
│   │   ├── ExecBlockManagerTest.h
│   │   ├── ExecBlockTest.cpp
│   │   ├── ExecBlockTest.h
│   │   ├── PatchEmpty.h
│   │   ├── X86/
│   │   │   ├── CMakeLists.txt
│   │   │   └── PatchEmptyX86.cpp
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       └── PatchEmptyX86_64.cpp
│   ├── Miscs/
│   │   ├── CMakeLists.txt
│   │   └── StringTest.cpp
│   ├── Patch/
│   │   ├── AARCH64/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ComparedExecutor_AARCH64.cpp
│   │   │   ├── ComparedExecutor_AARCH64.h
│   │   │   ├── LLVMOperandInfo_AARCH64.cpp
│   │   │   └── MemoryAccessTable_AARCH64.cpp
│   │   ├── ARM/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ComparedExecutor_ARM.cpp
│   │   │   ├── ComparedExecutor_ARM.h
│   │   │   ├── ComparedExecutor_Thumb.cpp
│   │   │   ├── ComparedExecutor_Thumb.h
│   │   │   ├── Instr_Test_ARM.cpp
│   │   │   ├── Instr_Test_Thumb.cpp
│   │   │   ├── Instr_Test_Thumb.h
│   │   │   ├── LLVMOperandInfo_ARM.cpp
│   │   │   ├── MemoryAccessTable_ARM.cpp
│   │   │   ├── Patch_Test_ARM.cpp
│   │   │   ├── Patch_Test_Thumb.cpp
│   │   │   └── Patch_Test_Thumb.h
│   │   ├── CMakeLists.txt
│   │   ├── Instr_Test.cpp
│   │   ├── Instr_Test.h
│   │   ├── MemoryAccessTable.h
│   │   ├── Patch_Test.cpp
│   │   ├── Patch_Test.h
│   │   ├── Utils.cpp
│   │   ├── Utils.h
│   │   ├── X86/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── ComparedExecutor_X86.cpp
│   │   │   ├── ComparedExecutor_X86.h
│   │   │   ├── Instr_Test_X86.cpp
│   │   │   ├── Patch_Test_X86.cpp
│   │   │   └── WIN86_RunRealExec.asm
│   │   └── X86_64/
│   │       ├── CMakeLists.txt
│   │       ├── ComparedExecutor_X86_64.cpp
│   │       ├── ComparedExecutor_X86_64.h
│   │       ├── Instr_Test_X86_64.cpp
│   │       ├── LLVMOperandInfo_X86_64.cpp
│   │       ├── MemoryAccessTable_X86_64.cpp
│   │       ├── Patch_Test_X86_64.cpp
│   │       └── WIN64_RunRealExec.asm
│   ├── QBDIBenchmark.cpp
│   ├── QBDITest.cpp
│   └── TestSetup/
│       ├── AARCH64/
│       │   ├── CMakeLists.txt
│       │   └── InMemoryAssembler_AARCH64.cpp
│       ├── ARM/
│       │   ├── CMakeLists.txt
│       │   └── InMemoryAssembler_ARM.cpp
│       ├── CMakeLists.txt
│       ├── InMemoryAssembler.cpp
│       ├── InMemoryAssembler.h
│       ├── LLVMTestEnv.h
│       ├── ShellcodeTester.cpp
│       ├── ShellcodeTester.h
│       ├── X86/
│       │   ├── CMakeLists.txt
│       │   └── InMemoryAssembler_X86.cpp
│       └── X86_64/
│           ├── CMakeLists.txt
│           └── InMemoryAssembler_X86_64.cpp
└── tools/
    ├── CMakeLists.txt
    ├── QBDIPreload/
    │   ├── CMakeLists.txt
    │   ├── include/
    │   │   └── QBDIPreload.h
    │   └── src/
    │       ├── AARCH64/
    │       │   ├── CMakeLists.txt
    │       │   ├── linux_AARCH64.c
    │       │   ├── linux_AARCH64.h
    │       │   ├── macos_AARCH64.c
    │       │   └── macos_AARCH64.h
    │       ├── ARM/
    │       │   ├── CMakeLists.txt
    │       │   ├── linux_ARM.c
    │       │   └── linux_ARM.h
    │       ├── CMakeLists.txt
    │       ├── X86/
    │       │   ├── CMakeLists.txt
    │       │   ├── linux_X86.c
    │       │   ├── linux_X86.h
    │       │   ├── macos_X86.c
    │       │   ├── macos_X86.h
    │       │   └── win_x86.asm
    │       ├── X86_64/
    │       │   ├── CMakeLists.txt
    │       │   ├── linux_X86_64.c
    │       │   ├── linux_X86_64.h
    │       │   ├── macos_X86_64.c
    │       │   ├── macos_X86_64.h
    │       │   └── win_X86_64.asm
    │       ├── darwin_exceptd.c
    │       ├── darwin_exceptd.h
    │       ├── darwin_exception.defs
    │       ├── darwin_preload.c
    │       ├── linux_preload.c
    │       └── win_preload.c
    ├── QBDIWinPreloader/
    │   ├── CMakeLists.txt
    │   └── src/
    │       └── QBDIWinPreloader.c
    ├── frida-qbdi.js
    ├── pyqbdi/
    │   ├── CMakeLists.txt
    │   ├── binding/
    │   │   ├── AARCH64/
    │   │   │   ├── CMakeLists.txt
    │   │   │   ├── Options_AARCH64.cpp
    │   │   │   └── State_AARCH64.cpp
    │   │   ├── ARM/
    │   │   │   ├── CMakeLists.txt
    │   │   │   ├── Options_ARM.cpp
    │   │   │   └── State_ARM.cpp
    │   │   ├── CMakeLists.txt
    │   │   ├── Callback.cpp
    │   │   ├── Enum.hpp
    │   │   ├── Errors.cpp
    │   │   ├── InstAnalysis.cpp
    │   │   ├── Logs.cpp
    │   │   ├── Memory.cpp
    │   │   ├── Range.cpp
    │   │   ├── VM.cpp
    │   │   ├── X86/
    │   │   │   ├── CMakeLists.txt
    │   │   │   ├── Options_X86.cpp
    │   │   │   └── State_X86.cpp
    │   │   ├── X86_64/
    │   │   │   ├── CMakeLists.txt
    │   │   │   ├── Options_X86_64.cpp
    │   │   │   └── State_X86_64.cpp
    │   │   └── callback_python.h
    │   ├── fix_preload_lib_macos.py
    │   ├── preload.cpp
    │   ├── pyqbdi.hpp
    │   ├── pyqbdi_module.cpp
    │   ├── pyqbdipreload.py
    │   └── utils/
    │       ├── CMakeLists.txt
    │       ├── Float.cpp
    │       └── Memory.cpp
    ├── validation_runner/
    │   ├── RunConfig.py
    │   ├── RunOrchestrator.py
    │   ├── RunResult.py
    │   ├── SQLite.py
    │   ├── TestResult.py
    │   ├── ValidationRunner.py
    │   ├── buildbot.cfg
    │   ├── coverage.cfg
    │   ├── example.cfg
    │   ├── testfiles/
    │   │   └── hamlet.txt
    │   └── travis.cfg
    └── validator/
        ├── AARCH64/
        │   ├── CMakeLists.txt
        │   ├── linux_AARCH64.cpp
        │   ├── linux_AARCH64.h
        │   └── validatorengine_AARCH64.cpp
        ├── ARM/
        │   ├── CMakeLists.txt
        │   ├── linux_ARM.cpp
        │   ├── linux_ARM.h
        │   └── validatorengine_ARM.cpp
        ├── CMakeLists.txt
        ├── X86/
        │   ├── CMakeLists.txt
        │   ├── linux_X86.cpp
        │   ├── linux_X86.h
        │   └── validatorengine_X86.cpp
        ├── X86_64/
        │   ├── CMakeLists.txt
        │   ├── linux_X86_64.cpp
        │   ├── linux_X86_64.h
        │   └── validatorengine_X86_64.cpp
        ├── darwin_process.cpp
        ├── darwin_process.h
        ├── darwin_validator.cpp
        ├── instrumented.cpp
        ├── instrumented.h
        ├── linux_process.cpp
        ├── linux_process.h
        ├── linux_validator.cpp
        ├── master.cpp
        ├── master.h
        ├── pipes.cpp
        ├── pipes.h
        ├── process.h
        ├── validator.h
        ├── validatorengine.cpp
        └── validatorengine.h
Download .txt
SYMBOL INDEX (1775 symbols across 328 files)

FILE: cmake/dummy.c
  function dummy (line 1) | int dummy() { return 42; }

FILE: cmake/llvm/rename_object.py
  function eprint (line 14) | def eprint(*args, **kwargs):
  function listArchs (line 17) | def listArchs(archive):
  function extractArch (line 31) | def extractArch(archive, arch, path):
  function extractObjs (line 43) | def extractObjs(archive, path):
  function archiveObjs (line 53) | def archiveObjs(archive, path):
  function mergeArch (line 65) | def mergeArch(archives, outpath):
  function rename_object (line 77) | def rename_object(archive, ofname, suffix="", remove=False):

FILE: docs/rtd_pyqbdi_artifact/setup.py
  function do_get_request (line 25) | def do_get_request(path, params={}, headers={}, retry=10, retry_sleep=1,...
  function get_workflow_id (line 42) | def get_workflow_id(name):
  function get_last_workflow_run (line 61) | def get_last_workflow_run(ident, artifact_name, branch=None, commit_hash...
  function get_artifact (line 101) | def get_artifact(run_id, artifact_name, check=False):
  function download_wheel (line 121) | def download_wheel(artifact):
  function install_wheel (line 137) | def install_wheel(wheelname, wheeldata):
  function check_installation (line 147) | def check_installation():
  function install_pyqbdi (line 151) | def install_pyqbdi():

FILE: docs/source/conf.py
  function extract_version (line 24) | def extract_version(cmakefile):

FILE: examples/c/fibonacci.c
  function fibonacci (line 8) | int fibonacci(int n) {
  function VMAction (line 14) | VMAction showInstruction(VMInstanceRef vm, GPRState *gprState,
  function VMAction (line 27) | VMAction countIteration(VMInstanceRef vm, GPRState *gprState,
  function main (line 36) | int main(int argc, char **argv) {

FILE: examples/c/tracer_preload.c
  function VMAction (line 6) | static VMAction onInstruction(VMInstanceRef vm, GPRState *gprState,
  function qbdipreload_on_start (line 15) | int qbdipreload_on_start(void *main) {
  function qbdipreload_on_premain (line 24) | int qbdipreload_on_premain(void *gprCtx, void *fpuCtx) {
  function qbdipreload_on_main (line 28) | int qbdipreload_on_main(int argc, char **argv) {
  function qbdipreload_on_run (line 32) | int qbdipreload_on_run(VMInstanceRef vm, rword start, rword stop) {
  function qbdipreload_on_exit (line 38) | int qbdipreload_on_exit(int status) { return QBDIPRELOAD_NO_ERROR; }

FILE: examples/cpp/fibonacci.cpp
  function fibonacci (line 10) | int fibonacci(int n) {
  function showInstruction (line 16) | QBDI::VMAction showInstruction(QBDI::VM *vm, QBDI::GPRState *gprState,
  function countIteration (line 29) | QBDI::VMAction countIteration(QBDI::VM *vm, QBDI::GPRState *gprState,
  function main (line 38) | int main(int argc, char **argv) {

FILE: examples/cpp/tracer_preload.cpp
  function onInstruction (line 6) | static QBDI::VMAction onInstruction(QBDI::VMInstanceRef vm,
  function qbdipreload_on_start (line 21) | int qbdipreload_on_start(void *main) {
  function qbdipreload_on_premain (line 30) | int qbdipreload_on_premain(void *gprCtx, void *fpuCtx) {
  function qbdipreload_on_main (line 34) | int qbdipreload_on_main(int argc, char **argv) {
  function qbdipreload_on_run (line 38) | int qbdipreload_on_run(QBDI::VMInstanceRef vm, QBDI::rword start,
  function qbdipreload_on_exit (line 45) | int qbdipreload_on_exit(int status) { return QBDIPRELOAD_NO_ERROR; }

FILE: examples/cryptolock.c
  function QBDI_NOINLINE (line 9) | QBDI_NOINLINE void hashPassword(char *hash, const char *password) {
  function QBDI_NOINLINE (line 25) | QBDI_NOINLINE const char *getSecret(const char *password) {
  function QBDI_NOINLINE (line 34) | QBDI_NOINLINE const char *cryptolock(const char *password) {
  function VMAction (line 54) | VMAction onwrite(VMInstanceRef vm, GPRState *gprState, FPRState *fprState,
  function main (line 86) | int main(int argc, char **argv) {

FILE: examples/cryptolock.cpp
  function QBDI_NOINLINE (line 8) | QBDI_NOINLINE void hashPassword(char *hash, const char *password) {
  function QBDI_NOINLINE (line 23) | QBDI_NOINLINE const char *getSecret(const char *password) {
  function QBDI_NOINLINE (line 31) | QBDI_NOINLINE const char *cryptolock(const char *password) {
  function onwrite (line 50) | QBDI::VMAction onwrite(QBDI::VMInstanceRef vm, QBDI::GPRState *gprState,
  function main (line 80) | int main(int argc, char **argv) {

FILE: examples/mnemonicFilter.cpp
  function HW (line 13) | int HW(void) {
  function CBMnemonic (line 21) | QBDI::VMAction CBMnemonic(QBDI::VMInstanceRef vm, QBDI::GPRState *gprState,
  function main (line 29) | int main(int argc, char **argv) {

FILE: examples/modules.c
  function main (line 6) | int main(int argc, char **argv) {

FILE: examples/modules.cpp
  function main (line 5) | int main(int argc, char **argv) {

FILE: examples/pyqbdi/coverage.py
  class CovModule (line 8) | class CovModule:
    method __init__ (line 11) | def __init__(self, module):
    method append (line 16) | def append(self, module):
  function get_modules (line 24) | def get_modules():
  function writeCoverage (line 43) | def writeCoverage(stats):
  function vmCB (line 75) | def vmCB(vm, evt, gpr, fpr, data):
  function pyqbdipreload_on_run (line 83) | def pyqbdipreload_on_run(vm, start, stop):

FILE: examples/pyqbdi/trace_preload.py
  function showInstruction (line 5) | def showInstruction(vm, gpr, fpr, data):
  function pyqbdipreload_on_run (line 11) | def pyqbdipreload_on_run(vm, start, stop):

FILE: examples/pyqbdi/trace_sin.py
  function insnCB (line 9) | def insnCB(vm, gpr, fpr, data):
  function run (line 15) | def run():

FILE: examples/thedude.c
  function stripLF (line 10) | void stripLF(char *s) {
  function QBDI_NOINLINE (line 17) | QBDI_NOINLINE uint64_t magicPow(uint64_t n, uint64_t e) {
  function QBDI_NOINLINE (line 27) | QBDI_NOINLINE uint64_t magicHash(char *secret) {
  function QBDI_NOINLINE (line 42) | QBDI_NOINLINE int thedude() {
  function VMAction (line 69) | VMAction count(VMInstanceRef vm, GPRState *gprState, FPRState *fprState,
  function main (line 88) | int main(int argc, char **argv) {

FILE: examples/thedude.cpp
  function QBDI_NOINLINE (line 11) | QBDI_NOINLINE uint64_t magicPow(uint64_t n, uint64_t e) {
  function QBDI_NOINLINE (line 21) | QBDI_NOINLINE uint64_t magicHash(const char *secret) {
  function QBDI_NOINLINE (line 36) | QBDI_NOINLINE int thedude() {
  function count (line 59) | QBDI::VMAction count(QBDI::VMInstanceRef vm, QBDI::GPRState *gprState,
  function main (line 78) | int main(int argc, char **argv) {

FILE: include/QBDI/Bitmask.h
  function namespace (line 24) | namespace QBDI {

FILE: include/QBDI/Callback.h
  type VMAction (line 34) | typedef enum {
  type VMInstance (line 76) | typedef VMInstance *VMInstanceRef;
  type VMAction (line 94) | typedef VMAction (*InstCallback)(VMInstanceRef vm, GPRState *gprState,
  type std (line 110) | typedef std::function<VMAction(VMInstanceRef vm, GPRState *gprState,
  type InstPosition (line 117) | typedef enum {
  type CallbackPriority (line 140) | typedef enum {
  type VMEvent (line 147) | typedef enum {
  function typedef (line 178) | _QBDI_ENABLE_BITMASK_OPERATORS(VMEvent)
  type VMAction (line 219) | typedef VMAction (*VMCallback)(VMInstanceRef vm, const VMState *vmState,
  type std (line 237) | typedef std::function<VMAction(VMInstanceRef vm, const VMState *vmState,
  type MemoryAccessType (line 248) | typedef enum {
  type MemoryAccessFlags (line 258) | typedef enum {
  type MemoryAccess (line 275) | typedef struct {

FILE: include/QBDI/Errors.h
  function namespace (line 24) | namespace QBDI {

FILE: include/QBDI/InstAnalysis.h
  type RegisterAccessType (line 33) | typedef enum {
  type OperandType (line 72) | typedef enum {
  type OperandFlag (line 81) | typedef enum {
  function typedef (line 96) | _QBDI_ENABLE_BITMASK_OPERATORS(OperandFlag)
  type AnalysisType (line 115) | typedef enum {
  function typedef (line 125) | _QBDI_ENABLE_BITMASK_OPERATORS(AnalysisType)

FILE: include/QBDI/Logs.h
  function namespace (line 29) | namespace QBDI {

FILE: include/QBDI/Memory.h
  function namespace (line 29) | namespace QBDI {

FILE: include/QBDI/Memory.hpp
  type QBDI (line 32) | namespace QBDI {
    type MemoryMap (line 47) | struct MemoryMap {
      method MemoryMap (line 61) | MemoryMap() : range(0, 0, real_addr_t()), permission(QBDI::PF_NONE) {}
      method MemoryMap (line 71) | MemoryMap(rword start, rword end, Permission permission, std::string...
      method MemoryMap (line 82) | MemoryMap(Range<rword> range, Permission permission, std::string name)

FILE: include/QBDI/PtrAuth.h
  function namespace (line 24) | namespace QBDI {
  function namespace (line 38) | namespace QBDI {
  function namespace (line 72) | namespace QBDI {

FILE: include/QBDI/Range.h
  function namespace (line 27) | namespace QBDI {
  function operator (line 94) | bool operator==(const Range &r) const {
  function contains (line 104) | bool contains(const T t) const { return (start() <= t) && (t < end()); }
  function contains (line 112) | bool contains(const Range<T> &r) const {
  function overlaps (line 123) | bool overlaps(const Range<T> &r) const {
  function display (line 131) | void display(std::ostream &os) const {
  function T (line 164) | T size() const {
  function Range (line 172) | const Range<T> *getElementRange(const T &t) const {
  function contains (line 183) | bool contains(const T &t) const { return getElementRange(t) != nullptr; }
  function contains (line 185) | bool contains(const Range<T> &t) const {
  function overlaps (line 199) | bool overlaps(const Range<T> &t) const {
  function add (line 213) | void add(const Range<T> &t) {
  function add (line 261) | void add(const RangeSet<T> &t) {
  function clear (line 375) | void clear() { ranges.clear(); }
  function display (line 377) | void display(std::ostream &os) const {

FILE: include/QBDI/VM.h
  function namespace (line 38) | namespace QBDI {

FILE: include/QBDI/VM_C.h
  function namespace (line 33) | namespace QBDI {

FILE: include/QBDI/arch/AARCH64/Options.h
  function namespace (line 27) | namespace QBDI {

FILE: include/QBDI/arch/AARCH64/State.h
  function namespace (line 37) | namespace QBDI {

FILE: include/QBDI/arch/ARM/Options.h
  function namespace (line 27) | namespace QBDI {

FILE: include/QBDI/arch/ARM/State.h
  function namespace (line 37) | namespace QBDI {

FILE: include/QBDI/arch/X86/Options.h
  function namespace (line 27) | namespace QBDI {

FILE: include/QBDI/arch/X86/State.h
  function namespace (line 33) | namespace QBDI {

FILE: include/QBDI/arch/X86_64/Options.h
  function namespace (line 27) | namespace QBDI {

FILE: include/QBDI/arch/X86_64/State.h
  function namespace (line 33) | namespace QBDI {

FILE: setup.py
  function detect_QBDI_platform (line 35) | def detect_QBDI_platform():
  class CMakeExtension (line 84) | class CMakeExtension(Extension):
    method __init__ (line 85) | def __init__(self, name, sourcedir=''):
  class CMakeBuild (line 89) | class CMakeBuild(build_ext):
    method build_extension (line 91) | def build_extension(self, ext):

FILE: src/Engine/Engine.cpp
  type QBDI (line 50) | namespace QBDI {
    function Engine (line 111) | Engine &Engine::operator=(const Engine &other) {
    function GPRState (line 194) | GPRState *Engine::getGPRState() const { return curGPRState; }
    function FPRState (line 196) | FPRState *Engine::getFPRState() const { return curFPRState; }

FILE: src/Engine/Engine.h
  function namespace (line 35) | namespace QBDI {

FILE: src/Engine/LLVMCPU.cpp
  type QBDI (line 57) | namespace QBDI {

FILE: src/Engine/LLVMCPU.h
  function namespace (line 33) | namespace llvm {
  function namespace (line 49) | namespace QBDI {
  function hasOptions (line 116) | bool hasOptions(Options opts) const { return (getOptions() & opts) == op...
  function class (line 123) | class LLVMCPUs {

FILE: src/Engine/VM.cpp
  function warmConflictPriority (line 56) | inline void warmConflictPriority(int priority) {
  function VMAction (line 67) | VMAction memReadGate(VMInstanceRef vm, GPRState *gprState, FPRState *fpr...
  function VMAction (line 97) | VMAction memWriteGate(VMInstanceRef vm, GPRState *gprState, FPRState *fp...
  function InstrCBGateC (line 137) | std::vector<InstrRuleDataCBK>
  function VMAction (line 145) | VMAction VMCBLambdaProxy(VMInstanceRef vm, const VMState *vmState,
  function VMAction (line 151) | VMAction InstCBLambdaProxy(VMInstanceRef vm, GPRState *gprState,
  function InstrRuleCBLambdaProxy (line 157) | std::vector<InstrRuleDataCBK>
  function VMAction (line 163) | VMAction stopCallback(VMInstanceRef vm, GPRState *gprState, FPRState *fp...
  function VM (line 204) | VM &VM::operator=(VM &&vm) {
  function VM (line 286) | VM &VM::operator=(const VM &vm) {
  function GPRState (line 355) | GPRState *VM::getGPRState() const { return engine->getGPRState(); }
  function FPRState (line 359) | FPRState *VM::getFPRState() const { return engine->getFPRState(); }
  function Options (line 377) | Options VM::getOptions() const { return engine->getOptions(); }
  function QBDI_REQUIRE_ACTION (line 734) | QBDI_REQUIRE_ACTION(start < end, return VMError::INVALID_EVENTID);
  function QBDI_REQUIRE_ACTION (line 856) | QBDI_REQUIRE_ACTION(id < EVENTID_VIRTCB_MASK,
  function InstAnalysis (line 957) | const InstAnalysis *VM::getInstAnalysis(AnalysisType type) const {
  function InstAnalysis (line 966) | const InstAnalysis *VM::getCachedInstAnalysis(rword address,
  function InstAnalysis (line 972) | const InstAnalysis *VM::getJITInstAnalysis(rword jitAddress,

FILE: src/Engine/VM_C.cpp
  type QBDI (line 33) | namespace QBDI {
    function qbdi_initVM (line 35) | void qbdi_initVM(VMInstanceRef *instance, const char *cpu, const char ...
    function qbdi_terminateVM (line 56) | void qbdi_terminateVM(VMInstanceRef instance) {
    function qbdi_addInstrumentedRange (line 61) | void qbdi_addInstrumentedRange(VMInstanceRef instance, rword start, rw...
    function qbdi_addInstrumentedModule (line 66) | bool qbdi_addInstrumentedModule(VMInstanceRef instance, const char *na...
    function qbdi_addInstrumentedModuleFromAddr (line 71) | bool qbdi_addInstrumentedModuleFromAddr(VMInstanceRef instance, rword ...
    function qbdi_instrumentAllExecutableMaps (line 76) | bool qbdi_instrumentAllExecutableMaps(VMInstanceRef instance) {
    function qbdi_removeInstrumentedRange (line 81) | void qbdi_removeInstrumentedRange(VMInstanceRef instance, rword start,
    function qbdi_removeAllInstrumentedRanges (line 87) | void qbdi_removeAllInstrumentedRanges(VMInstanceRef instance) {
    function qbdi_removeInstrumentedModule (line 92) | bool qbdi_removeInstrumentedModule(VMInstanceRef instance, const char ...
    function qbdi_removeInstrumentedModuleFromAddr (line 98) | bool qbdi_removeInstrumentedModuleFromAddr(VMInstanceRef instance, rwo...
    function qbdi_run (line 103) | bool qbdi_run(VMInstanceRef instance, rword start, rword stop) {
    function qbdi_call (line 108) | bool qbdi_call(VMInstanceRef instance, rword *retval, rword function,
    function qbdi_callV (line 118) | bool qbdi_callV(VMInstanceRef instance, rword *retval, rword function,
    function qbdi_callA (line 124) | bool qbdi_callA(VMInstanceRef instance, rword *retval, rword function,
    function qbdi_switchStackAndCall (line 130) | bool qbdi_switchStackAndCall(VMInstanceRef instance, rword *retval,
    function qbdi_switchStackAndCallV (line 142) | bool qbdi_switchStackAndCallV(VMInstanceRef instance, rword *retval,
    function qbdi_switchStackAndCallA (line 150) | bool qbdi_switchStackAndCallA(VMInstanceRef instance, rword *retval,
    function GPRState (line 158) | GPRState *qbdi_getGPRState(VMInstanceRef instance) {
    function FPRState (line 163) | FPRState *qbdi_getFPRState(VMInstanceRef instance) {
    function qbdi_getErrno (line 168) | uint32_t qbdi_getErrno(VMInstanceRef instance) {
    function qbdi_setGPRState (line 173) | void qbdi_setGPRState(VMInstanceRef instance, GPRState *gprState) {
    function qbdi_setFPRState (line 178) | void qbdi_setFPRState(VMInstanceRef instance, FPRState *fprState) {
    function qbdi_setErrno (line 183) | void qbdi_setErrno(VMInstanceRef instance, uint32_t backupErrno) {
    function Options (line 188) | Options qbdi_getOptions(VMInstanceRef instance) {
    function qbdi_setOptions (line 193) | void qbdi_setOptions(VMInstanceRef instance, Options options) {
    function qbdi_addMnemonicCB (line 198) | uint32_t qbdi_addMnemonicCB(VMInstanceRef instance, const char *mnemonic,
    function qbdi_addCodeCB (line 206) | uint32_t qbdi_addCodeCB(VMInstanceRef instance, InstPosition pos,
    function qbdi_addCodeAddrCB (line 212) | uint32_t qbdi_addCodeAddrCB(VMInstanceRef instance, rword address,
    function qbdi_addCodeRangeCB (line 220) | uint32_t qbdi_addCodeRangeCB(VMInstanceRef instance, rword start, rwor...
    function qbdi_addMemAccessCB (line 228) | uint32_t qbdi_addMemAccessCB(VMInstanceRef instance, MemoryAccessType ...
    function qbdi_addMemAddrCB (line 234) | uint32_t qbdi_addMemAddrCB(VMInstanceRef instance, rword address,
    function qbdi_addMemRangeCB (line 241) | uint32_t qbdi_addMemRangeCB(VMInstanceRef instance, rword start, rword...
    function qbdi_addVMEventCB (line 249) | uint32_t qbdi_addVMEventCB(VMInstanceRef instance, VMEvent mask, VMCal...
    function qbdi_deleteInstrumentation (line 255) | bool qbdi_deleteInstrumentation(VMInstanceRef instance, uint32_t id) {
    function qbdi_deleteAllInstrumentations (line 260) | void qbdi_deleteAllInstrumentations(VMInstanceRef instance) {
    function InstAnalysis (line 265) | const InstAnalysis *qbdi_getInstAnalysis(const VMInstanceRef instance,
    function InstAnalysis (line 271) | const InstAnalysis *qbdi_getCachedInstAnalysis(const VMInstanceRef ins...
    function InstAnalysis (line 279) | const InstAnalysis *qbdi_getJITInstAnalysis(const VMInstanceRef instance,
    function qbdi_recordMemoryAccess (line 285) | bool qbdi_recordMemoryAccess(VMInstanceRef instance, MemoryAccessType ...
    function MemoryAccess (line 290) | MemoryAccess *qbdi_getInstMemoryAccess(VMInstanceRef instance, size_t ...
    function MemoryAccess (line 310) | MemoryAccess *qbdi_getBBMemoryAccess(VMInstanceRef instance, size_t *s...
    function qbdi_precacheBasicBlock (line 330) | bool qbdi_precacheBasicBlock(VMInstanceRef instance, rword pc) {
    function qbdi_clearAllCache (line 335) | void qbdi_clearAllCache(VMInstanceRef instance) {
    function qbdi_clearCache (line 339) | void qbdi_clearCache(VMInstanceRef instance, rword start, rword end) {
    function qbdi_getNbExecBlock (line 343) | uint32_t qbdi_getNbExecBlock(VMInstanceRef instance) {
    function qbdi_reduceCacheTo (line 347) | void qbdi_reduceCacheTo(VMInstanceRef instance, uint32_t nb) {
    function qbdi_addInstrRule (line 351) | uint32_t qbdi_addInstrRule(VMInstanceRef instance, InstrRuleCallbackC ...
    function qbdi_addInstrRuleRange (line 357) | uint32_t qbdi_addInstrRuleRange(VMInstanceRef instance, rword start, r...
    function qbdi_addInstrRuleData (line 365) | void qbdi_addInstrRuleData(InstrRuleDataVec cbks, InstPosition position,

FILE: src/Engine/VM_internal.h
  function namespace (line 23) | namespace QBDI {

FILE: src/ExecBlock/AARCH64/Context_AARCH64.h
  function namespace (line 23) | namespace QBDI {

FILE: src/ExecBlock/AARCH64/ExecBlock_AARCH64.cpp
  type QBDI (line 44) | namespace QBDI {

FILE: src/ExecBlock/AARCH64/ScratchRegisterInfo_AARCH64.h
  function namespace (line 25) | namespace QBDI {

FILE: src/ExecBlock/ARM/Context_ARM.h
  function namespace (line 23) | namespace QBDI {

FILE: src/ExecBlock/ARM/ExecBlock_ARM.cpp
  type QBDI (line 36) | namespace QBDI {

FILE: src/ExecBlock/ARM/ScratchRegisterInfo_ARM.h
  function namespace (line 23) | namespace QBDI {

FILE: src/ExecBlock/Context.h
  function namespace (line 23) | namespace QBDI {

FILE: src/ExecBlock/ExecBlock.cpp
  type QBDI (line 48) | namespace QBDI {
    function VMAction (line 195) | VMAction ExecBlock::execute() {
    function SeqWriteResult (line 363) | SeqWriteResult
    function rword (line 571) | rword ExecBlock::getShadow(uint16_t id) const {
    function rword (line 578) | rword ExecBlock::getShadowOffset(uint16_t id) const {
    function InstMetadata (line 594) | const InstMetadata &ExecBlock::getInstMetadata(uint16_t instID) const {
    function rword (line 599) | rword ExecBlock::getInstAddress(uint16_t instID) const {
    function rword (line 604) | rword ExecBlock::getInstInstrumentedAddress(uint16_t instID) const {
    function InstAnalysis (line 615) | const InstAnalysis *ExecBlock::getInstAnalysis(uint16_t instID,
    function LLVMCPU (line 761) | const LLVMCPU &ExecBlock::getLLVMCPUByInst(uint16_t instID) const {

FILE: src/ExecBlock/ExecBlock.h
  function namespace (line 46) | namespace llvm {
  function namespace (line 50) | namespace QBDI {

FILE: src/ExecBlock/ExecBlockManager.cpp
  type QBDI (line 33) | namespace QBDI {
    function rword (line 37) | inline rword getExecRegionKey(rword address, CPUMode cpumode) {
    function ExecBlock (line 114) | ExecBlock *ExecBlockManager::getProgrammedExecBlock(rword address,
    function ExecBlock (line 175) | const ExecBlock *ExecBlockManager::getExecBlock(rword address,

FILE: src/ExecBlock/ExecBlockManager.h
  function namespace (line 34) | namespace QBDI {

FILE: src/ExecBlock/X86_64/Context_X86_64.h
  function namespace (line 23) | namespace QBDI {

FILE: src/ExecBlock/X86_64/ExecBlock_X86_64.cpp
  type QBDI (line 46) | namespace QBDI {

FILE: src/ExecBlock/X86_64/ScratchRegisterInfo_X86_64.h
  function namespace (line 21) | namespace QBDI {

FILE: src/ExecBroker/AARCH64/ExecBroker_AARCH64.cpp
  type QBDI (line 31) | namespace QBDI {
    function rword (line 145) | rword *ExecBroker::getReturnPoint(GPRState *gprState) const {

FILE: src/ExecBroker/AARCH64/ExecBroker_AARCH64.h
  function namespace (line 23) | namespace QBDI {

FILE: src/ExecBroker/ARM/ExecBroker_ARM.cpp
  type QBDI (line 25) | namespace QBDI {
    function rword (line 29) | rword *ExecBroker::getReturnPoint(GPRState *gprState) const {

FILE: src/ExecBroker/ARM/ExecBroker_ARM.h
  function namespace (line 21) | namespace QBDI {

FILE: src/ExecBroker/ExecBroker.cpp
  type QBDI (line 27) | namespace QBDI {

FILE: src/ExecBroker/ExecBroker.h
  function namespace (line 44) | namespace QBDI {

FILE: src/ExecBroker/X86_64/ExecBroker_X86_64.cpp
  type QBDI (line 28) | namespace QBDI {
    class LLVMCPUs (line 29) | class LLVMCPUs
    function rword (line 33) | rword *ExecBroker::getReturnPoint(GPRState *gprState) const {

FILE: src/ExecBroker/X86_64/ExecBroker_X86_64.h
  function namespace (line 21) | namespace QBDI {

FILE: src/Patch/AARCH64/ExecBlockFlags_AARCH64.cpp
  type QBDI (line 21) | namespace QBDI {
    function getExecBlockFlags (line 25) | uint8_t getExecBlockFlags(const llvm::MCInst &inst,

FILE: src/Patch/AARCH64/ExecBlockFlags_AARCH64.h
  function namespace (line 23) | namespace QBDI {

FILE: src/Patch/AARCH64/ExecBlockPatch_AARCH64.cpp
  type QBDI (line 33) | namespace QBDI {
    function getExecBlockPrologue (line 35) | RelocatableInst::UniquePtrVec getExecBlockPrologue(const LLVMCPU &llvm...
    function getExecBlockEpilogue (line 119) | RelocatableInst::UniquePtrVec getExecBlockEpilogue(const LLVMCPU &llvm...
    function getTerminator (line 210) | RelocatableInst::UniquePtrVec getTerminator(const LLVMCPU &llvmcpu,
    function changeScratchRegister (line 226) | RelocatableInst::UniquePtrVec

FILE: src/Patch/AARCH64/ExecBlockPatch_AARCH64.h
  function namespace (line 27) | namespace QBDI {

FILE: src/Patch/AARCH64/InstInfo_AARCH64.cpp
  type QBDI (line 38) | namespace QBDI {
    function READ (line 1707) | constexpr uint32_t READ(uint32_t s, uint32_t p) { return (s * p) & 0x3...
    function WRITE (line 1708) | constexpr uint32_t WRITE(uint32_t s, uint32_t p) {
    function GET_READ_SIZE (line 1711) | constexpr uint32_t GET_READ_SIZE(uint32_t v) { return v & 0x3ff; }
    function GET_WRITE_SIZE (line 1712) | constexpr uint32_t GET_WRITE_SIZE(uint32_t v) {
    function IS_READ_DYN (line 1715) | constexpr uint32_t IS_READ_DYN(uint32_t v) { return (v >> READ_DYN_FLA...
    function IS_WRITE_DYN (line 1716) | constexpr uint32_t IS_WRITE_DYN(uint32_t v) {
    type MemAccessArray (line 1720) | struct MemAccessArray {
      method _initMemAccessRead (line 1723) | constexpr inline void _initMemAccessRead(const unsigned buff[],
      method _initMemAccessWrite (line 1731) | constexpr inline void _initMemAccessWrite(const unsigned buff[],
      method _initMemAccessFlags (line 1739) | constexpr inline void _initMemAccessFlags(const unsigned buff[],
      method MemAccessArray (line 1747) | constexpr MemAccessArray() {
      method check_table (line 1799) | void check_table(const unsigned buff[], const size_t buffSize, uint3...
      method check (line 1813) | int check() const {
      method get (line 1887) | inline uint32_t get(size_t op) const {
    function getReadSize (line 1904) | unsigned getReadSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
    function getWriteSize (line 1908) | unsigned getWriteSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
    function getInstSize (line 1912) | unsigned getInstSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
    function sword (line 1916) | sword getFixedOperandValue(const llvm::MCInst &inst, const LLVMCPU &ll...
    function getImmediateSize (line 1921) | unsigned getImmediateSize(const llvm::MCInst &inst, const LLVMCPU &llv...
    function unsupportedRead (line 1926) | bool unsupportedRead(const llvm::MCInst &inst) {
    function unsupportedWrite (line 1930) | bool unsupportedWrite(const llvm::MCInst &inst) {
    function variadicOpsIsWrite (line 1934) | bool variadicOpsIsWrite(const llvm::MCInst &inst) { return false; }
    function isMOPSPrologue (line 1936) | bool isMOPSPrologue(const llvm::MCInst &inst) {

FILE: src/Patch/AARCH64/InstInfo_AARCH64.h
  function namespace (line 21) | namespace llvm {
  function namespace (line 25) | namespace QBDI {

FILE: src/Patch/AARCH64/InstMetadata_AARCH64.h
  function namespace (line 21) | namespace QBDI {

FILE: src/Patch/AARCH64/InstrRules_AARCH64.cpp
  type QBDI (line 32) | namespace QBDI {
    function getBreakToHost (line 38) | RelocatableInst::UniquePtrVec getBreakToHost(Reg temp, const Patch &pa...

FILE: src/Patch/AARCH64/Layer2_AARCH64.cpp
  type QBDI (line 28) | namespace QBDI {
    function format_as (line 30) | unsigned format_as(ShiftExtendType type) { return fmt::underlying(type...
    function st1_post_inc (line 32) | llvm::MCInst st1_post_inc(RegLLVM regs, RegLLVM base) {
    function ld1_post_inc (line 42) | llvm::MCInst ld1_post_inc(RegLLVM regs, RegLLVM base) {
    function addr (line 52) | llvm::MCInst addr(RegLLVM dst, RegLLVM src) { return addr(dst, dst, sr...
    function addr (line 54) | llvm::MCInst addr(RegLLVM dst, RegLLVM src1, RegLLVM src2) {
    function addr (line 74) | llvm::MCInst addr(RegLLVM dst, RegLLVM src1, RegLLVM src2, ShiftExtend...
    function addri (line 124) | llvm::MCInst addri(RegLLVM dst, RegLLVM src, rword offset) {
    function subr (line 143) | llvm::MCInst subr(RegLLVM dst, RegLLVM src) { return subr(dst, dst, sr...
    function subr (line 145) | llvm::MCInst subr(RegLLVM dst, RegLLVM src1, RegLLVM src2) {
    function subri (line 167) | llvm::MCInst subri(RegLLVM dst, RegLLVM src, rword offset) {
    function br (line 186) | llvm::MCInst br(RegLLVM reg) {
    function blr (line 193) | llvm::MCInst blr(RegLLVM reg) {
    function branch (line 200) | llvm::MCInst branch(rword offset) {
    function cbz (line 207) | llvm::MCInst cbz(RegLLVM reg, sword offset) {
    function ret (line 221) | llvm::MCInst ret(RegLLVM reg) {
    function adr (line 228) | llvm::MCInst adr(RegLLVM reg, sword offset) {
    function adrp (line 238) | llvm::MCInst adrp(RegLLVM reg, sword offset) {
    function nop (line 252) | llvm::MCInst nop() {
    function ldr (line 259) | llvm::MCInst ldr(RegLLVM dest, RegLLVM base, rword offset) {
    function ldri (line 267) | llvm::MCInst ldri(RegLLVM dest, RegLLVM base, sword offset) {
    function ldrui (line 280) | llvm::MCInst ldrui(RegLLVM dest, RegLLVM base, rword offset) {
    function ldrw (line 294) | llvm::MCInst ldrw(RegLLVM dest, RegLLVM base, rword offset) {
    function ldrwi (line 302) | llvm::MCInst ldrwi(RegLLVM dest, RegLLVM base, sword offset) {
    function ldrwui (line 315) | llvm::MCInst ldrwui(RegLLVM dest, RegLLVM base, rword offset) {
    function ldrh (line 329) | llvm::MCInst ldrh(RegLLVM dest, RegLLVM base, rword offset) {
    function ldrhi (line 337) | llvm::MCInst ldrhi(RegLLVM dest, RegLLVM base, sword offset) {
    function ldrhui (line 350) | llvm::MCInst ldrhui(RegLLVM dest, RegLLVM base, rword offset) {
    function ldrb (line 364) | llvm::MCInst ldrb(RegLLVM dest, RegLLVM base, rword offset) {
    function ldxrb (line 377) | llvm::MCInst ldxrb(RegLLVM dest, RegLLVM addr) {
    function ldp (line 385) | llvm::MCInst ldp(RegLLVM dest1, RegLLVM dest2, RegLLVM base, sword off...
    function ldr_post_inc (line 401) | llvm::MCInst ldr_post_inc(RegLLVM dest, RegLLVM base, sword imm) {
    function ldp_post_inc (line 414) | llvm::MCInst ldp_post_inc(RegLLVM dest1, RegLLVM dest2, RegLLVM base,
    function str (line 431) | llvm::MCInst str(RegLLVM src, RegLLVM base, rword offset) {
    function stri (line 439) | llvm::MCInst stri(RegLLVM src, RegLLVM base, sword offset) {
    function strui (line 450) | llvm::MCInst strui(RegLLVM src, RegLLVM base, rword offset) {
    function stp (line 462) | llvm::MCInst stp(RegLLVM src1, RegLLVM src2, RegLLVM base, sword offse...
    function str_pre_inc (line 478) | llvm::MCInst str_pre_inc(RegLLVM reg, RegLLVM base, sword imm) {
    function lsl (line 491) | llvm::MCInst lsl(RegLLVM dst, RegLLVM src, size_t shift) {
    function lsr (line 507) | llvm::MCInst lsr(RegLLVM dst, RegLLVM src, size_t shift) {
    function msr (line 519) | llvm::MCInst msr(unsigned sysdst, RegLLVM src) {
    function mrs (line 527) | llvm::MCInst mrs(RegLLVM dst, unsigned syssrc) {
    function movrr (line 535) | llvm::MCInst movrr(RegLLVM dst, RegLLVM src) {
    function movri (line 548) | llvm::MCInst movri(RegLLVM dst, uint16_t v) {
    function orrrs (line 557) | llvm::MCInst orrrs(RegLLVM dst, RegLLVM src1, RegLLVM src2, unsigned l...
    function brk (line 567) | llvm::MCInst brk(unsigned imm) {
    function hint (line 574) | llvm::MCInst hint(unsigned imm) {
    function xpacd (line 581) | llvm::MCInst xpacd(RegLLVM reg) {
    function xpaci (line 589) | llvm::MCInst xpaci(RegLLVM reg) {
    function autia (line 597) | llvm::MCInst autia(RegLLVM reg, RegLLVM ctx) {
    function autib (line 606) | llvm::MCInst autib(RegLLVM reg, RegLLVM ctx) {
    function autiza (line 615) | llvm::MCInst autiza(RegLLVM reg) {
    function autizb (line 623) | llvm::MCInst autizb(RegLLVM reg) {
    function Ld1PostInc (line 633) | RelocatableInst::UniquePtr Ld1PostInc(RegLLVM regs, RegLLVM base) {
    function St1PostInc (line 637) | RelocatableInst::UniquePtr St1PostInc(RegLLVM regs, RegLLVM base) {
    function Add (line 641) | RelocatableInst::UniquePtr Add(RegLLVM dst, RegLLVM src, Constant val) {
    function Addc (line 649) | RelocatableInst::UniquePtrVec Addc(RegLLVM dst, RegLLVM src, Constant ...
    function Addr (line 667) | RelocatableInst::UniquePtr Addr(RegLLVM dst, RegLLVM src) {
    function Addr (line 671) | RelocatableInst::UniquePtr Addr(RegLLVM dst, RegLLVM src1, RegLLVM src2,
    function Br (line 676) | RelocatableInst::UniquePtr Br(RegLLVM reg) { return NoReloc::unique(br...
    function Blr (line 678) | RelocatableInst::UniquePtr Blr(RegLLVM reg) {
    function Cbz (line 682) | RelocatableInst::UniquePtr Cbz(RegLLVM reg, Constant offset) {
    function Ret (line 686) | RelocatableInst::UniquePtr Ret() {
    function Adr (line 690) | RelocatableInst::UniquePtr Adr(RegLLVM reg, rword offset) {
    function Adrp (line 694) | RelocatableInst::UniquePtr Adrp(RegLLVM reg, rword offset) {
    function Nop (line 701) | RelocatableInst::UniquePtr Nop() { return NoReloc::unique(nop()); }
    function Ldr (line 703) | RelocatableInst::UniquePtr Ldr(RegLLVM reg, RegLLVM base, rword offset) {
    function Ldrw (line 707) | RelocatableInst::UniquePtr Ldrw(RegLLVM reg, RegLLVM base, rword offse...
    function Ldrh (line 715) | RelocatableInst::UniquePtr Ldrh(RegLLVM reg, RegLLVM base, rword offse...
    function Ldrb (line 723) | RelocatableInst::UniquePtr Ldrb(RegLLVM reg, RegLLVM base, rword offse...
    function Ldr (line 731) | RelocatableInst::UniquePtr Ldr(RegLLVM reg, Offset offset) {
    function Ldxrb (line 735) | RelocatableInst::UniquePtr Ldxrb(RegLLVM dst, RegLLVM addr) {
    function LdrPost (line 743) | RelocatableInst::UniquePtr LdrPost(RegLLVM dest, RegLLVM base, Constan...
    function Ldp (line 747) | RelocatableInst::UniquePtr Ldp(RegLLVM dest1, RegLLVM dest2, RegLLVM b...
    function LdpPost (line 752) | RelocatableInst::UniquePtr LdpPost(RegLLVM dest1, RegLLVM dest2, RegLL...
    function Str (line 757) | RelocatableInst::UniquePtr Str(RegLLVM reg, RegLLVM base, Offset offse...
    function Str (line 761) | RelocatableInst::UniquePtr Str(RegLLVM reg, Offset offset) {
    function StrPre (line 765) | RelocatableInst::UniquePtr StrPre(RegLLVM src, RegLLVM base, Constant ...
    function Stp (line 769) | RelocatableInst::UniquePtr Stp(RegLLVM src1, RegLLVM src2, RegLLVM base,
    function Lsl (line 774) | RelocatableInst::UniquePtr Lsl(RegLLVM dst, RegLLVM src, Constant shif...
    function Lsr (line 778) | RelocatableInst::UniquePtr Lsr(RegLLVM dst, RegLLVM src, Constant shif...
    function ReadTPIDR (line 782) | RelocatableInst::UniquePtr ReadTPIDR(RegLLVM reg) {
    function WriteTPIDR (line 786) | RelocatableInst::UniquePtr WriteTPIDR(RegLLVM reg) {
    function WriteSRinTPIDR (line 790) | RelocatableInst::UniquePtr WriteSRinTPIDR() {
    function ReadNZCV (line 794) | RelocatableInst::UniquePtr ReadNZCV(RegLLVM reg) {
    function WriteNZCV (line 798) | RelocatableInst::UniquePtr WriteNZCV(RegLLVM reg) {
    function ReadFPCR (line 802) | RelocatableInst::UniquePtr ReadFPCR(RegLLVM reg) {
    function WriteFPCR (line 806) | RelocatableInst::UniquePtr WriteFPCR(RegLLVM reg) {
    function ReadFPSR (line 810) | RelocatableInst::UniquePtr ReadFPSR(RegLLVM reg) {
    function WriteFPSR (line 814) | RelocatableInst::UniquePtr WriteFPSR(RegLLVM reg) {
    function Mov (line 818) | RelocatableInst::UniquePtr Mov(RegLLVM dst, RegLLVM src) {
    function Mov (line 822) | RelocatableInst::UniquePtr Mov(RegLLVM dst, Constant constant) {
    function Orrs (line 826) | RelocatableInst::UniquePtr Orrs(RegLLVM dst, RegLLVM src1, RegLLVM src2,
    function BreakPoint (line 831) | RelocatableInst::UniquePtr BreakPoint() { return NoReloc::unique(brk(0...
    function BTIc (line 833) | RelocatableInst::UniquePtr BTIc() { return NoReloc::unique(hint(0x22)); }
    function BTIj (line 835) | RelocatableInst::UniquePtr BTIj() { return NoReloc::unique(hint(0x24)); }
    function Xpacd (line 837) | RelocatableInst::UniquePtr Xpacd(RegLLVM reg) {
    function Xpaci (line 841) | RelocatableInst::UniquePtr Xpaci(RegLLVM reg) {
    function Autia (line 845) | RelocatableInst::UniquePtr Autia(RegLLVM reg, RegLLVM ctx) {
    function Autib (line 849) | RelocatableInst::UniquePtr Autib(RegLLVM reg, RegLLVM ctx) {
    function Autiza (line 853) | RelocatableInst::UniquePtr Autiza(RegLLVM reg) {
    function Autizb (line 857) | RelocatableInst::UniquePtr Autizb(RegLLVM reg) {

FILE: src/Patch/AARCH64/Layer2_AARCH64.h
  function namespace (line 30) | namespace QBDI {

FILE: src/Patch/AARCH64/MemoryAccess_AARCH64.cpp
  type QBDI (line 56) | namespace QBDI {
    function ADDR_REGISTER_FN (line 69) | RelocatableInst::UniquePtrVec ADDR_REGISTER_FN(const Patch &patch,
    function ADDR_REGISTER_2_FN (line 262) | RelocatableInst::UniquePtrVec ADDR_REGISTER_2_FN(const Patch &patch,
    function ADDR_REGISTER_3_FN (line 643) | RelocatableInst::UniquePtrVec ADDR_REGISTER_3_FN(const Patch &patch,
    function ADDR_REGISTER_4_FN (line 764) | RelocatableInst::UniquePtrVec ADDR_REGISTER_4_FN(const Patch &patch,
    function ADDR_REGISTER_5_FN (line 815) | RelocatableInst::UniquePtrVec ADDR_REGISTER_5_FN(const Patch &patch,
    function ADDR_REGISTER_IMM_FN (line 824) | RelocatableInst::UniquePtrVec ADDR_REGISTER_IMM_FN(const Patch &patch,
    function ADDR_REGISTER_IMM_2_FN (line 914) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_IMM_3_FN (line 953) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_IMM_LSL_FN (line 962) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_IMM_LSL_2_FN (line 1024) | RelocatableInst::UniquePtrVec
    function ADDR_PAC_REGISTER_IMM_LSL_FN (line 1033) | RelocatableInst::UniquePtrVec
    function ADDR_PAC_REGISTER_IMM_LSL_2_FN (line 1082) | RelocatableInst::UniquePtrVec
    function ADDR_PAC_REGISTER_IMM_LSL_3_FN (line 1101) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_IMM_LSL2_FN (line 1110) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_IMM_LSL2_3_FN (line 1171) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_IMM_LSL2_4_FN (line 1199) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_FIXIMM_LSL_FN (line 1208) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_MIN1_LSL_3_FN (line 1243) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_MIN1_LSL_4_FN (line 1260) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_EXT_FN (line 1268) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_EXT_2_FN (line 1405) | RelocatableInst::UniquePtrVec
    function ADDR_REGISTER_PC_FN (line 1414) | RelocatableInst::UniquePtrVec ADDR_REGISTER_PC_FN(const Patch &patch,
    function ADDR_REGISTER_PC_2_FN (line 1446) | RelocatableInst::UniquePtrVec
    type MemoryAccessInfoArray (line 1451) | struct MemoryAccessInfoArray {
      method addData (line 1455) | constexpr void addData(size_t index, const unsigned insts[],
      method MemoryAccessInfoArray (line 1463) | constexpr MemoryAccessInfoArray() {
    type AddressGenerator (line 1506) | struct AddressGenerator {
    function checkTable (line 1512) | int checkTable() {
    function generateAddressPatch (line 1601) | RelocatableInst::UniquePtrVec generateAddressPatch(const Patch &patch,
    type MemoryTag (line 1623) | enum MemoryTag : uint16_t {
    function getInstrRuleMemAccessRead (line 1913) | std::vector<std::unique_ptr<InstrRule>> getInstrRuleMemAccessRead() {
    function getInstrRuleMemAccessWrite (line 1927) | std::vector<std::unique_ptr<InstrRule>> getInstrRuleMemAccessWrite() {
    function analyseMemoryAccessAddrValue (line 1953) | void analyseMemoryAccessAddrValue(const ExecBlock &curExecBlock,
    function analyseMemoryAccess (line 2059) | void analyseMemoryAccess(const ExecBlock &curExecBlock, uint16_t instID,

FILE: src/Patch/AARCH64/MemoryAccess_AARCH64.h
  function namespace (line 25) | namespace QBDI {

FILE: src/Patch/AARCH64/PatchCondition_AARCH64.cpp
  type QBDI (line 24) | namespace QBDI {

FILE: src/Patch/AARCH64/PatchCondition_AARCH64.h
  function namespace (line 23) | namespace QBDI {

FILE: src/Patch/AARCH64/PatchGenerator_AARCH64.cpp
  type QBDI (line 39) | namespace QBDI {

FILE: src/Patch/AARCH64/PatchGenerator_AARCH64.h
  function namespace (line 30) | namespace QBDI {

FILE: src/Patch/AARCH64/PatchRuleAssembly_AARCH64.cpp
  type QBDI (line 33) | namespace QBDI {
    function getDefaultPatchRules (line 37) | std::vector<PatchRule> getDefaultPatchRules(Options opts) {

FILE: src/Patch/AARCH64/PatchRuleAssembly_AARCH64.h
  function namespace (line 25) | namespace QBDI {

FILE: src/Patch/AARCH64/Register_AARCH64.cpp
  type QBDI (line 30) | namespace QBDI {
    function getEncodedBaseReg (line 507) | constexpr int8_t getEncodedBaseReg(unsigned reg) {
    type RegisterInfoArray (line 594) | struct RegisterInfoArray {
      method setValue (line 603) | constexpr uint16_t setValue(uint8_t size, uint8_t packed) {
      method RegisterInfoArray (line 607) | constexpr RegisterInfoArray() {
      method getSize (line 652) | inline uint8_t getSize(RegLLVM reg_) const {
      method getPacked (line 661) | inline uint8_t getPacked(RegLLVM reg_) const {
      method RegLLVM (line 670) | inline RegLLVM getUpperReg(RegLLVM reg_) const {
      method getGPRPos (line 706) | inline size_t getGPRPos(RegLLVM reg_) const {
      method RegLLVM (line 720) | inline RegLLVM getUpperBasedRegister(RegLLVM reg) const {
    function getRegisterSize (line 733) | uint8_t getRegisterSize(RegLLVM reg) { return arrayInfo.getSize(reg); }
    function getRegisterBaseOffset (line 735) | uint8_t getRegisterBaseOffset(RegLLVM reg) { return 0; }
    function getRegisterPacked (line 737) | uint8_t getRegisterPacked(RegLLVM reg) { return arrayInfo.getPacked(re...
    function getRegisterSpaced (line 739) | uint8_t getRegisterSpaced(RegLLVM reg) { return 1; }
    function getGPRPosition (line 741) | size_t getGPRPosition(RegLLVM reg) { return arrayInfo.getGPRPos(reg); }
    function RegLLVM (line 743) | RegLLVM getUpperRegister(RegLLVM reg, size_t pos) {
    function RegLLVM (line 792) | RegLLVM getPackedRegister(RegLLVM reg, size_t pos) {
    function fixLLVMUsedGPR (line 855) | void fixLLVMUsedGPR(const llvm::MCInst &inst, const LLVMCPU &llvmcpu,

FILE: src/Patch/AARCH64/RelocatableInst_AARCH64.cpp
  type QBDI (line 25) | namespace QBDI {

FILE: src/Patch/AARCH64/RelocatableInst_AARCH64.h
  function namespace (line 32) | namespace QBDI {

FILE: src/Patch/AARCH64/TempManagerImpl_AARCH64.h
  function namespace (line 24) | namespace QBDI {

FILE: src/Patch/AARCH64/TempManager_AARCH64.cpp
  type QBDI (line 27) | namespace QBDI {

FILE: src/Patch/ARM/ExecBlockFlags_ARM.cpp
  type QBDI (line 21) | namespace QBDI {
    function getExecBlockFlags (line 25) | uint8_t getExecBlockFlags(const llvm::MCInst &inst,

FILE: src/Patch/ARM/ExecBlockFlags_ARM.h
  function namespace (line 23) | namespace QBDI {

FILE: src/Patch/ARM/ExecBlockPatch_ARM.cpp
  type QBDI (line 32) | namespace QBDI {
    function getExecBlockPrologue (line 34) | RelocatableInst::UniquePtrVec getExecBlockPrologue(const LLVMCPU &llvm...
    function getExecBlockEpilogue (line 97) | RelocatableInst::UniquePtrVec getExecBlockEpilogue(const LLVMCPU &llvm...
    function getTerminator (line 156) | RelocatableInst::UniquePtrVec getTerminator(const LLVMCPU &llvmcpu,
    function changeScratchRegister (line 181) | RelocatableInst::UniquePtrVec

FILE: src/Patch/ARM/ExecBlockPatch_ARM.h
  function namespace (line 27) | namespace QBDI {

FILE: src/Patch/ARM/InstInfo_ARM.cpp
  type QBDI (line 38) | namespace QBDI {
    function READ (line 1109) | constexpr uint32_t READ(uint32_t s) { return s & 0x3ff; }
    function WRITE (line 1110) | constexpr uint32_t WRITE(uint32_t s) { return (s & 0x3ff) << WRITE_POS...
    function GET_READ_SIZE (line 1118) | constexpr uint32_t GET_READ_SIZE(uint32_t v) { return v & 0x3ff; }
    function GET_WRITE_SIZE (line 1119) | constexpr uint32_t GET_WRITE_SIZE(uint32_t v) {
    function IS_READ_DYN (line 1122) | constexpr bool IS_READ_DYN(uint32_t v) {
    function IS_WRITE_DYN (line 1125) | constexpr bool IS_WRITE_DYN(uint32_t v) {
    function IS_UNSUPPORTED_READ (line 1128) | constexpr bool IS_UNSUPPORTED_READ(uint32_t v) {
    function IS_UNSUPPORTED_WRITE (line 1131) | constexpr bool IS_UNSUPPORTED_WRITE(uint32_t v) {
    function IS_TWO_BYTES_ENCODING (line 1134) | constexpr bool IS_TWO_BYTES_ENCODING(uint32_t v) {
    type MemAccessArray (line 1138) | struct MemAccessArray {
      method _initMemAccessRead (line 1141) | constexpr inline void _initMemAccessRead(const unsigned buff[],
      method _initMemAccessWrite (line 1152) | constexpr inline void _initMemAccessWrite(const unsigned buff[],
      method _initMemUnsupported (line 1163) | constexpr inline void _initMemUnsupported(const unsigned buff[],
      method _initTwoBytesEncode (line 1174) | constexpr inline void _initTwoBytesEncode(const unsigned buff[],
      method MemAccessArray (line 1181) | constexpr MemAccessArray() {
      method check_table (line 1215) | void check_table(const unsigned buff[], const size_t buffSize, uint3...
      method check (line 1229) | int check() const {
      method get (line 1266) | inline uint32_t get(size_t op) const {
    function getReadSize (line 1283) | unsigned getReadSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
    function getWriteSize (line 1323) | unsigned getWriteSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
    function getInstSize (line 1363) | unsigned getInstSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
    function getImmediateSize (line 1372) | unsigned getImmediateSize(const llvm::MCInst &inst, const LLVMCPU &llv...
    function unsupportedRead (line 1377) | bool unsupportedRead(const llvm::MCInst &inst) {
    function unsupportedWrite (line 1381) | bool unsupportedWrite(const llvm::MCInst &inst) {
    function getCondition (line 1385) | unsigned getCondition(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
    function variadicOpsIsWrite (line 1441) | bool variadicOpsIsWrite(const llvm::MCInst &inst) {
    function sword (line 1470) | sword getFixedOperandValue(const llvm::MCInst &inst, const LLVMCPU &ll...

FILE: src/Patch/ARM/InstInfo_ARM.h
  function namespace (line 21) | namespace llvm {
  function namespace (line 25) | namespace QBDI {

FILE: src/Patch/ARM/InstMetadata_ARM.h
  function namespace (line 21) | namespace QBDI {

FILE: src/Patch/ARM/InstrRules_ARM.cpp
  type QBDI (line 32) | namespace QBDI {
    function getBreakToHost (line 38) | RelocatableInst::UniquePtrVec getBreakToHost(Reg temp, const Patch &pa...

FILE: src/Patch/ARM/Layer2_ARM.cpp
  type QBDI (line 25) | namespace QBDI {
    function getCondReg (line 27) | static inline unsigned int getCondReg(unsigned cond) {
    function ldmstmCommon (line 35) | static inline void ldmstmCommon(llvm::MCInst &inst, RegLLVM base,
    function armExpandCompatible (line 66) | bool armExpandCompatible(rword imm) {
    function thumbExpandCompatible (line 70) | bool thumbExpandCompatible(rword imm) {
    function t2moviCompatible (line 74) | bool t2moviCompatible(rword imm) {
    function popr1 (line 92) | llvm::MCInst popr1(RegLLVM reg, unsigned cond) {
    function ldri12 (line 96) | llvm::MCInst ldri12(RegLLVM reg, RegLLVM base, sword offset) {
    function ldri12 (line 100) | llvm::MCInst ldri12(RegLLVM reg, RegLLVM base, sword offset, unsigned ...
    function ldrPost (line 115) | llvm::MCInst ldrPost(RegLLVM dst, RegLLVM src, sword offset) {
    function ldrPost (line 119) | llvm::MCInst ldrPost(RegLLVM dst, RegLLVM src, sword offset, unsigned ...
    function t2ldri8 (line 135) | llvm::MCInst t2ldri8(RegLLVM reg, RegLLVM base, sword offset) {
    function t2ldri8 (line 139) | llvm::MCInst t2ldri8(RegLLVM reg, RegLLVM base, sword offset, unsigned...
    function t2ldri12 (line 154) | llvm::MCInst t2ldri12(RegLLVM reg, RegLLVM base, sword offset) {
    function t2ldri12 (line 158) | llvm::MCInst t2ldri12(RegLLVM reg, RegLLVM base, sword offset, unsigne...
    function t2ldrPost (line 173) | llvm::MCInst t2ldrPost(RegLLVM reg, RegLLVM base, sword offset) {
    function t2ldrPost (line 177) | llvm::MCInst t2ldrPost(RegLLVM reg, RegLLVM base, sword offset, unsign...
    function t2ldrPre (line 193) | llvm::MCInst t2ldrPre(RegLLVM reg, RegLLVM base, sword offset) {
    function t2ldrPre (line 197) | llvm::MCInst t2ldrPre(RegLLVM reg, RegLLVM base, sword offset, unsigne...
    function ldrh (line 215) | llvm::MCInst ldrh(RegLLVM dst, RegLLVM src, unsigned int offset) {
    function ldrh (line 219) | llvm::MCInst ldrh(RegLLVM dst, RegLLVM src, unsigned int offset,
    function ldrhPost (line 233) | llvm::MCInst ldrhPost(RegLLVM dst, RegLLVM src) {
    function ldrhPost (line 237) | llvm::MCInst ldrhPost(RegLLVM dst, RegLLVM src, unsigned cond) {
    function t2ldrh (line 251) | llvm::MCInst t2ldrh(RegLLVM dst, RegLLVM src, unsigned int offset) {
    function t2ldrh (line 255) | llvm::MCInst t2ldrh(RegLLVM dst, RegLLVM src, unsigned int offset,
    function t2ldrhPost (line 268) | llvm::MCInst t2ldrhPost(RegLLVM dst, RegLLVM src) {
    function t2ldrhPost (line 272) | llvm::MCInst t2ldrhPost(RegLLVM dst, RegLLVM src, unsigned cond) {
    function t2ldrhr (line 285) | llvm::MCInst t2ldrhr(RegLLVM base, RegLLVM reg, RegLLVM offReg) {
    function t2ldrhr (line 289) | llvm::MCInst t2ldrhr(RegLLVM base, RegLLVM reg, RegLLVM offReg, unsign...
    function t2ldrhrs (line 293) | llvm::MCInst t2ldrhrs(RegLLVM base, RegLLVM reg, RegLLVM offReg, unsig...
    function t2ldrhrs (line 297) | llvm::MCInst t2ldrhrs(RegLLVM base, RegLLVM reg, RegLLVM offReg, unsig...
    function ldrb (line 314) | llvm::MCInst ldrb(RegLLVM dst, RegLLVM src, unsigned int offset) {
    function ldrb (line 318) | llvm::MCInst ldrb(RegLLVM dst, RegLLVM src, unsigned int offset,
    function ldrbPost (line 331) | llvm::MCInst ldrbPost(RegLLVM dst, RegLLVM src) {
    function ldrbPost (line 335) | llvm::MCInst ldrbPost(RegLLVM dst, RegLLVM src, unsigned cond) {
    function t2ldrb (line 349) | llvm::MCInst t2ldrb(RegLLVM dst, RegLLVM src, unsigned int offset) {
    function t2ldrb (line 353) | llvm::MCInst t2ldrb(RegLLVM dst, RegLLVM src, unsigned int offset,
    function t2ldrbPost (line 366) | llvm::MCInst t2ldrbPost(RegLLVM dst, RegLLVM src) {
    function t2ldrbPost (line 370) | llvm::MCInst t2ldrbPost(RegLLVM dst, RegLLVM src, unsigned cond) {
    function t2ldrbr (line 383) | llvm::MCInst t2ldrbr(RegLLVM base, RegLLVM reg, RegLLVM offReg) {
    function t2ldrbr (line 387) | llvm::MCInst t2ldrbr(RegLLVM base, RegLLVM reg, RegLLVM offReg, unsign...
    function t2ldrbrs (line 391) | llvm::MCInst t2ldrbrs(RegLLVM base, RegLLVM reg, RegLLVM offReg, unsig...
    function t2ldrbrs (line 395) | llvm::MCInst t2ldrbrs(RegLLVM base, RegLLVM reg, RegLLVM offReg, unsig...
    function ldrexb (line 412) | llvm::MCInst ldrexb(RegLLVM dest, RegLLVM reg) {
    function ldrexb (line 416) | llvm::MCInst ldrexb(RegLLVM dest, RegLLVM reg, unsigned cond) {
    function t2ldrexb (line 427) | llvm::MCInst t2ldrexb(RegLLVM dest, RegLLVM reg) {
    function t2ldrexb (line 431) | llvm::MCInst t2ldrexb(RegLLVM dest, RegLLVM reg, unsigned cond) {
    function ldrexh (line 442) | llvm::MCInst ldrexh(RegLLVM dest, RegLLVM reg) {
    function ldrexh (line 446) | llvm::MCInst ldrexh(RegLLVM dest, RegLLVM reg, unsigned cond) {
    function t2ldrexh (line 457) | llvm::MCInst t2ldrexh(RegLLVM dest, RegLLVM reg) {
    function t2ldrexh (line 461) | llvm::MCInst t2ldrexh(RegLLVM dest, RegLLVM reg, unsigned cond) {
    function ldrex (line 472) | llvm::MCInst ldrex(RegLLVM dest, RegLLVM reg) {
    function ldrex (line 476) | llvm::MCInst ldrex(RegLLVM dest, RegLLVM reg, unsigned cond) {
    function t2ldrex (line 487) | llvm::MCInst t2ldrex(RegLLVM dest, RegLLVM reg) {
    function t2ldrex (line 491) | llvm::MCInst t2ldrex(RegLLVM dest, RegLLVM reg, unsigned cond) {
    function ldrexd (line 503) | llvm::MCInst ldrexd(RegLLVM dest, RegLLVM dest2, RegLLVM reg) {
    function ldrexd (line 507) | llvm::MCInst ldrexd(RegLLVM dest, RegLLVM dest2, RegLLVM reg, unsigned...
    function t2ldrexd (line 545) | llvm::MCInst t2ldrexd(RegLLVM dest, RegLLVM dest2, RegLLVM reg) {
    function t2ldrexd (line 549) | llvm::MCInst t2ldrexd(RegLLVM dest, RegLLVM dest2, RegLLVM reg, unsign...
    function ldmia (line 563) | llvm::MCInst ldmia(RegLLVM base, unsigned int regMask, bool wback) {
    function ldmia (line 567) | llvm::MCInst ldmia(RegLLVM base, unsigned int regMask, bool wback,
    function t2ldmia (line 581) | llvm::MCInst t2ldmia(RegLLVM base, unsigned int regMask, bool wback) {
    function t2ldmia (line 585) | llvm::MCInst t2ldmia(RegLLVM base, unsigned int regMask, bool wback,
    function t2ldmdb (line 602) | llvm::MCInst t2ldmdb(RegLLVM base, unsigned int regMask, bool wback) {
    function t2ldmdb (line 606) | llvm::MCInst t2ldmdb(RegLLVM base, unsigned int regMask, bool wback,
    function vldmia (line 623) | llvm::MCInst vldmia(RegLLVM base, RegLLVM reg, unsigned int nreg, bool...
    function vldmia (line 627) | llvm::MCInst vldmia(RegLLVM base, RegLLVM reg, unsigned int nreg, bool...
    function pushr1 (line 654) | llvm::MCInst pushr1(RegLLVM reg, unsigned cond) {
    function stri12 (line 668) | llvm::MCInst stri12(RegLLVM reg, RegLLVM base, sword offset) {
    function stri12 (line 672) | llvm::MCInst stri12(RegLLVM reg, RegLLVM base, sword offset, unsigned ...
    function t2stri8 (line 689) | llvm::MCInst t2stri8(RegLLVM reg, RegLLVM base, sword offset) {
    function t2stri8 (line 693) | llvm::MCInst t2stri8(RegLLVM reg, RegLLVM base, sword offset, unsigned...
    function t2stri12 (line 714) | llvm::MCInst t2stri12(RegLLVM reg, RegLLVM base, sword offset) {
    function t2stri12 (line 718) | llvm::MCInst t2stri12(RegLLVM reg, RegLLVM base, sword offset, unsigne...
    function t2strPost (line 739) | llvm::MCInst t2strPost(RegLLVM reg, RegLLVM base, sword offset) {
    function t2strPost (line 743) | llvm::MCInst t2strPost(RegLLVM reg, RegLLVM base, sword offset, unsign...
    function t2strPre (line 761) | llvm::MCInst t2strPre(RegLLVM reg, RegLLVM base, sword offset) {
    function t2strPre (line 765) | llvm::MCInst t2strPre(RegLLVM reg, RegLLVM base, sword offset, unsigne...
    function stmia (line 785) | llvm::MCInst stmia(RegLLVM base, unsigned int regMask, bool wback) {
    function stmia (line 789) | llvm::MCInst stmia(RegLLVM base, unsigned int regMask, bool wback,
    function t2stmia (line 803) | llvm::MCInst t2stmia(RegLLVM base, unsigned int regMask, bool wback) {
    function t2stmia (line 807) | llvm::MCInst t2stmia(RegLLVM base, unsigned int regMask, bool wback,
    function t2stmdb (line 825) | llvm::MCInst t2stmdb(RegLLVM base, unsigned int regMask, bool wback) {
    function t2stmdb (line 829) | llvm::MCInst t2stmdb(RegLLVM base, unsigned int regMask, bool wback,
    function vstmia (line 846) | llvm::MCInst vstmia(RegLLVM base, RegLLVM reg, unsigned int nreg, bool...
    function vstmia (line 850) | llvm::MCInst vstmia(RegLLVM base, RegLLVM reg, unsigned int nreg, bool...
    function movr (line 877) | llvm::MCInst movr(RegLLVM dst, RegLLVM src) {
    function movr (line 881) | llvm::MCInst movr(RegLLVM dst, RegLLVM src, unsigned cond) {
    function tmovr (line 894) | llvm::MCInst tmovr(RegLLVM dst, RegLLVM src) {
    function tmovr (line 898) | llvm::MCInst tmovr(RegLLVM dst, RegLLVM src, unsigned cond) {
    function movi (line 912) | llvm::MCInst movi(RegLLVM dst, rword imm) {
    function movi (line 916) | llvm::MCInst movi(RegLLVM dst, rword imm, unsigned cond) {
    function t2movi (line 929) | llvm::MCInst t2movi(RegLLVM dst, rword imm) {
    function t2movi (line 933) | llvm::MCInst t2movi(RegLLVM dst, rword imm, unsigned cond) {
    function branch (line 950) | llvm::MCInst branch(sword offset) { return bcc(offset, llvm::ARMCC::AL...
    function bcc (line 952) | llvm::MCInst bcc(sword offset, unsigned cond) {
    function tbranch (line 967) | llvm::MCInst tbranch(sword offset) {
    function tbranchIT (line 971) | llvm::MCInst tbranchIT(sword offset, unsigned cond) {
    function tbcc (line 988) | llvm::MCInst tbcc(sword offset, unsigned cond) {
    function t2branch (line 1003) | llvm::MCInst t2branch(sword offset) {
    function t2branchIT (line 1007) | llvm::MCInst t2branchIT(sword offset, unsigned cond) {
    function t2bcc (line 1025) | llvm::MCInst t2bcc(sword offset, unsigned cond) {
    function tbx (line 1041) | llvm::MCInst tbx(RegLLVM reg) { return tbx(reg, llvm::ARMCC::AL); }
    function tbx (line 1043) | llvm::MCInst tbx(RegLLVM reg, unsigned cond) {
    function mrs (line 1056) | llvm::MCInst mrs(RegLLVM dst) { return mrs(dst, llvm::ARMCC::AL); }
    function mrs (line 1058) | llvm::MCInst mrs(RegLLVM dst, unsigned cond) {
    function msr (line 1069) | llvm::MCInst msr(RegLLVM dst) { return msr(dst, llvm::ARMCC::AL); }
    function msr (line 1071) | llvm::MCInst msr(RegLLVM dst, unsigned cond) {
    function t2mrs (line 1083) | llvm::MCInst t2mrs(RegLLVM dst) { return t2mrs(dst, llvm::ARMCC::AL); }
    function t2mrs (line 1085) | llvm::MCInst t2mrs(RegLLVM dst, unsigned cond) {
    function t2msr (line 1096) | llvm::MCInst t2msr(RegLLVM dst) { return t2msr(dst, llvm::ARMCC::AL); }
    function t2msr (line 1098) | llvm::MCInst t2msr(RegLLVM dst, unsigned cond) {
    function vmrs (line 1110) | llvm::MCInst vmrs(RegLLVM dst) { return vmrs(dst, llvm::ARMCC::AL); }
    function vmrs (line 1112) | llvm::MCInst vmrs(RegLLVM dst, unsigned cond) {
    function vmsr (line 1123) | llvm::MCInst vmsr(RegLLVM dst) { return vmsr(dst, llvm::ARMCC::AL); }
    function vmsr (line 1125) | llvm::MCInst vmsr(RegLLVM dst, unsigned cond) {
    function adr (line 1138) | llvm::MCInst adr(RegLLVM reg, rword offset) {
    function adr (line 1142) | llvm::MCInst adr(RegLLVM reg, rword offset, unsigned cond) {
    function t2adr (line 1155) | llvm::MCInst t2adr(RegLLVM reg, sword offset) {
    function t2adr (line 1159) | llvm::MCInst t2adr(RegLLVM reg, sword offset, unsigned cond) {
    function add (line 1174) | llvm::MCInst add(RegLLVM dst, RegLLVM src, rword imm) {
    function add (line 1178) | llvm::MCInst add(RegLLVM dst, RegLLVM src, rword imm, unsigned cond) {
    function t2add (line 1194) | llvm::MCInst t2add(RegLLVM dst, RegLLVM src, rword imm) {
    function t2add (line 1198) | llvm::MCInst t2add(RegLLVM dst, RegLLVM src, rword imm, unsigned cond) {
    function addrsi (line 1214) | llvm::MCInst addrsi(RegLLVM dst, RegLLVM src, RegLLVM srcOff, unsigned...
    function addrsi (line 1219) | llvm::MCInst addrsi(RegLLVM dst, RegLLVM src, RegLLVM srcOff, unsigned...
    function t2addrsi (line 1241) | llvm::MCInst t2addrsi(RegLLVM dst, RegLLVM src, RegLLVM srcOff, unsign...
    function t2addrsi (line 1246) | llvm::MCInst t2addrsi(RegLLVM dst, RegLLVM src, RegLLVM srcOff, unsign...
    function addr (line 1268) | llvm::MCInst addr(RegLLVM dst, RegLLVM src, RegLLVM src2) {
    function addr (line 1272) | llvm::MCInst addr(RegLLVM dst, RegLLVM src, RegLLVM src2, unsigned con...
    function t2addr (line 1285) | llvm::MCInst t2addr(RegLLVM dst, RegLLVM src, RegLLVM src2) {
    function t2addr (line 1289) | llvm::MCInst t2addr(RegLLVM dst, RegLLVM src, RegLLVM src2, unsigned c...
    function sub (line 1304) | llvm::MCInst sub(RegLLVM dst, RegLLVM src, rword imm) {
    function sub (line 1308) | llvm::MCInst sub(RegLLVM dst, RegLLVM src, rword imm, unsigned cond) {
    function t2sub (line 1324) | llvm::MCInst t2sub(RegLLVM dst, RegLLVM src, rword imm) {
    function t2sub (line 1328) | llvm::MCInst t2sub(RegLLVM dst, RegLLVM src, rword imm, unsigned cond) {
    function subrsi (line 1344) | llvm::MCInst subrsi(RegLLVM dst, RegLLVM src, RegLLVM srcOff, unsigned...
    function subrsi (line 1349) | llvm::MCInst subrsi(RegLLVM dst, RegLLVM src, RegLLVM srcOff, unsigned...
    function t2subrsi (line 1370) | llvm::MCInst t2subrsi(RegLLVM dst, RegLLVM src, RegLLVM srcOff, unsign...
    function t2subrsi (line 1375) | llvm::MCInst t2subrsi(RegLLVM dst, RegLLVM src, RegLLVM srcOff, unsign...
    function subr (line 1397) | llvm::MCInst subr(RegLLVM dst, RegLLVM src, RegLLVM src2) {
    function subr (line 1401) | llvm::MCInst subr(RegLLVM dst, RegLLVM src, RegLLVM src2, unsigned con...
    function t2subr (line 1414) | llvm::MCInst t2subr(RegLLVM dst, RegLLVM src, RegLLVM src2) {
    function t2subr (line 1418) | llvm::MCInst t2subr(RegLLVM dst, RegLLVM src, RegLLVM src2, unsigned c...
    function bic (line 1433) | llvm::MCInst bic(RegLLVM dst, RegLLVM src, rword imm) {
    function bic (line 1437) | llvm::MCInst bic(RegLLVM dst, RegLLVM src, rword imm, unsigned cond) {
    function t2bic (line 1452) | llvm::MCInst t2bic(RegLLVM dest, RegLLVM reg, rword imm) {
    function t2bic (line 1456) | llvm::MCInst t2bic(RegLLVM dest, RegLLVM reg, rword imm, unsigned cond) {
    function orri (line 1474) | llvm::MCInst orri(RegLLVM dest, RegLLVM reg, rword imm) {
    function orri (line 1478) | llvm::MCInst orri(RegLLVM dest, RegLLVM reg, rword imm, unsigned cond) {
    function t2orri (line 1494) | llvm::MCInst t2orri(RegLLVM dest, RegLLVM reg, rword imm) {
    function t2orri (line 1498) | llvm::MCInst t2orri(RegLLVM dest, RegLLVM reg, rword imm, unsigned con...
    function orrshift (line 1514) | llvm::MCInst orrshift(RegLLVM dest, RegLLVM reg, RegLLVM reg2,
    function orrshift (line 1519) | llvm::MCInst orrshift(RegLLVM dest, RegLLVM reg, RegLLVM reg2,
    function t2orrshift (line 1535) | llvm::MCInst t2orrshift(RegLLVM dest, RegLLVM reg, RegLLVM reg2,
    function t2orrshift (line 1540) | llvm::MCInst t2orrshift(RegLLVM dest, RegLLVM reg, RegLLVM reg2,
    function cmp (line 1558) | llvm::MCInst cmp(RegLLVM src, rword imm) {
    function cmp (line 1562) | llvm::MCInst cmp(RegLLVM src, rword imm, unsigned cond) {
    function t2cmp (line 1575) | llvm::MCInst t2cmp(RegLLVM reg, rword imm) {
    function t2cmp (line 1579) | llvm::MCInst t2cmp(RegLLVM reg, rword imm, unsigned cond) {
    function t2it (line 1595) | llvm::MCInst t2it(unsigned int cond, unsigned pred) {
    function nop (line 1605) | llvm::MCInst nop() {
    function bkpt (line 1616) | llvm::MCInst bkpt(unsigned int value) {
    function t2autg (line 1625) | llvm::MCInst t2autg(RegLLVM reg, RegLLVM ctx, RegLLVM tag) {
    function t2autg (line 1629) | llvm::MCInst t2autg(RegLLVM reg, RegLLVM ctx, RegLLVM tag, unsigned co...
    function Popr1 (line 1644) | RelocatableInst::UniquePtr Popr1(CPUMode cpuMode, Reg reg) {
    function Pushr1 (line 1650) | RelocatableInst::UniquePtr Pushr1(CPUMode cpuMode, Reg reg) {
    function Add (line 1656) | RelocatableInst::UniquePtr Add(CPUMode cpuMode, RegLLVM dst, RegLLVM src,
    function Addr (line 1673) | RelocatableInst::UniquePtr Addr(CPUMode cpuMode, RegLLVM dst, RegLLVM ...
    function Subr (line 1682) | RelocatableInst::UniquePtr Subr(CPUMode cpuMode, RegLLVM dst, RegLLVM ...
    function Addrs (line 1691) | RelocatableInst::UniquePtr Addrs(CPUMode cpuMode, RegLLVM dst, RegLLVM...
    function Subrs (line 1701) | RelocatableInst::UniquePtr Subrs(CPUMode cpuMode, RegLLVM dst, RegLLVM...
    function LdmIA (line 1711) | RelocatableInst::UniquePtr LdmIA(CPUMode cpuMode, RegLLVM base,
    function StmIA (line 1718) | RelocatableInst::UniquePtr StmIA(CPUMode cpuMode, RegLLVM base,
    function VLdmIA (line 1725) | RelocatableInst::UniquePtr VLdmIA(CPUMode cpuMode, RegLLVM base,
    function VStmIA (line 1733) | RelocatableInst::UniquePtr VStmIA(CPUMode cpuMode, RegLLVM base,
    function Mrs (line 1741) | RelocatableInst::UniquePtr Mrs(CPUMode cpuMode, Reg reg) {
    function Msr (line 1749) | RelocatableInst::UniquePtr Msr(CPUMode cpuMode, Reg reg) {
    function Vmrs (line 1757) | RelocatableInst::UniquePtr Vmrs(CPUMode cpuMode, Reg reg) {
    function Vmsr (line 1763) | RelocatableInst::UniquePtr Vmsr(CPUMode cpuMode, Reg reg) {
    function Bkpt (line 1769) | RelocatableInst::UniquePtr Bkpt(CPUMode cpuMode, unsigned int value) {
    function T2it (line 1775) | RelocatableInst::UniquePtr T2it(CPUMode cpuMode, unsigned int cond,
    function Addc (line 1782) | RelocatableInst::UniquePtrVec Addc(CPUMode cpuMode, RegLLVM dst, RegLL...
    function Addc (line 1787) | RelocatableInst::UniquePtrVec Addc(CPUMode cpuMode, RegLLVM dst, RegLL...
    function Cmp (line 1861) | RelocatableInst::UniquePtr Cmp(CPUMode cpuMode, RegLLVM src, rword imm) {
    function Branch (line 1869) | RelocatableInst::UniquePtr Branch(CPUMode cpuMode, sword offset,
    function BranchCC (line 1874) | RelocatableInst::UniquePtr BranchCC(CPUMode cpuMode, sword offset,

FILE: src/Patch/ARM/Layer2_ARM.h
  function namespace (line 24) | namespace QBDI {

FILE: src/Patch/ARM/MemoryAccess_ARM.cpp
  type QBDI (line 46) | namespace QBDI {
    function ADDR_REG_FN (line 60) | RelocatableInst::UniquePtrVec ADDR_REG_FN(const Patch &patch, Reg dest,
    function ADDR_REG_1_FN (line 165) | RelocatableInst::UniquePtrVec ADDR_REG_1_FN(const Patch &patch, Reg dest,
    function ADDR_REG_2_FN (line 338) | RelocatableInst::UniquePtrVec ADDR_REG_2_FN(const Patch &patch, Reg dest,
    function ADDR_REG_3_FN (line 481) | RelocatableInst::UniquePtrVec ADDR_REG_3_FN(const Patch &patch, Reg dest,
    function ADDR_REG_4_FN (line 522) | RelocatableInst::UniquePtrVec ADDR_REG_4_FN(const Patch &patch, Reg dest,
    function ADDR_REG_5_FN (line 569) | RelocatableInst::UniquePtrVec ADDR_REG_5_FN(const Patch &patch, Reg dest,
    function ADDR_REG_6_FN (line 599) | RelocatableInst::UniquePtrVec ADDR_REG_6_FN(const Patch &patch, Reg dest,
    function ADDR_REG_PLUS_FN (line 608) | RelocatableInst::UniquePtrVec ADDR_REG_PLUS_FN(const Patch &patch, Reg...
    function ADDR_REG_1_PLUS4_FN (line 637) | RelocatableInst::UniquePtrVec ADDR_REG_1_PLUS4_FN(const Patch &patch, ...
    function ADDR_REG_1_DYN_FN (line 663) | RelocatableInst::UniquePtrVec ADDR_REG_1_DYN_FN(const Patch &patch, Re...
    function ADDR_REG_1_DYN_PLUS4_FN (line 688) | RelocatableInst::UniquePtrVec
    function ADDR_REG_SIMM_FN (line 706) | RelocatableInst::UniquePtrVec ADDR_REG_SIMM_FN(const Patch &patch, Reg...
    function ADDR_REG_1_SIMM_2_FN (line 762) | RelocatableInst::UniquePtrVec ADDR_REG_1_SIMM_2_FN(const Patch &patch,...
    function ADDR_REG_2_SIMM_3_FN (line 818) | RelocatableInst::UniquePtrVec ADDR_REG_2_SIMM_3_FN(const Patch &patch,...
    function ADDR_REG_3_SIMM_4_FN (line 847) | RelocatableInst::UniquePtrVec ADDR_REG_3_SIMM_4_FN(const Patch &patch,...
    function ADDR_REG_4_SIMM_5_FN (line 864) | RelocatableInst::UniquePtrVec ADDR_REG_4_SIMM_5_FN(const Patch &patch,...
    function ADDR_REG_REG_FN (line 873) | RelocatableInst::UniquePtrVec ADDR_REG_REG_FN(const Patch &patch, Reg ...
    function ADDR_REG_1_REG_2_FN (line 925) | RelocatableInst::UniquePtrVec ADDR_REG_1_REG_2_FN(const Patch &patch, ...
    function ADDR_REG_2_REG_3_FN (line 947) | RelocatableInst::UniquePtrVec ADDR_REG_2_REG_3_FN(const Patch &patch, ...
    function ADDR_REG_1_REGSHIFT1_2_FN (line 965) | RelocatableInst::UniquePtrVec
    function ADDR_REG_REGLSL_FN (line 1009) | RelocatableInst::UniquePtrVec ADDR_REG_REGLSL_FN(const Patch &patch, R...
    function ADDR_REG_2_REGLSL_3_FN (line 1079) | RelocatableInst::UniquePtrVec
    function ADDR_REG_REGSHIFT_FN (line 1088) | RelocatableInst::UniquePtrVec ADDR_REG_REGSHIFT_FN(const Patch &patch,...
    function ADDR_REG_2_REGSHIFT_3_FN (line 1167) | RelocatableInst::UniquePtrVec
    function ADDR_REG_3_REGSHIFT_4_FN (line 1185) | RelocatableInst::UniquePtrVec
    function ADDR_REG_IMMORREG_FN (line 1193) | RelocatableInst::UniquePtrVec ADDR_REG_IMMORREG_FN(const Patch &patch,...
    function ADDR_REG_IMMORREG_2_FN (line 1267) | RelocatableInst::UniquePtrVec
    function ADDR_REG_IMMORREG_3_FN (line 1287) | RelocatableInst::UniquePtrVec
    function ADDR_REG_IMMORREG_4_FN (line 1303) | RelocatableInst::UniquePtrVec
    function ADDR_REG_IMMSHIFT_FN (line 1312) | RelocatableInst::UniquePtrVec ADDR_REG_IMMSHIFT_FN(const Patch &patch,...
    function ADDR_REG_IMMSHIFT_2_SHIFT1_FN (line 1368) | RelocatableInst::UniquePtrVec
    function ADDR_REG_IMMSHIFT_2_SHIFT2_FN (line 1393) | RelocatableInst::UniquePtrVec
    function ADDR_REG_IMMSHIFT_3_SHIFT2_FN (line 1409) | RelocatableInst::UniquePtrVec
    function ADDR_REG_IMPLICIT_OFF_FN (line 1418) | RelocatableInst::UniquePtrVec
    function ADDR_REG_SP_FN (line 1439) | RelocatableInst::UniquePtrVec ADDR_REG_SP_FN(const Patch &patch, Reg d...
    function ADDR_REG_SP_DYN_FN (line 1454) | RelocatableInst::UniquePtrVec ADDR_REG_SP_DYN_FN(const Patch &patch, R...
    function ADDR_REG_IMPLICIT_PC_OFF_FN (line 1472) | RelocatableInst::UniquePtrVec ADDR_REG_IMPLICIT_PC_OFF_FN(const Patch ...
    function ADDR_REG_ALIGNPC_OFF_2_FN (line 1515) | RelocatableInst::UniquePtrVec
    type MemoryAccessInfoArray (line 1520) | struct MemoryAccessInfoArray {
      method addData (line 1524) | constexpr void addData(size_t index, const unsigned insts[],
      method MemoryAccessInfoArray (line 1532) | constexpr MemoryAccessInfoArray() {
    type AddressGenerator (line 1593) | struct AddressGenerator {
    function checkTable (line 1599) | int checkTable() {
    function generateAddressPatch (line 1704) | RelocatableInst::UniquePtrVec generateAddressPatch(const Patch &patch,
    type MemoryTag (line 1725) | enum MemoryTag : uint16_t {
    function getInstrRuleMemAccessRead (line 2542) | std::vector<std::unique_ptr<InstrRule>> getInstrRuleMemAccessRead() {
    function getInstrRuleMemAccessWrite (line 2548) | std::vector<std::unique_ptr<InstrRule>> getInstrRuleMemAccessWrite() {
    function analyseMemoryAccessAddrValue (line 2563) | void analyseMemoryAccessAddrValue(const ExecBlock &curExecBlock,
    function analyseMemoryAccess (line 2675) | void analyseMemoryAccess(const ExecBlock &curExecBlock, uint16_t instID,

FILE: src/Patch/ARM/MemoryAccess_ARM.h
  function namespace (line 26) | namespace QBDI {

FILE: src/Patch/ARM/PatchCondition_ARM.cpp
  type QBDI (line 28) | namespace QBDI {

FILE: src/Patch/ARM/PatchCondition_ARM.h
  function namespace (line 23) | namespace QBDI {

FILE: src/Patch/ARM/PatchGenerator_ARM.cpp
  type QBDI (line 41) | namespace QBDI {
    function gent2LDMsubPatch (line 1791) | static void gent2LDMsubPatch(RelocatableInst::UniquePtrVec &vec,

FILE: src/Patch/ARM/PatchGenerator_ARM.h
  function namespace (line 31) | namespace QBDI {

FILE: src/Patch/ARM/PatchRuleAssembly_ARM.cpp
  type QBDI (line 35) | namespace QBDI {
    function getARMPatchRules (line 39) | std::vector<PatchRule> getARMPatchRules(Options opts) {
    function getThumbPatchRules (line 659) | std::vector<PatchRule> getThumbPatchRules(Options opts) {

FILE: src/Patch/ARM/PatchRuleAssembly_ARM.h
  function namespace (line 24) | namespace QBDI {

FILE: src/Patch/ARM/Register_ARM.cpp
  type QBDI (line 29) | namespace QBDI {
    function getEncodedBaseReg (line 345) | constexpr int8_t getEncodedBaseReg(unsigned reg) {
    type RegisterInfoArray (line 402) | struct RegisterInfoArray {
      method setValue (line 416) | constexpr uint16_t setValue(uint8_t size, uint8_t packed, uint8_t sp...
      method RegisterInfoArray (line 420) | constexpr RegisterInfoArray() {
      method getSize (line 465) | inline uint8_t getSize(RegLLVM reg_) const {
      method getPacked (line 474) | inline uint8_t getPacked(RegLLVM reg_) const {
      method getSpaced (line 483) | inline uint8_t getSpaced(RegLLVM reg_) const {
      method RegLLVM (line 492) | inline RegLLVM getUpperReg(RegLLVM reg_) const {
      method getGPRPos (line 528) | inline size_t getGPRPos(RegLLVM reg_) const {
      method RegLLVM (line 542) | inline RegLLVM getUpperBasedRegister(RegLLVM reg) const {
    function getRegisterSize (line 555) | uint8_t getRegisterSize(RegLLVM reg) { return arrayInfo.getSize(reg); }
    function getRegisterBaseOffset (line 557) | uint8_t getRegisterBaseOffset(RegLLVM reg) { return 0; }
    function getRegisterPacked (line 559) | uint8_t getRegisterPacked(RegLLVM reg) { return arrayInfo.getPacked(re...
    function getRegisterSpaced (line 561) | uint8_t getRegisterSpaced(RegLLVM reg) { return arrayInfo.getSpaced(re...
    function getGPRPosition (line 563) | size_t getGPRPosition(RegLLVM reg) { return arrayInfo.getGPRPos(reg); }
    function RegLLVM (line 565) | RegLLVM getUpperRegister(RegLLVM reg, size_t pos) {
    function RegLLVM (line 576) | RegLLVM getPackedRegister(RegLLVM reg, size_t pos) {
    function fixLLVMUsedGPR (line 608) | void fixLLVMUsedGPR(const llvm::MCInst &inst, const LLVMCPU &llvmcpu,

FILE: src/Patch/ARM/RelocatableInst_ARM.cpp
  type QBDI (line 28) | namespace QBDI {

FILE: src/Patch/ARM/RelocatableInst_ARM.h
  function namespace (line 32) | namespace QBDI {

FILE: src/Patch/ARM/TempManagerImpl_ARM.h
  function namespace (line 24) | namespace QBDI {

FILE: src/Patch/ARM/TempManager_ARM.cpp
  type QBDI (line 27) | namespace QBDI {
    function allocateConsecutiveTempRegister (line 53) | void allocateConsecutiveTempRegister(TempManager &temp_manager, Temp t...

FILE: src/Patch/ARM/TempManager_ARM.h
  function namespace (line 24) | namespace QBDI {

FILE: src/Patch/ExecBlockFlags.h
  function namespace (line 34) | namespace llvm {
  function namespace (line 38) | namespace QBDI {

FILE: src/Patch/ExecBlockPatch.h
  function namespace (line 26) | namespace QBDI {

FILE: src/Patch/InstInfo.h
  function namespace (line 24) | namespace llvm {
  function namespace (line 28) | namespace QBDI {

FILE: src/Patch/InstMetadata.h
  function namespace (line 35) | namespace QBDI {

FILE: src/Patch/InstTransform.cpp
  type QBDI (line 29) | namespace QBDI {

FILE: src/Patch/InstTransform.h
  function namespace (line 30) | namespace llvm {
  function class (line 37) | class InstTransform {

FILE: src/Patch/InstrRule.cpp
  type QBDI (line 35) | namespace QBDI {

FILE: src/Patch/InstrRule.h
  function namespace (line 33) | namespace QBDI {

FILE: src/Patch/InstrRules.cpp
  type QBDI (line 25) | namespace QBDI {
    function getCallbackGenerator (line 36) | PatchGenerator::UniquePtrVec getCallbackGenerator(InstCallback cbk,

FILE: src/Patch/InstrRules.h
  function namespace (line 28) | namespace QBDI {

FILE: src/Patch/MemoryAccess.h
  function namespace (line 25) | namespace QBDI {

FILE: src/Patch/Patch.cpp
  type QBDI (line 33) | namespace QBDI {

FILE: src/Patch/Patch.h
  function namespace (line 34) | namespace llvm {
  function namespace (line 38) | namespace QBDI {

FILE: src/Patch/PatchCondition.cpp
  type QBDI (line 27) | namespace QBDI {

FILE: src/Patch/PatchCondition.h
  function namespace (line 35) | namespace QBDI {
  function test (line 116) | bool test(const Patch &patch, const LLVMCPU &llvmcpu) const override {
  function override (line 121) | const override {
  function test (line 141) | bool test(const Patch &patch, const LLVMCPU &llvmcpu) const override {
  function override (line 145) | const override {
  function test (line 164) | bool test(const Patch &patch, const LLVMCPU &llvmcpu) const override {
  function override (line 171) | const override {
  function test (line 197) | bool test(const Patch &patch, const LLVMCPU &llvmcpu) const override {
  function override (line 204) | const override {
  function std (line 212) | inline std::unique_ptr<PatchCondition> clone() const override {

FILE: src/Patch/PatchGenerator.cpp
  type QBDI (line 34) | namespace QBDI {

FILE: src/Patch/PatchGenerator.h
  function namespace (line 31) | namespace llvm {
  function namespace (line 35) | namespace QBDI {
  function getPreFlags (line 107) | inline uint32_t getPreFlags() const override {
  function getPreFlags (line 129) | inline uint32_t getPreFlags() const override { return flags; }

FILE: src/Patch/PatchRule.cpp
  type QBDI (line 31) | namespace QBDI {

FILE: src/Patch/PatchRule.h
  function namespace (line 27) | namespace llvm {
  function namespace (line 31) | namespace QBDI {

FILE: src/Patch/PatchRuleAssemblyBase.h
  function namespace (line 27) | namespace llvm {
  function namespace (line 31) | namespace QBDI {

FILE: src/Patch/PatchUtils.h
  function namespace (line 27) | namespace QBDI {
  function _conv_unique (line 55) | void _conv_unique(std::vector<std::unique_ptr<T>> &vec,
  function _conv_unique (line 61) | void _conv_unique(std::vector<std::unique_ptr<T>> &vec,
  function append (line 88) | void append(std::vector<std::unique_ptr<T>> &u,
  function prepend (line 94) | void prepend(std::vector<std::unique_ptr<T>> &u,

FILE: src/Patch/Register.cpp
  type QBDI (line 39) | namespace QBDI {
    function addRegisterInfo (line 41) | static void addRegisterInfo(std::array<RegisterUsage, NUM_GPR> &regArr,
    function getUsedGPR (line 62) | void getUsedGPR(const llvm::MCInst &inst, const LLVMCPU &llvmcpu,

FILE: src/Patch/Register.h
  function namespace (line 29) | namespace llvm {
  function namespace (line 33) | namespace QBDI {

FILE: src/Patch/RelocatableInst.h
  function namespace (line 31) | namespace QBDI {

FILE: src/Patch/TempManager.cpp
  type QBDI (line 52) | namespace QBDI {
    function Reg (line 86) | Reg TempManager::getRegForTemp(unsigned int id) {
    function RegLLVM (line 151) | RegLLVM TempManager::getSizedSubReg(RegLLVM reg, unsigned size) const {

FILE: src/Patch/TempManager.h
  function namespace (line 29) | namespace llvm {
  function namespace (line 34) | namespace QBDI {

FILE: src/Patch/Types.h
  function namespace (line 28) | namespace QBDI {
  function RegLLVM (line 74) | struct Reg {
  function operator (line 113) | inline bool operator==(const RegLLVM &o) const { return o == *this; }
  function operator (line 115) | inline bool operator!=(const RegLLVM &o) const { return o != *this; }
  function operator (line 124) | inline bool operator<(const Reg &o) const { return id < o.id; }
  type Shadow (line 129) | struct Shadow {
  type ShadowReservedTag (line 148) | enum ShadowReservedTag : uint16_t {
  function rword (line 160) | struct Constant {
  type RelocatableInstTag (line 252) | enum RelocatableInstTag {

FILE: src/Patch/X86_64/ExecBlockFlags_X86_64.cpp
  type QBDI (line 33) | namespace QBDI {
    type ExecBlockFlagsArray (line 36) | struct ExecBlockFlagsArray {
      method ExecBlockFlagsArray (line 39) | constexpr ExecBlockFlagsArray() : arr() {
      method get (line 56) | inline uint8_t get(RegLLVM reg_) const {
    function getExecBlockFlags (line 72) | uint8_t getExecBlockFlags(const llvm::MCInst &inst,

FILE: src/Patch/X86_64/ExecBlockPatch_X86_64.cpp
  type QBDI (line 39) | namespace QBDI {
    function getExecBlockPrologue (line 41) | RelocatableInst::UniquePtrVec getExecBlockPrologue(const LLVMCPU &llvm...
    function getExecBlockEpilogue (line 161) | RelocatableInst::UniquePtrVec getExecBlockEpilogue(const LLVMCPU &llvm...
    function getTerminator (line 283) | RelocatableInst::UniquePtrVec getTerminator(const LLVMCPU &llvmcpu,

FILE: src/Patch/X86_64/InstInfo_X86_64.cpp
  function READ (line 4152) | constexpr uint32_t READ(uint32_t s) { return s & 0xfff; }
  function WRITE (line 4153) | constexpr uint32_t WRITE(uint32_t s) { return (s & 0xfff) << WRITE_POSIT...
  function STACK_READ (line 4154) | constexpr uint32_t STACK_READ(uint32_t s) {
  function STACK_WRITE (line 4157) | constexpr uint32_t STACK_WRITE(uint32_t s) {
  function GET_READ_SIZE (line 4160) | constexpr uint32_t GET_READ_SIZE(uint32_t v) { return v & 0xfff; }
  function GET_WRITE_SIZE (line 4161) | constexpr uint32_t GET_WRITE_SIZE(uint32_t v) {
  function IS_STACK_READ (line 4164) | constexpr uint32_t IS_STACK_READ(uint32_t v) {
  function IS_STACK_WRITE (line 4167) | constexpr uint32_t IS_STACK_WRITE(uint32_t v) {
  function IS_MIN_SIZE_READ (line 4170) | constexpr uint32_t IS_MIN_SIZE_READ(uint32_t v) {
  function IS_MIN_SIZE_WRITE (line 4173) | constexpr uint32_t IS_MIN_SIZE_WRITE(uint32_t v) {
  type MemAccessArray (line 4177) | struct MemAccessArray {
    method _initMemAccessRead (line 4180) | constexpr inline void _initMemAccessRead(const unsigned buff[],
    method _initMemAccessWrite (line 4187) | constexpr inline void _initMemAccessWrite(const unsigned buff[],
    method _initMemAccessStackRead (line 4194) | constexpr inline void _initMemAccessStackRead(const unsigned buff[],
    method _initMemAccessStackWrite (line 4202) | constexpr inline void _initMemAccessStackWrite(const unsigned buff[],
    method MemAccessArray (line 4210) | constexpr MemAccessArray() {
    method check_table (line 4261) | void check_table(const unsigned buff[], size_t buff_size, uint32_t value,
    method check (line 4274) | int check() const {
    method get (line 4333) | inline uint32_t get(size_t op) const {
  function getReadSize (line 4351) | unsigned getReadSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
  function getWriteSize (line 4355) | unsigned getWriteSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {
  function isStackRead (line 4359) | bool isStackRead(const llvm::MCInst &inst) {
  function isStackWrite (line 4363) | bool isStackWrite(const llvm::MCInst &inst) {
  function isMinSizeRead (line 4367) | bool isMinSizeRead(const llvm::MCInst &inst) {
  function isMinSizeWrite (line 4371) | bool isMinSizeWrite(const llvm::MCInst &inst) {
  function sword (line 4375) | sword getFixedOperandValue(const llvm::MCInst &inst, const LLVMCPU &llvm...
  function getImmediateSize (line 4380) | unsigned getImmediateSize(const llvm::MCInst &inst, const LLVMCPU &llvmc...
  function isDoubleRead (line 4385) | bool isDoubleRead(const llvm::MCInst &inst) {
  function mayChangeWriteAddr (line 4397) | bool mayChangeWriteAddr(const llvm::MCInst &inst,
  function hasREPPrefix (line 4432) | bool hasREPPrefix(const llvm::MCInst &instr) {
  function implicitDSIAccess (line 4438) | bool implicitDSIAccess(const llvm::MCInst &inst,
  function unsupportedRead (line 4463) | bool unsupportedRead(const llvm::MCInst &inst) {
  function unsupportedWrite (line 4492) | bool unsupportedWrite(const llvm::MCInst &inst) {
  function variadicOpsIsWrite (line 4502) | bool variadicOpsIsWrite(const llvm::MCInst &inst) { return false; }
  function getInstSize (line 4504) | unsigned getInstSize(const llvm::MCInst &inst, const LLVMCPU &llvmcpu) {

FILE: src/Patch/X86_64/InstInfo_X86_64.h
  function namespace (line 21) | namespace llvm {
  function namespace (line 26) | namespace QBDI {

FILE: src/Patch/X86_64/InstMetadata_X86_64.h
  function namespace (line 21) | namespace QBDI {

FILE: src/Patch/X86_64/InstrRules_X86_64.cpp
  type QBDI (line 33) | namespace QBDI {
    class Patch (line 34) | class Patch
    function getBreakToHost (line 40) | RelocatableInst::UniquePtrVec getBreakToHost(Reg temp, const Patch &pa...

FILE: src/Patch/X86_64/Layer2_X86_64.cpp
  type QBDI (line 30) | namespace QBDI {
    function mov32rr (line 32) | llvm::MCInst mov32rr(RegLLVM dst, RegLLVM src) {
    function mov32ri (line 42) | llvm::MCInst mov32ri(RegLLVM reg, rword imm) {
    function mov32mr (line 52) | llvm::MCInst mov32mr(RegLLVM base, rword scale, RegLLVM offset,
    function mov32rm8 (line 67) | llvm::MCInst mov32rm8(RegLLVM dst, RegLLVM base, rword scale, RegLLVM ...
    function mov32rm16 (line 82) | llvm::MCInst mov32rm16(RegLLVM dst, RegLLVM base, rword scale, RegLLVM...
    function mov32rm (line 97) | llvm::MCInst mov32rm(RegLLVM dst, RegLLVM base, rword scale, RegLLVM o...
    function movzx32rr8 (line 112) | llvm::MCInst movzx32rr8(RegLLVM dst, RegLLVM src) {
    function mov64rr (line 123) | llvm::MCInst mov64rr(RegLLVM dst, RegLLVM src) {
    function mov64ri (line 133) | llvm::MCInst mov64ri(RegLLVM reg, rword imm) {
    function mov64ri32 (line 143) | llvm::MCInst mov64ri32(RegLLVM reg, rword imm) {
    function mov64mr (line 153) | llvm::MCInst mov64mr(RegLLVM base, rword scale, RegLLVM offset,
    function mov64rm (line 168) | llvm::MCInst mov64rm(RegLLVM dst, RegLLVM base, rword scale, RegLLVM o...
    function movzx64rr8 (line 183) | llvm::MCInst movzx64rr8(RegLLVM dst, RegLLVM src) {
    function test32ri (line 194) | llvm::MCInst test32ri(RegLLVM base, uint32_t imm) {
    function test64ri32 (line 204) | llvm::MCInst test64ri32(RegLLVM base, uint32_t imm) {
    function jmp32m (line 214) | llvm::MCInst jmp32m(RegLLVM base, rword offset) {
    function jmp64m (line 227) | llvm::MCInst jmp64m(RegLLVM base, rword offset) {
    function je (line 240) | llvm::MCInst je(int32_t offset) {
    function jne (line 250) | llvm::MCInst jne(int32_t offset) {
    function jmp (line 260) | llvm::MCInst jmp(rword offset) {
    function fxsave (line 269) | llvm::MCInst fxsave(RegLLVM base, rword offset) {
    function fxrstor (line 282) | llvm::MCInst fxrstor(RegLLVM base, rword offset) {
    function vextractf128 (line 295) | llvm::MCInst vextractf128(RegLLVM base, rword offset, RegLLVM src,
    function vinsertf128 (line 311) | llvm::MCInst vinsertf128(RegLLVM dst, RegLLVM base, rword offset,
    function push32r (line 328) | llvm::MCInst push32r(RegLLVM reg) {
    function push64r (line 337) | llvm::MCInst push64r(RegLLVM reg) {
    function pop32r (line 346) | llvm::MCInst pop32r(RegLLVM reg) {
    function pop64r (line 355) | llvm::MCInst pop64r(RegLLVM reg) {
    function addr32i (line 364) | llvm::MCInst addr32i(RegLLVM dst, RegLLVM src, rword imm) {
    function addr64i (line 370) | llvm::MCInst addr64i(RegLLVM dst, RegLLVM src, rword imm) {
    function lea32 (line 376) | llvm::MCInst lea32(RegLLVM dst, RegLLVM base, rword scale, RegLLVM off...
    function lea64 (line 391) | llvm::MCInst lea64(RegLLVM dst, RegLLVM base, rword scale, RegLLVM off...
    function popf32 (line 406) | llvm::MCInst popf32() {
    function popf64 (line 414) | llvm::MCInst popf64() {
    function pushf32 (line 422) | llvm::MCInst pushf32() {
    function pushf64 (line 430) | llvm::MCInst pushf64() {
    function ret (line 438) | llvm::MCInst ret() {
    function rdfsbase64 (line 446) | llvm::MCInst rdfsbase64(RegLLVM reg) {
    function rdgsbase64 (line 455) | llvm::MCInst rdgsbase64(RegLLVM reg) {
    function wrfsbase64 (line 464) | llvm::MCInst wrfsbase64(RegLLVM reg) {
    function wrgsbase64 (line 473) | llvm::MCInst wrgsbase64(RegLLVM reg) {
    function nop (line 482) | llvm::MCInst nop() {
    function xor32rr (line 490) | llvm::MCInst xor32rr(RegLLVM dst, RegLLVM src) {
    function xor64rr (line 501) | llvm::MCInst xor64rr(RegLLVM dst, RegLLVM src) {
    function isr8_15Reg (line 514) | [[maybe_unused]] static bool isr8_15Reg(RegLLVM r) {
    function lenInstLEAtype (line 530) | static unsigned lenInstLEAtype(RegLLVM base, RegLLVM scale, Constant cst,
    function DataBlockRelx86 (line 561) | static inline RelocatableInst::UniquePtr
    function JmpM (line 578) | RelocatableInst::UniquePtr JmpM(Offset offset) {
    function Fxsave (line 585) | RelocatableInst::UniquePtr Fxsave(Offset offset) {
    function Fxrstor (line 589) | RelocatableInst::UniquePtr Fxrstor(Offset offset) {
    function Vextractf128 (line 593) | RelocatableInst::UniquePtr Vextractf128(Offset offset, RegLLVM src,
    function Vinsertf128 (line 598) | RelocatableInst::UniquePtr Vinsertf128(RegLLVM dst, Offset offset,
    function Pushr (line 603) | RelocatableInst::UniquePtr Pushr(Reg reg) {
    function Popr (line 610) | RelocatableInst::UniquePtr Popr(Reg reg) {
    function Add (line 617) | RelocatableInst::UniquePtr Add(Reg dest, Reg src, Constant cst) {
    function Pushf (line 626) | RelocatableInst::UniquePtr Pushf() {
    function Popf (line 633) | RelocatableInst::UniquePtr Popf() {
    function Ret (line 640) | RelocatableInst::UniquePtr Ret() { return NoRelocSized::unique(ret(), ...
    function Test (line 642) | RelocatableInst::UniquePtr Test(Reg reg, uint32_t value) {
    function Je (line 649) | RelocatableInst::UniquePtr Je(int32_t offset) {
    function Jne (line 653) | RelocatableInst::UniquePtr Jne(int32_t offset) {
    function Rdfsbase (line 657) | RelocatableInst::UniquePtr Rdfsbase(Reg reg) {
    function Rdgsbase (line 661) | RelocatableInst::UniquePtr Rdgsbase(Reg reg) {
    function Wrfsbase (line 665) | RelocatableInst::UniquePtr Wrfsbase(Reg reg) {
    function Wrgsbase (line 669) | RelocatableInst::UniquePtr Wrgsbase(Reg reg) {
    function Xorrr (line 673) | RelocatableInst::UniquePtr Xorrr(RegLLVM dst, RegLLVM src) {
    function Lea (line 680) | RelocatableInst::UniquePtr Lea(RegLLVM dst, RegLLVM base, rword scale,
    function MovzxrAL (line 694) | RelocatableInst::UniquePtr MovzxrAL(Reg dst) {
    function Mov64rm (line 701) | RelocatableInst::UniquePtr Mov64rm(RegLLVM dst, RegLLVM addr, RegLLVM ...
    function Mov32rm (line 706) | RelocatableInst::UniquePtr Mov32rm(RegLLVM dst, RegLLVM addr, RegLLVM ...
    function Mov32rm16 (line 723) | RelocatableInst::UniquePtr Mov32rm16(RegLLVM dst, RegLLVM addr, RegLLV...
    function Mov32rm8 (line 740) | RelocatableInst::UniquePtr Mov32rm8(RegLLVM dst, RegLLVM addr, RegLLVM...

FILE: src/Patch/X86_64/Layer2_X86_64.h
  function namespace (line 29) | namespace QBDI {

FILE: src/Patch/X86_64/MemoryAccess_X86_64.cpp
  type llvm (line 48) | namespace llvm {
    class MCInstrDesc (line 49) | class MCInstrDesc
  type QBDI (line 52) | namespace QBDI {
    type MemoryTag (line 54) | enum MemoryTag : uint16_t {
    function analyseMemoryAccessAddrValue (line 70) | void analyseMemoryAccessAddrValue(const ExecBlock &curExecBlock,
    function analyseMemoryAccessAddrRange (line 133) | void analyseMemoryAccessAddrRange(const ExecBlock &curExecBlock,
    function analyseMemoryAccess (line 212) | void analyseMemoryAccess(const ExecBlock &curExecBlock, uint16_t instID,
    function getInstrRuleMemAccessRead (line 401) | std::vector<std::unique_ptr<InstrRule>> getInstrRuleMemAccessRead() {
    function getInstrRuleMemAccessWrite (line 411) | std::vector<std::unique_ptr<InstrRule>> getInstrRuleMemAccessWrite() {

FILE: src/Patch/X86_64/PatchGenerator_X86_64.cpp
  type QBDI (line 42) | namespace QBDI {

FILE: src/Patch/X86_64/PatchGenerator_X86_64.h
  function namespace (line 30) | namespace QBDI {

FILE: src/Patch/X86_64/PatchRuleAssembly_X86_64.cpp
  type QBDI (line 43) | namespace QBDI {
    type PatchGeneratorFlagsX86_64 (line 47) | enum PatchGeneratorFlagsX86_64 {
    function getDefaultPatchRules (line 51) | std::vector<PatchRule> getDefaultPatchRules(Options opts) {
    function setRegisterSaved (line 310) | static void setRegisterSaved(Patch &patch) {

FILE: src/Patch/X86_64/PatchRuleAssembly_X86_64.h
  function namespace (line 25) | namespace QBDI {

FILE: src/Patch/X86_64/Register_X86_64.cpp
  type QBDI (line 31) | namespace QBDI {
    function getGPRPositionConst (line 511) | constexpr int8_t getGPRPositionConst(size_t reg) {
    type RegisterInfoArray (line 637) | struct RegisterInfoArray {
      method RegisterInfoArray (line 641) | constexpr RegisterInfoArray() {
      method getSize (line 671) | inline uint8_t getSize(RegLLVM reg_) const {
      method getPos (line 680) | inline int8_t getPos(RegLLVM reg_) const {
    function getRegisterSize (line 694) | uint8_t getRegisterSize(RegLLVM reg) { return arrayInfo.getSize(reg); }
    function getRegisterBaseOffset (line 696) | uint8_t getRegisterBaseOffset(RegLLVM reg) {
    function getRegisterPacked (line 708) | uint8_t getRegisterPacked(RegLLVM reg) { return 1; }
    function getRegisterSpaced (line 710) | uint8_t getRegisterSpaced(RegLLVM reg) { return 1; }
    function getGPRPosition (line 712) | size_t getGPRPosition(RegLLVM reg) { return arrayInfo.getPos(reg); }
    function RegLLVM (line 714) | RegLLVM getUpperRegister(RegLLVM reg, size_t pos) {
    function RegLLVM (line 725) | RegLLVM getPackedRegister(RegLLVM reg, size_t pos) {
    function fixLLVMUsedGPR (line 732) | void fixLLVMUsedGPR(const llvm::MCInst &inst, const LLVMCPU &llvmcpu,

FILE: src/Patch/X86_64/RelocatableInst_X86_64.cpp
  type QBDI (line 26) | namespace QBDI {

FILE: src/Patch/X86_64/RelocatableInst_X86_64.h
  function namespace (line 32) | namespace QBDI {

FILE: src/Patch/X86_64/TempManagerImpl_X86_64.h
  function namespace (line 24) | namespace QBDI {

FILE: src/Patch/X86_64/TempManager_X86_64.cpp
  type QBDI (line 26) | namespace QBDI {

FILE: src/Utility/AARCH64/InstAnalysis_AARCH64.cpp
  type QBDI (line 32) | namespace QBDI {
    type InstructionAnalysis (line 33) | namespace InstructionAnalysis {
      function ConditionType (line 35) | ConditionType ConditionLLVM2QBDI(unsigned cond) {
      function getFlagOperand (line 73) | static unsigned getFlagOperand(unsigned opcode) {
      function analyseCondition (line 109) | void analyseCondition(InstAnalysis *instAnalysis, const llvm::MCInst...
      function isFlagOperand (line 125) | bool isFlagOperand(unsigned opcode, unsigned opNum,
      function getBias (line 135) | unsigned getBias(const llvm::MCInstrDesc &desc) {
      function getAdditionnalOperandNumber (line 157) | unsigned getAdditionnalOperandNumber(const llvm::MCInst &inst,
      function getAdditionnalOperand (line 163) | void getAdditionnalOperand(InstAnalysis *instAnalysis, const llvm::M...

FILE: src/Utility/AARCH64/System_OSX.cpp
  type QBDI (line 35) | namespace QBDI {
    function isRWXSupported (line 37) | bool isRWXSupported() { return false; }
    function isRWRXSupported (line 38) | bool isRWRXSupported() { return true; }
    function allocateMappedMemory (line 40) | llvm::sys::MemoryBlock
    function releaseMappedMemory (line 49) | void releaseMappedMemory(llvm::sys::MemoryBlock &block) {

FILE: src/Utility/AARCH64/System_darwin.cpp
  type QBDI (line 36) | namespace QBDI {
    function _getHostCPUName (line 38) | static const std::string _getHostCPUName() {
    function getHostCPUName (line 90) | const std::string getHostCPUName() {
    function getHostCPUFeatures (line 99) | const std::vector<std::string> getHostCPUFeatures() {
    function isHostCPUFeaturePresent (line 162) | bool isHostCPUFeaturePresent(const char *query) {

FILE: src/Utility/AARCH64/System_iOS.cpp
  type QBDI (line 36) | namespace QBDI {
    function vm_prot_t (line 43) | vm_prot_t getPageProtection(vm_address_t address_, mach_port_t &task) {
    function cache_RWXSupported (line 71) | void cache_RWXSupported() {
    function isRWXSupported (line 124) | bool isRWXSupported() {
    function isRWRXSupported (line 130) | bool isRWRXSupported() {
    function allocateMappedMemory (line 136) | llvm::sys::MemoryBlock
    function releaseMappedMemory (line 174) | void releaseMappedMemory(llvm::sys::MemoryBlock &block) {

FILE: src/Utility/ARM/InstAnalysis_ARM.cpp
  type QBDI (line 32) | namespace QBDI {
    type InstructionAnalysis (line 33) | namespace InstructionAnalysis {
      function ConditionType (line 35) | ConditionType ConditionLLVM2QBDI(unsigned cond) {
      function analyseCondition (line 72) | void analyseCondition(InstAnalysis *instAnalysis, const llvm::MCInst...
      function isFlagOperand (line 176) | bool isFlagOperand(unsigned opcode, unsigned opNum,
      function getBias (line 183) | unsigned getBias(const llvm::MCInstrDesc &desc) {
      function getAdditionnalOperandNumber (line 205) | unsigned getAdditionnalOperandNumber(const llvm::MCInst &inst,
      function getAdditionnalOperand (line 216) | void getAdditionnalOperand(InstAnalysis *instAnalysis, const llvm::M...

FILE: src/Utility/ARM/System_darwin.cpp
  type QBDI (line 36) | namespace QBDI {
    function _getHostCPUName (line 38) | static const std::string _getHostCPUName() {
    function getHostCPUName (line 90) | const std::string getHostCPUName() {
    function getHostCPUFeatures (line 99) | const std::vector<std::string> getHostCPUFeatures() {
    function isHostCPUFeaturePresent (line 162) | bool isHostCPUFeaturePresent(const char *query) {

FILE: src/Utility/ARM/System_iOS.cpp
  type QBDI (line 47) | namespace QBDI {
    function init_jit_server (line 49) | void init_jit_server() {
    function terminate_jit_server (line 63) | void terminate_jit_server() {
    function isRWXSupported (line 73) | bool isRWXSupported() {
    function allocateMappedMemory (line 127) | llvm::sys::MemoryBlock
    function releaseMappedMemory (line 185) | void releaseMappedMemory(llvm::sys::MemoryBlock &block) {

FILE: src/Utility/ARM/server-iOS-jit-user.c
  function mig_internal (line 130) | mig_internal kern_return_t
  function mig_external (line 167) | mig_external kern_return_t frida_jit_alloc(mach_port_t server, vm_map_t ...

FILE: src/Utility/ARM/server-iOS-jit-user.h
  type function_table_entry (line 85) | typedef struct {
  type function_table_entry (line 89) | typedef function_table_entry *function_table_t;
  type __Request__frida_jit_alloc_t (line 140) | typedef struct {
  type __Reply__frida_jit_alloc_t (line 172) | typedef struct {

FILE: src/Utility/InstAnalysis.cpp
  type QBDI (line 53) | namespace QBDI {
    type InstructionAnalysis (line 54) | namespace InstructionAnalysis {
      function isFlagRegister (line 56) | static bool isFlagRegister(RegLLVM regNo) {
      function analyseRegister (line 71) | void analyseRegister(OperandAnalysis &opa, RegLLVM regNo,
      function breakPackedRegister (line 151) | void breakPackedRegister(InstAnalysis *instAnalysis, OperandAnalysis...
      function tryMergeCurrentRegister (line 212) | void tryMergeCurrentRegister(InstAnalysis *instAnalysis) {
      function analyseImplicitRegisters (line 237) | void analyseImplicitRegisters(InstAnalysis *instAnalysis,
      function analyseOperands (line 264) | void analyseOperands(InstAnalysis *instAnalysis, const llvm::MCInst ...
    function InstAnalysis (line 470) | InstAnalysis *analyzeInstMetadata(const InstMetadata &instMetadata,

FILE: src/Utility/InstAnalysis_prive.h
  function namespace (line 27) | namespace llvm {
  function namespace (line 34) | namespace QBDI {

FILE: src/Utility/LogSys.cpp
  type QBDI (line 40) | namespace QBDI {
    class Logger (line 43) | class Logger {
      method Logger (line 45) | Logger(void) {
      method Logger (line 51) | Logger(const Logger &) = delete;
      method Logger (line 53) | Logger &operator=(const Logger &) = delete;
      method setPriority (line 55) | void setPriority(LogPriority priority) {
      method setFile (line 76) | void setFile(const std::string &f, bool truncate) {
      method setDefaultLogger (line 81) | void setDefaultLogger() {
      method setConsoleLogger (line 90) | void setConsoleLogger() {
    function qbdi_setLogFile (line 107) | void qbdi_setLogFile(const char *filename, bool truncate) {
    function setLogFile (line 111) | void setLogFile(const std::string &filename, bool truncate) {
    function qbdi_setLogPriority (line 115) | void qbdi_setLogPriority(LogPriority priority) { logger.setPriority(pr...
    function qbdi_setLogConsole (line 117) | void qbdi_setLogConsole() { logger.setConsoleLogger(); }
    function qbdi_setLogDefault (line 119) | void qbdi_setLogDefault() { logger.setDefaultLogger(); }
    function format_as (line 123) | std::string format_as(const QBDI::Patch &patch) {

FILE: src/Utility/LogSys.h
  function namespace (line 33) | namespace llvm {
  function namespace (line 37) | namespace QBDI {

FILE: src/Utility/Memory.cpp
  type QBDI (line 37) | namespace QBDI {
    function getModuleNames (line 40) | std::vector<std::string> getModuleNames() {
    function alignedFree (line 67) | void alignedFree(void *ptr) {
    function allocateVirtualStack (line 75) | bool allocateVirtualStack(GPRState *ctx, uint32_t stackSize, uint8_t *...
    function simulateCall (line 87) | void simulateCall(GPRState *ctx, rword returnAddress,
    function simulateCallV (line 92) | void simulateCallV(GPRState *ctx, rword returnAddress, uint32_t argNum,
    function simulateCallA (line 101) | void simulateCallA(GPRState *ctx, rword returnAddress, uint32_t argNum,
    function qbdi_MemoryMap (line 171) | qbdi_MemoryMap *convert_MemoryMap_to_C(std::vector<MemoryMap> maps,
    function qbdi_MemoryMap (line 191) | qbdi_MemoryMap *qbdi_getRemoteProcessMaps(rword pid, bool full_path,
    function qbdi_MemoryMap (line 198) | qbdi_MemoryMap *qbdi_getCurrentProcessMaps(bool full_path, size_t *siz...
    function qbdi_freeMemoryMapArray (line 204) | void qbdi_freeMemoryMapArray(qbdi_MemoryMap *arr, size_t size) {
    function qbdi_alignedFree (line 233) | void qbdi_alignedFree(void *ptr) { alignedFree(ptr); }
    function qbdi_allocateVirtualStack (line 235) | bool qbdi_allocateVirtualStack(GPRState *ctx, uint32_t stackSize,
    function qbdi_simulateCall (line 240) | void qbdi_simulateCall(GPRState *ctx, rword returnAddress, uint32_t ar...
    function qbdi_simulateCallV (line 248) | void qbdi_simulateCallV(GPRState *ctx, rword returnAddress, uint32_t a...
    function qbdi_simulateCallA (line 253) | void qbdi_simulateCallA(GPRState *ctx, rword returnAddress, uint32_t a...

FILE: src/Utility/Memory_linux.cpp
  type QBDI (line 33) | namespace QBDI {
    function getCurrentProcessMaps (line 35) | std::vector<MemoryMap> getCurrentProcessMaps(bool full_path) {
    function getRemoteProcessMaps (line 39) | std::vector<MemoryMap> getRemoteProcessMaps(QBDI::rword pid, bool full...

FILE: src/Utility/Memory_macos.cpp
  type QBDI (line 32) | namespace QBDI {
    function mach_vm_address_t (line 46) | mach_vm_address_t getDyldAllImageInfoAddr(task_t task,
    function getDyldAllImageInfo (line 61) | bool getDyldAllImageInfo(task_t task,
    type dyld_image_info (line 79) | struct dyld_image_info
    type dyld_all_image_infos (line 80) | struct dyld_all_image_infos
    type dyld_image_info (line 82) | struct dyld_image_info
    type dyld_image_info (line 83) | struct dyld_image_info
    type dyld_image_info (line 84) | struct dyld_image_info
    type STRUCT_HEADER (line 103) | struct STRUCT_HEADER
    type dyld_image_info (line 104) | struct dyld_image_info
    type STRUCT_HEADER (line 105) | struct STRUCT_HEADER
    type STRUCT_HEADER (line 106) | struct STRUCT_HEADER
    type STRUCT_HEADER (line 115) | struct STRUCT_HEADER
    type STRUCT_HEADER (line 116) | struct STRUCT_HEADER
    type STRUCT_HEADER (line 116) | struct STRUCT_HEADER
    type dyld_image_info (line 126) | struct dyld_image_info
    function getImageSlideWithHeader (line 148) | uintptr_t getImageSlideWithHeader(const struct dyld_image_info *image_...
    function getProcessMaps (line 166) | static std::vector<MemoryMap> getProcessMaps(task_t task, bool full_pa...
    function getCurrentProcessMaps (line 292) | std::vector<MemoryMap> getCurrentProcessMaps(bool full_path) {
    function getRemoteProcessMaps (line 302) | std::vector<MemoryMap> getRemoteProcessMaps(QBDI::rword pid, bool full...

FILE: src/Utility/Memory_windows.cpp
  type QBDI (line 33) | namespace QBDI {
    function getCurrentProcessMaps (line 39) | std::vector<MemoryMap> getCurrentProcessMaps(bool full_path) {
    function getRemoteProcessMaps (line 43) | std::vector<MemoryMap> getRemoteProcessMaps(QBDI::rword pid, bool full...

FILE: src/Utility/MovableDoubleLinkedList.h
  function namespace (line 23) | namespace QBDI {
  function ptr (line 113) | ptr(ptr_) {}
  function ptr (line 130) | ptr(ptr_) {}
  function insertBegin (line 166) | void insertBegin(MovableDoubleLinkedListElement<T> &el) {
  function insertEnd (line 175) | void insertEnd(MovableDoubleLinkedListElement<T> &el) {

FILE: src/Utility/StackSwitch.cpp
  type QBDI (line 34) | namespace QBDI {
    function stackSwitchInternalHandler (line 37) | QBDI::rword stackSwitchInternalHandler(void *switchContext,
    function rword (line 45) | rword switchStack(void *newStackPtr, std::function<rword(rword)> handl...

FILE: src/Utility/StackSwitch.h
  function namespace (line 25) | namespace QBDI {

FILE: src/Utility/String.cpp
  type QBDI (line 23) | namespace QBDI {
    type String (line 24) | namespace String {
      function startsWith (line 26) | bool startsWith(const char *prefix, const char *str) {

FILE: src/Utility/String.h
  function namespace (line 23) | namespace QBDI {

FILE: src/Utility/System.h
  function namespace (line 28) | namespace QBDI {

FILE: src/Utility/System_generic.cpp
  type QBDI (line 35) | namespace QBDI {
    function isRWXSupported (line 37) | bool isRWXSupported() { return false; }
    function isRWRXSupported (line 38) | bool isRWRXSupported() { return true; }
    function allocateMappedMemory (line 40) | llvm::sys::MemoryBlock
    function releaseMappedMemory (line 49) | void releaseMappedMemory(llvm::sys::MemoryBlock &block) {
    function getHostCPUName (line 53) | const std::string getHostCPUName() {
    function getHostCPUFeatures (line 62) | const std::vector<std::string> getHostCPUFeatures() {
    function isHostCPUFeaturePresent (line 149) | bool isHostCPUFeaturePresent(const char *query) {

FILE: src/Utility/Version.cpp
  type QBDI (line 21) | namespace QBDI {

FILE: src/Utility/X86_64/InstAnalysis_X86_64.cpp
  type llvm (line 33) | namespace llvm {
    class MCRegisterInfo (line 34) | class MCRegisterInfo
  type QBDI (line 37) | namespace QBDI {
    type InstructionAnalysis (line 38) | namespace InstructionAnalysis {
      function ConditionType (line 40) | ConditionType ConditionLLVM2QBDI(unsigned cond) {
      function analyseCondition (line 79) | void analyseCondition(InstAnalysis *instAnalysis, const llvm::MCInst...
      function isFlagOperand (line 102) | bool isFlagOperand(unsigned opcode, unsigned opNum,
      function getBias (line 112) | unsigned getBias(const llvm::MCInstrDesc &desc) {
      function getAdditionnalOperandNumber (line 116) | unsigned getAdditionnalOperandNumber(const llvm::MCInst &inst,
      function getAdditionnalOperand (line 134) | void getAdditionnalOperand(InstAnalysis *instAnalysis, const llvm::M...

FILE: src/fridaStubs.cpp
  type QBDI (line 23) | namespace QBDI {
    function QBDI_EXPORT (line 26) | QBDI_EXPORT rword qbdi_getGPR(GPRState *state, uint32_t rid) {
    function QBDI_EXPORT (line 30) | QBDI_EXPORT void qbdi_setGPR(GPRState *state, uint32_t rid, rword val) {
    type StructDesc (line 34) | struct StructDesc {
    function QBDI_EXPORT (line 40) | QBDI_EXPORT const StructDesc *qbdi_getMemoryAccessStructDesc() {
    function QBDI_EXPORT (line 56) | QBDI_EXPORT const StructDesc *qbdi_getVMStateStructDesc() {
    function QBDI_EXPORT (line 70) | QBDI_EXPORT const StructDesc *qbdi_getOperandAnalysisStructDesc() {
    function QBDI_EXPORT (line 87) | QBDI_EXPORT const StructDesc *qbdi_getInstAnalysisStructDesc() {

FILE: src/windowsDllMain.cpp
  function QBDI_EXPORT (line 24) | QBDI_EXPORT BOOLEAN WINAPI DllMain(IN HINSTANCE hDllHandle, IN DWORD nRe...

FILE: templates/qbdi_frida_template/SimpleXOR.c
  function EXPORT (line 12) | EXPORT int Secret(char *str) {
  function Hello (line 27) | void Hello() { Secret("Hello world !"); }
  function main (line 29) | int main() { Hello(); }

FILE: templates/qbdi_preload_template/qbdi_preload_template.c
  function VMAction (line 6) | static VMAction onInstruction(VMInstanceRef vm, GPRState *gprState,
  function qbdipreload_on_start (line 21) | int qbdipreload_on_start(void *main) { return QBDIPRELOAD_NOT_HANDLED; }
  function qbdipreload_on_premain (line 23) | int qbdipreload_on_premain(void *gprCtx, void *fpuCtx) {
  function qbdipreload_on_main (line 27) | int qbdipreload_on_main(int argc, char **argv) {
  function qbdipreload_on_run (line 36) | int qbdipreload_on_run(VMInstanceRef vm, rword start, rword stop) {
  function qbdipreload_on_exit (line 42) | int qbdipreload_on_exit(int status) { return QBDIPRELOAD_NO_ERROR; }

FILE: templates/qbdi_template/qbdi_template.c
  function QBDI_NOINLINE (line 9) | QBDI_NOINLINE int secretFunc(unsigned int value) { return value ^ 0x5c; }
  function VMAction (line 11) | VMAction showInstruction(VMInstanceRef vm, GPRState *gprState,
  function main (line 22) | int main(int argc, char **argv) {

FILE: test/API/AARCH64/InstAnalysisTest_AARCH64.cpp
  type ExpectedInstAnalysis (line 29) | struct ExpectedInstAnalysis {
  function debugOperand (line 46) | [[maybe_unused]] static void debugOperand(const QBDI::InstAnalysis *ana) {
  function checkOperand (line 63) | static void checkOperand(const QBDI::InstAnalysis *ana,
  function checkInst (line 99) | static void checkInst(const QBDI::InstAnalysis *ana,

FILE: test/API/AARCH64/MemoryAccessTest_AARCH64.cpp
  function checkFeature (line 29) | static bool checkFeature(const char *f) {
  function debugCB (line 37) | [[maybe_unused]] static QBDI::VMAction debugCB(QBDI::VMInstanceRef vm,
  type ExpectedMemoryAccess (line 56) | struct ExpectedMemoryAccess {
  type ExpectedMemoryAccesses (line 65) | struct ExpectedMemoryAccesses {
  function checkAccess (line 69) | static QBDI::VMAction checkAccess(QBDI::VMInstanceRef vm,
  function setFPR (line 98) | void setFPR(QBDI::FPRState *fpr, size_t index, QBDI::rword hvalue,
  function checkFullFPR (line 104) | void checkFullFPR(QBDI::FPRState *fpr, size_t index, QBDI::rword hvalue,
  function checkLowFPR (line 111) | void checkLowFPR(QBDI::FPRState *fpr, size_t index, QBDI::rword lvalue) {

FILE: test/API/AARCH64/VMTest_AARCH64.cpp
  type TestInst (line 25) | struct TestInst
  function QBDI_NOINLINE (line 41) | QBDI_NOINLINE QBDI::rword satanicFun(QBDI::rword arg0) {

FILE: test/API/AARCH64/VMTest_AARCH64.h
  type SizedTestCode (line 39) | struct SizedTestCode {
  type TestInst (line 44) | struct TestInst {
  type TestInst (line 52) | struct TestInst

FILE: test/API/AARCH64/VMTest_AARCH64_LDRL.cpp
  function QBDI_NOINLINE (line 25) | QBDI_NOINLINE uint64_t ldrlX() {
  function QBDI_NOINLINE (line 49) | QBDI_NOINLINE uint64_t ldrlW_1() {
  function QBDI_NOINLINE (line 73) | QBDI_NOINLINE uint64_t ldrlW_2() {
  function QBDI_NOINLINE (line 96) | QBDI_NOINLINE uint64_t ldrlSW_1() {
  function QBDI_NOINLINE (line 119) | QBDI_NOINLINE uint64_t ldrlSW_2() {

FILE: test/API/AARCH64/VMTest_AARCH64_LocalMonitor.cpp
  function x28CBK (line 26) | QBDI::VMAction x28CBK(QBDI::VMInstanceRef vm, QBDI::GPRState *gprState,
  function QBDI_NOINLINE (line 33) | QBDI_NOINLINE uint64_t simpleStore() {
  function QBDI_NOINLINE (line 57) | QBDI_NOINLINE uint64_t clearMonitor() {
  function QBDI_NOINLINE (line 82) | QBDI_NOINLINE uint64_t doubleStackStore() {
  function QBDI_NOINLINE (line 111) | QBDI_NOINLINE uint64_t doubleStore(uint64_t *arg) {

FILE: test/API/AARCH64/VMTest_AARCH64_X28.cpp
  function dummyCB (line 25) | static QBDI::VMAction dummyCB(QBDI::VMInstanceRef vm, QBDI::GPRState *gp...
  function QBDI_NOINLINE (line 30) | QBDI_NOINLINE uint64_t useX28_simple() {
  function QBDI_NOINLINE (line 83) | QBDI_NOINLINE uint64_t useX28_crossBB() {

FILE: test/API/APITest.cpp
  function dummyFn (line 33) | static void dummyFn() {}

FILE: test/API/APITest.h
  function class (line 30) | class APITest {

FILE: test/API/ARM/InstAnalysisTest_ARM.cpp
  type ExpectedInstAnalysis (line 29) | struct ExpectedInstAnalysis {
  function debugOperand (line 47) | [[maybe_unused]] static void debugOperand(const QBDI::InstAnalysis *ana) {
  function checkOperand (line 64) | static void checkOperand(const QBDI::InstAnalysis *ana,
  function checkInst (line 100) | static void checkInst(const QBDI::InstAnalysis *ana,

FILE: test/API/ARM/InstAnalysisTest_Thumb.cpp
  type ExpectedInstAnalysis (line 29) | struct ExpectedInstAnalysis {
  function debugOperand (line 47) | [[maybe_unused]] static void debugOperand(const QBDI::InstAnalysis *ana) {
  function checkOperand (line 64) | static void checkOperand(const QBDI::InstAnalysis *ana,
  function checkInst (line 100) | static void checkInst(const QBDI::InstAnalysis *ana,

FILE: test/API/ARM/MemoryAccessTest_ARM.cpp
  function checkFeature (line 29) | [[maybe_unused]] static bool checkFeature(const char *f) {
  function debugCB (line 37) | [[maybe_unused]] static QBDI::VMAction debugCB(QBDI::VMInstanceRef vm,
  type ExpectedMemoryAccess (line 56) | struct ExpectedMemoryAccess {
  type ExpectedMemoryAccesses (line 65) | struct ExpectedMemoryAccesses {
  function checkAccess (line 69) | static QBDI::VMAction checkAccess(QBDI::VMInstanceRef vm,

FILE: test/API/ARM/MemoryAccessTest_ARM_LDM_STM.cpp
  function debugCB (line 29) | [[maybe_unused]] static QBDI::VMAction debugCB(QBDI::VMInstanceRef vm,
  type ExpectedMemoryAccess (line 48) | struct ExpectedMemoryAccess {
  type ExpectedMemoryAccesses (line 57) | struct ExpectedMemoryAccesses {
  function checkAccess (line 61) | static QBDI::VMAction checkAccess(QBDI::VMInstanceRef vm,

FILE: test/API/ARM/MemoryAccessTest_Thumb.cpp
  function checkFeature (line 29) | [[maybe_unused]] static bool checkFeature(const char *f) {
  function debugCB (line 37) | [[maybe_unused]] static QBDI::VMAction debugCB(QBDI::VMInstanceRef vm,
  type ExpectedMemoryAccess (line 56) | struct ExpectedMemoryAccess {
  type ExpectedMemoryAccesses (line 65) | struct ExpectedMemoryAccesses {
  function checkAccess (line 69) | static QBDI::VMAction checkAccess(QBDI::VMInstanceRef vm,

FILE: test/API/ARM/MemoryAccessTest_Thumb_LDM_STM.cpp
  function debugCB (line 29) | [[maybe_unused]] static QBDI::VMAction debugCB(QBDI::VMInstanceRef vm,
  type ExpectedMemoryAccess (line 48) | struct ExpectedMemoryAccess {
  type ExpectedMemoryAccesses (line 57) | struct ExpectedMemoryAccesses {
  function checkAccess (line 61) | static QBDI::VMAction checkAccess(QBDI::VMInstanceRef vm,

FILE: test/API/ARM/VMTest_ARM.cpp
  type TestInst (line 25) | struct TestInst
  function QBDI_NOINLINE (line 37) | QBDI_NOINLINE QBDI::rword satanicFun(QBDI::rword arg0) {

FILE: test/API/ARM/VMTest_ARM.h
  type SizedTestCode (line 36) | struct SizedTestCode {
  type TestInst (line 41) | struct TestInst {
  type TestInst (line 49) | struct TestInst

FILE: test/API/MemoryAccessTest.cpp
  type TestInfo (line 36) | struct TestInfo {
  function arrayRead8 (line 42) | QBDI::rword arrayRead8(volatile char *buffer, size_t size) {
  function arrayRead16 (line 50) | QBDI::rword arrayRead16(volatile uint16_t *buffer, size_t size) {
  function arrayRead32 (line 58) | QBDI::rword arrayRead32(volatile uint32_t *buffer, size_t size) {
  function arrayWrite8 (line 66) | QBDI::rword arrayWrite8(volatile uint8_t *buffer, size_t size) {
  function arrayWrite16 (line 76) | QBDI::rword arrayWrite16(volatile uint16_t *buffer, size_t size) {
  function arrayWrite32 (line 86) | QBDI::rword arrayWrite32(volatile uint32_t *buffer, size_t size) {
  function unrolledRead (line 96) | QBDI::rword unrolledRead(volatile char *buffer) {
  function unrolledWrite (line 111) | QBDI::rword unrolledWrite(volatile char *buffer) {
  function unrolledReadLoop (line 138) | QBDI::rword unrolledReadLoop(volatile char *buffer, size_t len) {
  function unrolledWriteLoop (line 146) | QBDI::rword unrolledWriteLoop(volatile char *buffer, size_t len) {
  function mad (line 155) | QBDI::rword mad(volatile uint32_t *a, volatile uint32_t *b,
  function checkArrayRead8 (line 165) | QBDI::VMAction checkArrayRead8(QBDI::VMInstanceRef vm, QBDI::GPRState *g...
  function checkArrayRead16 (line 186) | QBDI::VMAction checkArrayRead16(QBDI::VMInstanceRef vm,
  function checkArrayRead32 (line 209) | QBDI::VMAction checkArrayRead32(QBDI::VMInstanceRef vm,
  function checkArrayWrite8 (line 232) | QBDI::VMAction checkArrayWrite8(QBDI::VMInstanceRef vm,
  function checkArrayWrite16 (line 254) | QBDI::VMAction checkArrayWrite16(QBDI::VMInstanceRef vm,
  function checkArrayWrite32 (line 277) | QBDI::VMAction checkArrayWrite32(QBDI::VMInstanceRef vm,
  function checkUnrolledReadInst (line 300) | QBDI::VMAction checkUnrolledReadInst(QBDI::VMInstanceRef vm,
  function checkUnrolledWriteInst (line 322) | QBDI::VMAction checkUnrolledWriteInst(QBDI::VMInstanceRef vm,
  function checkUnrolledReadBB (line 344) | QBDI::VMAction checkUnrolledReadBB(QBDI::VMInstanceRef vm,
  function checkUnrolledWriteBB (line 367) | QBDI::VMAction checkUnrolledWriteBB(QBDI::VMInstanceRef vm,
  function readSnooper (line 390) | QBDI::VMAction readSnooper(QBDI::VMInstanceRef vm, QBDI::GPRState *gprSt...
  function writeSnooper (line 406) | QBDI::VMAction writeSnooper(QBDI::VMInstanceRef vm, QBDI::GPRState *gprS...

FILE: test/API/OptionsTest.h
  function class (line 25) | class OptionsTest {

FILE: test/API/RangeTest.cpp
  function checkRangeSetInvariant (line 26) | void checkRangeSetInvariant(const QBDI::RangeSet<T> &set) {
  function randomPermutation (line 122) | void randomPermutation(std::vector<T> &v) {

FILE: test/API/VMTest.cpp
  function QBDI_DISABLE_ASAN (line 45) | QBDI_DISABLE_ASAN QBDI_NOINLINE int dummyFun0() { return 42; }
  function QBDI_DISABLE_ASAN (line 47) | QBDI_DISABLE_ASAN QBDI_NOINLINE int dummyFun1(int arg0) { return arg0; }
  function QBDI_DISABLE_ASAN (line 49) | QBDI_DISABLE_ASAN QBDI_NOINLINE int dummyFun4(int arg0, int arg1, int arg2,
  function QBDI_DISABLE_ASAN (line 54) | QBDI_DISABLE_ASAN QBDI_NOINLINE int dummyFun5(int arg0, int arg1, int arg2,
  function QBDI_DISABLE_ASAN (line 59) | QBDI_DISABLE_ASAN QBDI_NOINLINE int dummyFun8(int arg0, int arg1, int arg2,
  function QBDI_DISABLE_ASAN (line 65) | QBDI_DISABLE_ASAN QBDI_NOINLINE int dummyFunCall(int arg0) {
  function QBDI_DISABLE_ASAN (line 75) | QBDI_DISABLE_ASAN QBDI_NOINLINE int dummyFunBB(int arg0, int arg1, int a...
  function countInstruction (line 171) | QBDI::VMAction countInstruction(QBDI::VMInstanceRef vm,
  function evilCbk (line 178) | QBDI::VMAction evilCbk(QBDI::VMInstanceRef vm, QBDI::GPRState *gprState,
  type TestInst (line 249) | struct TestInst
  function checkTransfer (line 333) | QBDI::VMAction checkTransfer(QBDI::VMInstanceRef vm, const QBDI::VMState...
  type CheckBasicBlockData (line 377) | struct CheckBasicBlockData {
  function checkBasicBlock (line 384) | static QBDI::VMAction checkBasicBlock(QBDI::VMInstanceRef vm,
  type FunkyInfo (line 530) | struct FunkyInfo {
  function funkyCountInstruction (line 535) | QBDI::VMAction funkyCountInstruction(QBDI::VMInstanceRef vm,
  type PriorityDataCall (line 594) | struct PriorityDataCall {
    method PriorityDataCall (line 599) | PriorityDataCall(QBDI::rword addr, QBDI::InstPosition pos, int priority)
  function priorityInstrCB (line 603) | static std::vector<QBDI::InstrRuleDataCBK>
  type SkipTestData (line 779) | struct SkipTestData {
  type MoveCallbackStruct (line 920) | struct MoveCallbackStruct {
  function allowedNewBlock (line 930) | static QBDI::VMAction allowedNewBlock(QBDI::VMInstanceRef vm,
  function instrumentCopyCB (line 943) | static std::vector<QBDI::InstrRuleDataCBK>
  function verifyVMRef (line 954) | static QBDI::VMAction verifyVMRef(QBDI::VMInstanceRef vm, QBDI::GPRState *,
  function verifyCB2 (line 963) | static QBDI::VMAction verifyCB2(QBDI::VMInstanceRef vm, QBDI::GPRState *,
  type CheckReduceSizeData (line 1815) | struct CheckReduceSizeData {

FILE: test/API/X86/InstAnalysisTest_X86.cpp
  type ExpectedInstAnalysis (line 29) | struct ExpectedInstAnalysis {
  function debugOperand (line 46) | [[maybe_unused]] static void debugOperand(const QBDI::InstAnalysis *ana) {
  function checkOperand (line 63) | static void checkOperand(const QBDI::InstAnalysis *ana,
  function checkInst (line 99) | static void checkInst(const QBDI::InstAnalysis *ana,

FILE: test/API/X86/MemoryAccessTest_X86.cpp
  function checkFeature (line 29) | static bool checkFeature(const char *f) {
  type ExpectedMemoryAccess (line 53) | struct ExpectedMemoryAccess {
  type ExpectedMemoryAccesses (line 62) | struct ExpectedMemoryAccesses {
  function checkAccess (line 66) | static QBDI::VMAction checkAccess(QBDI::VMInstanceRef vm,

FILE: test/API/X86/OptionsTest_X86.cpp
  function setBool (line 55) | static QBDI::VMAction setBool(QBDI::VMInstanceRef vm, QBDI::GPRState *gp...

FILE: test/API/X86/VMTest_X86.cpp
  type TestInst (line 25) | struct TestInst
  function QBDI_NOINLINE (line 92) | QBDI_NOINLINE QBDI::rword satanicFun(QBDI::rword arg0) {

FILE: test/API/X86/VMTest_X86.h
  type TestInst (line 36) | struct TestInst {
  type SizedTestCode (line 44) | struct SizedTestCode {
  type TestInst (line 49) | struct TestInst

FILE: test/API/X86_64/InstAnalysisTest_X86_64.cpp
  type ExpectedInstAnalysis (line 29) | struct ExpectedInstAnalysis {
  function checkDisassembly (line 46) | static void checkDisassembly(const QBDI::InstAnalysis *ana,
  function debugOperand (line 51) | [[maybe_unused]] static void debugOperand(const QBDI::InstAnalysis *ana) {
  function checkOperand (line 68) | static void checkOperand(const QBDI::InstAnalysis *ana,
  function checkInst (line 104) | static void checkInst(const QBDI::InstAnalysis *ana,

FILE: test/API/X86_64/MemoryAccessTest_X86_64.cpp
  function checkFeature (line 29) | static bool checkFeature(const char *f) {
  type ExpectedMemoryAccess (line 53) | struct ExpectedMemoryAccess {
  type ExpectedMemoryAccesses (line 62) | struct ExpectedMemoryAccesses {
  function checkAccess (line 66) | static QBDI::VMAction checkAccess(QBDI::VMInstanceRef vm,

FILE: test/API/X86_64/OptionsTest_X86_64.cpp
  function setBool (line 55) | static QBDI::VMAction setBool(QBDI::VMInstanceRef vm, QBDI::GPRState *gp...

FILE: test/API/X86_64/VMTest_X86_64.cpp
  type TestInst (line 25) | struct TestInst
  function QBDI_NOINLINE (line 92) | QBDI_NOINLINE QBDI::rword satanicFun(QBDI::rword arg0) {

FILE: test/API/X86_64/VMTest_X86_64.h
  type TestInst (line 36) | struct TestInst {
  type SizedTestCode (line 44) | struct SizedTestCode {
  type TestInst (line 49) | struct TestInst

FILE: test/Benchmark/Fibonacci.cpp
  function QBDI_NOINLINE (line 25) | QBDI_NOINLINE QBDI::rword Fibonacci(QBDI::rword number) {
  function eventCB (line 31) | static QBDI::VMAction eventCB(QBDI::VMInstanceRef vm,
  function eventMemoryCB (line 38) | static QBDI::VMAction eventMemoryCB(QBDI::VMInstanceRef vm,
  function instEmptyCB (line 47) | static QBDI::VMAction instEmptyCB(QBDI::VMInstanceRef vm,
  function instCB (line 53) | static QBDI::VMAction instCB(QBDI::VMInstanceRef vm, QBDI::GPRState *gpr...
  function instMemoryCB (line 64) | static QBDI::VMAction instMemoryCB(QBDI::VMInstanceRef vm,

FILE: test/Benchmark/SHA256.cpp
  function QBDI_NOINLINE (line 29) | QBDI_NOINLINE sha256::HashType *compute_sha(size_t l) {
  function eventCB (line 35) | static QBDI::VMAction eventCB(QBDI::VMInstanceRef vm,
  function eventMemoryCB (line 42) | static QBDI::VMAction eventMemoryCB(QBDI::VMInstanceRef vm,
  function instEmptyCB (line 51) | static QBDI::VMAction instEmptyCB(QBDI::VMInstanceRef vm,
  function instCB (line 57) | static QBDI::VMAction instCB(QBDI::VMInstanceRef vm, QBDI::GPRState *gpr...
  function instMemoryCB (line 68) | static QBDI::VMAction instMemoryCB(QBDI::VMInstanceRef vm,

FILE: test/ExecBlock/AARCH64/PatchEmptyAARCH64.cpp
  function generateEmptyPatch (line 24) | QBDI::Patch generateEmptyPatch(QBDI::rword address,

FILE: test/ExecBlock/ARM/PatchEmptyARM.cpp
  function generateEmptyPatch (line 24) | QBDI::Patch generateEmptyPatch(QBDI::rword address,

FILE: test/ExecBlock/ExecBlockManagerTest.cpp
  function getEmptyBB (line 33) | QBDI::Patch::Vec getEmptyBB(QBDI::rword address,

FILE: test/ExecBlock/ExecBlockManagerTest.h
  function class (line 24) | class ExecBlockManagerTest : public LLVMTestEnv {

FILE: test/ExecBlock/ExecBlockTest.h
  function class (line 25) | class ExecBlockTest : public LLVMTestEnv {

FILE: test/ExecBlock/X86/PatchEmptyX86.cpp
  function generateEmptyPatch (line 24) | QBDI::Patch generateEmptyPatch(QBDI::rword address,

FILE: test/ExecBlock/X86_64/PatchEmptyX86_64.cpp
  function generateEmptyPatch (line 24) | QBDI::Patch generateEmptyPatch(QBDI::rword address,

FILE: test/Patch/AARCH64/ComparedExecutor_AARCH64.h
  function class (line 38) | class ComparedExecutor_AARCH64 : public ShellcodeTester {

FILE: test/Patch/AARCH64/LLVMOperandInfo_AARCH64.cpp
  class LLVMOperandInfoCheck (line 30) | class LLVMOperandInfoCheck : public LLVMTestEnv {

FILE: test/Patch/ARM/ComparedExecutor_ARM.cpp
  function InMemoryObject (line 26) | InMemoryObject

FILE: test/Patch/ARM/ComparedExecutor_ARM.h
  function class (line 47) | class ComparedExecutor_ARM : public ShellcodeTester {

FILE: test/Patch/ARM/ComparedExecutor_Thumb.cpp
  function InMemoryObject (line 26) | InMemoryObject

FILE: test/Patch/ARM/ComparedExecutor_Thumb.h
  function class (line 65) | class ComparedExecutor_Thumb : public ShellcodeTester {

FILE: test/Patch/ARM/Instr_Test_Thumb.cpp
  function incrementThumbPre (line 21) | QBDI::VMAction incrementThumbPre(QBDI::VMInstanceRef vm,
  function incrementThumbPost (line 33) | QBDI::VMAction incrementThumbPost(QBDI::VMInstanceRef vm,

FILE: test/Patch/ARM/Instr_Test_Thumb.h
  function class (line 30) | class Instr_Test_Thumb : public ComparedExecutor_Thumb {}

FILE: test/Patch/ARM/LLVMOperandInfo_ARM.cpp
  class LLVMOperandInfoCheck (line 30) | class LLVMOperandInfoCheck : public LLVMTestEnv {

FILE: test/Patch/ARM/Patch_Test_Thumb.h
  function class (line 30) | class Patch_Test_Thumb : public ComparedExecutor_Thumb {}

FILE: test/Patch/Instr_Test.cpp
  function increment (line 21) | QBDI::VMAction increment(QBDI::VMInstanceRef vm, QBDI::GPRState *gprState,

FILE: test/Patch/Instr_Test.h
  function class (line 31) | class Instr_Test : public ComparedExecutor_X86 {}
  function class (line 35) | class Instr_Test : public ComparedExecutor_X86_64 {}
  function class (line 39) | class Instr_Test : public ComparedExecutor_ARM {}
  function class (line 44) | class Instr_Test : public ComparedExecutor_AARCH64 {}

FILE: test/Patch/MemoryAccessTable.h
  function class (line 23) | class MemoryAccessTable : public LLVMTestEnv {}

FILE: test/Patch/Patch_Test.h
  function class (line 31) | class Patch_Test : public ComparedExecutor_X86 {}
  function class (line 35) | class Patch_Test : public ComparedExecutor_X86_64 {}
  function class (line 39) | class Patch_Test : public ComparedExecutor_ARM {}
  function class (line 44) | class Patch_Test : public ComparedExecutor_AARCH64 {}

FILE: test/Patch/Utils.cpp
  function seed_random (line 23) | QBDI::rword seed_random() {
  function get_random (line 35) | QBDI::rword get_random() {

FILE: test/Patch/X86/ComparedExecutor_X86.cpp
  function InMemoryObject (line 27) | InMemoryObject

FILE: test/Patch/X86/ComparedExecutor_X86.h
  function class (line 36) | class ComparedExecutor_X86 : public ShellcodeTester {

FILE: test/Patch/X86_64/ComparedExecutor_X86_64.cpp
  function InMemoryObject (line 27) | InMemoryObject

FILE: test/Patch/X86_64/ComparedExecutor_X86_64.h
  function class (line 38) | class ComparedExecutor_X86_64 : public ShellcodeTester {

FILE: test/Patch/X86_64/LLVMOperandInfo_X86_64.cpp
  class LLVMOperandInfoCheck (line 30) | class LLVMOperandInfoCheck : public LLVMTestEnv {

FILE: test/QBDIBenchmark.cpp
  function main (line 28) | int main(int argc, char **argv) {

FILE: test/QBDITest.cpp
  function getpid (line 31) | static int getpid() { return GetCurrentProcessId(); }
  function main (line 36) | int main(int argc, char **argv) {

FILE: test/TestSetup/InMemoryAssembler.cpp
  function writeResult (line 52) | void writeResult(const char *source,

FILE: test/TestSetup/InMemoryAssembler.h
  function namespace (line 27) | namespace llvm::object {
  function namespace (line 31) | namespace QBDI {
  function class (line 35) | class InMemoryObject {

FILE: test/TestSetup/LLVMTestEnv.h
  function class (line 27) | class LLVMTestEnv : public QBDI::LLVMCPUs {}

FILE: test/TestSetup/ShellcodeTester.h
  function class (line 29) | class ShellcodeTester {

FILE: tools/QBDIPreload/include/QBDIPreload.h
  function namespace (line 28) | namespace QBDI {

FILE: tools/QBDIPreload/src/AARCH64/linux_AARCH64.c
  type fpsimd_context (line 23) | typedef struct {
  function qbdipreload_threadCtxToGPRState (line 33) | void qbdipreload_threadCtxToGPRState(const void *gprCtx, GPRState *gprSt...
  function qbdipreload_floatCtxToFPRState (line 73) | void qbdipreload_floatCtxToFPRState(const void *fprCtx, FPRState *fprSta...
  function prepareStack (line 114) | void prepareStack(void *newStack, size_t sizeStack, ucontext_t *uap) {
  function removeConflictModule (line 119) | void removeConflictModule(VMInstanceRef vm, qbdi_MemoryMap *modules,

FILE: tools/QBDIPreload/src/AARCH64/linux_AARCH64.h
  function rword (line 39) | static inline rword getReturnAddress(GPRState *gprState) {
  function fix_ucontext_t (line 43) | static inline void fix_ucontext_t(ucontext_t *uap) {
  function setPC (line 49) | static inline void setPC(ucontext_t *uap, rword address) {

FILE: tools/QBDIPreload/src/AARCH64/macos_AARCH64.c
  function qbdipreload_threadCtxToGPRState (line 29) | void qbdipreload_threadCtxToGPRState(const void *gprCtx, GPRState *gprSt...
  function qbdipreload_floatCtxToFPRState (line 68) | void qbdipreload_floatCtxToFPRState(const void *fprCtx, FPRState *fprSta...

FILE: tools/QBDIPreload/src/AARCH64/macos_AARCH64.h
  function rword (line 42) | static inline rword getReturnAddress(GPRState *gprState) {
  function rword (line 46) | static inline rword getPC(THREAD_STATE *state) {
  function setPC (line 50) | static inline void setPC(THREAD_STATE *state, rword address) {
  function prepareStack (line 54) | static inline void prepareStack(void *newStack, size_t sizeStack,
  function fixSignalPC (line 60) | static inline void fixSignalPC(THREAD_STATE *state) {}

FILE: tools/QBDIPreload/src/ARM/linux_ARM.c
  function qbdipreload_threadCtxToGPRState (line 22) | void qbdipreload_threadCtxToGPRState(const void *gprCtx, GPRState *gprSt...
  function qbdipreload_floatCtxToFPRState (line 47) | void qbdipreload_floatCtxToFPRState(const void *fprCtx, FPRState *fprSta...
  function prepareStack (line 51) | void prepareStack(void *newStack, size_t sizeStack, ucontext_t *uap) {
  function removeConflictModule (line 56) | void removeConflictModule(VMInstanceRef vm, qbdi_MemoryMap *modules,

FILE: tools/QBDIPreload/src/ARM/linux_ARM.h
  function rword (line 46) | static inline rword getReturnAddress(GPRState *gprState) {
  function fix_ucontext_t (line 50) | static inline void fix_ucontext_t(ucontext_t *uap) {
  function setPC (line 56) | static inline void setPC(ucontext_t *uap, rword address) {

FILE: tools/QBDIPreload/src/X86/linux_X86.c
  function qbdipreload_threadCtxToGPRState (line 22) | void qbdipreload_threadCtxToGPRState(const void *gprCtx, GPRState *gprSt...
  function qbdipreload_floatCtxToFPRState (line 37) | void qbdipreload_floatCtxToFPRState(const void *fprCtx, FPRState *fprSta...
  function prepareStack (line 61) | void prepareStack(void *newStack, size_t sizeStack, ucontext_t *uap) {
  function removeConflictModule (line 71) | void removeConflictModule(VMInstanceRef vm, qbdi_MemoryMap *modules,

FILE: tools/QBDIPreload/src/X86/linux_X86.h
  function rword (line 39) | static inline rword getReturnAddress(GPRState *gprState) {
  function fix_ucontext_t (line 43) | static inline void fix_ucontext_t(ucontext_t *uap) {
  function setPC (line 49) | static inline void setPC(ucontext_t *uap, rword address) {

FILE: tools/QBDIPreload/src/X86/macos_X86.c
  function qbdipreload_threadCtxToGPRState (line 28) | void qbdipreload_threadCtxToGPRState(const void *gprCtx, GPRState *gprSt...
  function qbdipreload_floatCtxToFPRState (line 43) | void qbdipreload_floatCtxToFPRState(const void *fprCtx, FPRState *fprSta...

FILE: tools/QBDIPreload/src/X86/macos_X86.h
  function rword (line 41) | static inline rword getReturnAddress(GPRState *gprState) {
  function rword (line 45) | static inline rword getPC(THREAD_STATE *state) { return state->__rip; }
  function setPC (line 47) | static inline void setPC(THREAD_STATE *state, rword address) {
  function prepareStack (line 51) | static inline void prepareStack(void *newStack, size_t sizeStack,
  function fixSignalPC (line 57) | static inline void fixSignalPC(THREAD_STATE *state) { state->__eip -= 1; }

FILE: tools/QBDIPreload/src/X86_64/linux_X86_64.c
  function qbdipreload_threadCtxToGPRState (line 22) | void qbdipreload_threadCtxToGPRState(const void *gprCtx, GPRState *gprSt...
  function qbdipreload_floatCtxToFPRState (line 45) | void qbdipreload_floatCtxToFPRState(const void *fprCtx, FPRState *fprSta...
  function prepareStack (line 81) | void prepareStack(void *newStack, size_t sizeStack, ucontext_t *uap) {
  function removeConflictModule (line 86) | void removeConflictModule(VMInstanceRef vm, qbdi_MemoryMap *modules,

FILE: tools/QBDIPreload/src/X86_64/linux_X86_64.h
  function rword (line 39) | static inline rword getReturnAddress(GPRState *gprState) {
  function fix_ucontext_t (line 43) | static inline void fix_ucontext_t(ucontext_t *uap) {
  function setPC (line 49) | static inline void setPC(ucontext_t *uap, rword address) {

FILE: tools/QBDIPreload/src/X86_64/macos_X86_64.c
  function qbdipreload_threadCtxToGPRState (line 29) | void qbdipreload_threadCtxToGPRState(const void *gprCtx, GPRState *gprSt...
  function qbdipreload_floatCtxToFPRState (line 52) | void qbdipreload_floatCtxToFPRState(const void *fprCtx, FPRState *fprSta...

FILE: tools/QBDIPreload/src/X86_64/macos_X86_64.h
  function rword (line 41) | static inline rword getReturnAddress(GPRState *gprState) {
  function rword (line 45) | static inline rword getPC(THREAD_STATE *state) { return state->__rip; }
  function setPC (line 47) | static inline void setPC(THREAD_STATE *state, rword address) {
  function prepareStack (line 51) | static inline void prepareStack(void *newStack, size_t sizeStack,
  function fixSignalPC (line 57) | static inline void fixSignalPC(THREAD_STATE *state) { state->__rip -= 1; }

FILE: tools/QBDIPreload/src/darwin_exceptd.c
  type ExceptionHandler (line 28) | struct ExceptionHandler {
  type ExceptionHandler (line 38) | struct ExceptionHandler
  function kern_return_t (line 42) | kern_return_t catch_mach_exception_raise(mach_port_t exception_port,
  function kern_return_t (line 66) | kern_return_t catch_mach_exception_raise_state(
  function kern_return_t (line 77) | kern_return_t catch_mach_exception_raise_state_identity(
  type ExceptionHandler (line 93) | struct ExceptionHandler
  type ExceptionHandler (line 93) | struct ExceptionHandler
  type ExceptionHandler (line 142) | struct ExceptionHandler
  type ExceptionHandler (line 148) | struct ExceptionHandler
  type ExceptionHandler (line 149) | struct ExceptionHandler
  type ExceptionHandler (line 160) | struct ExceptionHandler
  type ExceptionHandler (line 161) | struct ExceptionHandler
  type ExceptionHandler (line 193) | struct ExceptionHandler
  type ExceptionHandler (line 193) | struct ExceptionHandler
  type ExceptionHandler (line 194) | struct ExceptionHandler
  type ExceptionHandler (line 197) | struct ExceptionHandler
  function stopExceptionHandler (line 215) | void stopExceptionHandler(struct ExceptionHandler *exceptionHandler) {

FILE: tools/QBDIPreload/src/darwin_exceptd.h
  type kern_return_t (line 21) | typedef kern_return_t (*exception_handler_func)(mach_port_t, mach_port_t,
  type ExceptionHandler (line 26) | struct ExceptionHandler
  type ExceptionHandler (line 28) | struct ExceptionHandler
  type ExceptionHandler (line 32) | struct ExceptionHandler

FILE: tools/QBDIPreload/src/darwin_preload.c
  type ExceptionHandler (line 66) | struct ExceptionHandler
  function writeCode (line 68) | static void writeCode(rword address, void *data, size_t data_size) {
  function setEntryBreakpoint (line 130) | void setEntryBreakpoint(rword address) {
  function unsetEntryBreakpoint (line 197) | void unsetEntryBreakpoint() {
  function rword (line 221) | rword getEntrypointAddress() {
  function catchEntrypoint (line 329) | void catchEntrypoint(int argc, char **argv) {
  function kern_return_t (line 377) | kern_return_t redirectExec(mach_port_t exception_port, mach_port_t thread,
  function qbdipreload_hook_main (line 455) | int qbdipreload_hook_main(void *main) {
  function QBDI_FORCE_EXPORT (line 462) | QBDI_FORCE_EXPORT void intercept_exit(int status) {
  function intercept__exit (line 471) | void intercept__exit(int status) {
  function qbdipreload_hook_init (line 480) | int qbdipreload_hook_init() {

FILE: tools/QBDIPreload/src/linux_preload.c
  type sigaction (line 50) | struct sigaction
  function setEntryBreakpoint (line 58) | void setEntryBreakpoint(void *address_) {
  function unsetEntryBreakpoint (line 80) | void unsetEntryBreakpoint() {
  function catchEntrypoint (line 108) | void catchEntrypoint(int argc, char **argv) {
  function redirectExec (line 140) | void redirectExec(int signum, siginfo_t *info, void *data) {
  type sigaction (line 163) | struct sigaction
  function qbdipreload_hook_main (line 179) | int qbdipreload_hook_main(void *main) {
  function QBDI_FORCE_EXPORT (line 185) | QBDI_FORCE_EXPORT void exit(int status) {
  function QBDI_FORCE_EXPORT (line 194) | QBDI_FORCE_EXPORT void _exit(int status) {
  function QBDI_FORCE_EXPORT (line 207) | QBDI_FORCE_EXPORT int __libc_start_main(int (*main)(int, char **, char **),
  function qbdipreload_hook_init (line 233) | int qbdipreload_hook_init() {

FILE: tools/QBDIPreload/src/win_preload.c
  function qbdipreload_threadCtxToGPRState (line 70) | void qbdipreload_threadCtxToGPRState(const void *gprCtx, GPRState *gprSt...
  function fullTagWordToAbridged (line 106) | static uint8_t fullTagWordToAbridged(uint16_t fullTag) {
  function qbdipreload_floatCtxToFPRState (line 121) | void qbdipreload_floatCtxToFPRState(const void *gprCtx, FPRState *fprSta...
  function setInt1Exception (line 221) | int setInt1Exception(void *fn_va) {
  function unsetInt1Exception (line 245) | int unsetInt1Exception() {
  function unsetExceptionHandler (line 263) | int unsetExceptionHandler(LONG (*exception_filter_fn)(PEXCEPTION_POINTER...
  function setExceptionHandler (line 271) | int setExceptionHandler(PVECTORED_EXCEPTION_HANDLER exception_filter_fn) {
  function removeConflictModule (line 280) | void removeConflictModule(VMInstanceRef vm, qbdi_MemoryMap *modules,
  function qbdipreload_trampoline_impl (line 321) | void qbdipreload_trampoline_impl() {
  function LONG (line 363) | LONG WINAPI QbdiPreloadExceptionFilter(PEXCEPTION_POINTERS exc_info) {

FILE: tools/QBDIWinPreloader/src/QBDIWinPreloader.c
  function main (line 5) | int main(int argc, TCHAR **argv) {

FILE: tools/frida-qbdi.js
  class Binder (line 43) | class Binder {
    method constructor (line 44) | constructor() { }
    method findLibrary (line 46) | findLibrary(lib, paths) {
    method safeNativeFunction (line 76) | safeNativeFunction(cbk, ret, args) {
    method load (line 84) | load(lib, paths) {
    method bind (line 101) | bind(name, ret, args) {
  class QBDIBinder (line 109) | class QBDIBinder extends Binder {
    method QBDI_LIB (line 113) | get QBDI_LIB() {
    method QBDI_PATHS (line 122) | get QBDI_PATHS() {
    method bind (line 139) | bind(name, ret, args) {
    method load (line 146) | load() {
  function hexPointer (line 276) | function hexPointer(ptr) {
  class InstrRuleDataCBK (line 874) | class InstrRuleDataCBK {
    method constructor (line 883) | constructor(pos, cbk, data, priority = CallbackPriority.PRIORITY_DEFAU...
  class State (line 891) | class State {
    method constructor (line 892) | constructor(state) {
    method ptr (line 899) | get ptr() {
    method toRword (line 903) | toRword() {
    method toString (line 907) | toString() {
  class GPRState (line 915) | class GPRState extends State {
    method _getGPRId (line 916) | _getGPRId(rid) {
    method getRegister (line 933) | getRegister(rid) {
    method setRegister (line 947) | setRegister(rid, value) {
    method getRegisters (line 959) | getRegisters() {
    method setRegisters (line 973) | setRegisters(gprs) {
    method synchronizeRegister (line 989) | synchronizeRegister(FridaCtx, rid, direction) {
    method synchronizeContext (line 1006) | synchronizeContext(FridaCtx, direction) {
    method pp (line 1025) | pp(color) {
    method dump (line 1051) | dump(color) {
    method validOrThrow (line 1055) | static validOrThrow(state) {
  class FPRState (line 1065) | class FPRState extends State {
    method validOrThrow (line 1066) | static validOrThrow(state) {
  class VM (line 1073) | class VM {
    method constructor (line 1087) | constructor() {
    method ptr (line 1122) | get ptr() {
    method version (line 1131) | get version() {
    method getOptions (line 1153) | getOptions() {
    method setOptions (line 1162) | setOptions(options) {
    method addInstrumentedRange (line 1172) | addInstrumentedRange(start, end) {
    method addInstrumentedModule (line 1183) | addInstrumentedModule(name) {
    method addInstrumentedModuleFromAddr (line 1195) | addInstrumentedModuleFromAddr(addr) {
    method instrumentAllExecutableMaps (line 1204) | instrumentAllExecutableMaps() {
    method removeInstrumentedRange (line 1214) | removeInstrumentedRange(start, end) {
    method removeInstrumentedModule (line 1225) | removeInstrumentedModule(name) {
    method removeInstrumentedModuleFromAddr (line 1237) | removeInstrumentedModuleFromAddr(addr) {
    method removeAllInstrumentedRanges (line 1244) | removeAllInstrumentedRanges() {
    method run (line 1256) | run(start, stop) {
    method getGPRState (line 1265) | getGPRState() {
    method getFPRState (line 1274) | getFPRState() {
    method getErrno (line 1283) | getErrno() {
    method setGPRState (line 1292) | setGPRState(state) {
    method setFPRState (line 1302) | setFPRState(state) {
    method setErrno (line 1312) | setErrno(errno) {
    method precacheBasicBlock (line 1323) | precacheBasicBlock(pc) {
    method clearCache (line 1333) | clearCache(start, end) {
    method clearAllCache (line 1340) | clearAllCache() {
    method getNbExecBlock (line 1350) | getNbExecBlock() {
    method reduceCacheTo (line 1362) | reduceCacheTo(nb) {
    method addMnemonicCB (line 1377) | addMnemonicCB(mnem, pos, cbk, data, priority = CallbackPriority.PRIORI...
    method addMemAccessCB (line 1395) | addMemAccessCB(type, cbk, data, priority = CallbackPriority.PRIORITY_D...
    method addInstrRule (line 1411) | addInstrRule(cbk, type, data) {
    method addInstrRuleRange (line 1429) | addInstrRuleRange(start, end, cbk, type, data) {
    method addMemAddrCB (line 1447) | addMemAddrCB(addr, type, cbk, data) {
    method addMemRangeCB (line 1466) | addMemRangeCB(start, end, type, cbk, data) {
    method addCodeCB (line 1483) | addCodeCB(pos, cbk, data, priority = CallbackPriority.PRIORITY_DEFAULT) {
    method addCodeAddrCB (line 1501) | addCodeAddrCB(addr, pos, cbk, data, priority = CallbackPriority.PRIORI...
    method addCodeRangeCB (line 1520) | addCodeRangeCB(start, end, pos, cbk, data, priority = CallbackPriority...
    method addVMEventCB (line 1536) | addVMEventCB(mask, cbk, data) {
    method deleteInstrumentation (line 1549) | deleteInstrumentation(id) {
    method deleteAllInstrumentations (line 1557) | deleteAllInstrumentations() {
    method getInstAnalysis (line 1570) | getInstAnalysis(type) {
    method getCachedInstAnalysis (line 1588) | getCachedInstAnalysis(addr, type) {
    method getJITInstAnalysis (line 1610) | getJITInstAnalysis(addr, type) {
    method recordMemoryAccess (line 1624) | recordMemoryAccess(type) {
    method getInstMemoryAccess (line 1633) | getInstMemoryAccess() {
    method getBBMemoryAccess (line 1642) | getBBMemoryAccess() {
    method allocateVirtualStack (line 1656) | allocateVirtualStack(state, stackSize) {
    method alignedAlloc (line 1675) | alignedAlloc(size, align) {
    method alignedFree (line 1684) | alignedFree(ptr) {
    method simulateCall (line 1695) | simulateCall(state, retAddr, args) {
    method getModuleNames (line 1711) | getModuleNames() {
    method setLogPriority (line 1732) | setLogPriority(priority) {
    method newInstrRuleCallback (line 1759) | newInstrRuleCallback(cbk) {
    method newInstCallback (line 1809) | newInstCallback(cbk) {
    method newVMCallback (line 1849) | newVMCallback(cbk) {
    method call (line 1883) | call(address, args) {
    method switchStackAndCall (line 1918) | switchStackAndCall(address, args, stackSize) {
    method _parseStructDesc (line 1941) | _parseStructDesc(ptr) {
    method _initVM (line 1957) | _initVM() {
    method _terminateVM (line 1963) | _terminateVM(v) {
    method _retainUserData (line 1972) | _retainUserData(data, fn) {
    method _retainUserDataForInstrRuleCB (line 1988) | _retainUserDataForInstrRuleCB(data, fn) {
    method _retainUserDataForInstrRuleCB2 (line 1999) | _retainUserDataForInstrRuleCB2(data, id) {
    method _getUserData (line 2015) | _getUserData(dataPtr) {
    method _releaseUserData (line 2028) | _releaseUserData(id) {
    method _releaseAllUserData (line 2043) | _releaseAllUserData() {
    method _formatVAArgs (line 2049) | _formatVAArgs(args) {
    method _parseMemoryAccess (line 2082) | _parseMemoryAccess(ptr) {
    method _getMemoryAccess (line 2100) | _getMemoryAccess(f) {
    method _parseVMState (line 2133) | _parseVMState(ptr) {
    method _parseOperandAnalysis (line 2167) | _parseOperandAnalysis(ptr) {
    method _parseInstAnalysis (line 2230) | _parseInstAnalysis(ptr) {

FILE: tools/pyqbdi/binding/AARCH64/Options_AARCH64.cpp
  type QBDI (line 22) | namespace QBDI {
    type pyQBDI (line 23) | namespace pyQBDI {
      function init_binding_Options (line 25) | void init_binding_Options(py::module_ &m) {

FILE: tools/pyqbdi/binding/AARCH64/State_AARCH64.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function hexify_register (line 24) | void hexify_register(std::ostringstream &out, __int128 v) {
      function init_binding_State (line 30) | void init_binding_State(py::module_ &m) {

FILE: tools/pyqbdi/binding/ARM/Options_ARM.cpp
  type QBDI (line 22) | namespace QBDI {
    type pyQBDI (line 23) | namespace pyQBDI {
      function init_binding_Options (line 25) | void init_binding_Options(py::module_ &m) {

FILE: tools/pyqbdi/binding/ARM/State_ARM.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function init_binding_State (line 24) | void init_binding_State(py::module_ &m) {

FILE: tools/pyqbdi/binding/Callback.cpp
  type QBDI (line 23) | namespace QBDI {
    type pyQBDI (line 24) | namespace pyQBDI {
      function init_binding_Callback (line 26) | void init_binding_Callback(py::module_ &m) {

FILE: tools/pyqbdi/binding/Enum.hpp
  type QBDI (line 29) | namespace QBDI {
    type pyQBDI (line 30) | namespace pyQBDI {
      class enum_int_flag_ (line 33) | class enum_int_flag_ : public pybind11::enum_<Type> {
        method enum_int_flag_ (line 47) | enum_int_flag_(const py::handle &scope, const char *name,
        method enum_int_flag_ (line 79) | enum_int_flag_ &value(char const *name, Type value,
        method enum_int_flag_ (line 87) | enum_int_flag_ &export_values() {
        method enum_int_flag_ (line 92) | enum_int_flag_ &def_invert() {
        method enum_int_flag_ (line 104) | enum_int_flag_ &def_repr_str() {
        method get_member_name (line 129) | static inline std::string

FILE: tools/pyqbdi/binding/Errors.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function init_binding_Errors (line 24) | void init_binding_Errors(py::module_ &m) {

FILE: tools/pyqbdi/binding/InstAnalysis.cpp
  type QBDI (line 22) | namespace QBDI {
    type pyQBDI (line 23) | namespace pyQBDI {
      function get_InstAnalysis_member (line 26) | py::object get_InstAnalysis_member(const InstAnalysis &obj,
      function get_InstAnalysis_member (line 37) | py::object get_InstAnalysis_member(const InstAnalysis &obj,
      function init_binding_InstAnalysis (line 46) | void init_binding_InstAnalysis(py::module_ &m) {

FILE: tools/pyqbdi/binding/Logs.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function init_binding_Logs (line 24) | void init_binding_Logs(py::module_ &m) {

FILE: tools/pyqbdi/binding/Memory.cpp
  type QBDI (line 22) | namespace QBDI {
    type pyQBDI (line 23) | namespace pyQBDI {
      function init_binding_Memory (line 25) | void init_binding_Memory(py::module_ &m) {

FILE: tools/pyqbdi/binding/Range.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function init_binding_Range (line 24) | void init_binding_Range(py::module_ &m) {

FILE: tools/pyqbdi/binding/VM.cpp
  type QBDI (line 22) | namespace QBDI {
    type pyQBDI (line 23) | namespace pyQBDI {
      type TrampData (line 27) | struct TrampData {
        method TrampData (line 33) | TrampData(const T &cbk, const py::object &obj) : cbk(cbk), obj(obj...
      function removeTrampData (line 37) | static void removeTrampData(uint32_t n, std::map<uint32_t, T> &map) {
      function addTrampData (line 45) | static py::object
      function clearTrampDataMap (line 66) | static void clearTrampDataMap() {
      function VMAction (line 74) | static VMAction trampoline_InstCallback(VMInstanceRef vm, GPRState *...
      function VMAction (line 88) | static VMAction trampoline_VMCallback(VMInstanceRef vm, const VMStat...
      function trampoline_InstrRuleCallback (line 102) | static std::vector<InstrRuleDataCBK>
      function init_binding_VM (line 138) | void init_binding_VM(py::module_ &m) {

FILE: tools/pyqbdi/binding/X86/Options_X86.cpp
  type QBDI (line 22) | namespace QBDI {
    type pyQBDI (line 23) | namespace pyQBDI {
      function init_binding_Options (line 25) | void init_binding_Options(py::module_ &m) {

FILE: tools/pyqbdi/binding/X86/State_X86.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function hexify_register (line 24) | void hexify_register(std::ostringstream &out, const char *s, int siz...
      function init_binding_State (line 30) | void init_binding_State(py::module_ &m) {

FILE: tools/pyqbdi/binding/X86_64/Options_X86_64.cpp
  type QBDI (line 22) | namespace QBDI {
    type pyQBDI (line 23) | namespace pyQBDI {
      function init_binding_Options (line 25) | void init_binding_Options(py::module_ &m) {

FILE: tools/pyqbdi/binding/X86_64/State_X86_64.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function hexify_register (line 24) | void hexify_register(std::ostringstream &out, const char *s, int siz...
      function init_binding_State (line 30) | void init_binding_State(py::module_ &m) {

FILE: tools/pyqbdi/binding/callback_python.h
  function namespace (line 23) | namespace QBDI {

FILE: tools/pyqbdi/fix_preload_lib_macos.py
  function read_header (line 7) | def read_header(libpath):
  function setID (line 42) | def setID(libname):
  function removeRpath (line 47) | def removeRpath(libname, path):
  function movLib (line 52) | def movLib(libname, oldlib, newlib):
  function resign (line 57) | def resign(libname):
  function run (line 63) | def run():

FILE: tools/pyqbdi/preload.cpp
  type QBDI (line 27) | namespace QBDI {
    type pyQBDI (line 28) | namespace pyQBDI {
      function PYBIND11_EMBEDDED_MODULE (line 30) | PYBIND11_EMBEDDED_MODULE(pyqbdi, m) {

FILE: tools/pyqbdi/pyqbdi.hpp
  type QBDI (line 41) | namespace QBDI {
    type pyQBDI (line 42) | namespace pyQBDI {

FILE: tools/pyqbdi/pyqbdi_module.cpp
  type QBDI (line 23) | namespace QBDI {
    type pyQBDI (line 24) | namespace pyQBDI {
      function PYBIND11_MODULE (line 26) | PYBIND11_MODULE(pyqbdi, m) {

FILE: tools/pyqbdi/pyqbdipreload.py
  function get_preloadlib (line 27) | def get_preloadlib():
  function find_binary (line 48) | def find_binary(environ, binary, canFail=False):
  function find_windows_inject_binary (line 73) | def find_windows_inject_binary(environ):
  function run (line 88) | def run():

FILE: tools/pyqbdi/utils/Float.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function init_utils_Float (line 24) | void init_utils_Float(py::module_ &m) {

FILE: tools/pyqbdi/utils/Memory.cpp
  type QBDI (line 21) | namespace QBDI {
    type pyQBDI (line 22) | namespace pyQBDI {
      function init_utils_Memory (line 24) | void init_utils_Memory(py::module_ &m) {

FILE: tools/validation_runner/RunConfig.py
  class TestConfig (line 23) | class TestConfig:
    method __init__ (line 24) | def __init__(self, conf = None):
    method from_dict (line 37) | def from_dict(cls, d):
    method command_line (line 43) | def command_line(self):
  class RunConfig (line 46) | class RunConfig:
    method __init__ (line 47) | def __init__(self, config_file, lib=None, thread=0):

FILE: tools/validation_runner/RunOrchestrator.py
  function run_test (line 26) | def run_test(test, env, idx):
  class RunOrchestrator (line 61) | class RunOrchestrator:
    method __init__ (line 62) | def __init__(self, run_cfg):
    method run (line 65) | def run(self):

FILE: tools/validation_runner/RunResult.py
  class RunResult (line 22) | class RunResult:
    method __init__ (line 23) | def __init__(self, test_results=None):
    method from_dict (line 68) | def from_dict(cls, d):
    method print_stats (line 101) | def print_stats(self):
    method compartive_analysis (line 117) | def compartive_analysis(self, db):
    method get_branch_commit (line 153) | def get_branch_commit(self):
    method write_to_db (line 164) | def write_to_db(self, db):

FILE: tools/validation_runner/SQLite.py
  class SQLiteDBAdapter (line 24) | class SQLiteDBAdapter:
    method __init__ (line 25) | def __init__(self, db_path):
    method setup_db (line 30) | def setup_db(self):
    method insert_run_result (line 108) | def insert_run_result(self, run_result):
    method insert_test_result (line 125) | def insert_test_result(self, run_id, test_result):
    method get_last_run (line 146) | def get_last_run(self, branch):

FILE: tools/validation_runner/TestResult.py
  class Scan_Pattern_Exception (line 25) | class Scan_Pattern_Exception(Exception):
  function scan_for_pattern (line 28) | def scan_for_pattern(data, pattern):
  function scan_for_multipattern (line 34) | def scan_for_multipattern(data, pattern):
  function coverage_to_log (line 40) | def coverage_to_log(coverage):
  class TestResult (line 45) | class TestResult:
    method __init__ (line 46) | def __init__(self, cfg = None, retcode = None, result = None, coverage...
    method from_dict (line 120) | def from_dict(cls, d):
    method get_binary_hash (line 159) | def get_binary_hash(self):

FILE: tools/validator/AARCH64/linux_AARCH64.cpp
  function userToGPRState (line 25) | void userToGPRState(const GPR_STRUCT *user, QBDI::GPRState *gprState) {
  function userToFPRState (line 62) | void userToFPRState(const FPR_STRUCT *user, QBDI::FPRState *fprState) {
  type iovec (line 101) | struct iovec
  type iovec (line 113) | struct iovec

FILE: tools/validator/AARCH64/linux_AARCH64.h
  type GPR_STRUCT (line 35) | typedef struct user_regs_struct GPR_STRUCT;
  type FPR_STRUCT (line 36) | typedef struct user_fpsimd_struct FPR_STRUCT;

FILE: tools/validator/ARM/linux_ARM.cpp
  function userToGPRState (line 56) | void userToGPRState(const GPR_STRUCT *user, QBDI::GPRState *gprState) {
  function userToFPRState (line 79) | void userToFPRState(const FPR_STRUCT *user, QBDI::FPRState *fprState) {

FILE: tools/validator/ARM/linux_ARM.h
  type GPR_STRUCT (line 41) | typedef struct user_regs GPR_STRUCT;
  type FPR_STRUCT (line 42) | typedef struct __attribute__((__packed__)) {

FILE: tools/validator/X86/linux_X86.cpp
  function userToGPRState (line 26) | void userToGPRState(const GPR_STRUCT *user, QBDI::GPRState *gprState) {
  function userToFPRState (line 39) | void userToFPRState(const FPR_STRUCT *user, QBDI::FPRState *fprState) {

FILE: tools/validator/X86/linux_X86.h
  type GPR_STRUCT (line 32) | typedef struct user_regs_struct GPR_STRUCT;
  type FPR_STRUCT (line 33) | typedef struct user_fpxregs_struct FPR_STRUCT;
  function fix_GPR_STRUCT (line 38) | static inline void fix_GPR_STRUCT(GPR_STRUCT *user) { user->eip -= 1; }

FILE: tools/validator/X86_64/linux_X86_64.cpp
  function userToGPRState (line 26) | void userToGPRState(const GPR_STRUCT *user, QBDI::GPRState *gprState) {
  function userToFPRState (line 47) | void userToFPRState(const FPR_STRUCT *user, QBDI::FPRState *fprState) {

FILE: tools/validator/X86_64/linux_X86_64.h
  type GPR_STRUCT (line 32) | typedef struct user_regs_struct GPR_STRUCT;
  type FPR_STRUCT (line 33) | typedef struct user_fpregs_struct FPR_STRUCT;
  function fix_GPR_STRUCT (line 38) | static inline void fix_GPR_STRUCT(GPR_STRUCT *user) { user->rip -= 1; }

FILE: tools/validator/darwin_process.cpp
  type Status (line 41) | enum Status { Running, Stopped, Crashed, Exited }
  function kern_return_t (line 43) | kern_return_t onBreakpoint(mach_port_t exception_port, mach_port_t thread,
  type kevent (line 99) | struct kevent
  type kevent (line 258) | struct kevent
  function hasExited (line 317) | bool hasExited(int status) { return status == Status::Exited; }
  function hasStopped (line 319) | bool hasStopped(int status) { return status == Status::Stopped; }
  function hasCrashed (line 321) | bool hasCrashed(int status) { return status == Status::Crashed; }
  function threadStateToGPRState (line 323) | void threadStateToGPRState(THREAD_STATE *ts, QBDI::GPRState *gprState) {
  function floatStateToFPRState (line 327) | void floatStateToFPRState(THREAD_STATE_FP *fs, QBDI::FPRState *fprState) {

FILE: tools/validator/darwin_process.h
  function QBDI (line 56) | static inline QBDI::rword getSP(THREAD_STATE *state) {
  function setSP (line 60) | static inline void setSP(THREAD_STATE *state, QBDI::rword address) {
  function setBP (line 64) | static inline void setBP(THREAD_STATE *state, QBDI::rword address) {
  function class (line 69) | class DarwinProcess : public Process {

FILE: tools/validator/darwin_validator.cpp
  type Role (line 38) | enum Role { Master, Instrumented, Debugged }

FILE: tools/validator/instrumented.cpp
  type Pipes (line 35) | struct Pipes {
  type CBData (line 40) | struct CBData {
  function step (line 45) | static QBDI::VMAction step(QBDI::VMInstanceRef vm, QBDI::GPRState *gprSt...
  function verifyMemoryAccess (line 111) | static QBDI::VMAction verifyMemoryAccess(QBDI::VMInstanceRef vm,
  function logSyscall (line 258) | static QBDI::VMAction logSyscall(QBDI::VMInstanceRef vm,
  function logTransfer (line 268) | static QBDI::VMAction logTransfer(QBDI::VMInstanceRef vm,
  function saveErrno (line 277) | static QBDI::VMAction saveErrno(QBDI::VMInstanceRef vm,
  function restoreErrno (line 285) | static QBDI::VMAction restoreErrno(QBDI::VMInstanceRef vm,
  function cleanup_instrumentation (line 296) | void cleanup_instrumentation() {
  function start_instrumented (line 307) | void start_instrumented(QBDI::VM *vm, QBDI::rword start, QBDI::rword stop,

FILE: tools/validator/linux_process.cpp
  function hasExited (line 67) | bool hasExited(int status) { return WIFEXITED(status) > 0; }
  function hasStopped (line 69) | bool hasStopped(int status) {
  function hasCrashed (line 73) | bool hasCrashed(int status) {

FILE: tools/validator/linux_process.h
  function class (line 33) | class LinuxProcess : public Process {

FILE: tools/validator/linux_validator.cpp
  function killChild (line 75) | void killChild() {

FILE: tools/validator/master.cpp
  function start_master (line 31) | void start_master(Process *debugged, pid_t instrumented, int ctrlfd, int...

FILE: tools/validator/pipes.cpp
  function readCString (line 24) | int readCString(char *str, size_t length, FILE *pipe) {
  function writeCString (line 38) | int writeCString(const char *str, FILE *pipe) {
  function readInstructionEvent (line 46) | int readInstructionEvent(QBDI::rword *address, char *mnemonic,
  function writeInstructionEvent (line 72) | int writeInstructionEvent(QBDI::rword address, const char *mnemonic,
  function readMismatchMemAccessEvent (line 101) | int readMismatchMemAccessEvent(QBDI::rword *address, bool *doRead,
  function writeMismatchMemAccessEvent (line 132) | int writeMismatchMemAccessEvent(QBDI::rword address, bool doRead, bool m...
  function readExecTransferEvent (line 168) | int readExecTransferEvent(QBDI::rword *address, FILE *pipe) {
  function writeExecTransferEvent (line 175) | int writeExecTransferEvent(QBDI::rword address, FILE *pipe) {
  function readEvent (line 186) | int readEvent(EVENT *event, FILE *pipe) {
  function writeEvent (line 193) | int writeEvent(EVENT event, FILE *pipe) {
  function readCommand (line 201) | int readCommand(COMMAND *command, FILE *pipe) {
  function writeCommand (line 208) | int writeCommand(COMMAND command, FILE *pipe) {

FILE: tools/validator/pipes.h
  type EVENT (line 28) | enum EVENT {
  function format_as (line 35) | inline int format_as(EVENT e) { return e; }
  type COMMAND (line 37) | enum COMMAND {

FILE: tools/validator/process.h
  function class (line 25) | class Process {

FILE: tools/validator/validatorengine.cpp
  function getValidOffsetRange (line 25) | std::pair<QBDI::rword, QBDI::rword> getValidOffsetRange(QBDI::rword addr...
  type pollfd (line 563) | struct pollfd

FILE: tools/validator/validatorengine.h
  type LogVerbosity (line 32) | enum LogVerbosity { Stat, Summary, Detail, Full }
  type ErrorSeverity (line 34) | enum ErrorSeverity {
  type DiffError (line 40) | struct DiffError {
  type DiffMap (line 49) | struct DiffMap {
  type Cascade (line 57) | struct Cascade {
  function ValidatorEngine (line 65) | struct AccessError {
Condensed preview — 604 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,547K chars).
[
  {
    "path": ".clang-format",
    "chars": 668,
    "preview": "---\nBasedOnStyle: LLVM\nIndentWidth: 2\n---\nLanguage: Cpp\nAlignConsecutiveBitFields: true\nAlignEscapedNewlines: Left\nAlway"
  },
  {
    "path": ".clang-format.exclude-list.txt",
    "chars": 59,
    "preview": "cmake/llvm/.*\\.patch\\.txt\ncmake/config/ios.toolchain.cmake\n"
  },
  {
    "path": ".cmake_format.conf.py",
    "chars": 390,
    "preview": "with section(\"format\"):\n\n  line_width = 80\n  tab_size = 2\n  use_tabchars = False\n\nwith section(\"markup\"):\n  enable_marku"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/assistance_request.md",
    "chars": 1668,
    "preview": "---\nname: Assistance Request\nabout: Ask for help for using QBDI\ntitle: ''\nlabels: ''\nassignees: ''\n---\n\n**Description of"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/assistance_request_new.yml",
    "chars": 2186,
    "preview": "name: Assistance Request (new)\ndescription: Ask for help for using QBDI\nbody:\n  - type: markdown\n    attributes:\n      l"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 1639,
    "preview": "---\nname: Bug report\nabout: Create a bug report\ntitle: ''\nlabels: ''\nassignees: ''\n---\n\n** Description of the problem **"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report_new.yml",
    "chars": 2153,
    "preview": "name: Bug Report (new)\ndescription: Create a bug report\nbody:\n  - type: markdown\n    attributes:\n      label: Descriptio"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 27,
    "preview": "blank_issues_enabled: true\n"
  },
  {
    "path": ".github/format_check.sh",
    "chars": 683,
    "preview": "#!/usr/bin/env bash\n\nset -e\n\ncd $(dirname \"$0\")\nRETURN_CODE=0\nBASEDIR=$(pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n"
  },
  {
    "path": ".github/workflows/android.yml",
    "chars": 3187,
    "preview": "name: Package Android\n\non:\n  push:\n    branches:\n      - master\n      - dev-next\n  workflow_dispatch:\n\njobs:\n  build:\n  "
  },
  {
    "path": ".github/workflows/ccache.conf",
    "chars": 17,
    "preview": "max_size = 512 M\n"
  },
  {
    "path": ".github/workflows/clang_format.yml",
    "chars": 583,
    "preview": "name: Code format\n\non: [push, pull_request]\n\njobs:\n  check:\n    runs-on: ubuntu-24.04\n    env:\n      CLANG_FORMAT_VERSIO"
  },
  {
    "path": ".github/workflows/ios.yml",
    "chars": 1938,
    "preview": "name: Package iOS\n\non:\n  push:\n    branches:\n      - master\n      - dev-next\n  workflow_dispatch:\n\njobs:\n  build:\n    ru"
  },
  {
    "path": ".github/workflows/linux.yml",
    "chars": 3837,
    "preview": "name: Tests and Package Linux\n\non:\n  push:\n    branches:\n      - master\n      - dev-next\n  pull_request:\n  workflow_disp"
  },
  {
    "path": ".github/workflows/macos.yml",
    "chars": 6427,
    "preview": "name: Tests and Package macOS\n\non:\n  push:\n    branches:\n      - master\n      - dev-next\n  pull_request:\n  workflow_disp"
  },
  {
    "path": ".github/workflows/python.yml",
    "chars": 2582,
    "preview": "name: PyQBDI package\n\non:\n  push:\n    branches:\n      - master\n      - dev-next\n    tags:\n      - 'v*'\n  workflow_dispat"
  },
  {
    "path": ".github/workflows/python_linux.yml",
    "chars": 1763,
    "preview": "name: PyQBDI Linux package\n\non:\n  workflow_call:\n  workflow_dispatch:\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    str"
  },
  {
    "path": ".github/workflows/python_macos.yml",
    "chars": 6357,
    "preview": "name: PyQBDI macOS package\n\non:\n  workflow_call:\n  workflow_dispatch:\n\njobs:\n  build-pyqbdi-x64:\n    runs-on: macos-15-i"
  },
  {
    "path": ".github/workflows/python_windows.yml",
    "chars": 2793,
    "preview": "name: PyQBDI Windows Package\n\non:\n  workflow_call:\n  workflow_dispatch:\n\njobs:\n  build:\n    runs-on: windows-latest\n    "
  },
  {
    "path": ".github/workflows/windows.yml",
    "chars": 2579,
    "preview": "name: Tests and Package Windows\n\non:\n  push:\n    branches:\n      - master\n      - dev-next\n  pull_request:\n  workflow_di"
  },
  {
    "path": ".gitignore",
    "chars": 452,
    "preview": "**/.DS_Store\nTODO\nbuild*/*\n\ndist\noutwheel\n\ndocs/build\ndocs/doxygen_c\ndocs/doxygen_cpp\ndocs/doxygen_qbdipreload\ndocs/qbdi"
  },
  {
    "path": ".readthedocs.condaenv.yml",
    "chars": 306,
    "preview": "name: RTD\nchannels:\n  - conda-forge\n  - defaults\ndependencies:\n  - python=3.11\n  - doxygen=1.9.8\n  - pip\n  - pip:\n    - "
  },
  {
    "path": ".readthedocs.yml",
    "chars": 450,
    "preview": "version: 2\n\nbuild:\n  os: ubuntu-24.04\n  tools:\n    python: \"miniconda3-4.7\"\n    nodejs: \"20\"\n  jobs:\n    post_create_env"
  },
  {
    "path": "CHANGELOG",
    "chars": 107,
    "preview": "Changelog\n=========\n\nsee docs/source/changelog.rst or https://qbdi.readthedocs.io/en/stable/changelog.html\n"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 17883,
    "preview": "cmake_minimum_required(VERSION 3.28)\nproject(QBDI)\n\ninclude(GNUInstallDirs)\n\nlist(APPEND CMAKE_MODULE_PATH \"${CMAKE_CURR"
  },
  {
    "path": "LICENSE.txt",
    "chars": 12462,
    "preview": "################################################################################\nQBDI package license\n##################"
  },
  {
    "path": "MANIFEST.in",
    "chars": 324,
    "preview": "\n## include any cmake file\n\ninclude CMakeLists.txt\nrecursive-include cmake *\nrecursive-exclude cmake config/*\n\n## includ"
  },
  {
    "path": "README-pypi.rst",
    "chars": 3786,
    "preview": "Introduction\n============\n\n.. image:: https://readthedocs.org/projects/qbdi/badge/?version=stable\n    :target: https://q"
  },
  {
    "path": "README.rst",
    "chars": 9032,
    "preview": ".. image:: https://readthedocs.org/projects/qbdi/badge/?version=stable\n    :target: https://qbdi.readthedocs.io/en/stabl"
  },
  {
    "path": "cmake/QBDIConfig.cmake",
    "chars": 5738,
    "preview": "if(__add_qbdi_config)\n  return()\nendif()\nset(__add_qbdi_config ON)\n\n# ========================\n# CMAKE build type\n# ===="
  },
  {
    "path": "cmake/QBDIDependencies.cmake",
    "chars": 4607,
    "preview": "if(__add_qbdi_deps)\n  return()\nendif()\nset(__add_qbdi_deps ON)\ninclude(FetchContent)\n\nif(NOT DEFINED QBDI_THIRD_PARTY_DI"
  },
  {
    "path": "cmake/QBDIOptions.cmake",
    "chars": 4218,
    "preview": "if(__add_qbdi_options)\n  return()\nendif()\nset(__add_qbdi_options ON)\n\n# Enable compilation using ccache\noption(QBDI_CCAC"
  },
  {
    "path": "cmake/config/config-android-X86.sh",
    "chars": 871,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\nif [ -z \"${NDK_PA"
  },
  {
    "path": "cmake/config/config-android-X86_64.sh",
    "chars": 871,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\nif [ -z \"${NDK_PA"
  },
  {
    "path": "cmake/config/config-android-aarch64.sh",
    "chars": 870,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\nif [ -z \"${NDK_PA"
  },
  {
    "path": "cmake/config/config-android-armv7.sh",
    "chars": 869,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\nif [ -z \"${NDK_PA"
  },
  {
    "path": "cmake/config/config-ios-aarch64.sh",
    "chars": 412,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\ncmake \"${GITDIR}\""
  },
  {
    "path": "cmake/config/config-linux-X86.sh",
    "chars": 333,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\ncmake \"${GITDIR}\""
  },
  {
    "path": "cmake/config/config-linux-X86_64.sh",
    "chars": 333,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\ncmake \"${GITDIR}\""
  },
  {
    "path": "cmake/config/config-linux-aarch64.sh",
    "chars": 333,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\ncmake \"${GITDIR}\""
  },
  {
    "path": "cmake/config/config-macOS-AARCH64.sh",
    "chars": 333,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\ncmake \"${GITDIR}\""
  },
  {
    "path": "cmake/config/config-macOS-AARCH64e.sh",
    "chars": 419,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\ncmake \"${GITDIR}\""
  },
  {
    "path": "cmake/config/config-macOS-X86.sh",
    "chars": 333,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\ncmake \"${GITDIR}\""
  },
  {
    "path": "cmake/config/config-macOS-X86_64.sh",
    "chars": 333,
    "preview": "#!/bin/sh\nset -e\n\nBASEDIR=\"$(cd \"$(dirname \"$0\")\" && pwd -P)\"\nGITDIR=\"$(realpath \"${BASEDIR}/../..\")\"\n\ncmake \"${GITDIR}\""
  },
  {
    "path": "cmake/config/config-win-X86.py",
    "chars": 587,
    "preview": "import subprocess\nimport os\n\n# be sure to run \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliar"
  },
  {
    "path": "cmake/config/config-win-X86_64.py",
    "chars": 501,
    "preview": "import subprocess\nimport os\n\n# be sure to run \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliar"
  },
  {
    "path": "cmake/config/ios.toolchain.cmake",
    "chars": 3482,
    "preview": "# from https://github.com/llvm/llvm-project/blob/release/19.x/llvm/cmake/platforms/iOS.cmake\n\n# LICENSE : Apache License"
  },
  {
    "path": "cmake/dummy.c",
    "chars": 27,
    "preview": "int dummy() { return 42; }\n"
  },
  {
    "path": "cmake/llvm/QBDI_llvm.cmake",
    "chars": 10324,
    "preview": "if(__add_qbdi_llvm)\n  return()\nendif()\nset(__add_qbdi_llvm ON)\n\ninclude(FetchContent)\n\n# configure FetchContent\nset(QBDI"
  },
  {
    "path": "cmake/llvm/QBDI_llvm_tblgen.cmake",
    "chars": 1299,
    "preview": "if(__add_qbdi_llvm_tblgen)\n  return()\nendif()\nset(__add_qbdi_llvm_tblgen ON)\ninclude(ExternalProject)\n\nset(NATIVE_BUILD_"
  },
  {
    "path": "cmake/llvm/rename_object.py",
    "chars": 5154,
    "preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport subprocess\nimport tempfile\nimport os\nimport sys\n\nLIPO = \"lipo\"\nIOS_"
  },
  {
    "path": "cmake/merge_archives.cmake",
    "chars": 2128,
    "preview": "set(MERGE_LIBS_DUMMY_FILE ${CMAKE_CURRENT_LIST_DIR}/dummy.c)\n\nmacro(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)\n"
  },
  {
    "path": "docker/.gitignore",
    "chars": 11,
    "preview": "image.hash\n"
  },
  {
    "path": "docker/archlinux/Dockerfile.X86",
    "chars": 1259,
    "preview": "FROM archlinux:base-devel\nLABEL maintainer=\"QBDI Team <qbdi@quarkslab.com>\"\n\nENV USER=\"docker\" \\\n    HOME=\"/home/docker\""
  },
  {
    "path": "docker/archlinux/Dockerfile.X86_64",
    "chars": 1119,
    "preview": "FROM archlinux:base-devel\nLABEL maintainer=\"QBDI Team <qbdi@quarkslab.com>\"\n\nENV USER=\"docker\" \\\n    HOME=\"/home/docker\""
  },
  {
    "path": "docker/archlinux/PKGBUILD.X86",
    "chars": 914,
    "preview": "# Maintainer: Charles Hubain <chubain@quarkslab.com>\n# Maintainer: QBDI Team <qbdi@quarkslab.com>\n\npkgname=QBDI-X86\npkgv"
  },
  {
    "path": "docker/archlinux/PKGBUILD.X86_64",
    "chars": 916,
    "preview": "# Maintainer: Charles Hubain <chubain@quarkslab.com>\n# Maintainer: QBDI Team <qbdi@quarkslab.com>\n\npkgname=QBDI-X86_64\np"
  },
  {
    "path": "docker/archlinux/build.sh",
    "chars": 411,
    "preview": "#!/usr/bin/bash\n\nset -e\nset -x\n\nBASEDIR=$(cd $(dirname \"$0\") && pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n\n. \"${BA"
  },
  {
    "path": "docker/ci_linux/Dockerfile",
    "chars": 947,
    "preview": "ARG DOCKER_IMG=\"debian:13\"\n\nFROM $DOCKER_IMG\n\nENV USER=\"docker\" \\\n    HOME=\"/home/docker\" \\\n    PREFIX=\"/usr\" \\\n    CLIC"
  },
  {
    "path": "docker/ci_linux/build-qbdi.sh",
    "chars": 575,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd \"${HOME}/qbdi/\"\nmkdir -p build\ncd build\n\ncmake .. \\\n      -G Ninja \\\n      -DCMAKE_BUIL"
  },
  {
    "path": "docker/ci_linux/img_build.sh",
    "chars": 473,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd $(dirname \"$0\")\nBASEDIR=$(pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n\nif [[ \"${QBD"
  },
  {
    "path": "docker/ci_linux/qbdi.sh",
    "chars": 523,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd $(dirname \"$0\")\nBASEDIR=$(pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n\n./img_build."
  },
  {
    "path": "docker/ci_linux_arm/.gitignore",
    "chars": 61,
    "preview": ".dockcross-linux-AARCH64-latest\n.dockcross-linux-ARM-latest\n\n"
  },
  {
    "path": "docker/ci_linux_arm/build_qbdi_linux.sh",
    "chars": 894,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd \"$(dirname \"$0\")\"\nBASEDIR=\"$(pwd -P)\"\nGITDIR=\"$(git rev-parse --show-toplevel)\"\n\nTAG_PR"
  },
  {
    "path": "docker/ci_linux_arm/docker_internal_script/build-test-linux.sh",
    "chars": 1427,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\nmkdir -p \"build-docker-${QBDI_PLATFORM}-${QBDI_ARCH}\"\ncd \"build-docker-${QBDI_PLATFORM}-${"
  },
  {
    "path": "docker/ci_linux_arm/images/Dockerfile.dockcross",
    "chars": 595,
    "preview": "ARG DOCKER_IMG=\"dockcross/linux-arm64\"\n\nFROM $DOCKER_IMG\n\nENV CLICOLOR_FORCE=1\n\n# setup backport to use cmake >= 3.28\nRU"
  },
  {
    "path": "docker/ci_linux_arm/images/img_build.sh",
    "chars": 850,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd \"$(dirname \"$0\")\"\nBASEDIR=\"$(pwd -P)\"\nTAG_PREFIX=\"qbdi-linux/qbdi_test\"\nTARGET_ARCH=\"$1"
  },
  {
    "path": "docker/ci_python_linux/Dockerfile",
    "chars": 1553,
    "preview": "ARG DOCKER_IMG=\"quay.io/pypa/manylinux2014\"\n\nFROM $DOCKER_IMG\n\nENV USER=\"docker\" \\\n    HOME=\"/home/docker\" \\\n    PREFIX="
  },
  {
    "path": "docker/ci_python_linux/build_whl.sh",
    "chars": 1441,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd ~/qbdi\n\nPYTHON_VERSION=\"${1:-all}\"\n\nif [[ \"${PYTHON_VERSION}\" = \"all\" ]] || [[ \"${PYTHO"
  },
  {
    "path": "docker/ci_python_linux/img_build.sh",
    "chars": 638,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd $(dirname \"$0\")\nBASEDIR=$(pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n\nif [[ \"${QBD"
  },
  {
    "path": "docker/ci_python_linux/whl_build.sh",
    "chars": 517,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd $(dirname \"$0\")\nBASEDIR=$(pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n\nPYTHON_VERSI"
  },
  {
    "path": "docker/common.sh",
    "chars": 401,
    "preview": "\nQBDI_VERSION=\"0.12.2-devel\"\nDOCKERHUB_REPO=\"qbdi/qbdi\"\nDOCKER_BUILD_DIR=\"/home/docker/qbdi/build\"\n\nDEBIAN_TARGET=\"trixi"
  },
  {
    "path": "docker/linux_arm_natif/.gitignore",
    "chars": 61,
    "preview": ".dockcross-linux-AARCH64-latest\n.dockcross-linux-ARM-latest\n\n"
  },
  {
    "path": "docker/linux_arm_natif/build_qbdi_linux.sh",
    "chars": 745,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd \"$(dirname \"$0\")\"\nBASEDIR=\"$(pwd -P)\"\nGITDIR=\"$(git rev-parse --show-toplevel)\"\n\nTAG_PR"
  },
  {
    "path": "docker/linux_arm_natif/docker_internal_script/build-test-linux.sh",
    "chars": 550,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\nmkdir -p \"build-docker-native-${QBDI_PLATFORM}-${QBDI_ARCH}\"\ncd \"build-docker-native-${QBD"
  },
  {
    "path": "docker/linux_arm_natif/images/Dockerfile",
    "chars": 1066,
    "preview": "ARG DOCKER_IMG=\"debian:latest\"\nFROM $DOCKER_IMG\n\nARG QBDI_ARCH=\"AARCH64\"\n\nENV USER=\"docker\" \\\n    HOME=\"/home/docker\" \\\n"
  },
  {
    "path": "docker/linux_arm_natif/images/build_docker_img.sh",
    "chars": 789,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd \"$(dirname \"$0\")\"\nBASEDIR=\"$(pwd -P)\"\nTAG_PREFIX=\"qbdi-linux/qbdi_test\"\nTARGET_ARCH=\"$1"
  },
  {
    "path": "docker/python_linux_arm/docker_internal_script/build_wheel.sh",
    "chars": 373,
    "preview": "#!/usr/bin/env bash\n\n# change python host platform to armv7 arch\n# This is needed when compile on X86 or AARCH64 platfor"
  },
  {
    "path": "docker/python_linux_arm/images/Dockerfile",
    "chars": 1021,
    "preview": "ARG DOCKER_IMG=\"arm32v7/python:3\"\n\nFROM $DOCKER_IMG\n\nENV USER=\"docker\" \\\n    HOME=\"/home/docker\" \\\n    PREFIX=\"/usr\" \\\n "
  },
  {
    "path": "docker/python_linux_arm/images/build_docker_img.sh",
    "chars": 779,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd \"$(dirname \"$0\")\"\nBASEDIR=\"$(pwd -P)\"\nTAG_PREFIX=\"pyqbdi/wheel_arm_building\"\nBASE_DEBIA"
  },
  {
    "path": "docker/python_linux_arm/whl_build.sh",
    "chars": 963,
    "preview": "#!/usr/bin/env bash\n\nset -ex\n\ncd $(dirname \"$0\")\nBASEDIR=$(pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\nTAG_PREFIX=\"p"
  },
  {
    "path": "docker/release.sh",
    "chars": 3052,
    "preview": "#!/usr/bin/bash\n\nset -e\n\nHASHFILE=\"image.hash\"\nPUSH_IMAGE=0\nTARGET_ARCH=\"$1\"\n\nBASEDIR=$(cd $(dirname \"$0\") && pwd -P)\nGI"
  },
  {
    "path": "docker/ubuntu_debian/Dockerfile",
    "chars": 2145,
    "preview": "ARG DOCKER_IMG=\"ubuntu:latest\"\n\nFROM $DOCKER_IMG AS builder\n\nARG QBDI_ARCH=\"X86_64\"\n\nENV USER=\"docker\" \\\n    HOME=\"/home"
  },
  {
    "path": "docker/ubuntu_debian/build.sh",
    "chars": 1251,
    "preview": "#!/usr/bin/bash\n\nset -e\nset -x\n\nBASEDIR=$(cd $(dirname \"$0\") && pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n\n. \"${BA"
  },
  {
    "path": "docker/ubuntu_debian_devel/Dockerfile",
    "chars": 1971,
    "preview": "ARG DOCKER_IMG=\"ubuntu:latest\"\n\nFROM $DOCKER_IMG\n\nARG QBDI_ARCH=\"X86_64\"\n\nENV USER=\"docker\" \\\n    HOME=\"/home/docker\" \\\n"
  },
  {
    "path": "docker/ubuntu_debian_devel/build.sh",
    "chars": 1223,
    "preview": "#!/usr/bin/bash\n\nset -e\n\nBASEDIR=$(cd $(dirname \"$0\") && pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n\n. \"${BASEDIR}/"
  },
  {
    "path": "docs/CMakeLists.txt",
    "chars": 1646,
    "preview": "configure_file(qbdi_cpp.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/qbdi_cpp.doxygen\n               @ONLY)\nconfigure_file(qbd"
  },
  {
    "path": "docs/qbdi_c.doxygen.in",
    "chars": 114972,
    "preview": "# Doxyfile 1.9.2\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) "
  },
  {
    "path": "docs/qbdi_cpp.doxygen.in",
    "chars": 115139,
    "preview": "# Doxyfile 1.9.2\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) "
  },
  {
    "path": "docs/qbdipreload.doxygen.in",
    "chars": 114408,
    "preview": "# Doxyfile 1.9.2\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) "
  },
  {
    "path": "docs/requirements.txt",
    "chars": 138,
    "preview": "python-dateutil\npygit2\nrequests\nSphinx==8.2.3\ndocutils==0.21.2\nbreathe==4.36.0\nsphinx-js==5.0.2\nmarkupsafe==3.0.3\nsphinx"
  },
  {
    "path": "docs/rtd_pyqbdi_artifact/setup.py",
    "chars": 7391,
    "preview": "#!/usr/bin/env python3\n\n# This script will install the latest artifact from 'PyQBDI Linux package' github action\n\nimport"
  },
  {
    "path": "docs/source/_static/style.css",
    "chars": 160,
    "preview": ".green {\n    color: green;\n}\n.yellow {\n    color: #ffc000;\n}\n.orange {\n    color: #ff6000;\n}\n.red {\n    color: red;\n}\n\n."
  },
  {
    "path": "docs/source/_templates/layout.html",
    "chars": 85,
    "preview": "{% extends \"!layout.html\" %}\n{% set css_files = css_files + [\"_static/style.css\"] %}\n"
  },
  {
    "path": "docs/source/api.rst",
    "chars": 395,
    "preview": "\nAPI\n===\n\nThis section contains the documentation of every QBDI API.\n\n\n.. toctree::\n    :maxdepth: 2\n\n    API descriptio"
  },
  {
    "path": "docs/source/api_c.rst",
    "chars": 11233,
    "preview": ".. highlight:: c\n\nC API\n=====\n\nIntroduction\n------------\n\nThe C API offers bindings over the C++ API. The VM class' meth"
  },
  {
    "path": "docs/source/api_cpp.rst",
    "chars": 12704,
    "preview": ".. highlight:: c++\n\nC++ API\n=======\n\nIntroduction\n------------\n\nThe C++ API is the primary API of QBDI. The API is compa"
  },
  {
    "path": "docs/source/api_description.rst",
    "chars": 17867,
    "preview": "API description\n===============\n\nThis section gives the big picture of all the APIs QBDI offers.\nIt may help you better "
  },
  {
    "path": "docs/source/api_js.rst",
    "chars": 15730,
    "preview": ".. _frida-qbdi-api:\n\nFrida/QBDI API\n==============\n\nIntroduction\n------------\n\nWe provide bindings for Frida, most C/C++"
  },
  {
    "path": "docs/source/api_pyqbdi.rst",
    "chars": 9233,
    "preview": ".. currentmodule:: pyqbdi\n\nPyQBDI API\n==========\n\nIntroduction\n------------\n\nWe offer bindings for Python, the whole C/C"
  },
  {
    "path": "docs/source/api_pyqbdipreload.rst",
    "chars": 1684,
    "preview": ".. _pyqbdipreload_api:\n\nPyQBDIPreload API\n=================\n\nIntroduction\n------------\n\nPyQBDIPreload consists of two ma"
  },
  {
    "path": "docs/source/api_qbdipreload.rst",
    "chars": 2462,
    "preview": ".. _qbdipreload_api:\n\nQBDIPreload API\n===============\n\nIntroduction\n------------\n\nQBDIPreload is a small utility library"
  },
  {
    "path": "docs/source/architecture_support.rst",
    "chars": 13679,
    "preview": "Architecture Support\n====================\n\nOur patching system uses a generic approach which means instruction support i"
  },
  {
    "path": "docs/source/changelog.rst",
    "chars": 25314,
    "preview": "CHANGELOG\n=========\n\nNext Release (0.12.2)\n---------------------\n\n\nVersion (0.12.1)\n----------------\n\n2026-01-07 QBDI Te"
  },
  {
    "path": "docs/source/compilation.rst",
    "chars": 1873,
    "preview": "\nCompilation From Source\n=======================\n\n.. include:: ../../README.rst\n    :start-after: .. compil\n    :end-bef"
  },
  {
    "path": "docs/source/conf.py",
    "chars": 12867,
    "preview": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# QBDI documentation build configuration file, created by\n# sphinx-quic"
  },
  {
    "path": "docs/source/dev.rst",
    "chars": 214,
    "preview": "Developer Documentation\n=======================\n\n.. toctree::\n    :maxdepth: 2\n\n    Compilation <compilation>\n    Reposi"
  },
  {
    "path": "docs/source/execblock.rst",
    "chars": 3453,
    "preview": "ExecBlock\n=========\n\nIntroduction\n------------\n\nThe ExecBlock is a concept which tries to simplify the problem of contex"
  },
  {
    "path": "docs/source/get_started-PyQBDIPreload.rst",
    "chars": 3116,
    "preview": ".. currentmodule:: pyqbdi\n\n.. _get_started-pyqbdipreload:\n\nPyQBDIPreload\n=============\n\nPyQBDIPreload is an implementati"
  },
  {
    "path": "docs/source/get_started-QBDIPreload.rst",
    "chars": 6965,
    "preview": ".. _get_started-qbdipreload:\n\nQBDIPreload\n===========\n\nQBDIPreload is a small utility library that provides code injecti"
  },
  {
    "path": "docs/source/get_started-c.rst",
    "chars": 8280,
    "preview": "C API\n=====\n\nA step-by-step example illustrating a basic (yet powerful) usage of the QBDI C API.\n\nLoad the target code\n-"
  },
  {
    "path": "docs/source/get_started-cpp.rst",
    "chars": 7449,
    "preview": "C++ API\n=======\n\nA step-by-step example illustrating a basic (yet powerful) usage of the QBDI C++ API.\n\nLoad the target "
  },
  {
    "path": "docs/source/get_started-frida.rst",
    "chars": 7585,
    "preview": ".. highlight:: javascript\n\nFrida/QBDI\n==========\n\nQBDI can team up with Frida to be even more powerful together.\nTo be a"
  },
  {
    "path": "docs/source/get_started-pyqbdi.rst",
    "chars": 6526,
    "preview": ".. currentmodule:: pyqbdi\n\n.. _get_started-pyqbdi:\n\nPyQBDI\n======\n\nPyQBDI brings Python3 bindings over the QBDI API.\nTha"
  },
  {
    "path": "docs/source/get_started.rst",
    "chars": 371,
    "preview": "Getting Started\n===============\n\nThe following sections explain how one can take advantage of QBDI through different use"
  },
  {
    "path": "docs/source/index.rst",
    "chars": 772,
    "preview": ".. QBDI documentation master file, created by\n   sphinx-quickstart on Mon Nov  2 10:36:40 2015.\n   You can adapt this fi"
  },
  {
    "path": "docs/source/installation_and_integration.rst",
    "chars": 7285,
    "preview": "Installation and Integration\n============================\n\n\nC/C++ API installation\n----------------------\n\nWhen a new st"
  },
  {
    "path": "docs/source/instrumentation_process.rst",
    "chars": 3767,
    "preview": ".. _instrumentation_process:\n\nInstrumentation Process\n=======================\n\nIntroduction\n------------\n\n.. image:: ima"
  },
  {
    "path": "docs/source/intro.rst",
    "chars": 4820,
    "preview": ".. _user-introduction:\n\nIntroduction\n============\n\n.. role:: red\n\nWhy a DBI?\n-----------\n\nDebuggers are a popular approa"
  },
  {
    "path": "docs/source/patchdsl.rst",
    "chars": 15456,
    "preview": ".. highlight:: c++\n\nPatchDSL\n========\n\n.. contents::\n  :depth: 3\n\nLanguage Concepts\n-----------------\n\nType System\n+++++"
  },
  {
    "path": "docs/source/references.rst",
    "chars": 1600,
    "preview": "References\n==========\n\nConferences and Workshops\n-------------------------\n\n- 2020-10-15: BSides Delhi - Analysing progr"
  },
  {
    "path": "docs/source/repo_organization.rst",
    "chars": 1533,
    "preview": "Repository Organization\n=======================\n\nRoot Tree\n---------\n\nThe root of the source tree is organized as follow"
  },
  {
    "path": "docs/source/techref.rst",
    "chars": 201,
    "preview": "Technical Reference\n===================\n\n.. toctree::\n   :maxdepth: 2\n\n   Instrumentation Process <instrumentation_proce"
  },
  {
    "path": "docs/source/testing.rst",
    "chars": 4308,
    "preview": ".. _developer-testing:\n\nTesting\n=======\n\nMaking mistakes while writing a DBI framework is particularly easy and often fa"
  },
  {
    "path": "docs/source/tutorial.rst",
    "chars": 222,
    "preview": "\nTutorials\n=========\n\nThis section contains some tutorials on specifics points of QBDI\n\n\n.. toctree::\n    :maxdepth: 2\n\n"
  },
  {
    "path": "docs/source/tutorial_BBVMEvent.rst",
    "chars": 11172,
    "preview": ".. currentmodule:: pyqbdi\n\nBasic block events\n==================\n\nIntroduction\n------------\n\nThe :ref:`Instrument Callba"
  },
  {
    "path": "docs/source/tutorial_ExecBrokerEvent.rst",
    "chars": 12060,
    "preview": "Execution transfer event\n=========================\n\nIntroduction\n------------\n\nOne limitation of QBDI is that it shares "
  },
  {
    "path": "examples/CMakeLists.txt",
    "chars": 1354,
    "preview": "add_executable(mnemonicFilter mnemonicFilter.cpp)\ntarget_link_libraries(mnemonicFilter QBDI)\nset_target_properties(mnemo"
  },
  {
    "path": "examples/Dockerfile",
    "chars": 703,
    "preview": "FROM qbdi/qbdi:x86_ubuntu\n\nENV USER=\"docker\" \\\n    HOME=\"/home/docker\"\n\n# install some needed tools\nRUN apt-get update &"
  },
  {
    "path": "examples/c/CMakeLists.txt",
    "chars": 265,
    "preview": "add_executable(fibonacci_c fibonacci.c)\ntarget_link_libraries(fibonacci_c QBDI)\nadd_signature(fibonacci_c)\n\nif(QBDI_TOOL"
  },
  {
    "path": "examples/c/fibonacci.c",
    "chars": 2179,
    "preview": "#include <assert.h>\n#include <inttypes.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"QBDI.h\"\n\nint fibonacci(int n"
  },
  {
    "path": "examples/c/tracer_preload.c",
    "chars": 1129,
    "preview": "#include <stdio.h>\n#include \"QBDIPreload.h\"\n\nQBDIPRELOAD_INIT;\n\nstatic VMAction onInstruction(VMInstanceRef vm, GPRState"
  },
  {
    "path": "examples/cpp/CMakeLists.txt",
    "chars": 565,
    "preview": "add_executable(fibonacci_cpp fibonacci.cpp)\ntarget_link_libraries(fibonacci_cpp QBDI)\nset_target_properties(fibonacci_cp"
  },
  {
    "path": "examples/cpp/fibonacci.cpp",
    "chars": 2398,
    "preview": "#include <assert.h>\n#include <cstdint>\n#include <cstdlib>\n#include <cstring>\n#include <iomanip>\n#include <iostream>\n\n#in"
  },
  {
    "path": "examples/cpp/tracer_preload.cpp",
    "chars": 1266,
    "preview": "#include <iomanip>\n#include <iostream>\n\n#include \"QBDIPreload.h\"\n\nstatic QBDI::VMAction onInstruction(QBDI::VMInstanceRe"
  },
  {
    "path": "examples/cryptolock.c",
    "chars": 3629,
    "preview": "#include <inttypes.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"QBDI.h\"\n"
  },
  {
    "path": "examples/cryptolock.cpp",
    "chars": 3752,
    "preview": "#include <cstring>\n#include <iomanip>\n#include <iostream>\n#include <vector>\n\n#include \"QBDI.h\"\n\nQBDI_NOINLINE void hashP"
  },
  {
    "path": "examples/mnemonicFilter.cpp",
    "chars": 1555,
    "preview": "#include <inttypes.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"QBDI.h\"\n"
  },
  {
    "path": "examples/modules.c",
    "chars": 761,
    "preview": "#include <stdio.h>\n#include <stdlib.h>\n\n#include <QBDI.h>\n\nint main(int argc, char **argv) {\n  size_t size = 0, i = 0;\n "
  },
  {
    "path": "examples/modules.cpp",
    "chars": 264,
    "preview": "#include <iostream>\n\n#include <QBDI.h>\n\nint main(int argc, char **argv) {\n  for (const QBDI::MemoryMap &m : QBDI::getCur"
  },
  {
    "path": "examples/pyqbdi/coverage.py",
    "chars": 3013,
    "preview": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport pyqbdi\nimport struct\nimport atexit\n\nclass CovModule:\n    # Create"
  },
  {
    "path": "examples/pyqbdi/trace_preload.py",
    "chars": 352,
    "preview": "#!/usr/bin/env python3\n\nimport pyqbdi\n\ndef showInstruction(vm, gpr, fpr, data):\n    instAnalysis = vm.getInstAnalysis()\n"
  },
  {
    "path": "examples/pyqbdi/trace_sin.py",
    "chars": 1537,
    "preview": "#!/usr/bin/env python3\n\nimport sys\nimport math\nimport ctypes\nimport pyqbdi\nimport struct\n\ndef insnCB(vm, gpr, fpr, data)"
  },
  {
    "path": "examples/thedude.c",
    "chars": 3539,
    "preview": "#include <inttypes.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n\n"
  },
  {
    "path": "examples/thedude.cpp",
    "chars": 3694,
    "preview": "#include <cinttypes>\n#include <cstdint>\n#include <cstdlib>\n#include <cstring>\n#include <ctime>\n#include <iomanip>\n#inclu"
  },
  {
    "path": "include/QBDI/Bitmask.h",
    "chars": 3056,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Callback.h",
    "chars": 15170,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Config.h.in",
    "chars": 2327,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Errors.h",
    "chars": 1033,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/InstAnalysis.h",
    "chars": 9166,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Logs.h",
    "chars": 3085,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Memory.h",
    "chars": 6461,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Memory.hpp",
    "chars": 6786,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Platform.h",
    "chars": 1750,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/PtrAuth.h",
    "chars": 2259,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Range.h",
    "chars": 10418,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/VM.h",
    "chars": 36049,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/VM_C.h",
    "chars": 27394,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/Version.h.in",
    "chars": 1853,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/arch/AARCH64/Options.h",
    "chars": 2521,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/arch/AARCH64/State.h",
    "chars": 3957,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/arch/ARM/Options.h",
    "chars": 2995,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/arch/ARM/State.h",
    "chars": 3175,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/arch/X86/Options.h",
    "chars": 2287,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/arch/X86/State.h",
    "chars": 4812,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/arch/X86_64/Options.h",
    "chars": 2662,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI/arch/X86_64/State.h",
    "chars": 5675,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "include/QBDI.h",
    "chars": 863,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "package/.dockerignore",
    "chars": 7,
    "preview": "QBDI-*\n"
  },
  {
    "path": "package/CMakeLists.txt",
    "chars": 1426,
    "preview": "set(CPACK_PACKAGE_DESCRIPTION_SUMMARY\n    \"QuarkslaB Dynamic binary Instrumentation\")\nset(CPACK_PACKAGE_VENDOR \"Quarksla"
  },
  {
    "path": "package/Readme.txt",
    "chars": 518,
    "preview": "QuarkslaB Dynamic binary Instrumentation (QBDI) is a custom, tailored, cross platform and cross architecture DBI framewo"
  },
  {
    "path": "package/Welcome.txt",
    "chars": 72,
    "preview": "This program will guide you through the installation of QBDI framework.\n"
  },
  {
    "path": "package/launch_docker_packager.sh",
    "chars": 3419,
    "preview": "#!/usr/bin/env bash\nset -e\nset -x\n\nBASEDIR=$(cd $(dirname \"$0\") && pwd -P)\nGITDIR=$(git rev-parse --show-toplevel)\n\nTARG"
  },
  {
    "path": "package/qbdi-frida-template.in",
    "chars": 141,
    "preview": "#!/bin/sh\ncp @CMAKE_INSTALL_PREFIX@/@RESOURCES_PREFIX@/qbdi_frida_template/* .\ncp @CMAKE_INSTALL_PREFIX@/@RESOURCES_PREF"
  },
  {
    "path": "package/qbdi-preload-template.in",
    "chars": 89,
    "preview": "#!/bin/sh\ncp @CMAKE_INSTALL_PREFIX@/@PRELOAD_RESOURCES_PREFIX@/qbdi_preload_template/* .\n"
  },
  {
    "path": "package/qbdi-template.in",
    "chars": 73,
    "preview": "#!/bin/sh\ncp @CMAKE_INSTALL_PREFIX@/@RESOURCES_PREFIX@/qbdi_template/* .\n"
  },
  {
    "path": "package/qbdi.pc.in",
    "chars": 253,
    "preview": "prefix=@CMAKE_INSTALL_PREFIX@\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include\n\nName: qbdi\nD"
  },
  {
    "path": "pyproject.toml",
    "chars": 132,
    "preview": "[build-system]\nrequires = [\n  \"setuptools>=61.0\",\n  \"wheel\",\n  \"ninja\",\n  \"cmake>=3.28\",\n]\n\nbuild-backend = \"setuptools."
  },
  {
    "path": "setup.cfg",
    "chars": 1098,
    "preview": "[metadata]\nname = PyQBDI\nversion = 0.12.2a1\ndescription = Python binding for QBDI\nlong_description = file: README-pypi.r"
  },
  {
    "path": "setup.py",
    "chars": 5628,
    "preview": "#!/usr/bin/env python3\n\n# This file is part of pyQBDI (python binding for QBDI).\n#\n# Copyright 2017 - 2025 Quarkslab\n#\n#"
  },
  {
    "path": "src/CMakeLists.txt",
    "chars": 546,
    "preview": "include(\"${CMAKE_CURRENT_LIST_DIR}/Engine/CMakeLists.txt\")\ninclude(\"${CMAKE_CURRENT_LIST_DIR}/ExecBlock/CMakeLists.txt\")"
  },
  {
    "path": "src/Engine/CMakeLists.txt",
    "chars": 243,
    "preview": "# Add QBDI target\nset(SOURCES\n    \"${CMAKE_CURRENT_LIST_DIR}/Engine.cpp\"\n    \"${CMAKE_CURRENT_LIST_DIR}/LLVMCPU.cpp\" \"${"
  },
  {
    "path": "src/Engine/Engine.cpp",
    "chars": 24774,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/Engine/Engine.h",
    "chars": 10510,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/Engine/LLVMCPU.cpp",
    "chars": 9990,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/Engine/LLVMCPU.h",
    "chars": 4457,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/Engine/VM.cpp",
    "chars": 35601,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/Engine/VM_C.cpp",
    "chars": 13608,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/Engine/VM_internal.h",
    "chars": 1825,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/AARCH64/CMakeLists.txt",
    "chars": 746,
    "preview": "# Add QBDI target\nset(SOURCES \"${CMAKE_CURRENT_LIST_DIR}/ExecBlock_AARCH64.cpp\")\n\nif(QBDI_PLATFORM_LINUX OR QBDI_PLATFOR"
  },
  {
    "path": "src/ExecBlock/AARCH64/Context_AARCH64.h",
    "chars": 1440,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/AARCH64/ExecBlock_AARCH64.cpp",
    "chars": 7113,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/AARCH64/ScratchRegisterInfo_AARCH64.h",
    "chars": 1038,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/AARCH64/ios_AARCH64.s",
    "chars": 1815,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/AARCH64/ios_AARCH64e.s",
    "chars": 1830,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/AARCH64/linux-android_AARCH64.s",
    "chars": 2560,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/AARCH64/macos_AARCH64.s",
    "chars": 2593,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/AARCH64/macos_AARCH64e.s",
    "chars": 2606,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "src/ExecBlock/ARM/CMakeLists.txt",
    "chars": 422,
    "preview": "# Add QBDI target\nset(SOURCES \"${CMAKE_CURRENT_LIST_DIR}/ExecBlock_ARM.cpp\")\n\nif(QBDI_PLATFORM_LINUX OR QBDI_PLATFORM_AN"
  },
  {
    "path": "src/ExecBlock/ARM/Context_ARM.h",
    "chars": 1228,
    "preview": "/*\n * This file is part of QBDI.\n *\n * Copyright 2017 - 2025 Quarkslab\n *\n * Licensed under the Apache License, Version "
  }
]

// ... and 404 more files (download for full content)

About this extraction

This page contains the full source code of the quarkslab/QBDI GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 604 files (4.1 MB), approximately 1.1M tokens, and a symbol index with 1775 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!