Files
ReZygisk/loader/src/injector/entry.cpp
JingMatrix 0671f2e497 improve: reset linker module counters
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.
2024-12-18 07:21:03 +01:00

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);
}