jsadebugd.exe无法附加但VisualVM工作正常

时间:2012-08-21 16:07:53

标签: java debugging reverse-engineering remote-debugging jvm-hotspot

我正在尝试将调试器附加到第三方程序以进行一些逆向工程。这个程序正在保存not normal zip files的zip文件,它可以打开它们,但是当我尝试使用像7zip或CSharpZipLib这样的软件时,我会收到错误。我想附加一个调试器,看看程序是如何解压缩的。每个zip文件中的“畸形”也不一样。有些解压缩没有修改,有些有像我链接的问题中的格式错误的标题,有些看起来很好,但CSharpZipLib无法解压缩(但是解压缩内置的窗口工作正常)。

我知道在解压缩时使用ProcessExplorer调用java中的内容我可以看到很多来自exe的rt.jar调用,同时它正在向temp文件夹写出解压缩版本(我需要自己动手,因为我需要解压缩105,987个zip文件,这需要花费不合理的时间通过程序的UI完成,并从临时文件夹中获取解压缩的文件。)

this SO question我发现如何在没有使用JVM启动的调试器参数的情况下调试程序。我下载VisualVM,我可以附加和分析程序,但我找不到任何方法从VisualVM内部获取函数调用跟踪。

我也尝试了jsadebugd解决方案,但是当我尝试启动程序时出现以下错误。

C:\>"c:\Program Files\Java\jdk1.6.0_34\bin\jsadebugd.exe" 8824
Attaching to process ID 8824 and starting RMI services, please wait...
Error attaching to process or starting server: sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: ReadVirtual failed!
        at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess0(Native Method)
        at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readBytesFromProcess(WindbgDebuggerLocal.java:485)
        at sun.jvm.hotspot.debugger.DebuggerBase.readBytes(DebuggerBase.java:219)
        at sun.jvm.hotspot.debugger.DebuggerBase.readCInteger(DebuggerBase.java:375)
        at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
        at sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.readAddress(WindbgDebuggerLocal.java:316)
        at sun.jvm.hotspot.debugger.windbg.WindbgAddress.getAddressAt(WindbgAddress.java:72)
        at sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:126)
        at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:85)
        at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:388)
        at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:315)
        at sun.jvm.hotspot.HotSpotAgent.startServer(HotSpotAgent.java:221)
        at sun.jvm.hotspot.DebugServer.run(DebugServer.java:107)
        at sun.jvm.hotspot.DebugServer.main(DebugServer.java:46)
        at sun.jvm.hotspot.jdi.SADebugServer.main(SADebugServer.java:63)

我确实在路径C:\Program Files\Debugging Tools for Windows (x64)下安装了“Windows调试工具”。我的windbg.exe位于C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x86下方。多个副本可能是我的问题,如果是,我该如何解决?

我需要做些什么才能看到这个exe正在做什么,所以我可以模仿它的zip解压缩程序?

0 个答案:

没有答案