Evironment: MacOs 10.14
Dependency: WALA https://github.com/wala/WALA
STEP 1: Modify Makefile
- change
INCLUDE
andLDFLAGS
to your own jdk path.
STEP 2: Modify OWLJNIClient.cpp
- modify the class path on line #79 if necessary
STEP 3: Add Printer.java
in root directory to com.ibm.wala.shrikeBT
and rebuild WALA.
Comment: Printer.java does nothing but prints all instructions to stdout, this should be replaced by analyser where the shrikeBT instructions should be passed into.
STEP 4: set environment variables
export WALA_HOME=/Users/jackxia/Project/IBM/WALA
(replace by yours)export DYLD_LIBRARY_PATH=/Library/Java/JavaVirtualMachines/adoptopenjdk-12.jdk/Contents/Home/lib:/Library/Java/JavaVirtualMachines/adoptopenjdk-12.jdk/Contents/Home/lib/server
( replace by yours)
STEP 5: run make all
STEP 6: build WALA integration
- cd OWLJava/OWLLoader
- mvn clean install
STEP 7: run ./OWL ./examples/add.log
You should see a call graph printed out.
- write and append the method configuration (
JNIMethodConfig
) inOWLJNIConfig.hpp / cpp
. - Call the target java method through
jniClient->callMethod