Information*/Troubleshoot

Trouble shoot with installing gef

ch4rli3kop 2022. 8. 29. 18:35
반응형

Trouble shoot with installing gef

I installed gef in my docker container, and I found this error.

➜ ~ gdb
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
  <http://www.gnu.org/software/gdb/documentation/>.
​
For help, type "help".
Type "apropos word" to search for commands related to "word".
Traceback (most recent call last):
File "/home/ch4rli3kop/.gdbinit-gef.py", line 10878, in <module>
  reset()
File "/home/ch4rli3kop/.gdbinit-gef.py", line 190, in reset
  gef.setup()
File "/home/ch4rli3kop/.gdbinit-gef.py", line 10809, in setup
  self.reinitialize_managers()
File "/home/ch4rli3kop/.gdbinit-gef.py", line 10804, in reinitialize_managers
  self.session = GefSessionManager()
File "/home/ch4rli3kop/.gdbinit-gef.py", line 10454, in __init__
  self.constants[constant] = which(constant)
File "/home/ch4rli3kop/.gdbinit-gef.py", line 1810, in which
  raise FileNotFoundError(f"Missing file `{program}`")
FileNotFoundError: Missing file `file`

I saw gef/gef.py, and I found the cause of the error.

class GefSessionManager(GefManager):
   """Class managing the runtime properties of GEF. """
  def __init__(self) -> None:
      ...
       for constant in ("python3", "readelf", "file", "ps"):
          self.constants[constant] = which(constant)
      return

The error occurred because there is no file command in my container.

Solutions

In my case, the file command didn't exist. We can resolve this error by installing that commands (python3, readelf, file, ps).

$ sudo apt install file -y

 

반응형