Translate

Showing posts with label tutorials. Show all posts
Showing posts with label tutorials. Show all posts

Tuesday

Converting Dot files into Control Flow Graphs using GraphViz

Generate Control Flow Graph Using Graphviz

To convert android apk into dot files and do analysis by using soot click here. 

To generate control flow graph using graphviz, you need dot files which is generated from all methods of android apks. you can find them on sootOutput directory, now you need to go to command line and type following commands if you have already set graph viz path. 

To convert into pdf:

> dot Tpdf -o Example.pdf Example.dot

To convert into png:

> dot Tpng -o Example.png Example.dot

Note: if you haven't set path you need to set path (to know how to set path see installation post) or go to bin folder of graph viz installation folder and find dot file from command line and type above commands.

commands:

>dot : executable dot file (also MS word old file format for graph)

> -Tpdf, -Tpng: converting file format

> -o: Optimization

> Example.pdf, .png: Name of Control flow graph you wanna give after conversion.

>Example.dot : Name of dot file you wanna convert


Note: Graphviz not only use dot file format and executable files you can convert various different files into control flow graph. This post is on the context of program analysis of smart phone apps i.e. android apps using Soot as analysis tool.


Thursday

PROGRAM ANALYSIS OF SMART PHONE APPS

PROGRAM ANALYSIS OF SMART PHONE APPS

(A research based on program analysis of smart phone applications)


You can find complete tutorials

BY; CHALISE BIRENDRA
Abstract

Here, I am going to present the static analysis of an android app (Google Chrome) with the help of control flow graphs(CFGs) generated by using java bytecode analysis tool soot. For, control flow graphs, Soot converts the android application into its intermediate format(.jimple) and dot file of all methods which is further converted into control flow graphs through graph generated software i.e. Graphviz, before analyzing statically.

Additionally, the graphical representation of an app is created in the form of control flow graphs which is created for all possible java methods of the android app, and implemented to do static analysis of the app. I also generate and calculate the numbers of all java methods as CFG and classes as intermediate representation i.e.jimple.


Finally, I will introduce a new analysis that integrates and enhances existing Android app static analyses and successfully tests the static analysis of given android app by calculating the time span for extracting the methods from an app, number of all reachable classes and methods for the purpose of the CFG static analysis. 

Introduction
Here I am using Soot[1] to convert Android apk to Intermediate Representation mostly as Jimple (can be use baf, Shimple, Grimph etc) and produce Jimple files of each class that belongs to apk graphical representation of each method as dot file which further will generate Control flow graph for static analysis of android apk based on the process of java bytecode [6] (see in figure 1).







Figure 1: Java Bytecode


Moreover, I am using another technique to get similar results for static analysis with soot as Dalvik bytecode to Jimple. As Jimple is Soot’s main internal representation of code, the Dalvik bytecode can be manipulated with any Jimple based tool, for instance for performing point-to or flow analysis.

 Finally, I am able to convert any .java, .class, .apk and .jar files to its all intermediate representation jimple, baf, simple, grimph etc; Create Control Flow Graph, assemble/dissemble, .dex , .apk or delvik bytecode[1,2] which further helps to perform static analysis of all Java or Android files and apps for various security purpose as well[3].