Codex
Открыть в Telegram
Content channel : - App Development - Python , C++, kotlin , Golang, Java , JS , Rust This Channel Doesn't Promote Any Illegal Activities It's Just For Fun Educational Purposes Owner : @Qwanwin From : Indonesia
Больше1 514
Подписчики
+124 часа
+87 дней
+1730 дней
Архив постов
1 514
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <android/log.h>
#include <dlfcn.h>
#include <atomic>
#define LOG_TAG "Qwanwin"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
static std::atomic<int> gW{0}, gH{0};
using PFN_eglSwapBuffers = EGLBoolean (*)(EGLDisplay, EGLSurface);
static PFN_eglSwapBuffers orig_eglSwapBuffers = nullptr;
static thread_local bool tls_in_hook = false;
extern "C" EGLBoolean _eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) {
if (tls_in_hook) {
return orig_eglSwapBuffers ? orig_eglSwapBuffers(dpy, surface) : EGL_FALSE;
}
tls_in_hook = true;
if (dpy != EGL_NO_DISPLAY && surface != EGL_NO_SURFACE) {
EGLint w = 0, h = 0;
if (eglQuerySurface(dpy, surface, EGL_WIDTH, &w) == EGL_TRUE &&
eglQuerySurface(dpy, surface, EGL_HEIGHT, &h) == EGL_TRUE &&
w > 0 && h > 0) {
gW.store((int)w, std::memory_order_relaxed);
gH.store((int)h, std::memory_order_relaxed);
} else {
// fallback
GLint vp[4] = {0,0,0,0};
glGetIntegerv(GL_VIEWPORT, vp); // [x,y,w,h]
if (vp[2] > 0 && vp[3] > 0) {
gW.store(vp[2], std::memory_order_relaxed);
gH.store(vp[3], std::memory_order_relaxed);
}
}
}
EGLBoolean ret = orig_eglSwapBuffers ? orig_eglSwapBuffers(dpy, surface) : EGL_FALSE;
tls_in_hook = false;
return ret;
}
static void* Qwanwin_eglSwapBuffers() {
void* sym = dlsym(RTLD_NEXT, "eglSwapBuffers");
if (sym) return sym;
void* h = dlopen("libEGL.so", RTLD_NOW);
if (!h) return nullptr;
sym = dlsym(h, "eglSwapBuffers");
return sym;
}
extern "C" void QwanEglSwapHook_Easy() {
if (orig_eglSwapBuffers) return;
void* target = Qwanwin_eglSwapBuffers();
if (!target) {
LOGE("Failed to eglSwapBuffers");
return;
}
if (Tools::Hook((void*)target, (void*)_eglSwapBuffers, (void**)&orig_eglSwapBuffers)) {
LOGI("Hooked eglSwapBuffers successfully");
} else {
LOGE("Hook failed");
}
}
/*
extern "C" int eglhook_get_w() { return gW.load(std::memory_order_relaxed); }
extern "C" int eglhook_get_h() { return gH.load(std::memory_order_relaxed); }*/
Auto set-up
__attribute__((constructor))
static void on_load() { QwanEglSwapHook_Easy(); }
EGL Hook
Credit @codex44441 514
https://www.playbook.com/s/qwanwinkill/65bTgPsGR8XDMm2bDwzEsfFB
kill signature 64BIT 4.0
=> Without Crashing
=> Without blank
=> Without Crashing in game
=> Support Java and Imgui
=> Libanort edited
Author: @Qwanwin
1 514
https://www.playbook.com/s/qwanwinkill/V8nnTBUKFjrUUCd4kZK76cR4
Safe kill signature 32BIT
=> Without Crashing
=> Without blank
=> Without Crashing in game
=> Support Java and Imgui
Author: @Qwanwin
1 514
Tools plugin ida
Speeds up the process of labeling functions during reverse without having to rename them manually one by one for each binary version.
For usage instructions, refer to the readme.txt file.
For non-Indonesian language, please use a translator.☺️
Author: @Qwanwin
https://t.me/codex4444
