Git Product home page Git Product logo

Comments (10)

owen800q avatar owen800q commented on June 16, 2024 2

@Ayrx
Yes,the latest commit has fixed this issue, now it works perfectly for me.

from jnianalyzer.

owen800q avatar owen800q commented on June 16, 2024

@eacmen
@Ayrx
How to instlall this extension, I got this error when loading it into Ghidra 9.0
image

from jnianalyzer.

owen800q avatar owen800q commented on June 16, 2024

@eacmen
@Ayrx
Right.... missing properties
I have same issue, look like jni_all.h can not be imported
image

from jnianalyzer.

Ayrx avatar Ayrx commented on June 16, 2024

How are you building the extension?

FWIW I used "GhidraDev->Export->Ghidra Module Extension" from Eclipse with the official Ghidra Eclipse plugin. Code has been tested against Ghidra 9.0.4. That should give you a file like ghidra_9.0.4_PUBLIC_20190903_JNIAnalyzer.zip that you can install in Ghidra.

from jnianalyzer.

owen800q avatar owen800q commented on June 16, 2024

How are you building the extension?

FWIW I used "GhidraDev->Export->Ghidra Module Extension" from Eclipse with the official Ghidra Eclipse plugin. Code has been tested against Ghidra 9.0.4. That should give you a file like ghidra_9.0.4_PUBLIC_20190903_JNIAnalyzer.zip that you can install in Ghidra.

After install the extension built with GhidraDev from Eclipse, I got another exception
image

from jnianalyzer.

owen800q avatar owen800q commented on June 16, 2024

@Ayrx
Not sure it's a build problem, If you have time, can you release the built zip file that has been tested so that we can install it directly.

from jnianalyzer.

smarek avatar smarek commented on June 16, 2024

I can confirm this issue exists when building the extension archive through pure gradle too.
Issues are stacked on top of each other

#Trace1

Error running script: JNIAnalyzer.java
ghidra.util.exception.FileInUseException: File is in use - 'jni__all.gdt.lock(9,JNIAnalyzer.java)' by <Unknown>
ghidra.util.exception.FileInUseException: File is in use - 'jni__all.gdt.lock(9,JNIAnalyzer.java)' by <Unknown>
	at ghidra.framework.store.db.PackedDatabase.lock(PackedDatabase.java:462)
	at ghidra.framework.store.db.PackedDatabase.readContentTypeAndName(PackedDatabase.java:474)
	at ghidra.framework.store.db.PackedDatabase.<init>(PackedDatabase.java:96)
	at ghidra.framework.store.db.PackedDatabase.getPackedDatabase(PackedDatabase.java:289)
	at ghidra.program.database.data.DataTypeManagerDB.<init>(DataTypeManagerDB.java:176)
	at ghidra.program.model.data.StandAloneDataTypeManager.<init>(StandAloneDataTypeManager.java:55)
	at ghidra.program.model.data.FileDataTypeManager.<init>(FileDataTypeManager.java:56)
	at ghidra.program.model.data.FileDataTypeManager.openFileArchive(FileDataTypeManager.java:101)
	at ghidra.app.plugin.core.datamgr.archive.FileArchive.<init>(FileArchive.java:54)
	at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchive(DataTypeManagerHandler.java:429)
	at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchive(DataTypeManagerHandler.java:419)
	at ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin.openArchive(DataTypeManagerPlugin.java:715)
	at JNIAnalyzer.getDataTypeManageFromArchiveFile(JNIAnalyzer.java:146)
	at JNIAnalyzer.run(JNIAnalyzer.java:53)
	at ghidra.app.script.GhidraScript.executeNormal(GhidraScript.java:370)
	at ghidra.app.script.GhidraScript.doExecute(GhidraScript.java:222)
	at ghidra.app.script.GhidraScript.execute(GhidraScript.java:200)
	at ghidra.app.plugin.core.script.RunScriptTask.run(RunScriptTask.java:57)
	at ghidra.util.task.Task.monitoredRun(Task.java:128)
	at ghidra.util.task.TaskLauncher.lambda$startBackgroundThread$2(TaskLauncher.java:315)
	at java.base/java.lang.Thread.run(Thread.java:834)

#Trace2

