Giter Club home page Giter Club logo

Comments (13)

oleavr avatar oleavr commented on August 29, 2024 1

This is not a bug – there is no Java VM in the system session (pid 0), i.e. inside of Frida itself.

from frida-java-bridge.

oleavr avatar oleavr commented on August 29, 2024

Thanks! Does your libart.so have a JNI_GetCreatedJavaVMs export? Module.findExportByName('libart.so', 'JNI_GetCreatedJavaVMs') should tell you. It's the only exported function we rely on currently that decides Java.available: https://github.com/frida/frida-java/blob/2eccd0483af0b3bb9f12637852e30bef858639e4/lib/android.js#L33-L41

from frida-java-bridge.

dpnishant avatar dpnishant commented on August 29, 2024
[USB::Xiaomi Redmi Note 3::System]-> Module.findExportByName('libart.so', 'JNI_GetCreatedJavaVMs')
null

It returns null when I tried in the REPL with frida -U -p 0

from frida-java-bridge.

oleavr avatar oleavr commented on August 29, 2024

Could you check if there's any change with Frida 9.1.7?

from frida-java-bridge.

oleavr avatar oleavr commented on August 29, 2024

(We still depend on that function, but the error message should now tell you what other functions are also missing.)

from frida-java-bridge.

dpnishant avatar dpnishant commented on August 29, 2024

Same error

[USB::OnePlus ONEPLUS A3003::System]-> Frida.version
"9.1.8"
[USB::OnePlus ONEPLUS A3003::System]-> Java.available
false
[USB::OnePlus ONEPLUS A3003::System]-> Module.findExportByName('libart.so', 'JNI_GetCreatedJavaVMs')
null
[USB::OnePlus ONEPLUS A3003::System]-> 

from frida-java-bridge.

oleavr avatar oleavr commented on August 29, 2024

Interesting, could you show me what Process.enumerateModulesSync() gives you?

from frida-java-bridge.

dpnishant avatar dpnishant commented on August 29, 2024

Device: Nexus 5 (32-bit ART)

➜  Downloads frida -U -p 0
     ____
    / _  |   Frida 9.1.8 - A world-class dynamic instrumentation framework
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at http://www.frida.re/docs/home/
                                                                                
[USB::LGE Nexus 5::System]-> Frida.version
"9.1.9"
[USB::LGE Nexus 5::System]-> Java.androidVersion
"5.1.1"
[USB::LGE Nexus 5::System]-> Java.available
false
[USB::LGE Nexus 5::System]-> Module.findExportByName('libart.so', 'JNI_GetCreatedJavaVMs')
null
[USB::LGE Nexus 5::System]-> Process.enumerateModulesSync()
[
    {
        "base": "0xb20cf000",
        "name": "frida-agent-32.so",
        "path": "/data/local/tmp/re.frida.server/frida-agent-32.so",
        "size": 11509760
    },
    {
        "base": "0xb5a56000",
        "name": "libnetd_client.so",
        "path": "/system/lib/libnetd_client.so",
        "size": 16384
    },
    {
        "base": "0xb5a7a000",
        "name": "libstdc++.so",
        "path": "/system/lib/libstdc++.so",
        "size": 16384
    },
    {
        "base": "0xb5a7e000",
        "name": "libm.so",
        "path": "/system/lib/libm.so",
        "size": 102400
    },
    {
        "base": "0xb5a98000",
        "name": "liblog.so",
        "path": "/system/lib/liblog.so",
        "size": 28672
    },
    {
        "base": "0xb5a9f000",
        "name": "libc.so",
        "path": "/system/lib/libc.so",
        "size": 446464
    },
    {
        "base": "0xb5b1a000",
        "name": "linker",
        "path": "/system/bin/linker",
        "size": 65536
    },
    {
        "base": "0xb5b2b000",
        "name": "frida-server",
        "path": "/data/local/tmp/frida-server",
        "size": 21430272
    }
]
[USB::LGE Nexus 5::System]-> 

Device: Nexus 6P 3T (64-bit ART)

➜  Downloads frida -U -p 0
     ____
    / _  |   Frida 9.1.8 - A world-class dynamic instrumentation framework
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at http://www.frida.re/docs/home/
                                                                                
[USB::Huawei Nexus 6P::System]-> Frida.version
"9.1.9"
[USB::Huawei Nexus 6P::System]-> Java.androidVersion
"6.0.1"
[USB::Huawei Nexus 6P::System]-> Java.available
false
[USB::Huawei Nexus 6P::System]-> Module.findExportByName('libart.so', 'JNI_GetCreatedJavaVMs')
null
[USB::Huawei Nexus 6P::System]-> Process.enumerateModulesSync()
[
    {
        "base": "0x5583ef4000",
        "name": "frida-server",
        "path": "/data/local/tmp/frida-server",
        "size": 46415872
    },
    {
        "base": "0x7fb1301000",
        "name": "frida-agent-64.so",
        "path": "/data/local/tmp/re.frida.server/frida-agent-64.so",
        "size": 16965632
    },
    {
        "base": "0x7fb72d2000",
        "name": "libstdc++.so",
        "path": "/system/lib64/libstdc++.so",
        "size": 81920
    },
    {
        "base": "0x7fb7545000",
        "name": "libnetd_client.so",
        "path": "/system/lib64/libnetd_client.so",
        "size": 77824
    },
    {
        "base": "0x7fb7578000",
        "name": "libm.so",
        "path": "/system/lib64/libm.so",
        "size": 303104
    },
    {
        "base": "0x7fb75c2000",
        "name": "libc++.so",
        "path": "/system/lib64/libc++.so",
        "size": 974848
    },
    {
        "base": "0x7fb76b3000",
        "name": "liblog.so",
        "path": "/system/lib64/liblog.so",
        "size": 106496
    },
    {
        "base": "0x7fb76d0000",
        "name": "libc.so",
        "path": "/system/lib64/libc.so",
        "size": 897024
    },
    {
        "base": "0x7fb77d9000",
        "name": "linker64",
        "path": "/system/bin/linker64",
        "size": 200704
    }
]
[USB::Huawei Nexus 6P::System]-> 

from frida-java-bridge.

oleavr avatar oleavr commented on August 29, 2024

Sorry for the trouble, didn't notice this small but important detail until now.

from frida-java-bridge.

Oreaz avatar Oreaz commented on August 29, 2024

I got a similar issue, but mine isn't with pid 0 but with a regular app.

Seems the exports are from /system/fake-libs/libart.so instead of /system/lib/libart.so

http://stackoverflow.com/questions/37683416/dlsym-undefined-symbol-android-n

     ____
    / _  |   Frida 9.1.6 - A world-class dynamic instrumentation framework
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at http://www.frida.re/docs/home/
Waiting for USB device to appear...

