diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..aa0f9ce40f8d4465f9050d01830935fff0e76c17 --- /dev/null +++ b/.gitignore @@ -0,0 +1,59 @@ +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# vscode +*.vscode + +# idea files +*.idea + diff --git a/cmake/FindGlibc.cmake b/cmake/FindGlibc.cmake deleted file mode 100644 index 336fc216608b94c5ff2d487ce2594061ee59c8d6..0000000000000000000000000000000000000000 --- a/cmake/FindGlibc.cmake +++ /dev/null @@ -1,6 +0,0 @@ -# 这是一个示例的 FindGlibc.cmake 文件,用于查找 glibc -find_library(GLIB_C_LIBRARY NAMES c) -mark_as_advanced(GLIB_C_LIBRARY) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Glibc DEFAULT_MSG GLIB_C_LIBRARY) diff --git a/src/dumptool/Makefile b/src/dumptool/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..4c9f990fc4dc728ee5edb1a5036787b4d36d29e7 --- /dev/null +++ b/src/dumptool/Makefile @@ -0,0 +1,21 @@ +C++ = g++ +CC = gcc +APP = dumptool + +CFLAGS := -g -O2 -Wall -Werror -fstack-protector-strong +LDFLAGS := -lpthread +INCLUDES := -I/usr/include + +SRCS = dumptool.c + +all: $(APP) +.PHONY: clean install + +$(APP): $(SRCS) + $(CC) $(CFLAGS) $(INCLUDES) $(LINK_TARGET) -o $@ $^ + +clean: + rm -f *.o $(APP) + +install: $(APP) + @echo "installing dumptool..." \ No newline at end of file diff --git a/src/dumptool/dumptool.c b/src/dumptool/dumptool.c new file mode 100644 index 0000000000000000000000000000000000000000..367c97cebb018faa36266993c026df3bfeafad51 --- /dev/null +++ b/src/dumptool/dumptool.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("this is dumptool running...\n"); + return 0; +} diff --git a/src/init.c b/src/init.c deleted file mode 100644 index 6ccc16a363328437c0e0cc5733bed9522bf4f04e..0000000000000000000000000000000000000000 --- a/src/init.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -void init() { - printf("sysTrace initialized.\n"); -} diff --git a/src/nodeGuarder/Makefile b/src/nodeGuarder/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..2ed1d20e9c1668380c6cb2fa0b2bdaa214fd68d7 --- /dev/null +++ b/src/nodeGuarder/Makefile @@ -0,0 +1,21 @@ +C++ = g++ +CC = gcc +APP = nodeGuarder + +CFLAGS := -g -O2 -Wall -Werror -fstack-protector-strong +LDFLAGS := -lpthread +INCLUDES := -I/usr/include + +SRCS = nodeGuarder.c + +all: $(APP) +.PHONY: clean install + +$(APP): $(SRCS) + $(CC) $(CFLAGS) $(INCLUDES) $(LINK_TARGET) -o $@ $^ + +clean: + rm -f *.o $(APP) + +install: $(APP) + @echo "installing nodeGuarder..." \ No newline at end of file diff --git a/src/nodeGuarder/nodeGuarder.c b/src/nodeGuarder/nodeGuarder.c new file mode 100644 index 0000000000000000000000000000000000000000..504db1fe2270f7eab1c50460d67512ab20e80126 --- /dev/null +++ b/src/nodeGuarder/nodeGuarder.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("this is nodeGuarder running...\n"); + return 0; +} diff --git a/src/cann_hook.c b/src/systrace/cann/cann_hook.c similarity index 100% rename from src/cann_hook.c rename to src/systrace/cann/cann_hook.c diff --git a/src/libc_hook.c b/src/systrace/ebpf/ebpf_hook.c similarity index 100% rename from src/libc_hook.c rename to src/systrace/ebpf/ebpf_hook.c diff --git a/src/systrace/python/python_hook.c b/src/systrace/python/python_hook.c new file mode 100644 index 0000000000000000000000000000000000000000..90b5f6fed21bf53e3580725f4c03f1705caa1c63 --- /dev/null +++ b/src/systrace/python/python_hook.c @@ -0,0 +1,12 @@ +#include +#include + +void* malloc(size_t size) { + printf("malloc called with size: %zu\n", size); + return NULL; // 这里只是示例,实际应调用 glibc 的 malloc +} + +void free(void* ptr) { + printf("free called with ptr: %p\n", ptr); + // 这里只是示例,实际应调用 glibc 的 free +} diff --git a/src/watchdog/Makefile b/src/watchdog/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..71606513a3cb22a5370bdcaddd5607e11f1e4cb7 --- /dev/null +++ b/src/watchdog/Makefile @@ -0,0 +1,21 @@ +C++ = g++ +CC = gcc +APP = watchdog + +CFLAGS := -g -O2 -Wall -Werror -fstack-protector-strong +LDFLAGS := -lpthread +INCLUDES := -I/usr/include + +SRCS = watchdog.c + +all: $(APP) +.PHONY: clean install + +$(APP): $(SRCS) + $(CC) $(CFLAGS) $(INCLUDES) $(LINK_TARGET) -o $@ $^ + +clean: + rm -f *.o $(APP) + +install: $(APP) + @echo "installing watchdog..." \ No newline at end of file diff --git a/src/watchdog/watchdog.c b/src/watchdog/watchdog.c new file mode 100644 index 0000000000000000000000000000000000000000..8c41593a4d8275d12cd861af93418b13d5c465c0 --- /dev/null +++ b/src/watchdog/watchdog.c @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("this is watchdog running...\n"); + return 0; +}