[Soot-list] Using Soot with Java Agent

Arzt, Steven steven.arzt at sit.fraunhofer.de
Sun Mar 26 07:12:21 EDT 2017


Hi Han,

You can give Soot a single class to process: https://github.com/Sable/soot/wiki/Introduction:-Soot-as-a-command-line-tool. If you want to explicitly not load anything else, make sure to have an empty Soot classpath and use the –allow-phantom-refs option. Note that everything that would need whole program information (such as a callgraph) is likely to be unusable with such an approach, though, because you are not loading any required referenced classes.

An alternative approach would be to do a full instrumentation that can be controlled externally via flags that you can then set from the agent. This would limit your instrumentation to a pre-processing, without having to instrument classes on the fly.

Best regards,
  Steven

From: Soot-list [mailto:soot-list-bounces at cs.mcgill.ca] On Behalf Of han liu
Sent: Wednesday, March 22, 2017 4:23 PM
To: soot-list <soot-list at cs.mcgill.ca>
Subject: [Soot-list] Using Soot with Java Agent

I am new to Soot and considering using Soot to instrument bytecode in a java agent.
But I am not sure whether this could work because Soot seems to process the
classes once while the JVM will load the classes one by one.

Could I just simply let Soot work in non-application mode so that a class loaded by java agent
will be instrumented by Soot without processing the referenced classes?

Besides, could Soot be configured to emit a byte[] representation of a class instead of dumping
to a file?

Thanks!


Han Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20170326/ebc1937b/attachment.html>


More information about the Soot-list mailing list