Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# https://help.github.com/articles/dealing-with-line-endings/
* text eol=lf
*.png diff=none binary
*.jpg diff=none binary
*.jpeg diff=none binary
*.gif diff=none binary
*.svg diff=none binary
*.webp diff=none binary
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6.0.1
- name: Setup
run: |
export NEEDRESTART_MODE=n
Expand All @@ -44,7 +44,7 @@ jobs:
echo "score_diff=${score_diff}" >> $GITHUB_OUTPUT

- name: Post results
uses: actions/github-script@v7
uses: actions/github-script@v8.0.0
with:
script: |
const old_score = ${{ steps.get_coverage.outputs.current_score }};
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/extended-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6.0.1
- run: |
docker run -v ${PWD}:/gef ${{ matrix.variants.os }}:${{ matrix.variants.version }} "bash /gef/tests/extended/${{ matrix.variants.os }}.sh"
2 changes: 1 addition & 1 deletion .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install pre-requisite
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
discord:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.1
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6.0.1

- name: Install python and toolchain
run: |
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5.1.0
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6.2.0
with:
python-version: "3.8"
python-version: "3.10"
- uses: pre-commit/action@v3.0.1

docs_link_check:
Expand All @@ -23,11 +23,25 @@ jobs:
contents: read
steps:
- name: checkout
uses: actions/checkout@v4.1.6
uses: actions/checkout@v6.0.1
- name: Restore lychee cache
id: restore-cache
uses: actions/cache/restore@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Check links
uses: lycheeverse/lychee-action@v2.0.2
uses: lycheeverse/lychee-action@v2.7.0
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: --exclude-mail --accept=401 --no-progress --exclude 'https://cs.github.com/hugsy/gef\?q=.*' 'docs/**/*.md'
args: --exclude-mail --accept=401 --no-progress --exclude 'https://cs.github.com/hugsy/gef\?q=.*' '**/*.md'
fail: false
workingDirectory: docs/
- name: Save lychee cache
uses: actions/cache/save@v4
if: always()
with:
path: .lycheecache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://i.imgur.com/o0L8lPN.png" alt="logo"/>
<img src="assets/images/logo.png" alt="logo"/>
</p>

<p align="center">
Expand Down Expand Up @@ -39,7 +39,7 @@ $ gdb -q

You can immediately see that GEF is correctly installed by launching GDB:

