Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java error #56

Closed
torabi12 opened this issue Sep 6, 2022 · 11 comments
Closed

Java error #56

torabi12 opened this issue Sep 6, 2022 · 11 comments

Comments

@torabi12
Copy link

torabi12 commented Sep 6, 2022

I am using Ubuntu 22.04.1 Desktop OS and I followed the installation of BinAbsInspector strictly.
I have ghidra 10.1.2
I got the *.so files like this:
https://github.com/Z3Prover/z3/releases/download/z3-4.8.15/z3-4.8.15-x64-glibc-2.31.zip
$ unzip z3-4.8.15-x64-glibc-2.31.zip
$ cd ~/z3-4.8.15-x64-glibc-2.31/bin
$ sudo cp *.so /usr/local/lib/

I imported the ghidra_10.1.2_PUBLIC_20220420_BinAbsInspector.zip file successfully, but I get this error in ghidra:

kép

Tis is the java environment:
$ java --version
openjdk 11.0.16 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

I have no idea what to do, please help!

@MatthewShao
Copy link
Collaborator

I guess that's because z3-4.8.15-x64-glibc-2.31 lib file is not compatible with ubuntu 22.04 which using glibc-2.35, you could follow the instruction here: https://github.com/Z3Prover/z3#building-z3-using-make-and-gccclang to build the z3.

@torabi12
Copy link
Author

torabi12 commented Sep 7, 2022

Thank you, I built the 4.8.15 source successfully and I have libz3.so, but the other so file for z3 solver is still missing:
kép

can I get it from z3-4.8.15-x64-glibc-2.31.zip or how can I build it?

I am not a developer, I am not good in this part sorry.

@MatthewShao
Copy link
Collaborator

You should copy libz3.so and libz3java.so to /usr/local/lib/. It should work, if it still doesn't, you can try to run with docker image.

@torabi12
Copy link
Author

torabi12 commented Sep 7, 2022

I rebuilt the z3 with this command:
$ python scripts/mk_make.py --java

and I have the 2 .so files, libz3.so and libz3java.so. Both are copied to /usr/local/lib

The bad news is that the error is the same:
BinAbsInspector.java> Cannot detect z3 solver library, please check your z3 solver installation or disable z3 solver in configuration.

z3-4.8.15 is the best version to use?

@MatthewShao
Copy link
Collaborator

Z3-4.8.15 has been tested, other versions should work as well, but we cannot guarantee it.

@torabi12
Copy link
Author

torabi12 commented Sep 7, 2022

I put both .so files to /lib dir and the z3 issue looks like gone, I have only this:
kép

I do not understand this sentence in the installation:

"The Java package is already included in "/lib" directory, but we suggest that you replace it with your own Java package for version compatibility."

if you can give me any hint it would be great, I don't belive this, I am trying to fix this 2 days ago:)
Does it make sense to build the BinAbsInspector.zip on my system?

@torabi12
Copy link
Author

torabi12 commented Sep 8, 2022

I tried it on Ubuntu 20.04.5 and on Ubuntu 18.04.6 with the same java 11 JDK but I got the same red error as above.
I built the z3 on every system, as you suggested.

Java 11 must be good for ghidra 10.1.2 as the installation page shows:
https://htmlpreview.github.io/?https://github.com/NationalSecurityAgency/ghidra/blob/Ghidra_10.1.2_build/GhidraDocs/InstallationGuide.html#Requirements

I don't know what is the problem. Docker is not good for me.

@MatthewShao
Copy link
Collaborator

Could you please show what binary you are running for?

@torabi12
Copy link
Author

Hello Matthew,

I use this FW file:
https://ftp.dlink.ru/pub/Router/DIR-645/Firmware/Old/DIR645A1_FW102B08.bin

I am not sure this is the best choice. Could you give me another one which is suitable for sure?
Thank you!

@MatthewShao
Copy link
Collaborator

This file is a firmware, ghidra could not load it directly, so you need to unpack it and extract the ELFs. For now, we only support analyzing ELF files. If you want to have some simple testcases, you can download from https://github.com/KeenSecurityLab/BinAbsInspector-binaries.

@torabi12
Copy link
Author

Thank you for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants