请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BytecodeOffsetTag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中soot.tagkit.BytecodeOffsetTag的典型用法代码示例。如果您正苦于以下问题:Java BytecodeOffsetTag类的具体用法?Java BytecodeOffsetTag怎么用?Java BytecodeOffsetTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BytecodeOffsetTag类属于soot.tagkit包,在下文中一共展示了BytecodeOffsetTag类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addTags

import soot.tagkit.BytecodeOffsetTag; //导入依赖的package包/类
/**
 * Tag the passed host with: - this instructions line number (if one is set)
 * - the original bytecode offset
 * 
 * @param host
 *            the host to tag
 */
protected void addTags(Host host) {
    if (lineNumber != -1) {
        host.addTag(new LineNumberTag(lineNumber));
        host.addTag(new SourceLineNumberTag(lineNumber));
    }
    host.addTag(new BytecodeOffsetTag(codeAddress));
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:15,代码来源:DexlibAbstractInstruction.java


示例2: getBCI

import soot.tagkit.BytecodeOffsetTag; //导入依赖的package包/类
public static int getBCI(Unit u){
    try{
        BytecodeOffsetTag bci = (BytecodeOffsetTag)u.getTag("BytecodeOffsetTag");
        return bci.getBytecodeOffset();
    }catch(Exception e){
        if (Config.verbose >= 2)
            System.out.println("WARN: SootUtilities cannot get BCI"+u);
    }
    return -1;
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:11,代码来源:SootUtilities.java


示例3: ProgramPoint

import soot.tagkit.BytecodeOffsetTag; //导入依赖的package包/类
/**
 * Constructor
 * @param method
 * @param stmt
 */
public ProgramPoint(SootMethod method, Stmt stmt) {
	BytecodeOffsetTag tag = (BytecodeOffsetTag) stmt.getTag("BytecodeOffsetTag");
	offset = (tag == null) ? -1 : tag.getBytecodeOffset(); 
	this.method = method;
	this.stmt = stmt;
}
 
开发者ID:Orange-OpenSource,项目名称:matos-tool,代码行数:12,代码来源:ProgramPoint.java


示例4: run

import soot.tagkit.BytecodeOffsetTag; //导入依赖的package包/类
@Override
public void run(SpyResult result, AppDescription app) {
	Scene scene = Scene.v();
	int count = 0;
	Iterator<SootClass> classes = scene.getApplicationClasses().iterator();
	while(classes.hasNext()) {
		SootClass clazz = classes.next();
		for (SootMethod method : clazz.getMethods()) {
			if(!method.hasActiveBody()) continue;
			Body body = method.getActiveBody();
			Chain<Unit> code = body.getUnits();
			Iterator<Trap> traps = body.getTraps().iterator();
			while(traps.hasNext()) {
				boolean bogus = false;
				Trap trap = traps.next();
				Unit lastOfCatch = trap.getEndUnit();
				// System.err.println("Last of catch " + lastOfCatch);
				Unit firstHandler = trap.getHandlerUnit();
				// System.err.println("First of handler " + firstHandler);
				Unit nextHandler = code.getSuccOf(firstHandler);
				// System.err.println("Next handler " + nextHandler);
				if (nextHandler == null) continue;
				Unit handlerTarget = seekTarget(nextHandler);
				if (handlerTarget == null) continue;
				// System.err.println("handler goto " + handlerTarget + handlerTarget.getClass());
				if (handlerTarget instanceof ReturnVoidStmt) {
					bogus = true;
				} else if (lastOfCatch instanceof GotoStmt) {
					bogus = handlerTarget.equals(seekTarget(lastOfCatch));
				} else {
					if (!lastOfCatch.fallsThrough()) continue;
					Unit targetCatch = code.getSuccOf(lastOfCatch);
					if (targetCatch == null) continue; // This had to be a return.
					// System.err.println("Target 1" + targetCatch);
					if (handlerTarget.equals(targetCatch)) bogus = true;
					if (targetCatch.fallsThrough() && !targetCatch.branches()) {
						targetCatch = code.getSuccOf(targetCatch);
						// System.err.println("Target 2" + targetCatch);
						if (handlerTarget.equals(targetCatch)) bogus = true;
					}
				}
				
				// System.err.println(bogus);
				if (bogus) {
					BytecodeOffsetTag tag = (BytecodeOffsetTag) firstHandler.getTag("BytecodeOffsetTag");
					int offset = (tag == null) ? -1 : tag.getBytecodeOffset();
					result.setCustomResult(listItem("android.empty.exception.class",count),clazz.getName());
					result.setCustomResult(listItem("android.empty.exception.method",count),method.getSubSignature());
					result.setCustomResult(listItem("android.empty.exception.pos",count),offset);
					count++;
				}
				
			}
			result.setCustomResult("android.empty.exception.error", count > 0);
			result.setCustomResult("android.empty.exception.count", count);
		}
	}
}
 
开发者ID:Orange-OpenSource,项目名称:matos-tool,代码行数:59,代码来源:ExceptionAnalysis.java



注:本文中的soot.tagkit.BytecodeOffsetTag类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BGABadgeable类代码示例发布时间:2022-05-16
下一篇:
Java FirebaseFirestoreSettings类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap