roysmeding / ghidra-os9

Ghidra extension for dealing with Microware OS-9 for 68k (AKA 'OSK'; used by the Philips CD-i) files and code.
10 stars 4 forks source link

Failed to load an OS-9 module in ghidra 10.1.5 #3

Open Stovent opened 2 years ago

Stovent commented 2 years ago

I've built the extension using gradle so ghidra 10.1.5 accepts to install it, but when loading a module in a project, it fails with the following error:

The "void" data type is not allowed in a composite data type.
java.lang.IllegalArgumentException: The "void" data type is not allowed in a composite data type.
    at ghidra.program.model.data.CompositeDataTypeImpl.validateDataType(CompositeDataTypeImpl.java:182)
    at ghidra.program.model.data.StructureDataType.doAdd(StructureDataType.java:572)
    at ghidra.program.model.data.StructureDataType.add(StructureDataType.java:547)
    at os9.OS9Header.toDataType(OS9Header.java:377)
    at os9.OS9Builder.loadModuleArea(OS9Builder.java:130)
    at os9.OS9Builder.load(OS9Builder.java:92)
    at os9.OS9Loader.load(OS9Loader.java:156)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:347)
    at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:83)
    at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:113)
    at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:404)
    at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:350)
    at ghidra.util.task.TaskBuilder$TaskBuilderTask.run(TaskBuilder.java:306)
    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: 2022-Jul-26 1543 EDT
Ghidra Version: 10.1.5
Java Home: C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot
JVM Version: Eclipse Adoptium 17.0.3
OS: Windows 10 10.0 amd64
Workstation: LAPTOP-STOVENT

I don't know if the sources are compatible with ghidra 10.1.5, maybe it can explain it.

Stovent commented 2 years ago

I've tried using the prebuilt version from the Releases inside ghidra 9.1.1 but it fails with the following error:

Import - Uncaught Exception: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
    at generic.continues.ContinuesFactory.create(ContinuesFactory.java:61)
    at ghidra.app.util.bin.format.macho.MachHeader.createMachHeader(MachHeader.java:73)
    at ghidra.app.util.bin.format.macho.MachHeader.createMachHeader(MachHeader.java:61)
    at ghidra.app.util.opinion.MachoPrelinkUtils.parsePrelinkXml(MachoPrelinkUtils.java:56)
    at ghidra.file.formats.ios.prelink.PrelinkFileSystem.isValid(PrelinkFileSystem.java:79)
    at ghidra.formats.gfilesystem.factory.GFileSystemBaseFactory.probe(GFileSystemBaseFactory.java:66)
    at ghidra.formats.gfilesystem.factory.FileSystemFactoryMgr.test(FileSystemFactoryMgr.java:233)
    at ghidra.formats.gfilesystem.FileSystemService.isFileFilesystemContainer(FileSystemService.java:553)
    at ghidra.plugin.importer.ImporterUtilities.showImportDialog(ImporterUtilities.java:172)
    at ghidra.plugin.importer.ImporterUtilities.lambda$showImportDialog$0(ImporterUtilities.java:138)
    at ghidra.util.task.TaskLauncher$2.run(TaskLauncher.java:119)
    at ghidra.util.task.Task.monitoredRun(Task.java:126)
    at ghidra.util.task.TaskRunner.lambda$startTaskThread$1(TaskRunner.java:94)
    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)
Caused by: java.lang.ExceptionInInitializerError
    at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:166)
    at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
    at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
    at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
    at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
    at generic.continues.ContinuesFactory.create(ContinuesFactory.java:45)
    ... 15 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @245a2e25
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
    at net.sf.cglib.core.ReflectUtils$2.run(ReflectUtils.java:56)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at net.sf.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:46)
    ... 24 more

---------------------------------------------------
Build Date: 2019-Dec-18 1306 EST
Ghidra Version: 9.1.1
Java Home: C:\Program Files\Eclipse Adoptium\jdk-17.0.3.7-hotspot
JVM Version: Eclipse Adoptium 17.0.3
OS: Windows 10 10.0 amd64
egueli commented 1 year ago

The same error The "void" data type is not allowed in a composite data type. happens to me with Ghidra 10.1.