Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hugsy/gef
Browse files Browse the repository at this point in the history
  • Loading branch information
etrickel committed Jan 10, 2018
2 parents 22814bb + c758bb5 commit 579d49a
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 55 deletions.
7 changes: 4 additions & 3 deletions docs/commands/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Or get one setting value:
gef➤ gef config pcustom.struct_path
```

Feel free to edit the values. For example, if you want the screen to be cleared
before displaying the current context when reaching a breakpoing:
Of course you can edit the values. For example, if you want the screen to be
cleared before displaying the current context when reaching a breakpoing:
```
gef➤ gef config context.clear_screen 1
```
Expand All @@ -36,4 +36,5 @@ gef➤ gef restore
[+] Configuration from '/home/hugsy/.gef.rc' restored
```

You can tweak this configuration outside your `gdb` session to suit your needs.
You can tweak this configuration file outside your `gdb` session to suit your
needs.
31 changes: 22 additions & 9 deletions docs/commands/context.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ There are currently 6 sections that can be displayed:
heap vulnerability, etc.) it will be displayed in this pane
* `memory` : peek into arbitrary memory locations

To prevent one section to be displayed, simply use the `context.layout` setting,
and prepend the section name with `-` or just omit it.
To hide a section, simply use the `context.layout` setting, and prepend the
section name with `-` or just omit it.

```
gef➤ gef config context.layout "regs stack code -source -threads -trace extra memory"
```
Will not display the `source`, `threads`, and `trace` sections.
This configuration will not display the `source`, `threads`, and `trace` sections.

The `memory` pane will display the content of all locations specified by the
`memory` command. For instance,
Expand All @@ -57,10 +57,18 @@ The `memory` pane will display the content of all locations specified by the
gef➤ memory watch $sp 0x40 byte
```

will print an
hexdump version of 0x40 byte of the stack. This command makes it convenient for
tracking the evolution of arbitrary locations in memory. Tracked locations can
be removed one by one using `memory unwatch`, or altogether with `memory reset`.
will print a hexdump version of 0x40 bytes of the stack. This command makes it
convenient for tracking the evolution of arbitrary locations in memory. Tracked
locations can be removed one by one using `memory unwatch`, or altogether with
`memory reset`.

=======
The size of most sections are also customizable:

* `nb_lines_stack` configures how many lines of the stack to show.
* `nb_lines_backtrack` configures how many lines of the backtrace to show.
* `nb_lines_code` and `nb_lines_code_prev` configure how many lines to show
after and before the PC, respectively.

To have the stack displayed with the largest stack addresses on top (i.e., grow the
stack downward), enable the following setting:
Expand Down Expand Up @@ -122,9 +130,9 @@ gef➤ gef config context.redirect ""

### Examples ###

* Display the code section first, then register, and stack:
* Display the code section first, then register, and stack, hiding everything else:
```
gef➤ gef config context.layout "code regs stack -source -threads -trace"
gef➤ gef config context.layout "code regs stack"
```

* Stop showing the context sections when breaking:
Expand All @@ -146,3 +154,8 @@ gef➤ gef config context.show_registers_raw 0
```
gef➤ gef config context.peek_calls False
```

* Hide specific registers from the registers view.
```
gef➤ gef config context.ignore_registers "$cs $ds $gs"
```
Loading

0 comments on commit 579d49a

Please sign in to comment.