Created
July 25, 2013 20:19
-
-
Save tksk/6083356 to your computer and use it in GitHub Desktop.
jinsei
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 AssemblyKeys._ | |
assemblySettings | |
name := "jinsei" | |
version := "0.0.1" | |
scalaVersion := "2.10.2" | |
libraryDependencies ++= Seq( | |
"org.slf4j" % "slf4j-api" % "1.7.5" | |
, "ch.qos.logback" % "logback-classic" % "1.0.13" % "runtime" | |
, "org.ow2.asm" % "asm-all" % "4.1" | |
) |
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 org.objectweb.asm._ | |
import org.objectweb.asm.tree._ | |
import java.io._ | |
import java.lang.{Iterable => JIterable} | |
import java.util.jar._ | |
import collection.JavaConverters._ | |
/** Jinsei INSpects jar Entries' Inside | |
*/ | |
object Jinsei extends App { | |
val jar= new JarFile(new File("csvjdbc.jar")) | |
for { ze <- jar.entries.asScala | |
if ze.getName.endsWith(".class") | |
if ze.getName.contains("DbfReader") | |
in = jar.getInputStream(ze) | |
} { | |
val cr = new ClassReader(in) | |
val classNode = new ClassNode | |
cr.accept(classNode, 0) | |
for(methodNode <- classNode.methods | |
.asInstanceOf[JIterable[MethodNode]].asScala){ | |
println(methodNode.name+" "+methodNode.desc) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment