Agoat, a tool of Arbitrary-Granurality On And-or Tree
- Open JDK. Oracle JDK perhaps works (not tested)
- Soot: a Java Optimization Framework, enclosed
- Python
- colorama
python ags.py -h
for help message.
Agoat's (Sub-)commands are disasm
, index
, list
, query
.
python ags.py COMMAND -h
for help message of a command.
Performs dis-assemble of .class
or .jar
.
This step is required because the Agoat analyzer inputs assembly code, not binary.
Generates index data for searching. It may take large amount of memory/time for a large input.
Prints a list of methods or entry points.
Performs a keyword searching with the index data.
Here, a target binary is MonthlyCalendar.class
.
~$ cd sample
~/sample$ ls
MonthlyCalendar.java
~/sample$ javac MonthlyCalendar.java
~/sample$ java MonthlyCalendar 2014 7
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
~/sample$ ls
MonthlyCalendar.class MonthlyCalendar.java
Disassemble the binary file (with disasm
command)
and generate an index data from it (with index
command).
~/sample$ python ags.py disasm .
~/sample$ python ags.py index all
~/sample$ ls
MonthlyCalendar.class agoat.linenumbertable.gz javapOutput
MonthlyCalendar.java agoat.soot_log sootOutput
agoat.classtable.gz agoat.summarytable.gz
Specify keywords as parameters query
command.
Here, keywords are: set
and println
.
~/sample$ python ags.py query set println
---
MonthlyCalendar void printCalendarMonthYear(int,int) {
java.util.GregorianCalendar void set(int,int,int) (line: 19)
MonthlyCalendar void printFields(String[]) { (line: 25)
java.io.PrintStream void println(String) (line: 13)
}
MonthlyCalendar void printFields(String[]) { (line: 33)
java.io.PrintStream void println(String) (line: 13)
}
MonthlyCalendar void printFields(String[]) { (line: 38)
java.io.PrintStream void println(String) (line: 13)
}
}
- Documents!
- Scalability issues
Agoat is distributed under MIT License.
An enclosed library, Soot, is distributed under GNU LGPL.
- Toshihiro Kamiya, "An Algorithm for Keyword Search on an Execution Path", In Proc. CSMR-WCRE 2014, pp. 328-332, 2014-02-06.