You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
Two counters for module loading and unloading are introduced in the commit a2e83ab348. To remove linker traces of libzygisk.so and Zygisk modules, we should reset them properly.
30 lines
638 B
C++
30 lines
638 B
C++
#include "daemon.h"
|
|
#include "logging.h"
|
|
#include "zygisk.hpp"
|
|
|
|
using namespace std;
|
|
|
|
void *start_addr = nullptr;
|
|
size_t block_size = 0;
|
|
|
|
extern "C" [[gnu::visibility("default")]]
|
|
void entry(void* addr, size_t size, const char* path) {
|
|
LOGI("Zygisk library injected, version %s", ZKSU_VERSION);
|
|
start_addr = addr;
|
|
block_size = size;
|
|
zygiskd::Init(path);
|
|
|
|
if (!zygiskd::PingHeartbeat()) {
|
|
LOGE("Zygisk daemon is not running");
|
|
return;
|
|
}
|
|
|
|
#ifdef NDEBUG
|
|
logging::setfd(zygiskd::RequestLogcatFd());
|
|
#endif
|
|
|
|
LOGI("start plt hooking");
|
|
hook_functions();
|
|
clean_trace(path, 1, 0, false);
|
|
}
|