Giter Club home page Giter Club logo

frida-cycript's Introduction

frida-cycript

This is a fork of [Cycript] 1 in which we replaced its runtime with a brand new runtime called [Mjølner] 3 powered by [Frida] 4. This enables frida-cycript to run on all the platforms and architectures maintained by [frida-core] 8.

Motivation

[Cycript] 1 is an awesome interactive console for exploring and modifying running applications on iOS, Mac, and Android. It was created by [@saurik] 2 and essentially consists of four parts:

  1. Its readline-based user interface;
  2. Compiler that takes cylang as input and produces plain JavaScript as output;
  3. A runtime that executes the plain JavaScript on JavaScriptCore, providing a set of APIs expected by the compiled scripts, plus some facilities for injecting itself into remote processes;
  4. A couple of "user-space" modules written in cylang.

We didn't touch any other aspects of Cycript or did so with minimal changes.

We went out of our way to avoid touching the compiler, and also left the user interface mostly untouched, only adding extra CLI switches for things like device selection. We did, however, mostly rewrite the Cydia Substrate module so existing scripts relying on this will get the portability and [performance boost] 5 offered by Frida's instrumentation core.

We will be maintaining this fork and intend to stay in sync with user interface and language improvements made upstream.

FAQ

What are some advantages of this fork?

WE believe the main advantage is portability, but also think you should consider:

  • Ability to attach to sandboxed apps on Mac, without touching /usr or modifying the system in any way;
  • Instead of crashing the process if you make a mistake and access a bad pointer, you will get a JavaScript exception;
  • Frida's function hooking is able to hook many functions not supported by Cydia Substrate.

What are some disadvantages?

Our runtime doesn't yet support all the features that upstream's runtime does, but we are working hard to close this gap. Please file issues if something you rely on isn't working as expected.

Is Windows support planned?

Yes. You should already be able to do this by running frida-server on Windows and connecting to it with Cycript on your UNIX system. (We didn't try this yet so please tell us if and how it works for you.)

How does this benefit existing Frida-users building their own tools?

We have improved [frida-compile] 7 to support cylang by integrating the Cycript compiler. Sources with a .cy extension get compiled transparently, and this "just works" as long as [our runtime] 3 is also included in the compiled agent.

Status

Please see [our test-suite] 6 to get an overview of what we currently support.

Building

Mac

Install readline:

brew install readline

Mix it into your build environment:

export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/readline/include"
export LDFLAGS="$LDFLAGS -L/usr/local/opt/readline/lib"

Clone this repo:

git clone https://github.com/nowsecure/frida-cycript.git
cd cycript
git submodule init
git submodule update

Generate the build system:

./autogen.sh

Run configure:

./configure --enable-static --with-libclang="-rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib" --with-python=/usr/bin/python-config

Build:

make -j8

Run Cycript:

./src/cycript

Run the test-suite:

cd test && npm install && npm run test

frida-cycript's People

Contributors

saurik avatar oleavr avatar douglaswth avatar dweinstein avatar

Stargazers

 avatar

Watchers

James Cloos avatar

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.