QtRE icon indicating copy to clipboard operation
QtRE copied to clipboard

NullPointerException: langDescription() is null

Open SomeOtherDev opened this issue 1 year ago • 3 comments

Hi,

I could be running this incorrectly but I'm really not sure at this point given the error below:

anon@anon:~/QtRE$ ./run.sh -p QtRE-1.0.0.jar -c test.json --analyze-connect --analyze-meta
Initializing SSL Context
Initializing Random Number Generator...
Random Number Generator initialization complete: NativePRNGNonBlocking
Loading user preferences: /home/anon/.ghidra/.ghidra_9.2.2_PUBLIC/preferences
Loading previous preferences: /home/anon/.ghidra/.ghidra_9.2_PUBLIC/preferences
Trust manager disabled, cacerts have not been set
Opening project: /home/anon/test/QtRE
Output directory at: /home/anon/QtRE/current_output
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "ghidra.program.model.lang.SleighLanguageDescription.getCompilerSpecDescriptions()" because "langDescription" is null
    at ghidra.app.plugin.processors.sleigh.SleighLanguage.initialize(SleighLanguage.java:115)
    at ghidra.app.plugin.processors.sleigh.SleighLanguage.<init>(SleighLanguage.java:101)
    at ghidra.app.plugin.processors.sleigh.SleighLanguageProvider.getNewSleigh(SleighLanguageProvider.java:112)
    at ghidra.app.plugin.processors.sleigh.SleighLanguageProvider.getLanguage(SleighLanguageProvider.java:99)
    at Main.Analyzer.<init>(Analyzer.java:59)
    at Main.Main.main(Main.java:115)
anon@anon:~/QtRE$

JSON File contents:

{
  "DIRECTORY_NAME": "/home/anon/test",
  "OUTPUT_DIR": "/home/anon/QtRE/current_output",
  "PROJECT_NAME": "QtRE",
  "BINARY_FILE_LIST": "/home/anon/QtRE/input_bins",
  "LANGUAGE_NAME": "x86:LE:64",
  "DISASSEMBLE_TIMEOUT": 1000,
  "EMULATION_TIMEOUT": 30,
  "DECOMPILE_TIMEOUT": 60,
  "DECOMPILE_MODE": "decompile"
}

I downloaded the linked copy of ghidra 9.2.2, ran the buildGhidraJar script, and copied the resulting ghidra jar file into QtRE/lib. QtRE was compiled by git cloning the repo and running mvn package.

Is this a bug?

SomeOtherDev avatar Aug 12 '24 23:08 SomeOtherDev

Hi @SomeOtherDev. Could you replace the LANGUAGE_NAME field's value with x86:LE:64:default? This attribute is defined in https://github.com/NationalSecurityAgency/ghidra/blob/master/Ghidra/Features/Base/src/main/java/ghidra/program/database/ProgramBuilder.java#L64

onehouwong avatar Aug 13 '24 16:08 onehouwong

Thank you @onehouwong , that seems to have resolved that error. I must have forgotten to add the default when I was making the config file.

I received a different lengthy error, but I suspect this isn't a bug of this project, but something to do with my ghidra configuration.

SomeOtherDev avatar Aug 13 '24 18:08 SomeOtherDev

I'll post the error anyway but please feel free to close if you feel it's not relevant. Thanks again for resolving my issue

anon@anon:~/QtRE$ ./run.sh -p QtRE-1.0.0.jar -c test.json --analyze-connect --analyze-meta
Initializing SSL Context
Initializing Random Number Generator...
Random Number Generator initialization complete: NativePRNGNonBlocking
Loading user preferences: /home/anon/.ghidra/.ghidra_9.2.2_PUBLIC/preferences
Loading previous preferences: /home/anon/.ghidra/.ghidra_9.2_PUBLIC/preferences
Trust manager disabled, cacerts have not been set
Opening project: /home/anon/test/QtRE
Output directory at: /home/anon/QtRE/current_output
Unexpected Loader exception from Executable and Linking Format (ELF)
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:61)
	at ghidra.app.util.bin.format.elf.ElfHeader.createElfHeader(ElfHeader.java:104)
	at ghidra.app.util.opinion.ElfLoader.findSupportedLoadSpecs(ElfLoader.java:109)
	at ghidra.app.util.opinion.LoaderService.getSupportedLoadSpecs(LoaderService.java:47)
	at ghidra.app.util.importer.AutoImporter.getLoadSpec(AutoImporter.java:206)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:172)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:156)
	at ghidra.app.util.importer.AutoImporter.importByLookingForLcs(AutoImporter.java:91)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:608)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:601)
	at Main.Analyzer.<init>(Analyzer.java:77)
	at Main.Main.main(Main.java:115)
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)
	... 11 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 @163cc7b8
	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:200)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:194)
	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)
	... 20 more
