#include #include #include #include #include #include "sysinfo.h" #include "nopsmdrm.h" #define PSM_LIB_PATHS "/data/data/com.playstation.psstore/lib/" jint (*JNI_OnLoad_real)(JavaVM* vm, void* reserved) = NULL; JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { LOGFUNCTION(); void* handle = dlopen(PSM_LIB_PATHS "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"); set_lib_default_handle(handle); patch_nopsmdrm(); return res; }