3

I'm trying to figure out how to use Soot in an existing project (a metacircular interpreter). Specifically, I want to use Soot to convert java bytecode into a convenient 3-address code (either Jimple or Shimple) that I can interpret. I may want to do more things later, but for now I just want the conversion.

What's the best way to perform this translation? Soot seems like a ginormous project which as tons of functionality, but I really only need a single method

compileClass: Byte[] -> ShimpleClass

Preferably as pure as possible (i.e. no setup/teardown required, everything packaged within that method). I've spent hours going over the javadoc/papers/presentations, but most of them seem focused on usage as a command line tool or an eclipse plugin. Could anyone give me some pointers as to where to start?

Li Haoyi
  • 15,330
  • 17
  • 80
  • 137
  • This was asked four and a half years ago. You wouldn't happen to remember where you found the answer to this question? – User1291 Nov 23 '17 at 09:20

1 Answers1

0

This is probably easiest answered on the Soot mailing list.

Soot is set up to load .class files from the file system but it should not be that hard to instruct it to load something from a ByteArrayInputStream as well. I guess that should help you in your case.

Eric
  • 1,343
  • 1
  • 11
  • 19