I am trying to hook an obfuscated Android app, using frida 14.2.17. I try to intercept the input and output of the method fqikwlxyqx. The strings passed to the functions are in unicode format. Following is an example:
I am called :')
Error: invalid string
at NativePointer.readUtf16String (frida/runtime/core.js:127:1)
at t.stringFromJni (frida/node_modules/frida-java-bridge/lib/env.js:600:1)
at Object.fromJni (frida/node_modules/frida-java-bridge/lib/types.js:199:1)
at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:610:1)
at frida/node_modules/frida-java-bridge/lib/class-factory.js:592:1
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:1057:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:580:1)
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:963:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:547:1)
at Proxy.o.implementation (frida/node_modules/frida-java-bridge/index.js:225:1)
Encrypted String: '彇'
Plain String: '䍒'
Error: invalid string
at NativePointer.readUtf16String (frida/runtime/core.js:127:1)
at t.stringFromJni (frida/node_modules/frida-java-bridge/lib/env.js:600:1)
at Object.fromJni (frida/node_modules/frida-java-bridge/lib/types.js:199:1)
at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:610:1)
at frida/node_modules/frida-java-bridge/lib/class-factory.js:592:1
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:1057:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:580:1)
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:963:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:547:1)
at Proxy.o.implementation (frida/node_modules/frida-java-bridge/index.js:225:1)
Error: invalid string
at NativePointer.readUtf16String (frida/runtime/core.js:127:1)
at t.stringFromJni (frida/node_modules/frida-java-bridge/lib/env.js:600:1)
at Object.fromJni (frida/node_modules/frida-java-bridge/lib/types.js:199:1)
at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:610:1)
at frida/node_modules/frida-java-bridge/lib/class-factory.js:592:1
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:1057:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:580:1)
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:963:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:547:1)
at Proxy.o.implementation (frida/node_modules/frida-java-bridge/index.js:225:1)
Error: invalid string
at NativePointer.readUtf16String (frida/runtime/core.js:127:1)
at t.stringFromJni (frida/node_modules/frida-java-bridge/lib/env.js:600:1)
at Object.fromJni (frida/node_modules/frida-java-bridge/lib/types.js:199:1)
at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:610:1)
at frida/node_modules/frida-java-bridge/lib/class-factory.js:592:1
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:1057:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:580:1)
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:963:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:547:1)
at Proxy.o.implementation (frida/node_modules/frida-java-bridge/index.js:225:1)
Error: invalid string
at NativePointer.readUtf16String (frida/runtime/core.js:127:1)
at t.stringFromJni (frida/node_modules/frida-java-bridge/lib/env.js:600:1)
at Object.fromJni (frida/node_modules/frida-java-bridge/lib/types.js:199:1)
at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:610:1)
at frida/node_modules/frida-java-bridge/lib/class-factory.js:592:1
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:1057:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:580:1)
at Function.value (frida/node_modules/frida-java-bridge/lib/class-factory.js:963:1)
at Proxy.e (frida/node_modules/frida-java-bridge/lib/class-factory.js:547:1)
at Proxy.o.implementation (frida/node_modules/frida-java-bridge/index.js:225:1)
Process crashed: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.concat(java.lang.String)' on a null object reference
My guess is that frida might have a problem handling the unicode characters. The behaviour persists when removing the logging part in the reimplementation or overloading the method.
I am trying to hook an obfuscated Android app, using frida 14.2.17. I try to intercept the input and output of the method
fqikwlxyqx
. The strings passed to the functions are in unicode format. Following is an example:I use following script to try to print the output of the function:
Calling it with following command:
frida -p 0 --runtime=v8 --debug -U -f asd.xyz.abc.def -l frida_script.ts --no-pause
results in following stacktrace:
My guess is that frida might have a problem handling the unicode characters. The behaviour persists when removing the logging part in the reimplementation or overloading the method.