BinaryAnalysisPlatform / bap

Binary Analysis Platform
MIT License
2.07k stars 273 forks source link

ghidra_disasm.cpp:10:10: fatal error: ghidra/loadimage.hh: No such file or directory #1598

Closed wudehua2016 closed 9 months ago

wudehua2016 commented 9 months ago

I fellowed the instruction of this:

-----------------------------------------------------------------------------------------
git clone git@github.com:BinaryAnalysisPlatform/bap.git && cd bap
opam switch create . --deps-only
dune build && dune install
-----------------------------------------------------------------------------------------

but an error was iuessed:

-----------------------------------------------------------------------------------------
File "lib/bap_ghidra/dune", line 9, characters 9-22:
9 |   (names ghidra_disasm)
             ^^^^^^^^^^^^^
ghidra_disasm.cpp:10:10: fatal error: ghidra/loadimage.hh: No such file or directory
   10 | #include <ghidra/loadimage.hh>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
File "lib/bap_llvm/dune", line 1, characters 0-582: 
 1 | (library
 2 |  (name bap_llvm)
 3 |  (public_name bap-llvm)
....
22 |   (language c)
23 |   (names llvm_stubs llvm_loader_stubs))
24 |  (c_library_flags (:include link.flags)))
/usr/bin/ld: cannot find -lzstd
collect2: error: ld returned 1 exit status

my system is ubuntu 20.04, amd64, opam 2.1.0

ivg commented 9 months ago

Yes, libghidra is necessary for build bap from the trunk, you can install it with

          sudo add-apt-repository ppa:ivg/ghidra -y
          sudo apt-get update -y
          sudo apt-get install libghidra-dev -y
          sudo apt-get install libghidra-data -y
kimseongyu commented 8 months ago

I also had the same problem

So I tried to install ivg/ghidra, but 404 Not Found error is over

$ sudo add-apt-repository ppa:ivg/ghidra -y
Repository: 'deb https://ppa.launchpadcontent.net/ivg/ghidra/ubuntu/ jammy main'
Description:
A software reverse engineering (SRE) suite of tools developed by NSA's Research Directorate in support of the Cybersecurity mission
More info: https://launchpad.net/~ivg/+archive/ubuntu/ghidra
Adding repository.
Found existing deb entry in /etc/apt/sources.list.d/ivg-ubuntu-ghidra-jammy.list
Adding deb entry to /etc/apt/sources.list.d/ivg-ubuntu-ghidra-jammy.list
Found existing deb-src entry in /etc/apt/sources.list.d/ivg-ubuntu-ghidra-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/ivg-ubuntu-ghidra-jammy.list
Adding key to /etc/apt/trusted.gpg.d/ivg-ubuntu-ghidra.gpg with fingerprint 69FC09FC3B60A780A88B47247ADF80424D86B60D
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:4 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease
Ign:5 https://ppa.launchpadcontent.net/ivg/ghidra/ubuntu jammy InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:7 https://ppa.launchpadcontent.net/ytvwld/asciiquarium/ubuntu jammy InRelease
Err:8 https://ppa.launchpadcontent.net/ivg/ghidra/ubuntu jammy Release
  404  Not Found [IP: 185.125.190.80 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ivg/ghidra/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
basavesh commented 4 months ago

Running into same issue as @kimseongyu . Did you find any solution for this? for jammy distro, there is no ghidra release.

wudehua2016 commented 4 months ago

Running into same issue as @kimseongyu . Did you find any solution for this? for jammy distro, there is no ghidra release.

      sudo add-apt-repository ppa:ivg/ghidra -y
      sudo apt-get update -y
      sudo apt-get install libghidra-dev -y
      sudo apt-get install libghidra-data -y