You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
This commit fixes the logging tag for ptracer command-line tool, which would show as "zygisk-core64", the one from libzygisk, and an out-of-bounds access in "allowed_fds" array, which then the readdir returned the "." and "..", the "parse_int" would return -1, and would try to access it in "allowed_fds" without checking if it is negative, or bigger, first.
91 lines
1.6 KiB
C
91 lines
1.6 KiB
C
#ifndef DAEMON_H
|
|
#define DAEMON_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#ifdef __LP64__
|
|
#define LP_SELECT(lp32, lp64) lp64
|
|
#else
|
|
#define LP_SELECT(lp32, lp64) lp32
|
|
#endif
|
|
|
|
#define SOCKET_FILE_NAME LP_SELECT("cp32", "cp64") ".sock"
|
|
|
|
enum rezygiskd_actions {
|
|
PingHeartbeat,
|
|
GetProcessFlags,
|
|
GetInfo,
|
|
ReadModules,
|
|
RequestCompanionSocket,
|
|
GetModuleDir,
|
|
ZygoteRestart,
|
|
SystemServerStarted,
|
|
UpdateMountNamespace
|
|
};
|
|
|
|
struct zygisk_modules {
|
|
char **modules;
|
|
size_t modules_count;
|
|
};
|
|
|
|
enum root_impl {
|
|
ROOT_IMPL_NONE,
|
|
ROOT_IMPL_APATCH,
|
|
ROOT_IMPL_KERNELSU,
|
|
ROOT_IMPL_MAGISK
|
|
};
|
|
|
|
struct rezygisk_info {
|
|
struct zygisk_modules *modules;
|
|
enum root_impl root_impl;
|
|
pid_t pid;
|
|
bool running;
|
|
};
|
|
|
|
enum mount_namespace_state {
|
|
Clean,
|
|
Rooted,
|
|
Module
|
|
};
|
|
|
|
#define TMP_PATH "/data/adb/rezygisk"
|
|
|
|
static inline const char *rezygiskd_get_path() {
|
|
return TMP_PATH;
|
|
}
|
|
|
|
int rezygiskd_connect(uint8_t retry);
|
|
|
|
bool rezygiskd_ping();
|
|
|
|
uint32_t rezygiskd_get_process_flags(uid_t uid);
|
|
|
|
void rezygiskd_get_info(struct rezygisk_info *info);
|
|
|
|
void free_rezygisk_info(struct rezygisk_info *info);
|
|
|
|
bool rezygiskd_read_modules(struct zygisk_modules *modules);
|
|
|
|
void free_modules(struct zygisk_modules *modules);
|
|
|
|
int rezygiskd_connect_companion(size_t index);
|
|
|
|
int rezygiskd_get_module_dir(size_t index);
|
|
|
|
void rezygiskd_zygote_restart();
|
|
|
|
void rezygiskd_system_server_started();
|
|
|
|
bool rezygiskd_update_mns(enum mount_namespace_state nms_state, char *buf, size_t buf_size);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* DAEMON_H */ |