0

I have a question about JNI. I would like to know if there is a way to detect jni, I'll give you an example: I create a C ++ dll that uses JNI to call objects within another java process, so I inject the dll into the aforementioned process, I unload the dll, now there is a way to understand that in the java process there was jni who called some objects?

  • Can you explain in more detail? JNI provides the means for Java code to call C or C++ code and vice versa _within a single process_, and the "Java Invocation API" provides means to embed a Java interpreter in a C or C++ program, again, _within a single process._ Your question seems to ask about communication between _different_ processes, which is not something that the JNI directly facilitates. – Solomon Slow Sep 09 '19 at 16:04
  • 2
    Maybe you could say something about the problem that you think you could solve if your code was able to find out whether "there was jni who called some objects?" – Solomon Slow Sep 09 '19 at 16:07
  • I mean if there is a method to create an application that detects if a dll (with jni in it) has been injected in another application programmed in java. – XxArt0RagexX Sep 09 '19 at 17:52
  • Yes, and I mean, maybe you could tell us what problem you think you would be able to solve by detecting "if a dll...has been injected." – Solomon Slow Sep 09 '19 at 17:54
  • I understand what you mean, sorry before I didn't understand. I need to find out if a player uses cheats coded in C ++ on a java game (minecraft). The cheats on this game are indeed created via jni – XxArt0RagexX Sep 09 '19 at 18:46
  • OK, sounds like you run a server, and there are some people out there using hacked clients that give them unfair advantage over other players, and somehow, they can make their hacks harder to detect by coding them as `native` methods. You want to detect them and disconnect them. Sounds like an arms race, and sounds like it's way out of my league. But if you want to get answers here, you might try putting some more info about what you're really trying to do in your question title and text. – Solomon Slow Sep 09 '19 at 19:02
  • Perhaps your question is not so much "how do I detect JNI usage", but rather "how do I detect extra DLLs". I found [this question](https://reverseengineering.stackexchange.com/questions/2262/how-can-dll-injection-be-detected) that might give you some clues. If you know when people are trying to inject DLLs you can try to react, but this is just another step in the arms race. – Botje Sep 11 '19 at 10:25
  • Is this what you are asking about: https://stackoverflow.com/questions/1007861/how-do-i-get-a-list-of-jni-libraries-which-are-loaded/1008631#1008631 – Alex Barker Sep 12 '19 at 23:24

0 Answers0