Giter Club home page Giter Club logo

droid_injectso's Introduction

droid-injectso

A shared libraries injection tool and ELF hook engine of Android.

Please compile them with android-ndk-r8e, or you may need to rewrite Android.mk.

Has been tested on Android 2.2, 2.3 and 4.1, and root privilege is REQUIRED.

Special thanks to the author of libinject http://bbs.pediy.com/showthread.php?t=141355

Compilation

Enter each source directory and run ndk-build provided by android-ndk-r8e.

$ cd injector
$ $NDK/ndk-build
$ cd ../samples/test
$ $NDK/ndk-build

$NDK is the root directory of android-ndk-r8e.

Also, you can find pre-compiled binaries in bin.

Usage

We can use injector to inject a shared library into arbitrary processes. Let's take libtest.so as an example.

First, push both injector and libtest.so into a writeable location (e.g. /data/local/) of your device (or emulator).

$ adb push injector /data/local/
$ adb push libtest.so /data/local/

Then, set the permission of injector as executable.

$ adb shell chmod 755 /data/local/injector

Next, you can refer to injector's usage information to inject libtest.so into target processes.

$ adb shell /data/local/injector -h
Usage: injector -p pid -l libpath
-h  --help      Display this usage information.
-p  --pid       PID of target process.
-l  --libpath   Absolute path of the shared library that will be injected.

What should be noticed is that injection may be failed if you specify a relative path after -l (or --libpath) option.

Hook engine

Please take a look at the sample project samples/hook_ioctl.

Reference

  1. http://bbs.pediy.com/showthread.php?t=141355
  2. http://www.codeproject.com/Articles/70302/Redirecting-functions-in-shared-ELF-libraries

droid_injectso's People

Contributors

yurushao avatar

Watchers

James Cloos avatar easyit avatar  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.