Giter VIP home page Giter VIP logo

Comments (16)

ele7enxxh avatar ele7enxxh commented on July 2, 2024

给我个可触发崩溃的二进制可执行文件和源码

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

DemoForBUG.zip

HookDemo是android studio工程
X86_BUG_DEMO目录是native代码


Java层静态代码里加载共享库
native层在JNI_OnLoad函数里hook AAssetManager_open
Java层在activity的onCreate方法里通过jni调用native被hook的函数

from android-inline-hook.

ele7enxxh avatar ele7enxxh commented on July 2, 2024

好的,我会尽快测试

from android-inline-hook.

ele7enxxh avatar ele7enxxh commented on July 2, 2024

麻烦再提供以下崩溃手机里的libandroid.so

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

@ele7enxxh 上传的动态库好像错了,我明天拿设备验证下,抱歉了

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

Nexus 5X
Android OS Version:7.1.1 / 7.0都有问题

libandroid.so.zip
libandroid-64.so.zip

image

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

Hi @ele7enxxh, 关于7.0的问题你那边可有进展?是否能够重现呢?

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

崩溃不是发生在调用原函数,而是发生在新函数执行结束后。
新函数里不论是否有调用原函数,新函数执行结束就会崩溃

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

7.x设备上relocateInstructionInThumb执行和正常设备有差异,正常设备上执行的都是下图的分支2,7.x上执行的有一次不一样。

hook的目标函数是dlopen,

demo.apk.txt

image

运行正常的log:
5965-5965/? E/relocate: relocateInstruction,617
5965-5965/? E/relocate: relocateInstructionInThumb,471
5965-5965/? E/relocate: relocateInstructionInThumb,471
5965-5965/? E/relocate: relocateInstructionInThumb,471
5965-5965/? E/relocate: relocateInstructionInThumb,471
5965-5965/? E/relocate: relocateInstructionInThumb,471
5965-5965/? E/inlineHook: doInlineHook,364
5965-5965/? E/inlineHook: doInlineHook,385

崩溃设备输出的log:
E/relocate: relocateInstruction,617
E/relocate: relocateInstructionInThumb,471 (relocateInstructionInThumb16分支)
E/relocate: relocateInstructionInThumb,471 (relocateInstructionInThumb16分支)
E/relocate: relocateInstructionInThumb,464 (relocateInstructionInThumb32分支)
E/relocate: relocateInstructionInThumb,471 (relocateInstructionInThumb16分支)
E/relocate: relocateInstructionInThumb,471 (relocateInstructionInThumb16分支)
E/inlineHook: doInlineHook,364
E/inlineHook: doInlineHook,385

from android-inline-hook.

ele7enxxh avatar ele7enxxh commented on July 2, 2024

不好意思,我现在在忙其他工作,不保证后续会处理这个问题。

from android-inline-hook.

wyhuan avatar wyhuan commented on July 2, 2024

@WenhaiLin 问一下android x86模拟器使用inline hook你成功了?是怎么做到的

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

@wyhuan 没有成功。我后边改用静态注入方案

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

android 7.x上崩溃是因为我hook了另外的函数(dlopen,权限问题)导致,关闭此issue

from android-inline-hook.

wyhuan avatar wyhuan commented on July 2, 2024

@WenhaiLin android x86模拟器静态注入之后hook成功了嘛? 方案能分享一下不

from android-inline-hook.

WenhaiLin avatar WenhaiLin commented on July 2, 2024

成功了
基本思路是按ELF格式去解析原动态库,将要hook的函数修改为一个新增依赖库的函数

这个方式仅限于你要hook的函数是动态库外部实现的,例如gettimeofday等

from android-inline-hook.

xiaoyaomeng avatar xiaoyaomeng commented on July 2, 2024

成功了
基本思路是按ELF格式去解析原动态库,将要hook的函数修改为一个新增依赖库的函数

这个方式仅限于你要hook的函数是动态库外部实现的,例如gettimeofday等

同在厦门额,可否留个微信联系方式,我现在公司也有这块需求,想请教一点相关的信息

from android-inline-hook.

Related Issues (20)

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.