[USB::Unknown SM-T520::com.instagram.android]-> Module.enumerateExportsSync("libart.so")
[
    {
        "address": "0xa8ebf094",
        "name": "_Unwind_ForcedUnwind",
        "type": "function"
    },
    {
        "address": "0xa8ebebb0",
        "name": "__aeabi_unwind_cpp_pr0",
        "type": "function"
    },
    {
        "address": "0xa8ebebb8",
        "name": "__aeabi_unwind_cpp_pr1",
        "type": "function"
    },
    {
        "address": "0xa8ebe5d0",
        "name": "_Unwind_Complete",
        "type": "function"
    },
    {
        "address": "0xa8ebebc0",
        "name": "__aeabi_unwind_cpp_pr2",
        "type": "function"
    },
    {
        "address": "0xa8ebf04c",
        "name": "_Unwind_Resume",
        "type": "function"
    },
    {
        "address": "0xa8ebf070",
        "name": "_Unwind_Resume_or_Rethrow",
        "type": "function"
    },
    {
        "address": "0xa8ebef50",
        "name": "__gnu_Unwind_Save_VFP",
        "type": "function"
    },
    {
        "address": "0xa8ebef34",
        "name": "__restore_core_regs",
        "type": "function"
    },
    {
        "address": "0xa8ebf094",
        "name": "___Unwind_ForcedUnwind",
        "type": "function"
    },
    {
        "address": "0xa8ebf564",
        "name": "_Unwind_GetTextRelBase",
        "type": "function"
    },
    {
        "address": "0xa8ebe005",
        "name": "_ZN3art3Dbg8ResumeVMEv",
        "type": "function"
    },
    {
        "address": "0xa8ebef68",
        "name": "__gnu_Unwind_Restore_VFP_D_16_to_31",
        "type": "function"
    },
    {
        "address": "0xa8ebe6f8",
        "name": "__gnu_Unwind_Backtrace",
        "type": "function"
    },
    {
        "address": "0xa8ebef60",
        "name": "__gnu_Unwind_Save_VFP_D",
        "type": "function"
    },
    {
        "address": "0xa8ebef58",
        "name": "__gnu_Unwind_Restore_VFP_D",
        "type": "function"
    },
    {
        "address": "0xa8ebebc8",
        "name": "_Unwind_VRS_Pop",
        "type": "function"
    },
    {
        "address": "0xa8ebf04c",
        "name": "___Unwind_Resume",
        "type": "function"
    },
    {
        "address": "0xa8ebe53c",
        "name": "__gnu_Unwind_Resume",
        "type": "function"
    },
    {
        "address": "0xa8ebe5b0",
        "name": "__gnu_Unwind_Resume_or_Rethrow",
        "type": "function"
    },
    {
        "address": "0xa8ebf070",
        "name": "___Unwind_Resume_or_Rethrow",
        "type": "function"
    },
    {
        "address": "0xa8ebe520",
        "name": "__gnu_Unwind_ForcedUnwind",
        "type": "function"
    },
    {
        "address": "0xa8ebe029",
        "name": "_ZN3art12FaultManager35EnsureArtActionInFrontOfSignalChainEv",
        "type": "function"
    },
    {
        "address": "0xa8ebef48",
        "name": "__gnu_Unwind_Restore_VFP",
        "type": "function"
    },
    {
        "address": "0xa8ebe474",
        "name": "_Unwind_GetCFA",
        "type": "function"
    },
    {
        "address": "0xa8ebef34",
        "name": "restore_core_regs",
        "type": "function"
    },
    {
        "address": "0xa8ebf014",
        "name": "__gnu_Unwind_Save_WMMXC",
        "type": "function"
    },
    {
        "address": "0xa8ebf000",
        "name": "__gnu_Unwind_Restore_WMMXC",
        "type": "function"
    },
    {
        "address": "0xa8ebefbc",
        "name": "__gnu_Unwind_Save_WMMXD",
        "type": "function"
    },
    {
        "address": "0xa8ebf028",
        "name": "_Unwind_RaiseException",
        "type": "function"
    },
    {
        "address": "0xa8ebef78",
        "name": "__gnu_Unwind_Restore_WMMXD",
        "type": "function"
    },
    {
        "address": "0xa8ebe5ec",
        "name": "_Unwind_VRS_Get",
        "type": "function"
    },
    {
        "address": "0xa8ebf4f0",
        "name": "__gnu_unwind_frame",
        "type": "function"
    },
    {
        "address": "0xa8ebf028",
        "name": "___Unwind_RaiseException",
        "type": "function"
    },
    {
        "address": "0xa8ebf55c",
        "name": "_Unwind_GetDataRelBase",
        "type": "function"
    },
    {
        "address": "0xa8ebe47c",
        "name": "__gnu_Unwind_RaiseException",
        "type": "function"
    },
    {
        "address": "0xa8ebef70",
        "name": "__gnu_Unwind_Save_VFP_D_16_to_31",
        "type": "function"
    },
    {
        "address": "0xa8ebf540",
        "name": "_Unwind_GetLanguageSpecificData",
        "type": "function"
    },
    {
        "address": "0xa8ebe670",
        "name": "_Unwind_VRS_Set",
        "type": "function"
    },
    {
        "address": "0xa8ebe5d4",
        "name": "_Unwind_DeleteException",
        "type": "function"
    },
    {
        "address": "0xa8ebf0b8",
        "name": "___Unwind_Backtrace",
        "type": "function"
    },
    {
        "address": "0xa8ebf530",
        "name": "_Unwind_GetRegionStart",
        "type": "function"
    },
    {
        "address": "0xa8ebdfe1",
        "name": "_ZN3art3Dbg9SuspendVMEv",
        "type": "function"
    },
    {
        "address": "0xa8ebf0b8",
        "name": "_Unwind_Backtrace",
        "type": "function"
    },
    {
        "address": "0xa8ebf168",
        "name": "__gnu_unwind_execute",
        "type": "function"
    }
]
[USB::Unknown SM-T520::com.instagram.android]-> Frida.version
"9.1.10"
[USB::Unknown SM-T520::com.instagram.android]-> Module.findExportByName('libart.so', 'JNI_GetCreatedJavaVMs')
null

from frida-java-bridge.

mastercho avatar mastercho commented on August 29, 2024
frida -U -p 0
    ____
   / _  |   Frida 12.8.20 - A world-class dynamic instrumentation toolkit
  | (_| |
   > _  |   Commands:
  /_/ |_|       help      -> Displays the help system
  . . . .       object?   -> Display information about 'object'
  . . . .       exit/quit -> Exit
  . . . .
  . . . .   More info at https://www.frida.re/docs/home/

[Custom::SystemSession]-> Frida.version
"12.8.20"
[Custom::SystemSession]-> Java.androidVersion
"8.0.0"
[Custom::SystemSession]-> Java.available
false
[Custom::SystemSession]-> Java.vm
null
[Custom::SystemSession]-> Module.findExportByName('libart.so', 'JNI_GetCreatedJavaVMs')
null
[Custom::SystemSession]-> Process.enumerateModulesSync()
[
   {
       "base": "0x5e8ba000",
       "name": "frida",
       "path": "/data/local/tmp/frida",
       "size": 26128384
   },
   {
       "base": "0xf410e000",
       "name": "liblog.so",
       "path": "/system/lib/liblog.so",
       "size": 98304
   },
   {
       "base": "0xf40d1000",
       "name": "libdl.so",
       "path": "/system/lib/libdl.so",
       "size": 20480
   },
   {
       "base": "0xf4156000",
       "name": "libc.so",
       "path": "/system/lib/libc.so",
       "size": 950272
   },
   {
       "base": "0xf3fc9000",
       "name": "libc++.so",
       "path": "/system/lib/libc++.so",
       "size": 983040
   },
   {
       "base": "0xf3f83000",
       "name": "libm.so",
       "path": "/system/lib/libm.so",
       "size": 233472
   },
   {
       "base": "0xf3e44000",
       "name": "libnetd_client.so",
       "path": "/system/lib/libnetd_client.so",
       "size": 20480
   },
   {
       "base": "0xf3e1c000",
       "name": "libcutils.so",
       "path": "/system/lib/libcutils.so",
       "size": 77824
   },
   {
       "base": "0xef303000",
       "name": "frida-agent-32.so",
       "path": "/data/local/tmp/re.frida.server/frida-agent-32.so",
       "size": 21835776
   },
   {
       "base": "0xf42f1000",
       "name": "linux-vdso.so.1",
       "path": "linux-vdso.so.1",
       "size": 4096
   },
   {
       "base": "0xf42f2000",
       "name": "linker",
       "path": "/system/bin/linker",
       "size": 1085440
   }
]

Got the same issue on Frida 12.8.20

from frida-java-bridge.

RealMrHex avatar RealMrHex commented on August 29, 2024
[SM G988N::com.xyz.me]-> Frida.version
"16.0.1"

[SM G988N::com.xyz.me]-> Frida.version
"16.0.1"

[SM G988N::com.xyz.me]-> Java.androidVersion
"9"

[SM G988N::com.xyz.me]-> Java.available
false

[SM G988N::com.karizmastudio.yatzy ]-> Java.vm
null

[SM G988N::com.xyz.me]-> Module.findExportByName('libart.so', 'JNI_GetCreatedJavaVMs')
null

Same here

from frida-java-bridge.

s1341 avatar s1341 commented on August 29, 2024

@RealMrHex what android version are you on? Also, can you please show an enumeration of modules?

from frida-java-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.