Sunday, November 28, 2010

How to embed dvm/jvm modules ?

Hi !

Last days, I'm working to the next release by following the roadmap, but I'm currently focused on the watermark module. I've already said that but if you are interesting about this project and if you would like to improve it, please contact me.

This post can help you if you would like to embed the dalvik and java virtual machine modules in your software without androguard. It can be very usefull to do other things like reverse engineering, or to patch class files.

The first step is to get the source code :
pouik@camelot:~/$ hg clone androguard

Now you must create your software directory, and copy all needed files :
pouik@camelot:~/$ mkdir myapp
pouik@camelot:~/myapp$ cp ../androguard/core/ ./
pouik@camelot:~/myapp$ cp ../androguard/core/ ./
pouik@camelot:~/myapp$ cp ../androguard/core/bytecodes/*.py ./

And you can create a file and used the dvm or jvm modules :
#!/usr/bin/env python

import dvm

TEST = "../androguard/examples/dalvik/test/bin/classes.dex"

j = dvm.DalvikVMFormat( open(TEST).read() )
After, you can used the API to do what you would like !

Bye !

No comments:

Post a Comment