[Soot-list] how to translate a .class to .jimple?
Eric Bodden
eric.bodden at mail.mcgill.ca
Fri Aug 11 20:59:00 EDT 2006
Well, I guess firs you want to load your .class file into Soot. For that, you have to have your Soot classpath right, which you can set with this method:
http://www.sable.mcgill.ca/soot/doc/soot/Scene.html#setSootClassPath(java.lang.String)
Scene.v().setSootClassPath("/my/classfile/directory");
Then you have to load the class with:
http://www.sable.mcgill.ca/soot/doc/soot/Scene.html#loadClassAndSupport(java.lang.String)
SootClass c = Scene.v().loadClassAndSupport("my.fully.qualified.Name");
Then you write your class out to whatever PrintWriter you like:
Printer.v().printTo(c,System.out);
Hope that helps,
Eric
--
Eric Bodden
Sable Research Group, McGill University
Montréal, Québec, Canada
From: Peng Li [mailto:lipeng360 at gmail.com]
Sent: Friday, August 11, 2006 5:42 PM
To: Eric Bodden
Subject: Re: [Soot-list] how to translate a .class to .jimple?
Hi Eric,
Thank you very much for your help. Because I am a beginer and the API is very simple, I can not make it work. would you please to give me a very simple example about how to do this translation(.class -> .jimple)?
Thank you very much for your help and looking forward to hearing from you.
Cheers
Peng
2006/8/11, Eric Bodden <eric.bodden at mail.mcgill.ca>:
Oh, sorry. I think I got your question wrong...
Have a look at:
http://www.sable.mcgill.ca/soot/doc/soot/Printer.html#printTo(soot.SootClass,%20java.io.PrintWriter)
Eric
From: soot-list-bounces at sable.mcgill.ca [mailto:soot-list-bounces at sable.mcgill.ca] On Behalf Of Eric Bodden
Sent: Friday, August 11, 2006 12:01 AM
To: Peng Li
Cc: soot-list at sable.mcgill.ca
Subject: RE: [Soot-list] how to translate a .class to .jimple?
Yes, try:
soot.Main -f J my.class.FileName
By the way: The Soot eclipse plugin should output the command line it uses in the appropriate view in Eclipse, actually.
Eric
From: soot-list-bounces at sable.mcgill.ca [mailto:soot-list-bounces at sable.mcgill.ca] On Behalf Of Peng Li
Sent: Thursday, August 10, 2006 5:30 PM
To: soot-list at sable.mcgill.ca
Subject: [Soot-list] how to translate a .class to .jimple?
HI
I am a beginer of soot, does anyone know how to translater a .class to .jimple using API? I can do it use the eclipse plugin, but I need do this translatrion in my program. Anybody could help me ?
Cheers
Peng
PS
I dont want to use command line method:)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060811/c4510f94/attachment.htm
More information about the Soot-list
mailing list