[BUILD IS FAILING] Added file system hooks and other improvements. Uploading because of needing to backup

This commit is contained in:
h3xduck
2022-01-04 20:09:59 -05:00
parent 74873dbca5
commit f8774ac9cf
15 changed files with 1132 additions and 988 deletions

View File

@@ -1,6 +1,7 @@
#include "module_manager.h"
#include "xdp.h"
#include "sched.h"
#include "fs.h"
module_config_t module_config = {
.xdp_module = {
@@ -10,7 +11,13 @@ module_config_t module_config = {
.sched_module = {
.all = ON,
.handle_sched_process_exec = OFF
},
.fs_module = {
.all = ON,
.kprobe__64_compat_sys_read = OFF,
.kprobe__64_sys_read = OFF
}
};
module_config_attr_t module_config_attr = {
@@ -45,6 +52,15 @@ int setup_all_modules(){
}
if(ret!=0) return -1;
//FS (File system)
if(config.fs_module.all == ON){
ret = attach_fs_all(attr.skel);
}else{
if(config.fs_module.kprobe__64_compat_sys_read == ON) ret = attach_kprobe__64_compat_sys_read(attr.skel);
if(config.fs_module.kprobe__64_sys_read == ON) ret = attach_kprobe__64_sys_read(attr.skel);
}
if(ret!=0) return -1;
return 0;
}