frida / frida-java-bridge

Java runtime interop from Frida
324 stars 119 forks source link

Java API only partially available? #171

Open tr33s opened 4 years ago

tr33s commented 4 years ago

Error: Java API only partially available; please file a bug. Missing: _ZN6Method4sizeEb, _ZN6Method19set_native_functionEPhb, _ZN6Method21clear_native_functionEv, _ZN6Method24restore_unshareable_infoEP6Thread, _ZN6Method10jmethod_idEv, _ZN20ClassLoaderDataGraph10classes_doEP12KlassClosure, _ZN10JavaThread27thread_from_jni_environmentEP7JNIEnv_ at m (frida/node_modules/frida-java-bridge/lib/jvm.js:84:1) at u (frida/node_modules/frida-java-bridge/lib/jvm.js:10:1) at f._tryInitialize (frida/node_modules/frida-java-bridge/index.js:17:1) at new f (frida/node_modules/frida-java-bridge/index.js:9:1) at Object.4../lib/android (frida/node_modules/frida-java-bridge/index.js:308:1) at o (frida/node_modules/browser-pack/_prelude.js:1:1) at frida/node_modules/browser-pack/_prelude.js:1:1 at Object.19.frida-java-bridge (frida/runtime/java.js:1:1) at o (frida/node_modules/browser-pack/_prelude.js:1:1) at r (frida/node_modules/browser-pack/_prelude.js:1:1)

To be clear, I am running frida on a (HotSpot) java instance.

If this is an issue on my end please let me know.

0xra commented 4 years ago

Which JDK version and OS are you using?

tr33s commented 4 years ago

I'm on Windows 10 x64, and I tested Oracle JDK8/JDK11/JDK14 (x64) and also with OpenJDK (Hotspot, x64) 8, 11, 14.

Possibility of architecture issue, or none of those are compiled with symbols? Will build the JDK manually if I need to.

0xra commented 4 years ago

Yes, you need symbols. To test you can use Module.enumerateSymbolsSync('jvm.dll'). Try DebugSymbol.load(path) on a pdb

pandasauce commented 4 years ago

Loading a PDB doesn't seem to work with any of these path specs:

[Local::PID::12092]-> Error: unable to load symbols
    at /subtask1.js:1

Using https://github.com/ojdkbuild/ojdkbuild/releases's java-1.8.0-openjdk-1.8.0.265-1.b01-x86 doesn't work on Windows.

Error: Java API only partially available; please file a bug. Missing: _ZN6Method4sizeEb, _ZN6Method19set_native_functionEPhb, _ZN6Method21clear_native_functionEv, _ZN6Method24restore_unshareable_infoEP6Thread, _ZN6Method10jmethod_idEv, _ZN20ClassLoaderDataGraph10classes_doEP12KlassClosure, _ZN10JavaThread27thread_from_jni_environmentEP7JNIEnv_, _ZN8VMThread7executeEP12VM_Operation, _ZN11OopMapCache22flush_obsolete_entriesEv, _ZN14NMethodSweeper16sweep_code_cacheEv, JVM_Sleep, _ZTV18VM_RedefineClasses, _ZN18VM_RedefineClasses4doitEv, _ZN18VM_RedefineClasses13doit_prologueEv, _ZN18VM_RedefineClasses13doit_epilogueEv, _ZNK18VM_RedefineClasses26allow_nested_vm_operationsEv, _ZN19Abstract_VM_Version19jre_release_versionEv, _ZN14NMethodSweeper11_traversalsE, _ZN14NMethodSweeper13_should_sweepE
    at K (frida/node_modules/frida-java-bridge/lib/jvm.js:267)
    at O (frida/node_modules/frida-java-bridge/lib/jvm.js:34)
    at frida/node_modules/frida-java-bridge/index.js:53
    at e (frida/node_modules/frida-java-bridge/index.js:36)
    at frida/node_modules/frida-java-bridge/index.js:564
    at o (frida/node_modules/browser-pack/_prelude.js:1)
    at frida/runtime/java.js:1
    at o (/_java.js:1)
    at r (/_java.js:1)
londek commented 3 years ago

any solution for this?

stefan00lpf commented 3 years ago

I encountered the same problem, is it solved?

londek commented 3 years ago

@liupingfang you have to use JDK with symbols on (Unix-like system, Windows is currently not supported by Frida)

no-sec-marko commented 3 years ago

As @Londek already mentioned, you need to use JDK with debug symbols, see https://adoptopenjdk.net/upstream.html?vmVariant=hotspot

pinkLagoon commented 2 years ago

Windows is currently not supported by Frida

Is this true? I am having this issue and I have installed OpenJDK8 with debug symbols in the jvm.pdb file. And like @pandasauce, it does not load. The application I am testing is Windows only. Does this mean I cannot use Frida to test this Java app?

pinkLagoon commented 2 years ago

I have confirmed the above to be the case, you need to use Linux and MacOS to be able to use Frida on a desktop Java app: https://www.ayrx.me/frida-hotspot-jvm/

teamblubee commented 2 years ago

I ran into this issue, even with hostspot

sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                                 Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/java   1111      auto mode
* 1            /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/java   1111      manual mode
  2            /usr/lib/jvm/java-11-openjdk-amd64/bin/java           1111      manual mode
nm /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/lib/server/libjvm.so

                 U abort@@GLIBC_2.2.5
000000000156d300 b AbortVMOnCompilationFailure
000000000156d370 b AbortVMOnException
000000000156d368 b AbortVMOnExceptionMessage
000000000156d43a b AbortVMOnSafepointTimeout
000000000156d439 b AbortVMOnVMOperationTimeout
00000000015250a0 d AbortVMOnVMOperationTimeoutDelay
0000000000ab2d68 t acb_CopyLeft
0000000000ab2cca t acb_CopyRight
                 U accept@@GLIBC_2.2.5
                 U access@@GLIBC_2.2.5
. . .
nm /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so 
nm: /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so: no symbols
frida --version
15.1.14

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
depocoder commented 1 year ago

Any news? Still have issue.. Downloaded JDK 17 and still have issue.

ImMohammad20000 commented 8 months ago

i have the same problem on android 12 when i run frida-server it give me an error