update links (#3373)

pull/3374/head
k4lizen 1 month ago committed by GitHub
parent 4ff1c3cb9e
commit db03238abb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -10,11 +10,11 @@
with a focus on features needed by low-level software developers, hardware hackers, with a focus on features needed by low-level software developers, hardware hackers,
reverse-engineers and exploit developers. reverse-engineers and exploit developers.
It has a boatload of features, see our [Features page](https://pwndbg.re/pwndbg/latest/features/) It has a boatload of features, see our [Features page](https://pwndbg.re/latest/features/)
and [CHEATSHEET][CHEATSHEET] (feel free to print it!). If you have any questions you may read the and [CHEATSHEET][CHEATSHEET] (feel free to print it!). If you have any questions you may read the
[documentation](https://pwndbg.re/pwndbg/latest/) or asks us in our [Discord server](https://discord.gg/x47DssnGwm). [documentation](https://pwndbg.re/latest/) or asks us in our [Discord server](https://discord.gg/x47DssnGwm).
[CHEATSHEET]: https://pwndbg.re/pwndbg/dev/CHEATSHEET.pdf [CHEATSHEET]: https://pwndbg.re/dev/CHEATSHEET.pdf
## Why? ## Why?
@ -30,7 +30,7 @@ smoothing out rough edges and making them more user-friendly.
## Installation ## Installation
See [installation instructions](https://pwndbg.re/pwndbg/latest/setup). See [installation instructions](https://pwndbg.re/latest/setup).
## What about ...? ## What about ...?
@ -80,7 +80,7 @@ Pwndbg ensures a consistent experience across both, so switching between them is
## Contributing ## Contributing
Pull requests are welcome ❤️. Check out the [Contributing Guide](https://pwndbg.re/pwndbg/dev/contributing/). Pull requests are welcome ❤️. Check out the [Contributing Guide](https://pwndbg.re/dev/contributing/).
## Acknowledgements ## Acknowledgements
Pwndbg was originally created by [Zach Riggle](https://github.com/zachriggle), who is no longer with us. We want to thank Zach for all of his contributions to pwndbg and the wider security community. Pwndbg was originally created by [Zach Riggle](https://github.com/zachriggle), who is no longer with us. We want to thank Zach for all of his contributions to pwndbg and the wider security community.

@ -9,7 +9,7 @@ usage: dev-dump-instruction [-h] [-e] [-n] [address]
Dump internal PwndbgInstruction attributes. Dump internal PwndbgInstruction attributes.
Useful for debugging the disassembly and annotation subsystems Useful for debugging the disassembly and annotation subsystems
in Pwndbg. See https://pwndbg.re/pwndbg/dev/contributing/improving-annotations/#bug-root-cause in Pwndbg. See https://pwndbg.re/dev/contributing/improving-annotations/#bug-root-cause
for more information. for more information.
### Positional arguments ### Positional arguments

@ -41,7 +41,7 @@ We will cover the first four arguments now, and come back to the rest later.
If your command takes no arguments you can pass the description of the command as the first argument (`parser_or_desc`) to the constructor. Otherwise you will be passing an [`argparse.ArgumentParser`](https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser) object there. If your command takes no arguments you can pass the description of the command as the first argument (`parser_or_desc`) to the constructor. Otherwise you will be passing an [`argparse.ArgumentParser`](https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser) object there.
The only other required argument is `category`. The `category` determines how commands are grouped together in the output of the [`pwndbg`](https://pwndbg.re/pwndbg/dev/commands/pwndbg/pwndbg/) command and in the [documentation](https://pwndbg.re/pwndbg/dev/commands/). Peruse the list of all commands inside a debugger (by running the `pwndbg` command) and decide in which category your command fits best. The enum of all command categories is defined at the top of the `pwndbg/commands/__init__.py` file. The only other required argument is `category`. The `category` determines how commands are grouped together in the output of the [`pwndbg`](../commands/pwndbg/pwndbg.md) command and in the [documentation](../commands/index.md). Peruse the list of all commands inside a debugger (by running the `pwndbg` command) and decide in which category your command fits best. The enum of all command categories is defined at the top of the `pwndbg/commands/__init__.py` file.
### Picking a command name ### Picking a command name
Next, the `command_name` argument. It is optional because if it is not specified the command name will be the same as the function you used to define the command (except the underscores are replaced with dashes). As such, it is generally not needed to specify this argument. Next, the `command_name` argument. It is optional because if it is not specified the command name will be the same as the function you used to define the command (except the underscores are replaced with dashes). As such, it is generally not needed to specify this argument.
@ -53,7 +53,7 @@ If the command name contains three or more words, you should use dashes to make
You provide aliases to a command by specifying a list of strings to the `aliases` argument. Again, you may provide aliases to help users transitioning from other tools/debuggers (e.g. `nearpc [pdisass, u]`). You provide aliases to a command by specifying a list of strings to the `aliases` argument. Again, you may provide aliases to help users transitioning from other tools/debuggers (e.g. `nearpc [pdisass, u]`).
## The arguments your command will take ## The arguments your command will take
We are using [`argparse.ArgumentParser`](https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser) from the python standard library to define command arguments. Take a look at the python documentation to see how it works. Let's take a look at an example from the source (the [`setflag`](https://pwndbg.re/pwndbg/dev/commands/register/setflag/) command): We are using [`argparse.ArgumentParser`](https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser) from the python standard library to define command arguments. Take a look at the python documentation to see how it works. Let's take a look at an example from the source (the [`setflag`](../commands/register/setflag.md) command):
```python ```python
parser = argparse.ArgumentParser(description="Modify the flags register.") parser = argparse.ArgumentParser(description="Modify the flags register.")
@ -161,7 +161,7 @@ This command supports flags registers that are defined for architectures in the
def setflag(flag: str, value: int) -> None: def setflag(flag: str, value: int) -> None:
# .... # ....
``` ```
When writing this (and the command description for that matter), you should consider what it will [look like in the documentation](https://pwndbg.re/pwndbg/dev/commands/register/setflag/) after being parsed as markdown. When writing this (and the command description for that matter), you should consider what it will [look like in the documentation](../commands/register/setflag.md) after being parsed as markdown.
As for `only_debuggers` and `exclude_debuggers`, you must use (usually one of) them if your command does not work an all debuggers that Pwndbg supports. For instance, if it uses some features from `pwndbg.gdblib` (which should be avoided if at all possible). In such a case, you probably also need to conditionally import it in the `load_commands` function. As for `only_debuggers` and `exclude_debuggers`, you must use (usually one of) them if your command does not work an all debuggers that Pwndbg supports. For instance, if it uses some features from `pwndbg.gdblib` (which should be avoided if at all possible). In such a case, you probably also need to conditionally import it in the `load_commands` function.
## Can your command be invoked all the time? ## Can your command be invoked all the time?

@ -93,7 +93,7 @@ Valid values: 'disabled', 'disabled-deadlock', 'enabled'
``` ```
Note that the last two lines are automatically generated by Pwndbg. Note that the last two lines are automatically generated by Pwndbg.
When writing this explanation, it is important to take into account how it will be displayed [in the documentation](https://pwndbg.re/pwndbg/dev/configuration/) after being parsed as markdown. See what `gdb-workaround-stop-event` looks like here: https://pwndbg.re/pwndbg/dev/configuration/config/#gdb-workaround-stop-event . If there wasn't an empty line between `Values explained:` and ``+ `disabled`..`` the list wouldn't have rendered properly. When writing this explanation, it is important to take into account how it will be displayed [in the documentation](../configuration/index.md) after being parsed as markdown. See what `gdb-workaround-stop-event` looks like [here](../configuration/config.md#gdb-workaround-stop-event). If there wasn't an empty line between `Values explained:` and ``+ `disabled`..`` the list wouldn't have rendered properly.
## param_class ## param_class
This argument describes the type of the parameter. It will be used by GDB to perform input validation when the parameter is being set so it is important to set this to the correct value. The possible values are defined in `pwndbg/lib/config.py`, use the most restrictive one that fits: This argument describes the type of the parameter. It will be used by GDB to perform input validation when the parameter is being set so it is important to set this to the correct value. The possible values are defined in `pwndbg/lib/config.py`, use the most restrictive one that fits:
```python ```python
@ -134,7 +134,7 @@ class Scope(Enum):
theme = 2 theme = 2
heap = 3 heap = 3
``` ```
The parameters of each scope are printed using a different command. The `config` scope is printed with [`config`](https://pwndbg.re/pwndbg/dev/commands/pwndbg/config/), the `heap` scope is printed with [`heap-config`](https://pwndbg.re/pwndbg/dev/commands/pwndbg/heap-config/) and the `theme` scope is printed with [`theme`](https://pwndbg.re/pwndbg/dev/commands/pwndbg/theme/). The `config` and `theme` scopes also have corresponding [`configfile`](https://pwndbg.re/pwndbg/dev/commands/pwndbg/configfile/) and [`themefile`](https://pwndbg.re/pwndbg/dev/commands/pwndbg/themefile/) commands which export the values of all the parameters from those scopes. The parameters of each scope are printed using a different command. The `config` scope is printed with [`config`](../commands/pwndbg/config.md), the `heap` scope is printed with [`heap-config`](../commands/pwndbg/heap-config.md) and the `theme` scope is printed with [`theme`](../commands/pwndbg/theme.md). The `config` and `theme` scopes also have corresponding [`configfile`](../commands/pwndbg/configfile.md) and [`themefile`](../commands/pwndbg/themefile.md) commands which export the values of all the parameters from those scopes.
### The `theme` scope ### The `theme` scope
You should never directly pass this scope to `pwndbg.config.add_param`. Instead use the `pwndbg.color.theme.add_param` and `pwndbg.color.theme.add_color_param` wrapper commands like this: You should never directly pass this scope to `pwndbg.config.add_param`. Instead use the `pwndbg.color.theme.add_param` and `pwndbg.color.theme.add_color_param` wrapper commands like this:
```python ```python

@ -14,7 +14,7 @@ vhs record > my_thingy.tape
Whatever you now do in the terminal will be "recorded" to the `my_thingy.tape` file. Exit the shell to save the recording. The tape probably isn't ready to use as-is. You will want to add some metadata and fixup some lines. Whatever you now do in the terminal will be "recorded" to the `my_thingy.tape` file. Exit the shell to save the recording. The tape probably isn't ready to use as-is. You will want to add some metadata and fixup some lines.
??? example ??? example
This is the tape used to generate the gif at https://pwndbg.re/pwndbg/dev/commands/context/context/ : This is the tape used to generate the gif at https://pwndbg.re/dev/commands/context/context/ :
```bash ```bash
# https://github.com/charmbracelet/vhs # https://github.com/charmbracelet/vhs

@ -1,7 +1,7 @@
# Make LSPs validate the mkdocs format # Make LSPs validate the mkdocs format
# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json # yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json
site_url: https://pwndbg.re/pwndbg/ site_url: https://pwndbg.re/
site_name: Documentation site_name: Documentation
site_description: >- site_description: >-
pwndbg (/paʊnˈdiˌbʌɡ/) is a GDB plug-in that makes debugging with GDB suck less, with a focus on features needed by low-level software developers, hardware hackers, reverse-engineers and exploit developers. pwndbg (/paʊnˈdiˌbʌɡ/) is a GDB plug-in that makes debugging with GDB suck less, with a focus on features needed by low-level software developers, hardware hackers, reverse-engineers and exploit developers.
@ -21,12 +21,12 @@ theme:
text: Roboto text: Roboto
code: Roboto Mono code: Roboto Mono
features: features:
# https://squidfunk.github.io/mkdocs-material/reference/code-blocks/ # https://squidfunk.github.io/mkdocs-material/reference/code-blocks/
# A button to copy code snippets. # A button to copy code snippets.
# - content.code.copy # - content.code.copy
# Enable annotations in code blocks. # Enable annotations in code blocks.
- content.code.annotate - content.code.annotate
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/ # https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/
# Use XHR instead of fully reloading the page when navigating around. # Use XHR instead of fully reloading the page when navigating around.
- navigation.instant - navigation.instant
# Progress bar on page load for slow connections (>400ms). # Progress bar on page load for slow connections (>400ms).
@ -47,17 +47,17 @@ theme:
# - toc.integrate # - toc.integrate
# A button that takes the user to the top of the page. # A button that takes the user to the top of the page.
- navigation.top - navigation.top
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/ # https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/
# Press right arrow to accept search suggestion. # Press right arrow to accept search suggestion.
- search.suggest - search.suggest
# Highlight the search query on the chosen page. # Highlight the search query on the chosen page.
# - search.highlight # - search.highlight
# Add a "share" button to copy a link to the search query. # Add a "share" button to copy a link to the search query.
- search.share - search.share
# https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#code-actions # https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#code-actions
# Adds an edit button to every page that links to the repository. # Adds an edit button to every page that links to the repository.
# - content.action.edit # - content.action.edit
# Extra # Extra
# Sync the content tab selection across the whole site (based on label). # Sync the content tab selection across the whole site (based on label).
- content.tabs.link - content.tabs.link
palette: palette:
@ -77,63 +77,63 @@ plugins:
default_handler: python default_handler: python
handlers: handlers:
python: python:
# https://mkdocstrings.github.io/python/usage/ # https://mkdocstrings.github.io/python/usage/
load_external_modules: false load_external_modules: false
paths: ['pwndbg'] paths: ["pwndbg"]
options: options:
# https://mkdocstrings.github.io/python/usage/configuration/general/ # https://mkdocstrings.github.io/python/usage/configuration/general/
# Allow importing modules to improve doc generation. # Allow importing modules to improve doc generation.
# We have to disable this since many modules can't be imported easily # We have to disable this since many modules can't be imported easily
# as they require gdb/lldb to be running. # as they require gdb/lldb to be running.
allow_inspection: false allow_inspection: false
backlinks: tree backlinks: tree
show_source: false show_source: false
# Show the base classes of a class. # Show the base classes of a class.
show_bases: true show_bases: true
extensions: extensions:
# https://mkdocstrings.github.io/griffe/extensions/ # https://mkdocstrings.github.io/griffe/extensions/
# E.g. converts union types from Union[A, B] to A | B. # E.g. converts union types from Union[A, B] to A | B.
- griffe_modernized_annotations - griffe_modernized_annotations
# https://mkdocstrings.github.io/python/usage/configuration/headings/ # https://mkdocstrings.github.io/python/usage/configuration/headings/
heading_level: 1 heading_level: 1
parameter_headings: false parameter_headings: false
show_root_heading: true show_root_heading: true
show_root_toc_entry: true show_root_toc_entry: true
show_root_full_path: false show_root_full_path: false
show_symbol_type_heading: true show_symbol_type_heading: true
show_symbol_type_toc: true show_symbol_type_toc: true
# https://mkdocstrings.github.io/python/usage/configuration/members # https://mkdocstrings.github.io/python/usage/configuration/members
inherited_members: true inherited_members: true
members_order: source members_order: source
# WARN: Enabling this gives very flaky, hard-to-diagnose errors! Don't. # WARN: Enabling this gives very flaky, hard-to-diagnose errors! Don't.
# filters: public # filters: public
group_by_category: true group_by_category: true
summary: true summary: true
# https://mkdocstrings.github.io/python/usage/configuration/docstrings/ # https://mkdocstrings.github.io/python/usage/configuration/docstrings/
docstring_style: google docstring_style: google
docstring_section_style: list docstring_section_style: list
merge_init_into_class: true merge_init_into_class: true
relative_crossrefs: true relative_crossrefs: true
scoped_crossrefs: true scoped_crossrefs: true
show_if_no_docstring: true show_if_no_docstring: true
# All show_docstring_* options are enabled by default. # All show_docstring_* options are enabled by default.
# https://mkdocstrings.github.io/python/usage/configuration/signatures/ # https://mkdocstrings.github.io/python/usage/configuration/signatures/
line_length: 80 line_length: 80
modernize_annotations: true modernize_annotations: true
show_signature: true show_signature: true
separate_signature: true separate_signature: true
show_signature_annotations: true show_signature_annotations: true
show_overloads: true show_overloads: true
signature_crossrefs: true signature_crossrefs: true
docstring_options: docstring_options:
# https://mkdocstrings.github.io/griffe/reference/docstrings/#google-options # https://mkdocstrings.github.io/griffe/reference/docstrings/#google-options
ignore_init_summary: true ignore_init_summary: true
trim_doctest_flags: true trim_doctest_flags: true
warn_unknown_params: true warn_unknown_params: true
# Generate the whole Source page magically (hooks into mkdocstrings) # Generate the whole Source page magically (hooks into mkdocstrings)
- api-autonav: - api-autonav:
modules: ['pwndbg'] modules: ["pwndbg"]
nav_section_title: "Source" nav_section_title: "Source"
# Documentation versioning # Documentation versioning
@ -146,11 +146,11 @@ plugins:
- awesome-nav: - awesome-nav:
- rss: - rss:
# https://squidfunk.github.io/mkdocs-material/tutorials/blogs/engage/#rss-feeds # https://squidfunk.github.io/mkdocs-material/tutorials/blogs/engage/#rss-feeds
# https://guts.github.io/mkdocs-rss-plugin/configuration/#plugin-options # https://guts.github.io/mkdocs-rss-plugin/configuration/#plugin-options
feed_title: "pwndbg Blog" feed_title: "pwndbg Blog"
# Image doesn't support relative paths :(. # Image doesn't support relative paths :(.
image: https://pwndbg.re/pwndbg/assets/favicon.ico image: https://pwndbg.re/assets/favicon.ico
match_path: blog/posts/.* match_path: blog/posts/.*
date_from_meta: date_from_meta:
as_creation: date as_creation: date
@ -160,7 +160,7 @@ plugins:
# Theme specific template values. # Theme specific template values.
extra: extra:
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-the-footer/ # https://squidfunk.github.io/mkdocs-material/setup/setting-up-the-footer/
# The icons in the footer. # The icons in the footer.
social: social:
- icon: fontawesome/brands/github - icon: fontawesome/brands/github
@ -183,7 +183,7 @@ extra_javascript:
- js/prompt-highlighter.js - js/prompt-highlighter.js
markdown_extensions: markdown_extensions:
# https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/ # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/
- abbr - abbr
- admonition - admonition
- attr_list - attr_list
@ -194,9 +194,9 @@ markdown_extensions:
permalink: "¤" permalink: "¤"
toc_depth: 3 toc_depth: 3
- tables - tables
# https://facelessuser.github.io/pymdown-extensions/ # https://facelessuser.github.io/pymdown-extensions/
# Officially supported are: # Officially supported are:
# https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/ # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/
# Not enabled from the list^ : arithmatex, critic # Not enabled from the list^ : arithmatex, critic
- pymdownx.betterem: - pymdownx.betterem:
smart_enable: all smart_enable: all
@ -231,7 +231,7 @@ markdown_extensions:
slugify: !!python/object/apply:pymdownx.slugs.slugify slugify: !!python/object/apply:pymdownx.slugs.slugify
kwds: kwds:
case: lower case: lower
# Not officially supported: # Not officially supported:
- pymdownx.magiclink: - pymdownx.magiclink:
repo_url_shortener: true repo_url_shortener: true
repo_url_shorthand: true repo_url_shorthand: true
@ -239,6 +239,5 @@ markdown_extensions:
user: pwndbg user: pwndbg
repo: pwndbg repo: pwndbg
- pymdownx.tasklist - pymdownx.tasklist
# We intentionally do not include `nav:` so that it gets autogenerated using # We intentionally do not include `nav:` so that it gets autogenerated using
# the folder structure. See also docs/.nav.yml # the folder structure. See also docs/.nav.yml

@ -5,7 +5,7 @@ Takes the debugging primitives provided by the Debugger API
and builds the more complex and interesting bits of functionality and builds the more complex and interesting bits of functionality
found in Pwndbg on top of them. found in Pwndbg on top of them.
See https://pwndbg.re/pwndbg/dev/contributing/dev-notes/#aglib See https://pwndbg.re/dev/contributing/dev-notes/#aglib
for more information. for more information.
""" """

@ -13,7 +13,7 @@ parser = argparse.ArgumentParser(
Dump internal PwndbgInstruction attributes. Dump internal PwndbgInstruction attributes.
Useful for debugging the disassembly and annotation subsystems Useful for debugging the disassembly and annotation subsystems
in Pwndbg. See https://pwndbg.re/pwndbg/dev/contributing/improving-annotations/#bug-root-cause in Pwndbg. See https://pwndbg.re/dev/contributing/improving-annotations/#bug-root-cause
for more information. for more information.
""" """
) )

@ -34,7 +34,7 @@ PWNDBG_TIPS: List[str] = [
"Pwndbg context displays where the program branches to thanks to emulating few instructions into the future. You can disable this with `set emulate off` which may also speed up debugging", "Pwndbg context displays where the program branches to thanks to emulating few instructions into the future. You can disable this with `set emulate off` which may also speed up debugging",
"Use the `canary` command to see all stack canary/cookie values on the stack (based on the *usual* stack canary value initialized by glibc)", "Use the `canary` command to see all stack canary/cookie values on the stack (based on the *usual* stack canary value initialized by glibc)",
"Use the `procinfo` command for better process introspection (than the GDB's `info proc` command)", "Use the `procinfo` command for better process introspection (than the GDB's `info proc` command)",
"Want to display each context panel in a separate tmux window? See https://pwndbg.re/pwndbg/latest/tutorials/splitting-the-context/", "Want to display each context panel in a separate tmux window? See https://pwndbg.re/latest/tutorials/splitting-the-context/",
'Use `$base("heap")` to get the start address of a [heap] memory page', 'Use `$base("heap")` to get the start address of a [heap] memory page',
"Use the `errno` (or `errno <number>`) command to see the name of the last or provided (libc) error", "Use the `errno` (or `errno <number>`) command to see the name of the last or provided (libc) error",
"Pwndbg sets the SIGLARM, SIGBUS, SIGPIPE and SIGSEGV signals so they are not passed to the app; see `info signals` for full GDB signals configuration", "Pwndbg sets the SIGLARM, SIGBUS, SIGPIPE and SIGSEGV signals so they are not passed to the app; see `info signals` for full GDB signals configuration",

@ -245,7 +245,7 @@ configure_venv() {
if osx; then if osx; then
echo "Not supported on macOS. Please use one of the alternative methods listed at:" echo "Not supported on macOS. Please use one of the alternative methods listed at:"
echo "https://pwndbg.re/pwndbg/dev/contributing/setup-pwndbg-dev/" echo "https://pwndbg.re/dev/contributing/setup-pwndbg-dev/"
exit 1 exit 1
fi fi

@ -122,7 +122,7 @@ PYTHON=''
if osx; then if osx; then
echo "Not supported on macOS. Please use one of the alternative methods listed at:" echo "Not supported on macOS. Please use one of the alternative methods listed at:"
echo "https://pwndbg.re/pwndbg/dev/contributing/setup-pwndbg-dev/" echo "https://pwndbg.re/dev/contributing/setup-pwndbg-dev/"
exit 1 exit 1
fi fi

Loading…
Cancel
Save