Skip to content

Commit 62ac664

Browse files
committed
initial
1 parent fe12b30 commit 62ac664

File tree

2,124 files changed

+177688
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,124 files changed

+177688
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
# c-java-native-interface-agent-stack-trace-heap-capture
2+
23
The beginning of a C JNI Agent which can capture recursively the values of objects inside the methods on a stack-trace
4+
5+
To build the C part you need to install the libxml2 library and Jansson and crypto and openssl.
6+
7+
The resulting library files can be attached using the -agentpath in the java command.
8+
9+
Communicates with an elementary Scala Spray server recording values in MongoDB (configure src/main/resources/application.conf from sample, build and run with sbt run)
10+
11+
Uses a FuelPHP dashboard which communicated with the Scala Spray Server to show results of analysis (do a composer install)
12+
13+
No stable, not secure or optimised.
14+
15+
This is an MVP from which you could use code-bits for now, especially on how to communicate with the JNE.
16+
17+
This was an university experimental project.

c-jvm-agent-lib/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Project Agent
2+
3+
## Run release
4+
java -jar app.jar
5+
6+
java -agentpath:CodEvoAgent -jar app.jar
7+
8+
java -agentpath:CodEvoAgent -DcodevoSources=../java/java_test/ -DcodevoVerbose=3 -jar app.jar
9+
10+
## Building setup
11+
12+
Useful setup commands to be able to build
13+
14+
curl
15+
brew link curl --force
16+
17+
18+
sudo apt-get install libcrypto++-dev libcrypto++-doc libcrypto++-utils
19+
20+
21+
http://mac-dev-env.patrickbougie.com/openssl/ -lssl
22+
23+
https://wiki.openssl.org/index.php/EVP_Symmetric_Encryption_and_Decryption
24+
25+
http://www.xmlsoft.org/downloads.html xml2-config --libs
26+
27+
brew install libxml2
28+
brew install gpg

c-jvm-agent-lib/build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
echo "Go compile [C] ..."
2+
3+
rm hs_err_*.log || true
4+
5+
cd ./c/agent/
6+
sh build.sh
7+
cd ../../
8+
9+
sleep 1
10+
11+
echo "Go compile [JAVA] ..."
12+
13+
cd ./java/
14+
sh build.sh
15+
16+
cd ../
17+
18+
echo "Compiled successful ..."
19+
sleep 2
20+
21+
echo "Releasing.."
22+
rm ./release/*.jar
23+
rm ./release/*.dll
24+
rm ./release/*.log
25+
rm ./release/*.dylib
26+
cp ./java/output/app.jar ./release/app.jar
27+
cp ./c/agent/output/agent.dll ./release/CodEvoAgent.dll
28+
cp ./c/agent/output/agent.dylib ./release/libCodEvoAgent.dylib
29+
30+
echo "Released!"
31+
sleep 2

c-jvm-agent-lib/c/agent/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cd ./output/
2+
3+
#win32 vs darwin
4+
g++ -c -I "/usr/local/opt/libxml2/include/libxml2/" -I "/usr/local/opt/openssl/include" -I "." -I "../jdk1.8.0_91.jdk/Contents/Home/include" -I "../jdk1.8.0_91.jdk/Contents/Home/include/darwin" ../code/*.cpp
5+
6+
g++ -lssl -lxml2 -lcrypto -lcurl -ljansson -o agent.dll *.o
7+
g++ -lssl -lxml2 -lcrypto -dynamiclib -ljansson -lcurl -o agent.dylib *.o
8+
9+
rm *.o

0 commit comments

Comments
 (0)