[Soot-list] Using Dava as a library

Дмитрий Михайлов dmitry239mikhaylov at gmail.com
Wed Sep 7 09:12:25 EDT 2011


Hello.

I'm experiencing troubles trying to use Dava as a library to decompile
particular method bodies. It works actually, but the output differs from the
one I get when using Dava as a console tool. For example, the "for" loops
are presented as "while" loops where console decompiling collapses them to
"for" normally. Here is the code:

for (SootMethod method : sootClass.getMethods()) {
    if (method.isConcrete()) {
        GrimpBody intermediateBody =
Grimp.v().newBody(method.retrieveActiveBody(), "gb");
        method.setActiveBody(intermediateBody);
        System.out.println(intermediateBody.toString());

        DavaBody body = Dava.v().newBody(intermediateBody);
        method.setActiveBody(body);

        Chain units = body.getUnits();
        DavaUnitPrinter printer = new DavaUnitPrinter(body);
        ((ASTNode) units.getFirst()).toString(printer);
        System.out.print(printer.toString());
    }
}

I suppose that I'm using Dava in a wrong way. I'll be glad to get any advice
of using it properly. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110907/b2d1b5e2/attachment.html 


More information about the Soot-list mailing list