chaoticgd / ghidra-emotionengine-reloaded

An extension for Ghidra that adds support for the PlayStation 2.
Apache License 2.0
118 stars 11 forks source link

PCSX2SaveStateImporter: 7-Zip returned unsupported method #40

Closed polybiusproxy closed 9 months ago

polybiusproxy commented 9 months ago

Using the latest version of PCSX2 Nightly (v1.7.5040) and ghidra-emotionengine-reloaded (commit 71e6094)

Unexpected: 7-Zip returned unsupported method
java.io.IOException: Unexpected: 7-Zip returned unsupported method
    at ghidra.file.formats.sevenzip.SevenZipFileSystem$SZExtractCallback.extractOperationResultToException(SevenZipFileSystem.java:529)
    at ghidra.file.formats.sevenzip.SevenZipFileSystem$SZExtractCallback.setOperationResult(SevenZipFileSystem.java:495)
    at net.sf.sevenzipjbinding.impl.InArchiveImpl.nativeExtract(Native Method)
    at net.sf.sevenzipjbinding.impl.InArchiveImpl.extract(InArchiveImpl.java:113)
    at ghidra.file.formats.sevenzip.SevenZipFileSystem.getByteProvider(SevenZipFileSystem.java:343)
    at ghidra.formats.gfilesystem.GFileSystem.getInputStreamHelper(GFileSystem.java:201)
    at ghidra.formats.gfilesystem.GFileSystem.getInputStream(GFileSystem.java:145)
    at PCSX2SaveStateImporter.getBuffer(PCSX2SaveStateImporter.java:52)
    at PCSX2SaveStateImporter.loadMainMemory(PCSX2SaveStateImporter.java:59)
    at PCSX2SaveStateImporter.run(PCSX2SaveStateImporter.java:36)
    at ghidra.app.script.GhidraScript.executeNormal(GhidraScript.java:399)
    at ghidra.app.script.GhidraScript.doExecute(GhidraScript.java:254)
    at ghidra.app.script.GhidraScript.execute(GhidraScript.java:232)
    at ghidra.app.plugin.core.script.RunScriptTask.run(RunScriptTask.java:47)
    at ghidra.util.task.Task.monitoredRun(Task.java:134)
    at ghidra.util.task.TaskRunner.lambda$startTaskThread$0(TaskRunner.java:106)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

---------------------------------------------------
Build Date: 2023-Aug-29 1442 EDT
Ghidra Version: 10.3.3
Java Home: C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot
JVM Version: Eclipse Adoptium 17.0.6
OS: Windows 11 10.0 amd64
Workstation: WIN32
polybiusproxy commented 9 months ago

Save state attached here: pr2_state.zip

chaoticgd commented 9 months ago

This is a fairly common issue. Modern versions of PCSX2 store save states using zstd compression, which lots of zip implementations don't support. To fix it you have to add SavestateZstdCompression=disabled to the EmuCore section of your PCSX2_vm.ini.

I'll add a note to the readme.

chaoticgd commented 9 months ago

Okay, note added. I assume this solves your issue?

polybiusproxy commented 9 months ago

Yes. 🙂