I created JNI export dll with visual c++ with one simple function. it work correctly when i use it in my java code with LoadLibrary method.
but when i use Unikey Enveloper and protected this dll it not work in java and this error appear
Invalid access to memory location
when i test this protected dll with visual c++ console application it work correctly.
how can I use protected dll in java LoadLibrary Method?
Visual C++ Code:
extern "C" {
JNIEXPORT jint JNICALL Java_Bikaran_Start_JniTestFunction(JNIEnv *env, jclass c, jint a, jint b)
{
return a + b;
}
}
JAVA Code :
package Bikaran;
public class Start {
public static native int JniTestFunction(int s, int s1);
public static void main(String[] args) {
System.loadLibrary("...");
System.out.println(JniTestFunction(1,2));
}
}