Unexpected Loader exception from New Executable (NE)
java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:61)
	at ghidra.app.util.bin.format.mz.DOSHeader.createDOSHeader(DOSHeader.java:100)
	at ghidra.app.util.bin.format.ne.NewExecutable.<init>(NewExecutable.java:46)
	at ghidra.app.util.opinion.NeLoader.findSupportedLoadSpecs(NeLoader.java:70)
	at ghidra.app.util.opinion.LoaderService.getSupportedLoadSpecs(LoaderService.java:47)
	at ghidra.app.util.importer.AutoImporter.getLoadSpec(AutoImporter.java:206)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:172)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:156)
	at ghidra.app.util.importer.AutoImporter.importByLookingForLcs(AutoImporter.java:91)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:608)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:601)
	at Main.Analyzer.<init>(Analyzer.java:77)
	at Main.Main.main(Main.java:115)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:45)
	... 12 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "main"]
	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)
	at ghidra.app.util.bin.format.elf.ElfHeader.createElfHeader(ElfHeader.java:104)
	at ghidra.app.util.opinion.ElfLoader.findSupportedLoadSpecs(ElfLoader.java:109)
	... 9 more
Unexpected Loader exception from Portable Executable (PE)
java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:61)
	at ghidra.app.util.bin.format.pe.PortableExecutable.createPortableExecutable(PortableExecutable.java:85)
	at ghidra.app.util.opinion.PeLoader.findSupportedLoadSpecs(PeLoader.java:79)
	at ghidra.app.util.opinion.LoaderService.getSupportedLoadSpecs(LoaderService.java:47)
	at ghidra.app.util.importer.AutoImporter.getLoadSpec(AutoImporter.java:206)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:172)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:156)
	at ghidra.app.util.importer.AutoImporter.importByLookingForLcs(AutoImporter.java:91)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:608)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:601)
	at Main.Analyzer.<init>(Analyzer.java:77)
	at Main.Main.main(Main.java:115)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:45)
	... 11 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "main"]
	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)
	at ghidra.app.util.bin.format.elf.ElfHeader.createElfHeader(ElfHeader.java:104)
	at ghidra.app.util.opinion.ElfLoader.findSupportedLoadSpecs(ElfLoader.java:109)
	... 9 more
Unexpected Loader exception from Old-style DOS Executable (MZ)
java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:61)
	at ghidra.app.util.bin.format.mz.DOSHeader.createDOSHeader(DOSHeader.java:100)
	at ghidra.app.util.bin.format.mz.OldStyleExecutable.<init>(OldStyleExecutable.java:41)
	at ghidra.app.util.opinion.MzLoader.findSupportedLoadSpecs(MzLoader.java:72)
	at ghidra.app.util.opinion.LoaderService.getSupportedLoadSpecs(LoaderService.java:47)
	at ghidra.app.util.importer.AutoImporter.getLoadSpec(AutoImporter.java:206)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:172)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:156)
	at ghidra.app.util.importer.AutoImporter.importByLookingForLcs(AutoImporter.java:91)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:608)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:601)
	at Main.Analyzer.<init>(Analyzer.java:77)
	at Main.Main.main(Main.java:115)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:45)
	... 12 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "main"]
	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)
	at ghidra.app.util.bin.format.elf.ElfHeader.createElfHeader(ElfHeader.java:104)
	at ghidra.app.util.opinion.ElfLoader.findSupportedLoadSpecs(ElfLoader.java:109)
	... 9 more
Exception in thread "main" java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:61)
	at ghidra.app.util.bin.format.mz.DOSHeader.createDOSHeader(DOSHeader.java:100)
	at ghidra.app.plugin.prototype.MicrosoftCodeAnalyzerPlugin.PEUtil.canAnalyze(PEUtil.java:51)
	at ghidra.app.plugin.prototype.MicrosoftCodeAnalyzerPlugin.PropagateExternalParametersAnalyzer.canAnalyze(PropagateExternalParametersAnalyzer.java:236)
	at ghidra.app.plugin.core.analysis.AutoAnalysisManager.initializeAnalyzers(AutoAnalysisManager.java:165)
	at ghidra.app.plugin.core.analysis.AutoAnalysisManager.<init>(AutoAnalysisManager.java:147)
	at ghidra.app.plugin.core.analysis.AutoAnalysisManager.getAnalysisManager(AutoAnalysisManager.java:983)
	at ghidra.base.project.GhidraProject.initializeProgram(GhidraProject.java:592)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:610)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:601)
	at Main.Analyzer.<init>(Analyzer.java:77)
	at Main.Main.main(Main.java:115)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
	at generic.continues.ContinuesFactory.create(ContinuesFactory.java:45)
	... 11 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "main"]
	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)
	at ghidra.app.util.bin.format.elf.ElfHeader.createElfHeader(ElfHeader.java:104)
	at ghidra.app.util.opinion.ElfLoader.findSupportedLoadSpecs(ElfLoader.java:109)
	at ghidra.app.util.opinion.LoaderService.getSupportedLoadSpecs(LoaderService.java:47)
	at ghidra.app.util.importer.AutoImporter.getLoadSpec(AutoImporter.java:206)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:172)
	at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:156)
	at ghidra.app.util.importer.AutoImporter.importByLookingForLcs(AutoImporter.java:91)
	at ghidra.base.project.GhidraProject.importProgram(GhidraProject.java:608)
	... 3 more

SomeOtherDev avatar Aug 13 '24 18:08 SomeOtherDev