Soot 学习笔记 6:一些 Soot 重要的类

本文深入介绍了Soot框架中的核心类,包括Body、Unit、Local、UnitBox和ValueBox。Body存储method代码,有BafBody、JimpleBody和GrimpBody三种类型,含有Unit链、Local链和Trap链。Unit用于表示代码,如Stmt和Inst。Value接口描述数据,包括Local、Constants、Expr等。Box作为间接访问Soot对象的指针,分为ValueBox和UnitBox,对于修改代码操作提供了便利。
摘要由CSDN通过智能技术生成

本文依旧参考自 soot 的 tutorial :On the Soot menagerie - fundamental Soot objects 。文中会介绍 Body, Unit, Local, UnitBox 和 ValueBox。

所有Body

Body 是用于存放 method 代码的。根据中间代码的不同可以有 BafBody, JimpleBody 和 GrimpBody 三种。Body 中有3种主要的 chain,分别是 Unit chain,Local chain 和 Trap chain。

以下是一段 Java 代码以及其对应的 Jimple 代码:

    public static void main(String[] argv) throws Exception
    {
        int x = 2, y = 6;

        System.out.println("Hi!");
        System.out.println(x * y + y);
        try
        {
            int z = y * x;
        }
        catch (Exception e)
        {
            throw e;
        }
    }

public static void main(java.lang.String[]) throws java.lang.Except
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值