![gef-context](https://i.imgur.com/E3EuQPs.png)
![gef-context](assets/images/gef-context.png)

A few of `GEF` features include:

Expand Down Expand Up @@ -73,8 +73,8 @@ try to reach out for help on the Discord channel or submit an issue.

## Current status

| Documentation |License | Compatibility | CI Tests (`main`) |
|:---:|:---:|:---|--|
| Documentation | License | Compatibility | CI Tests (`main`) |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [![Documentation](https://github.com/hugsy/gef/actions/workflows/generate-docs.yml/badge.svg)](https://github.com/hugsy/gef/actions/workflows/generate-docs.yml) | [![MIT](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=plastic)](https://github.com/hugsy/gef/blob/main/LICENSE) | [![Python 3](https://img.shields.io/badge/Python-3-green.svg)](https://github.com/hugsy/gef/) | [![CI Test for GEF](https://github.com/hugsy/gef/actions/workflows/tests.yml/badge.svg)](https://github.com/hugsy/gef/actions/workflows/tests.yml) |

## Contribute
Expand Down
Binary file added docs/assets/images/aarch64-fmtstr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/double-free.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/elf-checksec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/elf-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/emu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/entry-break-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/flags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/fmtstr-helper-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/fork-execution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-canary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-context-memory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-exception.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-got-multi-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-got-one-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-got.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-pcustom-with-address.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-remote-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-remote-command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-remote.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/gef-tmux-setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/grep-address.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/grep.png
Binary file added docs/assets/images/heap-arenas.png
Binary file added docs/assets/images/heap-chunk.png
Binary file added docs/assets/images/heap-chunks-all.png
Binary file added docs/assets/images/heap-chunks-arena.png
Binary file added docs/assets/images/heap-chunks-size-filter.png
Binary file added docs/assets/images/heap-chunks-summary.png
Binary file added docs/assets/images/heap-chunks.png
Binary file added docs/assets/images/heap-track.png
Binary file added docs/assets/images/hexdump.png
Binary file added docs/assets/images/highlight-command.png
Binary file added docs/assets/images/ida-structure-examples.png
Binary file added docs/assets/images/logo.png
Binary file added docs/assets/images/memory-watch.png
Binary file added docs/assets/images/mipsel-deref-regs.png
Binary file added docs/assets/images/scan-address.png
Binary file added docs/assets/images/sparc-arb-struct.png
Binary file added docs/assets/images/stubbed-fork.png
Binary file added docs/assets/images/trace-run-1.png
Binary file added docs/assets/images/trace-run-2.png
Binary file added docs/assets/images/uaf.png
Binary file added docs/assets/images/vmmap.png
Binary file added docs/assets/images/voltron.png
Binary file added docs/assets/images/x86-heap-chunks.png
Binary file added docs/assets/images/x86-heap-helper-uaf.png
Binary file added docs/assets/images/xfiles-example.png
Binary file added docs/assets/images/xinfo-example.png
2 changes: 1 addition & 1 deletion docs/commands/canary.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ The command `canary` does not take any arguments.
gef➤ canary
```

![gef-canary](https://i.imgur.com/kPmsod2.png)
![gef-canary](assets/images/gef-canary.png)
2 changes: 1 addition & 1 deletion docs/commands/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To view all settings for all commands loaded:
gef➤ gef config
```

![gef-config](https://i.imgur.com/bd2ZqsU.png)
![gef-config](assets/images/gef-config.png)

Or to get one setting value:

Expand Down
4 changes: 2 additions & 2 deletions docs/commands/context.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Command `context`

![gef-context](https://i.imgur.com/aZiG8Yb.png)
![gef-context](assets/images/gef-context.png)

`gef` (not unlike `PEDA` or `fG! famous gdbinit`) provides comprehensive context menu when hitting a
breakpoint.
Expand Down Expand Up @@ -123,7 +123,7 @@ gef➤ gef config context.redirect /dev/pts/0
```

Enjoy:
![gef-context-redirect-section](https://i.imgur.com/sWlX37q.png)
![gef-context-redirect-section](assets/images/gef-context-redirect-section.png)

To go back to normal, remove the value:

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/edit-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ instruction), but we want to have the Carry flag set, simply go with:
gef➤ flags -ZERO +CARRY
```

![flags](https://i.imgur.com/ro7iC5m.png)
![flags](assets/images/flags.png)
2 changes: 1 addition & 1 deletion docs/commands/entry-break.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ It will perform the following actions:
header, set a breakpoint and run. This case should never fail if the ELF binary has a valid
structure.

![entry-break-example](https://i.imgur.com/zXSERMh.png)
![entry-break-example](assets/images/entry-break-example.png)
2 changes: 1 addition & 1 deletion docs/commands/format-string-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ gef➤ r
If a potentially insecure entry is found, the breakpoint will trigger, stop the process execution,
display the reason for trigger and the associated context.

![fmtstr-helper-example](https://i.imgur.com/INU3KGn.png)
![fmtstr-helper-example](assets/images/fmtstr-helper-example.png)
6 changes: 3 additions & 3 deletions docs/commands/gef-remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Process /tmp/default.out created; pid = 258932
Listening on port 1234
```

![gef-remote-1](https://i.imgur.com/Zc4vnBd.png)
![gef-remote-1](assets/images/gef-remote-1.png)

On the client, when the original `gdb` would use `target remote`, GEF's syntax is roughly similar
(shown running in debug mode for more verbose output, but you don't have to):
Expand Down Expand Up @@ -75,12 +75,12 @@ Reading /lib64/ld-linux-x86-64.so.2 from remote target...

And finally breaking into the program, showing the current context:

![gef-remote](https://i.imgur.com/IfsRDvK.png)
![gef-remote](assets/images/gef-remote.png)

You will also notice the prompt has changed to indicate the debugging mode is now "remote". Besides
that, all of GEF features are available:

![gef-remote-command](https://i.imgur.com/05epyX6.png)
![gef-remote-command](assets/images/gef-remote-command.png)

#### `remote-extended`

Expand Down
6 changes: 3 additions & 3 deletions docs/commands/got.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gef➤ got [--all] [filters]

`--all` Print the GOT for all shared objects in addition to the executable file

![gef-got](https://i.imgur.com/554ebM3.png)
![gef-got](assets/images/gef-got.png)

The applied filter partially matches the name of the functions, so you can do something like this.

Expand All @@ -21,15 +21,15 @@ gef➤ got print
gef➤ got read
```

![gef-got-one-filter](https://i.imgur.com/IU715CG.png)
![gef-got-one-filter](assets/images/gef-got-one-filter.png)

Example of multiple partial filters:

```text
gef➤ got str get
```

![gef-got-multi-filter](https://i.imgur.com/7L2uLt8.png)
![gef-got-multi-filter](assets/images/gef-got-multi-filter.png)

```text
gef➤ got --all str get
Expand Down
8 changes: 4 additions & 4 deletions docs/commands/heap-analysis-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ The following settings are accepted:
- `check_null_free`: to break execution when a free(NULL) is encountered (disabled by default);
- `check_double_free`: to break execution when a double free is encountered;

![double-free](https://i.imgur.com/S7b4FJa.png)
![double-free](assets/images/double-free.png)

- `check_weird_free`: to execution when `free()` is called against a non-tracked pointer;
- `check_uaf`: to break execution when a possible Use-after-Free condition is found.

![uaf](https://i.imgur.com/NfV5Cu9.png)
![uaf](assets/images/uaf.png)

Just like the format string vulnerability helper, the `heap-analysis-helper` can fail to detect
complex heap scenarios and/or provide some false positive alerts. Each finding must of course be
Expand All @@ -57,12 +57,12 @@ gef➤ gef config heap-analysis-helper.check_uaf False
Then `gef` will not notify you of any inconsistency detected, but simply display a clear message
when a chunk is allocated/freed.

![heap-track](https://i.imgur.com/68NGTvw.png)
![heap-track](assets/images/heap-track.png)

To get information regarding the currently tracked chunks, use the `show` subcommand:

```text
gef➤ heap-analysis-helper show
```

![heap-analysis-helper-show](https://i.imgur.com/0I4jBWJ.png)
![heap-analysis-helper-show](assets/images/heap-analysis-helper-show.png)
18 changes: 9 additions & 9 deletions docs/commands/heap.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Displays all the chunks from the `heap` section of the current arena.
gef➤ heap chunks
```

![heap-chunks](https://i.imgur.com/y90SfKH.png)
![heap-chunks](assets/images/heap-chunks.png)

To select from which arena to display chunks either use the `heap set-arena` command or provide the
base address of the other arena like this:
Expand All @@ -55,15 +55,15 @@ base address of the other arena like this:
gef➤ heap chunks [arena_address]
```

![heap-chunks-arena](https://i.imgur.com/y1fybRx.png)
![heap-chunks-arena](assets/images/heap-chunks-arena.png)

In order to display the chunks of all the available arenas at once use

```text
gef➤ heap chunks -a
```

![heap-chunks-all](https://i.imgur.com/pTjRJFo.png)
![heap-chunks-all](assets/images/heap-chunks-all.png)

Because usually the heap chunks are aligned to a certain number of bytes in memory GEF automatically
re-aligns the chunks data start addresses to match Glibc's behavior. To be able to view unaligned
Expand All @@ -76,7 +76,7 @@ To get a higher level overview of the chunks you can use the `--summary` flag to
gef➤ heap chunks --summary
```

![heap-chunks-summary](https://i.imgur.com/3HTgtwX.png)
![heap-chunks-summary](assets/images/heap-chunks-summary.png)

Sometimes, multiple types of objects could have the same size, hence it might not be enough only
knowing the chunk size when debugging issues like memory leaks. GEF supports using the vtable to
Expand All @@ -87,7 +87,7 @@ with the `--summary` flag.
gef➤ heap chunks --summary --resolve
```

![heap-chunks-summary-resolve](https://i.imgur.com/2Mm0JF6.png)
![heap-chunks-summary-resolve](assets/images/heap-chunks-summary-resolve.png)

Heap chunk command also supports filtering chunks by their size. To do so, simply provide the
`--min-size` or `--max-size` argument:
Expand All @@ -96,7 +96,7 @@ Heap chunk command also supports filtering chunks by their size. To do so, simpl
gef➤ heap chunks --min-size 16 --max-size 32
```

![heap-chunks-size-filter](https://i.imgur.com/AWuCvFK.png)
![heap-chunks-size-filter](assets/images/heap-chunks-size-filter.png)

The range is inclusive, so the above command will display all chunks with size >=16 and <=32.

Expand All @@ -107,7 +107,7 @@ of the chunks in the output:
gef➤ heap chunks --count 1
```

![heap-chunks-size-filter](https://i.imgur.com/EinuDAt.png)
![heap-chunks-size-filter](assets/images/heap-chunks-size-filter.png)

### `heap chunk` command

Expand All @@ -118,7 +118,7 @@ the user memory pointer of the chunk to show the information related to a specif
gef➤ heap chunk [address]
```

![heap-chunk](https://i.imgur.com/WXpHR58.png)
![heap-chunk](assets/images/heap-chunk.png)

Because usually the heap chunks are aligned to a certain number of bytes in memory GEF automatically
re-aligns the chunks data start addresses to match Glibc's behavior. To be able to view unaligned
Expand All @@ -145,7 +145,7 @@ Multi-threaded programs have different arenas, and the knowledge of the `main_ar
`gef` therefore provides the `arena` sub-commands to help you list all the arenas allocated in your
program **at the moment you call the command**.

![heap-arenas](https://i.imgur.com/RUTiADa.png)
![heap-arenas](assets/images/heap-arenas.png)

### `heap set-arena` command

Expand Down
4 changes: 2 additions & 2 deletions docs/commands/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
As long as the 'memory' section is enabled in your context layout (which it is by default), you can
register addresses, lengths, and grouping size.

![memory watch](https://i.imgur.com/NXYwSwW.png)
![memory watch](assets/images/memory watch.png)

_Note_: this command **should NOT** be mistaken with the [GDB `watch`
command](https://sourceware.org/gdb/current/onlinedocs/gdb/Set-Watchpoints.html) meant to set
Expand Down Expand Up @@ -38,7 +38,7 @@ gef ➤ memory watch $_got()+0x18 5

Which, when the `context` is displayed, will show something like:

![gef-context-memory](https://i.imgur.com/3YabwYv.png)
![gef-context-memory](assets/images/gef-context-memory.png)

### Removing a watch

Expand Down
6 changes: 3 additions & 3 deletions docs/commands/pcustom.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ gef➤ dt person_t
By providing an address or a GDB symbol, `gef` will apply this user-defined structure to the
specified address:

![gef-pcustom-with-address](https://i.imgur.com/vWGnu5g.png)
![gef-pcustom-with-address](assets/images/gef-pcustom-with-address.png)

This means that we can now create very easily new user-defined structures

Expand All @@ -120,8 +120,8 @@ For a full demo, watch the following tutorial:

Additionally, if you have successfully configured your IDA settings, you can also directly import
the structure(s) that was(were) reverse-engineered in IDA directly in your GDB session:
![ida-structure-examples](https://i.imgur.com/Tnsf6nt.png) - (see `gef-extras/ida-rpyc`, which is
the new improved version of `ida-interact`)
![ida-structure-examples](assets/images/ida-structure-examples.png) - (see `gef-extras/ida-rpyc`,
which is the new improved version of `ida-interact`)

#### Dynamic `ctypes.Structure`-like classes

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ gef➤ scan stack libc
To check mappings without a path associated, an address range (start-end) can be used. Note that
ranges don't include whitespaces.

![scan-address](https://i.imgur.com/ExJC2p7.png)
![scan-address](assets/images/scan-address.png)
Loading
Loading