This commit is contained in:
yunwei37
2023-09-18 03:27:00 +00:00
parent c830daeab7
commit e9ef88bc2f
58 changed files with 1893 additions and 664 deletions

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_core_read.h>
#include "common.h"
#include "replace.h"
char LICENSE[] SEC("license") = "Dual BSD/GPL";
@@ -268,7 +268,8 @@ int check_possible_addresses(struct trace_event_raw_sys_exit *ctx) {
// break;
// }
// }
// we can use bpf_strncmp here, but it's not available in the kernel version older
// we can use bpf_strncmp here,
// but it's not available in the kernel version older than 5.17
if (bpf_strncmp(name, text_len_max, (const char *)text_find) == 0) {
// ***********
// We've found out text!

View File

@@ -2,7 +2,7 @@
#include <argp.h>
#include <unistd.h>
#include "replace.skel.h"
#include "common.h"
#include "replace.h"
#include <bpf/bpf.h>

View File

@@ -26,14 +26,4 @@ struct event {
bool success;
};
struct tr_file {
char filename[FILENAME_LEN_MAX];
unsigned int filename_len;
};
struct tr_text {
char text[TEXT_LEN_MAX];
unsigned int text_len;
};
#endif // BAD_BPF_COMMON_H