TransWikia.com

How can I find the native functions used by the Java Runtime Environment on Linux?

Reverse Engineering Asked on March 30, 2021

I am not usually a Java programmer, but I need to locate for example, which native functions (or APIs) are used in something like java.io.File.createNewFile() on Linux?

Initially, I am thinking of 2 methods:

  1. Locate the source code for the JRE implementation and try to find OS-specific code path of how this is handled starting at File.createNewFile() and working my way down.

  2. (Probably more of a hassle) Write a small program and try to attach a debugger to the JRE, breaking on various file-related calls or memory accesses.

  3. Do #2 except just use strace on Linux. I feel like this may be loud and difficult to hunt down, but possible.

I have not yet had success with #1 as the Java code seems to have a lot of wrappers and it’s not clear how the managed code maps to the native code, especially between platforms.

Do you have any suggestions?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP