frida-compile icon indicating copy to clipboard operation
frida-compile copied to clipboard

how it's work ?!

Open QM4RS opened this issue 2 years ago • 5 comments

I think this project can compile a JavaScript file in a way that doesn't require Frida gadget or any other dependencies to run, and the JavaScript code can be executed on its own. But how does it work? I didn't understand the meaning of the agent. What exactly should I provide? I might have misunderstood correctly. I am interested in putting a JS file that contains instructions for an APK file inside the APK file in a way that I don't need to be connected to a computer to execute Frida and have it executed and loaded by the application itself. Does this project do the same thing?

QM4RS avatar Jun 25 '23 19:06 QM4RS

That's not the target of this project. It's used to "compile" a multi-file js file into a single js file that can be fed to frida. If you're looking to actually compile a frida script into a dynamic library (so no frida-gadget or its config is needed) for a more permanent change of a binary take a look at my project frida-deepfreeze-rs that does exactly that.

dzervas avatar Jun 26 '23 05:06 dzervas

That's not the target of this project. It's used to "compile" a multi-file js file into a single js file that can be fed to frida. If you're looking to actually compile a frida script into a dynamic library (so no frida-gadget or its config is needed) for a more permanent change of a binary take a look at my project frida-deepfreeze-rs that does exactly that.

I am looking for a tool that I can use for Android. I checked your project. What I noticed is that the output of your project is an Exe or DLL file, which I can't use for my Android target.

QM4RS avatar Jun 26 '23 06:06 QM4RS

there's also the ability to output a .so which you can use

dzervas avatar Jun 26 '23 07:06 dzervas

there's also the ability to output a .so which you can use

is there? how can i use that ? i cloned your project but i had never worked with Rust lang. how to build that?

QM4RS avatar Jun 26 '23 08:06 QM4RS

git clone https://github.com/dzervas/frida-deepfreeze-rs
rustup target add aarch64-linux-android
cargo install cargo-ndk
export ANDROID_NDK_HOME=/my/ndk/path
BINDGEN_EXTRA_CLANG_ARGS_aarch64_linux_android="--sysroot $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot" FRIDA_CODE="console.debug('Frida hello');" cargo ndk -t arm64-v8a build --lib

The resulting .so will be at target/aarch64-linux-android/frida-deepfreeze-rs.so

For setting up cargo check out the official docs: https://doc.rust-lang.org/cargo/getting-started/installation.html For setting up ANDROID_NDK_HOME: download https://dl.google.com/android/repository/android-sdk-r25c-linux.zip, unzip it and set the variable ANDROID_NDK_HOME to the path that you unzipped it

dzervas avatar Jun 26 '23 17:06 dzervas