├── .clang-format ├── .github └── workflows │ ├── build.yml │ └── linux.yml ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── CODEOWNERS ├── LICENSE ├── README.md ├── cmake ├── options.cmake ├── settings.cmake └── toolchain.cmake ├── ebpf ├── CMakeLists.txt ├── include │ └── tob │ │ └── ebpf │ │ ├── bpfmap.h │ │ ├── bpfsyscallinterface.h │ │ ├── cpu.h │ │ ├── ebpf_utils.h │ │ ├── iclangcompiler.h │ │ ├── ievent.h │ │ ├── illvmbridge.h │ │ ├── llvm_utils.h │ │ ├── perfeventarray.h │ │ ├── sectionmemorymanager.h │ │ ├── structure.h │ │ ├── tracepointdescriptor.h │ │ ├── typedbpfmap.h │ │ └── types.h └── src │ ├── bpf_helpers.h │ ├── bpfsyscallinterface.cpp │ ├── clangcompiler.cpp │ ├── clangcompiler.h │ ├── cpu.cpp │ ├── ebpf_common_helpers.h │ ├── ebpf_utils.cpp │ ├── iclangcompiler.cpp │ ├── ievent.cpp │ ├── illvmbridge.cpp │ ├── kprobe_helpers.cpp │ ├── kprobe_helpers.h │ ├── kprobeevent.cpp │ ├── kprobeevent.h │ ├── llvm_utils.cpp │ ├── llvmbridge.cpp │ ├── llvmbridge.h │ ├── lsmevent.cpp │ ├── lsmevent.h │ ├── perfeventarray.cpp │ ├── rawtracepointevent.cpp │ ├── rawtracepointevent.h │ ├── sectionmemorymanager.cpp │ ├── tracepointdescriptor.cpp │ ├── tracepointevent.cpp │ ├── tracepointevent.h │ ├── uprobeevent.cpp │ └── uprobeevent.h ├── error ├── CMakeLists.txt └── include │ └── tob │ └── error │ ├── erroror.h │ ├── errorstatus.h │ ├── namederror.h │ ├── stringerror.h │ └── successor.h ├── libraries ├── CMakeLists.txt ├── Clang │ └── CMakeLists.txt ├── LLVM │ └── CMakeLists.txt ├── btfparse │ └── CMakeLists.txt ├── doctest │ └── CMakeLists.txt └── libbpf │ └── CMakeLists.txt ├── tests ├── bpfmap.cpp ├── erroror.cpp ├── llvm_utils.cpp ├── llvmbridge.cpp ├── main.cpp ├── sectionmemorymanager.cpp ├── tracepointdescriptor.cpp ├── typedbpfmap.cpp └── uniqueref.cpp └── utils ├── CMakeLists.txt ├── include └── tob │ └── utils │ ├── architecture.h │ ├── bufferreader.h │ ├── ielfimage.h │ ├── kernel.h │ ├── uniquefd.h │ ├── uniquemappedmemory.h │ └── uniqueref.h └── src ├── architecture.cpp ├── bufferreader.cpp ├── elfimage.cpp ├── elfimage.h ├── kernel.cpp ├── uniquefd.cpp └── uniquemappedmemory.cpp /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: LLVM 3 | 4 | ... 5 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/.github/workflows/build.yml -------------------------------------------------------------------------------- /.github/workflows/linux.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/.github/workflows/linux.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | .vscode 3 | .cache 4 | compile_commands.json 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/.gitmodules -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/CMakeLists.txt -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @alessandrogario 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/README.md -------------------------------------------------------------------------------- /cmake/options.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/cmake/options.cmake -------------------------------------------------------------------------------- /cmake/settings.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/cmake/settings.cmake -------------------------------------------------------------------------------- /cmake/toolchain.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/cmake/toolchain.cmake -------------------------------------------------------------------------------- /ebpf/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/CMakeLists.txt -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/bpfmap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/bpfmap.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/bpfsyscallinterface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/bpfsyscallinterface.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/cpu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/cpu.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/ebpf_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/ebpf_utils.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/iclangcompiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/iclangcompiler.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/ievent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/ievent.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/illvmbridge.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/illvmbridge.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/llvm_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/llvm_utils.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/perfeventarray.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/perfeventarray.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/sectionmemorymanager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/sectionmemorymanager.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/structure.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/structure.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/tracepointdescriptor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/tracepointdescriptor.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/typedbpfmap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/typedbpfmap.h -------------------------------------------------------------------------------- /ebpf/include/tob/ebpf/types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/include/tob/ebpf/types.h -------------------------------------------------------------------------------- /ebpf/src/bpf_helpers.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/bpf_helpers.h -------------------------------------------------------------------------------- /ebpf/src/bpfsyscallinterface.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/bpfsyscallinterface.cpp -------------------------------------------------------------------------------- /ebpf/src/clangcompiler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/clangcompiler.cpp -------------------------------------------------------------------------------- /ebpf/src/clangcompiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/clangcompiler.h -------------------------------------------------------------------------------- /ebpf/src/cpu.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/cpu.cpp -------------------------------------------------------------------------------- /ebpf/src/ebpf_common_helpers.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/ebpf_common_helpers.h -------------------------------------------------------------------------------- /ebpf/src/ebpf_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/ebpf_utils.cpp -------------------------------------------------------------------------------- /ebpf/src/iclangcompiler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/iclangcompiler.cpp -------------------------------------------------------------------------------- /ebpf/src/ievent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/ievent.cpp -------------------------------------------------------------------------------- /ebpf/src/illvmbridge.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/illvmbridge.cpp -------------------------------------------------------------------------------- /ebpf/src/kprobe_helpers.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/kprobe_helpers.cpp -------------------------------------------------------------------------------- /ebpf/src/kprobe_helpers.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/kprobe_helpers.h -------------------------------------------------------------------------------- /ebpf/src/kprobeevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/kprobeevent.cpp -------------------------------------------------------------------------------- /ebpf/src/kprobeevent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/kprobeevent.h -------------------------------------------------------------------------------- /ebpf/src/llvm_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/llvm_utils.cpp -------------------------------------------------------------------------------- /ebpf/src/llvmbridge.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/llvmbridge.cpp -------------------------------------------------------------------------------- /ebpf/src/llvmbridge.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/llvmbridge.h -------------------------------------------------------------------------------- /ebpf/src/lsmevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/lsmevent.cpp -------------------------------------------------------------------------------- /ebpf/src/lsmevent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/lsmevent.h -------------------------------------------------------------------------------- /ebpf/src/perfeventarray.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/perfeventarray.cpp -------------------------------------------------------------------------------- /ebpf/src/rawtracepointevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/rawtracepointevent.cpp -------------------------------------------------------------------------------- /ebpf/src/rawtracepointevent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/rawtracepointevent.h -------------------------------------------------------------------------------- /ebpf/src/sectionmemorymanager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/sectionmemorymanager.cpp -------------------------------------------------------------------------------- /ebpf/src/tracepointdescriptor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/tracepointdescriptor.cpp -------------------------------------------------------------------------------- /ebpf/src/tracepointevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/tracepointevent.cpp -------------------------------------------------------------------------------- /ebpf/src/tracepointevent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/tracepointevent.h -------------------------------------------------------------------------------- /ebpf/src/uprobeevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/uprobeevent.cpp -------------------------------------------------------------------------------- /ebpf/src/uprobeevent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/ebpf/src/uprobeevent.h -------------------------------------------------------------------------------- /error/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/error/CMakeLists.txt -------------------------------------------------------------------------------- /error/include/tob/error/erroror.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/error/include/tob/error/erroror.h -------------------------------------------------------------------------------- /error/include/tob/error/errorstatus.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/error/include/tob/error/errorstatus.h -------------------------------------------------------------------------------- /error/include/tob/error/namederror.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/error/include/tob/error/namederror.h -------------------------------------------------------------------------------- /error/include/tob/error/stringerror.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/error/include/tob/error/stringerror.h -------------------------------------------------------------------------------- /error/include/tob/error/successor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/error/include/tob/error/successor.h -------------------------------------------------------------------------------- /libraries/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/libraries/CMakeLists.txt -------------------------------------------------------------------------------- /libraries/Clang/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/libraries/Clang/CMakeLists.txt -------------------------------------------------------------------------------- /libraries/LLVM/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/libraries/LLVM/CMakeLists.txt -------------------------------------------------------------------------------- /libraries/btfparse/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/libraries/btfparse/CMakeLists.txt -------------------------------------------------------------------------------- /libraries/doctest/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/libraries/doctest/CMakeLists.txt -------------------------------------------------------------------------------- /libraries/libbpf/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/libraries/libbpf/CMakeLists.txt -------------------------------------------------------------------------------- /tests/bpfmap.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/bpfmap.cpp -------------------------------------------------------------------------------- /tests/erroror.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/erroror.cpp -------------------------------------------------------------------------------- /tests/llvm_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/llvm_utils.cpp -------------------------------------------------------------------------------- /tests/llvmbridge.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/llvmbridge.cpp -------------------------------------------------------------------------------- /tests/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/main.cpp -------------------------------------------------------------------------------- /tests/sectionmemorymanager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/sectionmemorymanager.cpp -------------------------------------------------------------------------------- /tests/tracepointdescriptor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/tracepointdescriptor.cpp -------------------------------------------------------------------------------- /tests/typedbpfmap.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/typedbpfmap.cpp -------------------------------------------------------------------------------- /tests/uniqueref.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/tests/uniqueref.cpp -------------------------------------------------------------------------------- /utils/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/CMakeLists.txt -------------------------------------------------------------------------------- /utils/include/tob/utils/architecture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/include/tob/utils/architecture.h -------------------------------------------------------------------------------- /utils/include/tob/utils/bufferreader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/include/tob/utils/bufferreader.h -------------------------------------------------------------------------------- /utils/include/tob/utils/ielfimage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/include/tob/utils/ielfimage.h -------------------------------------------------------------------------------- /utils/include/tob/utils/kernel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/include/tob/utils/kernel.h -------------------------------------------------------------------------------- /utils/include/tob/utils/uniquefd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/include/tob/utils/uniquefd.h -------------------------------------------------------------------------------- /utils/include/tob/utils/uniquemappedmemory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/include/tob/utils/uniquemappedmemory.h -------------------------------------------------------------------------------- /utils/include/tob/utils/uniqueref.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/include/tob/utils/uniqueref.h -------------------------------------------------------------------------------- /utils/src/architecture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/src/architecture.cpp -------------------------------------------------------------------------------- /utils/src/bufferreader.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/src/bufferreader.cpp -------------------------------------------------------------------------------- /utils/src/elfimage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/src/elfimage.cpp -------------------------------------------------------------------------------- /utils/src/elfimage.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/src/elfimage.h -------------------------------------------------------------------------------- /utils/src/kernel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/src/kernel.cpp -------------------------------------------------------------------------------- /utils/src/uniquefd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/src/uniquefd.cpp -------------------------------------------------------------------------------- /utils/src/uniquemappedmemory.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trailofbits/ebpf-common/HEAD/utils/src/uniquemappedmemory.cpp --------------------------------------------------------------------------------