#include #include #include #include #include "nopsmdrm.h" jint (*JNI_OnLoad_real)(JavaVM* vm, void* reserved) = NULL; JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { LOGFUNCTION(); void* handle = dlopen("/data/data/com.playstation.psstore/lib/libdefault_real.so", RTLD_LAZY); LOG("dlopen libdefault_real.so @ %p errno = %x", handle, errno); if(handle == NULL) { handle = dlopen("libdefault_real.so", RTLD_LAZY); LOG("fail... trying just the raw name libdefault_real.so @ %p errno = %x", handle, errno); } JNI_OnLoad_real = dlsym(handle, "JNI_OnLoad"); if(JNI_OnLoad_real == NULL) { LOG("Cannot run PSM, JNI_OnLoad_real was nullptr"); return 0; } LOG("RUN JNI_OnLoad_real @ %p", JNI_OnLoad_real); jint res = JNI_OnLoad_real(vm, reserved); LOG("Install Pathces"); patch_libdefault(handle); return res; }