arguslab / Argus-SAF

Argus static analysis framework
Apache License 2.0
183 stars 49 forks source link

The meaning of the edges in iddgraph #51

Open sjl872964789 opened 6 years ago

sjl872964789 commented 6 years ago

Hi, first of all, thank you for providing this great framework. I read you paper that published on CCS and the tutorial you have gave,I'm very interested in the iddresult that you have mentioned, so I tried it out with the example in Argus-SAF-playground. The following is part of my results:

<edge id="CallMainActivityenvMainL1109p0-MainActivityenvMainL1108" source="CallMainActivityenvMainL1109p0" target="MainActivityenvMainL1108"/>

could you please tell me the meaning of the the edge in its result And how do I find the corresponding location in the.Jawa file ,At first I thought this meant calling the contents of # L1109p0 in the class MainActivity ,but after searching the file named MainActivity.Jawa , I found that there was no content with the beginning of #L1,I would be grateful if you could give me any help. By the way,here is my code, in case I wrote wrong anywhere.

val apk_name = "app-fdroid-debug.apk";
val apk_path = "F:\\AmAndroid_test\\apk_path\\" + apk_name
val out_path = "F:\\AmAndroid_test\\out_path\\"
val fileUri = FileUtil.toUri(apk_path)
val outputUri = FileUtil.toUri(out_path)
val reporter = new DefaultReporter
val yard = new ApkYard(reporter)
val layout = DecompileLayout(outputUri)
val strategy = DecompileStrategy(layout)
val settings = DecompilerSettings(debugMode = false,forceDelete = false, strategy, reporter)
val apk = yard.loadApk(fileUri, settings, collectInfo = true, resolveCallBack = true)
val component = apk.model.getComponents.head
    apk.model.getEnvMap.get(component) match {
        val ep = apk.getMethod(esig).get
        val initialfacts = AndroidReachingFactsAnalysisConfig.getInitialFactsForMainEnvironment(ep)
        val icfg = new InterProceduralControlFlowGraph[ICFGNode]
        val ptaresult = new PTAResult
        val sp = new AndroidSummaryProvider(apk)
        val analysis = new AndroidReachingFactsAnalysis(apk, icfg, ptaresult, new AndroidModelCallHandler, sp.getSummaryManager, new ClassLoadManager,AndroidReachingFactsAnalysisConfig.resolve_static_init,timeout = None)
        val idfg = analysis.build(ep, initialfacts, new Context(apk.nameUri))
        val iddResult = InterProceduralDataDependenceAnalysis(apk, idfg)
        val ssm = new DataLeakageAndroidSourceAndSinkManager(AndroidGlobalConfig.settings.sas_file)
        print(iddResult.getIddg.toGraphML(new PrintWriter(new File("F:\\AmAndroid_test\\out_path\\" + apk_name + "\\"+componentname+"\\iddresult.graphml"))))
    case None =>
        yard.reporter.error("TaintAnalysis", "Component " + component + " did not have environment! Some package or name mismatch maybe in the Manifest file.")

Best Regards