objection

本文介绍了Objection,一个简化Frida封装的工具,它降低了hook框架的使用难度,详细讲解了安装步骤、常见错误处理、API使用方法以及插件功能,适合IT技术开发者学习和实践。

1. objection的安装

a) objectionfrida做了进一步的封装,通过输入一系列的命令即可完成hook。忘记命令时还可以按空格弹出对应提示信息,大大降低了hook框架的使用门槛

b) 安装objection之前,先安装fridafrida-tools

c) 为了有更好的兼容性,objection的版本,最好选择当前frida版本之后更新

objection更新时间查看地址 https://pypi.org/project/objection/1.1.3/#history

frida更新时间查看地址

d) 教程使用的各版本号

pip install frida==14.2.18

pip install frida-tools==9.2.5

pip install objection==1.11.0

常见报错:

pkg_resources.ContextualVersionConflict: (Pygments 2.11.2 (d:\soft\python386\lib\site-packages), Requirement.parse('Pygments<=2.11.1,>=1.6'), {'litecli'})

降级Pygments库到2.11.1即可

2. objection的使用

注入进程,如果objection没有找到进程会以spwan方式启动进程

objection --help

objection -g <进程名> explore

objetion log 文件位置  C:\Users\Administrator\.objection

3. api

 列出所有已加载的

android hooking list classes

所有已加载的类中搜索包含特定关键的类

android hooking search classes <pattern>

列出类的所有方法

android hooking list class_methods <路径.类名>

hook类的所有方法(不包括构造方法)

android hooking watch class <路径.类名>

hook类的构造方法

android hooking watch class_method <路径.类名.$init>

默认是hook方法的所有重载

android hooking watch class_method <路径.类名.方法名>

hook方法的参数、返回值和调用栈

android hooking watch class_method <路径.类名.方法名> --dump-args --dump-return --dump-backtrace

如:java.lang.String.getBytes

hook单个重载函数,需要指定参数类型多个参数用逗号分隔

android hooking watch class_method <路径.类名.方法名> "<参数类型>"

查看与取消hook

jobs list

jobs kill <jobId>

指定ip和端口连接

objection -N -h <ip> -p <port> -g <进程名> explore

启动前hook

objection -N -h <ip> -p <port> -g <进程名> explore --startup-command "android hooking watch class <路径.类名>"

启动前就hook打印参数、返回值、函数调用栈

objection -N -h <ip> -p <port> -g <进程名> explore -s "android hooking watch class_method <路径.类名.方法名>  --dump-args --dump-return --dump-backtrace"

如果启动前需要运行多条命令,可以写到一个文件中,使用-c选项

objection -g <进程名> explore -c "命令文件的路径(一行一条命令,不加引号)"

不常用的操作

关闭ssl校验  android sslpinning disable

关闭root检测  android root disable

搜索堆中的实例

android heap search instances <类名>

通过实例调用静态和实例方法

调用 android heap execute <handle> <方法名>

调用打印返回值 android heap execute <handle> <方法名> --return-string

调用带参数方法进入编辑器环境

android heap evaluate <handle>

console.log(clazz.getCalc(100, 200));

查看当前appactivity

android hooking list activities

尝试跳转到对应activiy

android intent launch_activity <activiyName>

枚举内存中所有模块

memory list modules

枚举模块中所有导出函数

memory list exports <so库名>

当结果太多,可以将结果导出到本地文件中

memory list exports <so库名> --json <路径.文件名>

objection插件Wallbreaker

Wallbreaker-master

1. objection的插件加载

plugin load 插件路径 name

name指的是自己定义的插件名字,将来使用这个名字访问插件,区分大小写

2. 搜索类

plugin Wallbreaker classsearch <pattern>

3. 搜索对象

plugin Wallbreaker objectsearch <classname>

获得对象值

4. classdump输出类结构,若加了--fullname参数,打印数据中的类名会带完整包名

plugin Wallbreaker classdump <classname> [--fullname]

5. objectdump在classdump的基础上,输出指定对象中的每个字段的数据

plugin Wallbreaker objectdump <handle> [--fullname]
handle填对象值0x1115

### UVM Objection Mechanism in SystemVerilog In the context of Universal Verification Methodology (UVM), objections serve as a synchronization mechanism that allows different components within a testbench to control when simulation should end. This ensures all tests and sequences complete before ending the simulation, preventing premature termination. #### Key Concepts Objections are raised by various parts of the test environment indicating they have work to do or need more time to finish their tasks. Once these activities conclude, objections get dropped signaling completion. If no active objections remain at any point during simulation, it ends automatically unless prevented by other means such as infinite loops or explicit commands stopping this behavior. The primary class handling objections is `uvm_objection`. Components interact with an objection through methods provided by this class: - **raise_objection()**: Increases the count of pending objections. - **drop_objection()**: Decreases the count; if zero, may trigger automatic shutdown depending on configuration settings. These operations typically occur inside phase callbacks like build_phase(), run_phase(), etc., ensuring proper timing relative to component lifecycle events[^1]. #### Example Code Demonstrating Usage Below demonstrates how one might implement basic objection management using UVM's built-in facilities: ```systemverilog class my_test extends uvm_test; function new(string name, uvm_component parent); super.new(name,parent); endfunction : new virtual task run_phase(uvm_phase phase); // Raise global objection so sim does not stop immediately after starting phase.raise_objection(this); // Perform testing actions here... // Drop once done - signals readiness for potential cleanup/shutdown phase.drop_objection(this); endtask : run_phase endclass : my_test ``` This simple example shows raising and dropping an objection around some hypothetical set of tests performed within `run_phase`. --related questions-- 1. How can custom phases be created alongside standard ones in UVM? 2. What mechanisms exist beyond objections for controlling simulation flow in complex scenarios? 3. Are there best practices regarding where exactly to place raise/drop calls within hierarchical structures? 4. Can multiple types of objections coexist effectively without interfering with each other?
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值