> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/rev-eng/debuggers/gef.md).

# GEF

`GEF` (GDB enhanced features) is a kick-ass set of commands for X86, ARM, MIPS, PowerPC and SPARC to make GDB cool again for exploit dev. It is aimed to be used mostly by exploit developers and reverse-engineers, to provide additional features to GDB using the Python API to assist during the process of dynamic analysis and exploit development.

## Setup Configuration

### Kali Linux

To start `gdb` with GEF loaded from the start you can use `gdb-gef` which is just a small wrapper script

```bash
┌──(kali㉿kali)-[~]
└─$ cat /usr/bin/gdb-gef
#!/bin/sh
exec gdb -q -ex init-gef "$@"
```

`init-gef` is a [user-defined command](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Define.html) set in the `~/.gdbinit` file

```
define init-gef
source ~/.gdbinit-gef.py
end
document init-gef
Initializes GEF (GDB Enhanced Features)
end
```

### Pwn.college

Load GEF in pwn.college

```
(gdb) source /opt/gef/gef.py
```

## Resources

GEF (GDB Enhanced Features) - Documentation: <https://hugsy.github.io/gef/>

GEF (GDB Enhanced Features) - GitHub: <https://github.com/hugsy/gef>

GEF - Kali Tools: <https://www.kali.org/tools/gef/>