Unable to write to lock file: /home/user/ghidra_9.0.4/file:/home/user/ghidra_9.0.4/Ghidra/Extensions/JNIAnalyzer/lib/JNIAnalyzer.jar!/jni__all.gdt.lock
java.io.IOException: No such file or directory
	at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.base/java.io.File.createNewFile(File.java:1024)
	at ghidra.framework.store.local.LockFile.createLockFileNoWait(LockFile.java:449)
	at ghidra.framework.store.local.LockFile.createLock(LockFile.java:381)
	at ghidra.framework.store.db.PackedDatabase.lock(PackedDatabase.java:456)
	at ghidra.framework.store.db.PackedDatabase.readContentTypeAndName(PackedDatabase.java:474)
	at ghidra.framework.store.db.PackedDatabase.<init>(PackedDatabase.java:96)
	at ghidra.framework.store.db.PackedDatabase.getPackedDatabase(PackedDatabase.java:289)
	at ghidra.program.database.data.DataTypeManagerDB.<init>(DataTypeManagerDB.java:176)
	at ghidra.program.model.data.StandAloneDataTypeManager.<init>(StandAloneDataTypeManager.java:55)
	at ghidra.program.model.data.FileDataTypeManager.<init>(FileDataTypeManager.java:56)
	at ghidra.program.model.data.FileDataTypeManager.openFileArchive(FileDataTypeManager.java:101)
	at ghidra.app.plugin.core.datamgr.archive.FileArchive.<init>(FileArchive.java:54)
	at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchive(DataTypeManagerHandler.java:429)
	at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchive(DataTypeManagerHandler.java:419)
	at ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin.openArchive(DataTypeManagerPlugin.java:715)
	at JNIAnalyzer.getDataTypeManageFromArchiveFile(JNIAnalyzer.java:146)
	at JNIAnalyzer.run(JNIAnalyzer.java:53)
	at ghidra.app.script.GhidraScript.executeNormal(GhidraScript.java:370)
	at ghidra.app.script.GhidraScript.doExecute(GhidraScript.java:222)
	at ghidra.app.script.GhidraScript.execute(GhidraScript.java:200)
	at ghidra.app.plugin.core.script.RunScriptTask.run(RunScriptTask.java:57)
	at ghidra.util.task.Task.monitoredRun(Task.java:128)
	at ghidra.util.task.TaskLauncher.lambda$startBackgroundThread$2(TaskLauncher.java:315)
	at java.base/java.lang.Thread.run(Thread.java:834)

#Trace3

Unable to write to lock file: /home/user/ghidra_9.0.4/file:/home/user/ghidra_9.0.4/Ghidra/Extensions/JNIAnalyzer/lib/JNIAnalyzer.jar!/jni__all.gdt.lock
java.io.IOException: No such file or directory
	at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.base/java.io.File.createNewFile(File.java:1024)
	at ghidra.framework.store.local.LockFile.createLockFileNoWait(LockFile.java:449)
	at ghidra.framework.store.local.LockFile.createLock(LockFile.java:381)
	at ghidra.framework.store.db.PackedDatabase.lock(PackedDatabase.java:456)
	at ghidra.framework.store.db.PackedDatabaseCache.getCachedDB(PackedDatabaseCache.java:340)
	at ghidra.framework.store.db.PackedDatabase.getPackedDatabase(PackedDatabase.java:282)
	at ghidra.program.database.data.DataTypeManagerDB.<init>(DataTypeManagerDB.java:176)
	at ghidra.program.model.data.StandAloneDataTypeManager.<init>(StandAloneDataTypeManager.java:55)
	at ghidra.program.model.data.FileDataTypeManager.<init>(FileDataTypeManager.java:56)
	at ghidra.program.model.data.FileDataTypeManager.openFileArchive(FileDataTypeManager.java:101)
	at ghidra.app.plugin.core.datamgr.archive.FileArchive.<init>(FileArchive.java:54)
	at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchive(DataTypeManagerHandler.java:429)
	at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchive(DataTypeManagerHandler.java:419)
	at ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin.openArchive(DataTypeManagerPlugin.java:715)
	at JNIAnalyzer.getDataTypeManageFromArchiveFile(JNIAnalyzer.java:146)
	at JNIAnalyzer.run(JNIAnalyzer.java:53)
	at ghidra.app.script.GhidraScript.executeNormal(GhidraScript.java:370)
	at ghidra.app.script.GhidraScript.doExecute(GhidraScript.java:222)
	at ghidra.app.script.GhidraScript.execute(GhidraScript.java:200)
	at ghidra.app.plugin.core.script.RunScriptTask.run(RunScriptTask.java:57)
	at ghidra.util.task.Task.monitoredRun(Task.java:128)
	at ghidra.util.task.TaskLauncher.lambda$startBackgroundThread$2(TaskLauncher.java:315)
	at java.base/java.lang.Thread.run(Thread.java:834)
``

from jnianalyzer.

Ayrx avatar Ayrx commented on June 16, 2024

Ah that's bizarre.

So I realized that I was usually running the extension by installing it directly from Eclipse where this issue did not appear. Running the script after installing the built ZIP file has the issue reported here. I'll see if I can find the problem and push the fix ASAP.

from jnianalyzer.

Ayrx avatar Ayrx commented on June 16, 2024

So I think the root cause of the issue is because the attempt to open the archive file tries to acquire a write lock in a non-existent directory. I have filed an issue at NationalSecurityAgency/ghidra#976 to find out the proper way to actually do this.

In the mean time, you can manually import the src/main/resources/jni_all.gdt file by going to "Data Type Manager->Open File Archive" and selecting the jni_all.gdt file which will bypass the portion of the code with the bug. The rest of the script should work then.

from jnianalyzer.

Ayrx avatar Ayrx commented on June 16, 2024

My latest commit should have fixed the bug.

@eacmen @owen800q @smarek Can you check and see if it works for you?

from jnianalyzer.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.