|
[分享] 字节开源的android inline hook库,已经用在部分app上
这里的目标地址在ip寄存器中,arm32是没有BL <reg>指令的哈,只有BL <imm>和BLX <reg>,BLX <reg>自动根据寄存器中地址值奇偶设置instrSet |
|
|
|
[分享]字节跳动线上大规模使用的PLT hook方案bhook开源了
我是作者。 先简单列一下 xHook 的不足之处: * native 崩溃兜底机制有缺陷,导致线上崩溃无法完全避免。 * 无法自动对新加载的 ELF 执行 hook。(需要外部反复调用 `refresh` 来“发现”新加载的 ELF。但是在什么时机调用 `refresh` 呢?频率太高会影响性能,频率太低会导致 hook 不及时) * 由于依赖于链式调用的机制。如果一个调用点被多次 hook,在对某个 proxy 函数执行 unhook 后,链中后续的 proxy 函数就会丢失。 * 只使用了读 maps 的方式来遍历 ELF。在高版本 Android 系统和部分机型中兼容性不好,经常会发生 hook 不到的情况。 * API 设计中使用了正则来指定 hook 哪些目标 ELF,运行效率不佳。 * 需要在真正执行 hook 前,注册完所有的 hook 点,一旦开始执行 hook(调用 `refresh` 后),不能再添加 hook 点。这种设计是很不友好的。 * 无法适配 Android 8.0 引入 Linker Namespace 机制(同一个函数符号,在进程中可能存在多个实现)。 * 无法自动避免 proxy 函数之间的环形调用(比如:`open` 的 proxy 函数中调用了 `read`,然后 `read` 的 proxy 函数中又调用了 `open`。如果这两个 proxy 存在于两个独立的 SDK 中,此时形成的环形调用将很难在 SDK 开发阶段被发现。如果在更多的 SDK 之间形成了一个更大的 proxy 函数调用环,情况将会失去控制。) bhook 把上面这些问题都解决了。而且 bhook 是目前字节用于线上的 plt hook 方案,主要的几个app都在用。线上稳定性、功能性、性能这几个方面都达到了预期。 |
|
[推荐] 爱奇艺视频 APP 使用的 Android native crash + Java exception 捕获方案在 GitHub 开源了
这个是爱奇艺视频app一直在用的,一直在更新和维护,确认内部使用的和github开源的是完全相同的。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值