AddTracer is to inject tracers (monitoring variable value and entering/exiting method) into any Java class file. Tracers can be used to dynamic analysis of software. So, we can use this tool for examining the property of tamper resistant.
AddTracer accepts Java class file as input, and outputs class file which is modified for tracers.
To run the AddTracer, you must put required libraries on same directory of addtracer-X.X.jar. (If you compile from source files, Maven gets depend libraries from Internet and puts them on target directory.)
Also, addtracer-X.X.jar contains Main-Class manifest attribute. Therefore, it also runs as argument of -jar option of java command.
Injects tracer code into class files which specified and/or contained in specified jar and/or zip file. Then, dump class files to destination (default is current directory) which contained tracer code.
usage: java -jar addtracer-X.X.jar [options...] <classes...|jars...>
-O,--disable-arithmetic Do not inject the tracers for arithmetic
instructions
-C,--disable-constant Do not inject tracers for pushing
constants on operand stack
-A,--disable-array-instruction Do not inject tracers for array
instructions
-F,--disable-field-instruction Do not inject tracers for field
instructions
-M,--disable-method Do not inject tracers for start and end
of method
-T,--disable-throw Do not inject tracers for throw
statements
-L,--disable-local-variable Do not inject tracers for local variable
instructions
-d,--dest <DEST> Set destination directory
-f,--format <FORMAT> Select tracer format. Available formats
are: standard, simple and hex. Default is standard
-q,--quiet Quiet mode
-V,--verbose Verbose mode
-h,--help Print this message
-l,--license Print license of AddTracer
-v,--version Print AddTracer version
AddTracer version 2.0
Copyright (C) 2003-2006 by Haruaki TAMADA
Injects tracer code into class files contained in specified jar file. Then, launch the class which injected tracer code and invoke main method.
Specified jar file must have Main-Class attribute in manifest file.
usage: java -jar runner.jar [options...] <jar [args]>
-O,--disable-arithmetic Do not inject the tracers for arithmetic
instructions
-C,--disable-constant Do not inject tracers for pushing
constants on operand stack
-A,--disable-array-instruction Do not inject tracers for array
instructions
-F,--disable-field-instruction Do not inject tracers for field
instructions
-M,--disable-method Do not inject tracers for start and end
of method
-T,--disable-throw Do not inject tracers for throw
statements
-L,--disable-local-variable Do not inject tracers for local variable
instructions
-f,--format <FORMAT> Select tracer format. Available formats
are: standard, simple and hex. Default is standard
-q,--quiet Quiet mode
-V,--verbose Verbose mode
-h,--help Print this message
-l,--license Print license of AddTracer
-v,--version Print AddTracer version
AddTracer version 2.0
Copyright (C) 2003-2006 by Haruaki TAMADA
AddTracer can be used in Apache Ant Task as following.
<taskdef name="addtracer"
classname="jp.naist.se.ant.taskdefs.AddTracerTask"
classpathref="project.class.path"
/>
<mkdir dir="${output.dir}" />
<addtracer destdir="${output.dir}"
basedir="${compiled.dir}">
<include name="**/*.class" />
<exclude name="**/*Test.class" />
</addtracer>
| Attribute | Description | Required |
| baseDir | The directory contained class files. Default is project directory | No. |
| destDir | Destination directory | Yes |
| lastModifiedCheck | Check last modified date. Default is true | No |
AddTracer is supporting to run on DonQuixote. Put addtracer-X.X.jar file into DonQuixote plugins directory, then DonQuixote automatically finds and installs AddTracer.
A processor name of AddTracer in DonQuixote is ``tracer.'' Available property is ``format,'' which value is allowed ``standard,'' ``simple,'' and ``hex.'' Default value is standard. If unknown value is specified, the value is regarded as standard.
$ ls
HelloWorld.class HelloWorld.java addtracer-1.10
$ cat HelloWorld.java
public class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World!");
}
}
$ java HelloWorld
Hello World!
$ java -jar addtracer-1.10/target/addtracer-1.10.jar -d dest HelloWorld.class
$ ls
dest HelloWorld.class HelloWorld.java addtracer-1.10
$ ls dest
HelloWorld.class
$ java -classpath dest HelloWorld
<!-- begin Method HelloWorld#main // line 3 defined in - -->
arg0[0-0] * assignment // line 3
arg0.length 0 assingment // line 3
java.lang.System#out<s> java.io.PrintStream@181afa3 reference // line 3
Hello World!
<!-- end Method HelloWorld#main // - ending at line 4 -->
$ ls
HelloWorld.class HelloWorld.java manifest.mf addtracer-1.10
$ cat HelloWorld.java
public class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World!");
}
}
$ cat manifest.mf
Main-Class: HelloWorld
$ jar cfm hello.jar manifest.mf HelloWorld.class
$ java -jar hello.jar
Hello World!
$ java -jar addtracer-1.10/targets/runner.jar hello.jar
<!-- begin Method HelloWorld#main // line 3 defined in - -->
arg0[0-0] * assignment // line 3
arg0.length 0 assingment // line 3
java.lang.System#out<s> java.io.PrintStream@181afa3 reference // line 3
Hello World!
<!-- end Method HelloWorld#main // - ending at line 4 -->