#define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef RENAME_EXCHANGE #define RENAME_EXCHANGE (1 << 1) #endif // The code that is added to static Go programs (gosys/gosys.c), built by scripts/build-gosys.sh. A // build without it works as before, only without Go support. It is AArch64 code: the 32-bit hook // has none (a 32-bit phone cannot run 64-bit programs). #if defined(__has_include) && defined(__LP64__) #if __has_include("gosys/gosys_blob.h") #include "gosys/gosys_abi.h" #include "gosys/gosys_blob.h" #define DDNATV_HAVE_GOSYS 1 #endif #endif // The hook is one translation unit split into parts by topic, in this order (later parts use // the static functions of earlier ones). #include "hook/syscalls.c" #include "hook/paths.c" #include "hook/hardlinks.c" #include "hook/signals.c" #include "hook/setup.c" #include "hook/files.c" #include "hook/fileops.c" #include "hook/identity.c" #include "hook/privileged.c" #include "hook/env.c" #include "hook/exec_probe.c" #include "hook/static_programs.c" #include "hook/go_programs.c" #include "hook/exec.c" #include "hook/net.c" #include "hook/sockets.c" #include "hook/sysv_shm.c" #include "hook/posix_shm.c"