Coder Social home page Coder Social logo

class-file-extractor's Introduction

Class File Extractor

Extract loaded classes from a running JVM application

Download

Usage

java -jar extractor.jar <pid> <output.jar> [prefix]
  • <pid> - process ID of the target JVM.
  • <output.jar> - output file name (where to store the extracted class files).
  • [prefix] - optional class name prefix (e.g. to extract classes only in a selected package).

class-file-extractor's People

Contributors

apangin avatar tenghuanhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

class-file-extractor's Issues

Invalid Agent jar path on linux

On linux when trying to load the agent we get the following exception:
Exception in thread "main" com.sun.tools.attach.AgentLoadException: Agent JAR not found or no Agent-Class attribute at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:163) at com.extractor.ClassFileExtractor.main(ClassFileExtractor.java:74)

The reason for that is that the jar path is invalid.
The substring call on line 62 get rids 6 characters. This causes the first "/" to not be included in the full path of the agent jar.
We need only get rid of "file:" substring in linux.
Changing this line to following:
String jar = url.substring(5);
solves the issue for me.

Thanks!

P.S. I am using jdk18 if it matters

Exception in thread "main"

Hi! I'm getting this error:

└┌(Downloads)┌¨˙java -jar extractor.jar 36920 test.jar
Exception in thread "main" com.sun.tools.attach.AgentLoadException: 100
	at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:112)
	at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:123)
	at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:151)
	at ClassFileExtractor.main(Unknown Source)

The process im trying to extract is Minecraft. Have you any ideas why isn't it working ?
Thanks!

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/attach/VirtualMachine

$ /jdk1.8.0_151/bin/java -jar extractor.jar 45 mainloader.jar *
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/attach/VirtualMachine
at ClassFileExtractor.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.