From 9a61b14bf090f5acfed032185d73d66f931b146b Mon Sep 17 00:00:00 2001 From: wh1t3P1g Date: Fri, 23 Feb 2024 21:19:56 +0800 Subject: [PATCH] remove static invoker check --- .../analysis/switcher/InvokeExprSwitcher.java | 4 +-- .../tabby/analysis/switcher/Switcher.java | 32 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/tabby/analysis/switcher/InvokeExprSwitcher.java b/src/main/java/tabby/analysis/switcher/InvokeExprSwitcher.java index 8036b3a..2433026 100644 --- a/src/main/java/tabby/analysis/switcher/InvokeExprSwitcher.java +++ b/src/main/java/tabby/analysis/switcher/InvokeExprSwitcher.java @@ -43,10 +43,10 @@ public class InvokeExprSwitcher extends AbstractJimpleValueSwitch { @Override public void caseStaticInvokeExpr(StaticInvokeExpr v) { - if(isNecessaryEdge("StaticInvoke", v)){ +// if(isNecessaryEdge("StaticInvoke", v)){ generate(v); buildCallRelationship(v); - } +// } } @Override diff --git a/src/main/java/tabby/analysis/switcher/Switcher.java b/src/main/java/tabby/analysis/switcher/Switcher.java index e88ff4d..158948f 100644 --- a/src/main/java/tabby/analysis/switcher/Switcher.java +++ b/src/main/java/tabby/analysis/switcher/Switcher.java @@ -107,23 +107,23 @@ public static TabbyVariable doInvokeExprAnalysis( Map args = Switcher.extractArgsFromInvokeExpr(invokeExpr, context); // 检查当前的调用 是否需要分析 看入参、baseVar是否可控 List pollutedPosition = pollutedPositionAnalysis(baseVar, args, context); - TabbyVariable firstPollutedVar = null; - boolean flag = false; - int index = 0; - for(Integer pos:pollutedPosition){ - if(pos != PositionUtils.NOT_POLLUTED_POSITION){ - if(index == 0){ - firstPollutedVar = baseVar; - }else{ - firstPollutedVar = args.get(index-1); - } - flag=true; - break; - } - index++; - } +// TabbyVariable firstPollutedVar = null; +// boolean flag = false; +// int index = 0; +// for(Integer pos:pollutedPosition){ +// if(pos != PositionUtils.NOT_POLLUTED_POSITION){ +// if(index == 0){ +// firstPollutedVar = baseVar; +// }else{ +// firstPollutedVar = args.get(index-1); +// } +// flag=true; +// break; +// } +// index++; +// } - if(!flag) return null; +// if(!flag) return null; // baseVar,入参均不可控,返回值必不可控,无需做分析 // find target MethodRef SootClass cls = invokeExpr.getMethod().getDeclaringClass();