Objection

Objection是一个基于Frida的命令行hook工具。
通过命令pip install objection进行安装

基本使用

注入进程
objection -g <packageName>/<PID> explore
选项

  • -s <command>
    加上-s选项,可以在objection注入进程的时候就执行一些命令
  • -c <路径>
    如想在注入进程的时候执行多条命令,可以把他们放在一个文件里,然后把文件路径放这里
  • --json
    将输出以JSON格式返回

android

  • 列出全部的类
    android hooking list classes

  • 列出类中全部的方法
    android hooking list class_methods <class_name>

  • 查找类
    android hooking search classes <class_name>

  • 查找方法
    android hooking search methods <method_name>

  • 监听类
    android hooking watch class <class_name>

  • 监听方法
    android hooking watch class_method <method_name> --dump-backtrace --dump-return --dump-backtrace

  • 列出所以的activities
    android hooking list activities

  • 启动一个activity
    android intent launch_activity <package_name> <activity_name>

  • 在内存堆中查找类实例
    android heap search instances <class_name>

  • 在内存堆区执调用实例方法
    android heap execute <hashcode> <class_method>

  • 在内存堆区执行表达式,并返回其结果
    android heap evaluate <hashcode>
    通过hashcode定位实例

memory

  • 列出所有的模块
    memory list modules
  • 列出模块中的导出函数
    memory list exports <moduleName>

jobs

  • 列出后台任务
    jobs list
  • 终止任务
    jobs kill <ID>

Wallbreaker

Wallbreaker是一个基于objection的插件工具
git clone https://github.com/hluwa/Wallbreaker.git(注意路径)
启动Objection,然后加载Wallbreaker插件
plugin load /root/Documents/Wallbreaker(自己的路径)

  • plugin wallbreaker classsearch <pattern>
    根据给定的模式(pattern)对所有类名进行匹配,并列出所有匹配到的类名。

  • plugin wallbreaker objectsearch <classname>
    根据类名搜索内存中已经被创建的实例,并列出 handle 和 toString() 的结果

  • plugin wallbreaker classdump <classname> [--fullname]
    输出类的结构。如果加上 --fullname 参数,打印的数据中类名会带着完整的包名。

  • plugin wallbreaker objectdump <handle> [--fullname]
    在 ClassDump 的基础上,输出指定对象中的每个字段的数据。如果加上 --fullname 参数,打印的数据中类名会带着完整的包名。

    plugin wallbreaker classdump android.os.Buil # 查看 android.os.Build 类的结构
    
### 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?
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值