dukeify / fake-jni

An implementation of the JNI and JVMTI with support for direct interaction between natively registered classes and JVM objects.
Other
27 stars 10 forks source link

Link against loaded libraries before registerNatives #38

Open Matthewacon opened 5 years ago

Matthewacon commented 5 years ago

When registerNatives is invoked, preform a depth-first search for the corresponding function in all libraries registered with the JVM instance. The first symbol found will be registered in place of the function pointer provided by the JNINativeMethod struct.

meme commented 5 years ago

Just to clarify, these functions take the form of Java_package_method, e.g.: for randomNumber in com.example it would be Java_com_example_randomNumber. Also, we should really find where this behaviour is documented because I am only aware of this as an implementation detail of OpenJDK and the ART