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 $<$:${QBDI_COMMON_C_FLAGS}>) target_compile_options( QBDI_src INTERFACE $<$:${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 $ $ $ $) 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 $ $ $ INTERFACE $ PRIVATE $) 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} "$") 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 - $) 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 `_. 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 `_, 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 `__ 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 `__. 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 `_. 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 `_, 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 `_. Python API (PyQBDI) +++++++++++++++++++ PyQBDI is available through PyPI. The wheel package can be either `downloaded `__ 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 `__ for Android C/C++/frida API - `GitHub Actions `__ for Linux C/C++/frida API (based on ubuntu) - `GitHub Actions `__ for macOS C/C++/frida API - `GitHub Actions `__ for Windows packages C/C++ API - `GitHub Actions `__ 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 `__ 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= ../cmake/config/config-android-X86_64.sh ninja # Configure and compile QBDI X86 with a SDK mkdir build && cd build ANDROID_SDK_ROOT= ../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 $<$:${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 $ -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 $ -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 -B "-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 --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} $) 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:$ ${LINK_LIBS}") add_custom_command( TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E remove $ COMMAND "LIB.EXE" "@${LIB_COMMAND_ARGS_FILE}") elseif(APPLE) add_custom_command( TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E remove $ COMMAND /usr/bin/libtool -static -o $ ${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 $\n${AR_SCRIPT}\nsave\nend\n") add_custom_command( TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E remove $ 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 " 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 " 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 # Maintainer: QBDI Team 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 # Maintainer: QBDI Team 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_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # declarations. If set to NO, these declarations will be included in the # documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # With the correct setting of option CASE_SENSE_NAMES doxygen will better be # able to match the capabilities of the underlying filesystem. In case the # filesystem is case sensitive (i.e. it supports files in the same directory # whose names only differ in casing), the option must be set to YES to properly # deal with such files in case they appear in the input. For filesystems that # are not case sensitive the option should be be set to NO to properly deal with # output files written for symbols that only differ in casing, such as for two # classes, one named CLASS and the other named Class, and to also support # references to files without having to specify the exact matching casing. On # Windows (including Cygwin) and MacOS, users should typically set this option # to NO, whereas on Linux or other Unix flavors it should typically be set to # YES. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_HEADERFILE tag is set to YES then the documentation for a class # will show which file needs to be included to use the class. # The default value is: YES. SHOW_HEADERFILE = YES # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. See also section "Changing the # layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as documenting some parameters in # a documented function twice, or documenting parameters that don't exist or # using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete # function parameter documentation. If set to NO, doxygen will accept that some # parameters have no documentation without warning. # The default value is: YES. WARN_IF_INCOMPLETE_DOC = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong parameter # documentation, but not about the absence of documentation. If EXTRACT_ALL is # set to YES then this flag will automatically be disabled. See also # WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS # then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but # at the end of the doxygen process doxygen will return with a non-zero status. # Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../include \ @CMAKE_CURRENT_BINARY_DIR@/../include # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: # https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # Note the list of default checked file patterns might differ from the list of # default file extension mappings. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, # *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C # comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, # *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cpp \ *.h \ *.hpp # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/../include/QBDI/VM.h \ @CMAKE_CURRENT_SOURCE_DIR@/../include/QBDI/Memory.hpp \ @CMAKE_CURRENT_SOURCE_DIR@/../include/QBDI/arch # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = NO # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a color-wheel, see # https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that # are dynamically created via JavaScript. If disabled, the navigation index will # consists of multiple levels of tabs that are statically embedded in every HTML # page. Disable this option to support browsers that do not have JavaScript, # like the Qt help browser. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_MENUS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: # https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To # create a documentation set, doxygen will generate a Makefile in the HTML # output directory. Running make will produce the docset in that directory and # running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy # genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # on Windows. In the beginning of 2021 Microsoft took the original page, with # a.o. the download links, offline the HTML help workshop was already many years # in maintenance mode). You can download the HTML help workshop from the web # archives at Installation executable (see: # http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo # ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location (absolute path # including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to # run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine tune the look of the index (see "Fine-tuning the output"). As an # example, the default style sheet generated by doxygen has an example that # shows how to put an image at the root of the tree instead of the PROJECT_NAME. # Since the tree basically has the same information as the tab index, you could # consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the # FULL_SIDEBAR option determines if the side bar is limited to only the treeview # area (value NO) or if it should extend to the full height of the window (value # YES). Setting this to YES gives a layout similar to # https://docs.readthedocs.io with more room for contents, but less room for the # project logo, title, and description. If either GENERATOR_TREEVIEW or # DISABLE_INDEX is set to NO, this option has no effect. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. FULL_SIDEBAR = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg # tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see # https://inkscape.org) to generate formulas as SVG images instead of PNGs for # the HTML output. These images will generally look nicer at scaled resolutions. # Possible values are: png (the default) and svg (looks nicer but requires the # pdf2svg or inkscape tool). # The default value is: png. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FORMULA_FORMAT = png # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands # to create new LaTeX commands to be used in formulas as building blocks. See # the section "Including formulas" for details. FORMULA_MACROFILE = # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # With MATHJAX_VERSION it is possible to specify the MathJax version to be used. # Note that the different versions of MathJax have different requirements with # regards to the different settings, so it is possible that also other MathJax # settings have to be changed when switching between the different MathJax # versions. # Possible values are: MathJax_2 and MathJax_3. # The default value is: MathJax_2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_VERSION = MathJax_2 # When MathJax is enabled you can set the default output format to be used for # the MathJax output. For more details about the output format see MathJax # version 2 (see: # http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 # (see: # http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best # compatibility. This is the name for Mathjax version 2, for MathJax version 3 # this will be translated into chtml), NativeMML (i.e. MathML. Only supported # for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This # is the name for Mathjax version 3, for MathJax version 2 this will be # translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from https://www.mathjax.org before deployment. The default value is: # - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 # - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # for MathJax version 2 (see # https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # For example for MathJax version 3 (see # http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): # MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: # http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /