Giter Club home page Giter Club logo

elfhooker's Introduction

ELFHooker

基于EFL文件格式Hook的demo,hook了SurfaceFlinger进程的eglSwapBuffers函数,替换为new_eglSwapBuffers。

兼容Android 32位和64位。

注入系列笔记:

ELF格式分析
so文件加载流程
Inject和Hook

使用

准备:

  • 一台root的android设备
  • ndk编译环境

分别开2个终端来查看日志:

  • adb logcat | grep INJECT

  • adb logcat | grep ELFHooker

    如果日志太多了可以用 adb logcat -c来清理一下日志

然后在新的终端中执行:

  • git clone [email protected]:MelonWXD/ELFHooker.git
  • cd ELFHooker/jni
  • ndk-build
  • cd ../libs/arm64-v8a/ (or ../libs/armeabi// if your device is 32-bit)
  • adb push .* /data/local/tmp
  • adb shell
  • su
  • cd /data/local/tmp
  • chmod 755 inject
  • chmod 755 libelfHooker.so

找到/system/bin/surfaceflinger这个进程的pid:

  • ps | grep surfaceflinger (如果要在代码中实现的话,可以遍历/proc/pid/cmdline文件来找到你某个进程名对应的pid)

  • ./inject -p pid -l /data/local/tmp/libelfHooker.so

    查看日志输出:

参考

Lody's elfHook
Android中的so注入(inject)和挂钩(hook) - For both x86 and arm

elfhooker's People

Contributors

melonwxd avatar

Watchers

 avatar  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.