Created
November 28, 2018 23:55
-
-
Save ExcaliburZero/edf859bfce82622007e02ad8d591dbf9 to your computer and use it in GitHub Desktop.
Printing out the methods in a class using Soot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import soot.Scene | |
import scala.collection.JavaConverters._ | |
object SootPrintMethods { | |
def main(args: Array[String]): Unit = { | |
Scene.v().loadClassAndSupport("java.lang.Object") | |
val a = Scene.v().getSootClass("java.lang.Object") | |
Scene.v().loadNecessaryClasses() | |
a.getMethods.asScala.foreach(m => { | |
try { | |
println(m.retrieveActiveBody()) | |
} catch { | |
case _: java.lang.RuntimeException => | |
println(m.getSignature) | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment