[Soot-list] how to process single class file to a jimple file
Steven Arzt
Steven.Arzt at cased.de
Tue Mar 11 06:08:34 EDT 2014
If I understand it correctly, Jason is trying to convert a class file into a Jimple file on the command-line. On the other hand, there is a Java file on the command line. I'm now a bit confused as to whether the source is a class file or a Java source file.
@Jason: You might find this web page helpful: http://www.sable.mcgill.ca/soot/tutorial/usage/
Best regards,
Steven
-----Ursprüngliche Nachricht-----
Von: soot-list-bounces at sable.mcgill.ca [mailto:soot-list-bounces at sable.mcgill.ca] Im Auftrag von Marc-André Laverdière
Gesendet: Montag, 10. März 2014 17:51
An: soot-list at sable.mcgill.ca
Betreff: Re: [Soot-list] how to process single class file to a jimple file
Hello Jason,
I would ask you two things. 1) It seems you are using 2.5.0. Please use a nightly build instead - or learn to build from the 'dev' branch on github.
2) I would appreciate a very simple summary of what the problem is.
People get 'scrolling blindness' when given chunks of code.
Marc-André Laverdière-Papineau
Doctorant - PhD Candidate
On 03/10/2014 12:29 PM, 毅力公司 wrote:
> Dear all,
> I am just beginning to learn to use the Soot.
> I am in trouble with how to process the single class file to a jimple
> file by command-line and in eclipse. Do someone can give me a help?
> screenshot are attached below~
> the command-line:
> jasonxie at jasonxie-HP-ENVY-15-Notebook-PC:~/Downloads/SootTest/SootTest
> /test$
> ls
> InvokeStaticInstrumenter.class MainDriver.class MyCounter.class
> soot-2.5.0.jar TestInvoke.class
> jasonxie at jasonxie-HP-ENVY-15-Notebook-PC:~/Downloads/SootTest/SootTest
> /test$ java -jar soot-2.5.0.jar -cp .:"%JAVA_HOME%"\jre\lib\rt.jar
> TestInvoke.java Soot started on Tue Mar 11 00:10:27 HKT 2014 Exception
> in thread "main" java.lang.RuntimeException: couldn't find
> class: TestInvoke.java (is your soot-class-path set properly?) at
> soot.SootResolver.bringToHierarchy(SootResolver.java:205)
> at soot.SootResolver.bringToSignatures(SootResolver.java:239)
> at soot.SootResolver.processResolveWorklist(SootResolver.java:154)
> at soot.SootResolver.resolveClass(SootResolver.java:124)
> at soot.Scene.loadClass(Scene.java:448)
> at soot.Scene.loadClassAndSupport(Scene.java:433)
> at soot.Scene.loadNecessaryClass(Scene.java:1053)
> at soot.Scene.loadNecessaryClasses(Scene.java:1067)
> at soot.Main.run(Main.java:167)
> at soot.Main.main(Main.java:141)
>
> how to transfer the TestInvoke.class to a jimple file?
> or In eclipse:
> I got a TestInvoke.class in the "sootOutput"filefolder , it was show
> like this:
> But when transferred it a jimple file by right-click to create a
> jimple file for TestInvoke.class It was different with the the
> original TestInvoke.class file:
> class TestInvoke extends java.lang.Object {
> private static int calls;
>
> static void <clinit>()
> {
> <TestInvoke: int calls> = 0;
> return;
> }
>
> void <init>()
> {
> TestInvoke r0;
>
> r0 := @this: TestInvoke;
> specialinvoke r0.<java.lang.Object: void <init>()>();
> return;
> }
>
> public static void main(java.lang.String[])
> {
> java.lang.String[] r0;
> int i0, $i1;
> java.io.PrintStream $r1;
> java.lang.StringBuilder $r2, $r3, $r4;
> java.lang.String $r5;
>
> r0 := @parameter0: java.lang.String[];
> i0 = 0;
> goto label1;
>
> label0:
> staticinvoke <TestInvoke: void foo()>();
> i0 = i0 + 1;
>
> label1:
> if i0 < 10 goto label0;
>
> $r1 = <java.lang.System: java.io.PrintStream out>;
> $r2 = new java.lang.StringBuilder;
> specialinvoke $r2.<java.lang.StringBuilder: void
> <init>(java.lang.String)>("I made ");
> $i1 = <TestInvoke: int calls>;
> $r3 = virtualinvoke $r2.<java.lang.StringBuilder:
> java.lang.StringBuilder append(int)>($i1);
> $r4 = virtualinvoke $r3.<java.lang.StringBuilder:
> java.lang.StringBuilder append(java.lang.String)>(" static calls");
> $r5 = virtualinvoke $r4.<java.lang.StringBuilder:
> java.lang.String toString()>();
> virtualinvoke $r1.<java.io.PrintStream: void
> println(java.lang.String)>($r5);
> return;
> }
>
> private static void foo()
> {
> int $i0, $i1;
>
> $i0 = <TestInvoke: int calls>;
> $i1 = $i0 + 1;
> <TestInvoke: int calls> = $i1;
> staticinvoke <TestInvoke: void bar()>();
> return;
> }
>
> private static void bar()
> {
> int $i0, $i1;
>
> $i0 = <TestInvoke: int calls>;
> $i1 = $i0 + 1;
> <TestInvoke: int calls> = $i1;
> return;
> }
> }
> Looking forward your help.
> Thanks a lot.
> Jason
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
_______________________________________________
Soot-list mailing list
Soot-list at sable.mcgill.ca
http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
More information about the Soot-list
mailing list