简体   繁体   English

Soot Java字节码框架:如何将单个类文件编译为Jimple / Shimple

[英]Soot Java bytecode framework: How to compile a single class file to Jimple/Shimple

I'm trying to figure out how to use Soot in an existing project (a metacircular interpreter). 我想弄清楚如何在现有项目中使用Soot(一个metacircular解释器)。 Specifically, I want to use Soot to convert java bytecode into a convenient 3-address code (either Jimple or Shimple) that I can interpret. 具体来说,我想使用Soot将java字节码转换为一个方便的3地址代码(Jimple或Shimple),我可以解释。 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 (ie 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. 我花了好几个小时来讨论javadoc / papers / presentation,但是大部分内容似乎都专注于使用命令行工具或eclipse插件。 Could anyone give me some pointers as to where to start? 谁能给我一些关于从哪里开始的指示?

This is probably easiest answered on the Soot mailing list. 这在Soot邮件列表上可能是最容易回答的。

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. Soot设置为从文件系统加载.class文件,但指示它从ByteArrayInputStream加载东西也不难。 I guess that should help you in your case. 我想这应该可以帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM