hugsy / gef-extras

Extra goodies for GEF to (try to) make GDB suck even less
https://hugsy.github.io/gef-extras
MIT License
148 stars 50 forks source link

NameError: name 'register' is not defined #84

Closed aliencaocao closed 1 year ago

aliencaocao commented 1 year ago

Step 1: Describe your environment

Step 2: Describe your problem

Steps to reproduce

  1. Install gef-extras using wget -q -O- https://github.com/hugsy/gef/raw/main/scripts/gef-extras.sh | sh
  2. launch gdb using gdb

Minimalist test case

No need for anything, just run gdb

Observed Results

* What happened? This could be a description, log output, etc.
GNU gdb (Debian 12.1-4) 12.1
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".
GEF for linux ready, type `gef' to start, `gef config' to configure
96 commands loaded for GDB 12.1 using Python engine 3.10
[+] Configuration from '/home/kali/.gef.rc' restored
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/assemble.py", line 37, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/stack.py", line 11, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/retdec.py", line 14, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/ropper.py", line 11, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/xref-telescope.py", line 10, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/skel.py", line 52, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/ida_interact.py", line 103, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/bincompare.py", line 27, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/bytearray.py", line 18, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/v8-dereference.py", line 61, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/windbg.py", line 40, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/ftrace.py", line 72, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/peekpointers.py", line 13, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/remote.py", line 51, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/visualize_heap.py", line 144, in <module>
    @register
NameError: name 'register' is not defined
Traceback (most recent call last):
  File "/home/kali/.config/gef-extras/scripts/capstone.py", line 94, in <module>
    @register
NameError: name 'register' is not defined

Expected results

No error

Grazfather commented 1 year ago

Do you ALSO have gef installed?

aliencaocao commented 1 year ago

Yes, does that conflict?

Grazfather commented 1 year ago

Both should be installed. I think perhaps you need to update GEF as well. Please try that.

aliencaocao commented 1 year ago

My gef is latest dev version

maple3142 commented 1 year ago

I am getting this error too, but it only happens on ropper.py. This is due to a common Python error of naming a file with the same name as other packages ropper (reference).

Renaming ropper.py to ropper_.py helps.

SuperStormer commented 1 year ago

Also resolved by pip install ropper.