如何将java exe提取到jar

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/316701/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 13:05:15  来源:igfitidea点击:

How can I extract java exe to jar

java

提问by Tim Matthews

I have an exe that I know was written in java. I understand that java programs can be made into an exe and there are tools to convert jar files to exe but is it possible to convert back? AFAIK jar files can be run on any platform that can run java and I would like to use a windows compiled java program on mac without using any extra virtualisation (wine,vmware)

我有一个 exe,我知道它是用 java 编写的。我知道java程序可以变成exe,并且有将jar文件转换为exe的工具,但是可以转换回来吗?AFAIK jar 文件可以在任何可以运行 java 的平台上运行,我想在 mac 上使用 Windows 编译的 java 程序而不使用任何额外的虚拟化(wine,vmware)

采纳答案by VonC

It depends how the exe has been built:

这取决于 exe 的构建方式:

  • If it has simply wrapped, with a tool like JSmooth(as suggested by this thread), the same tool can extract the jar
  • If it it has been compiled, with for instance gcj (as illustrated by this question),... I am not sure.
  • If it has been compiled by a static compiler (or AOT - Ahead-Of-Time-), I believe it is not possible to extract the orignial jars.
  • 如果它只是简单地包装,使用JSmooth 之类的工具(如该线程所建议的),则相同的工具可以提取 jar
  • 如果它已经编译,例如 gcj (如本问题所示),...我不确定。
  • 如果它是由静态编译器(或AOT - Ahead-Of-Time-)编译的,我相信不可能提取原始 jars。

回答by James Van Huis

If your application was wrapped using JSmooth, you can look in your default temp directory (C:\Documents and Settings\Username\Local Settings\Temp) while the application is running.

如果您的应用程序是使用 JSmooth 包装的,您可以在应用程序运行时查看您的默认临时目录 (C:\Documents and Settings\Username\Local Settings\Temp)。

Open a windows explorer window to the temp dir, then start up your application. You should see a jar file show up (Temp#.jar). Just make a copy of this and you should be on your way.

打开一个 windows 资源管理器窗口到临时目录,然后启动您的应用程序。您应该会看到一个 jar 文件 (Temp#.jar)。只需复制一份,你就可以上路了。

回答by Kabera Mugwaneza Alexis

It is possible to convert file.exe back to file.jar , To go with this reversing process to will require you to know how the file was beeen encrypted ,for example if is the first level encryption class name and files are not hidden , for the second level file classes are hidden , for the 3rd level file and classes are hidden . to get this well download jar to exe software and try how they convert jar to exe then you will be able to know the reverse. to know how you proceed with reversing the process there is a single blog which helped me and all tools you may use are listed there like : Resource Hacker Winhex Ollydbg 1.10+ MemoryDump 0.9 and Olly Advanced or StrongOD Plugin(for advanced ctrl+g). DJ Java Decompiler 7-Zip or Winrar The link: https://reverseengineeringtips.blogspot.com/2014/12/unpacking-jar2exe-21-extracting-jar.html?showComment=1480364662658#c447064983483780468

可以将 file.exe 转换回 file.jar ,要进行此逆向过程,您将需要知道文件是如何加密的,例如是否为一级加密类名称且文件未隐藏,例如隐藏二级文件类,隐藏三级文件和类。为了得到这个很好的下载 jar 到 exe 软件并尝试他们如何将 jar 转换为 exe 然后你将能够知道相反的情况。要了解您如何进行逆转过程,有一个博客对我有帮助,您可能使用的所有工具都列在那里,例如:Resource Hacker Winhex Ollydbg 1.10+ MemoryDump 0.9 和 Olly Advanced 或 StrongOD Plugin(用于高级 ctrl+g)。DJ Java Decompiler 7-Zip 或 Winrar 链接: https://reverseengineeringtips.blogspot.com/2014/12/unpacking-jar2exe-21-extracting-jar.html?showComment=1480364662658#c447064983483780468

thanks

谢谢