Skip to content

Commit

Permalink
master -> main (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed Jun 20, 2022
1 parent 0fcd20a commit f890579
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Expand Up @@ -2,7 +2,7 @@

### License ###

`gef` is placed under [license MIT](https://github.com/hugsy/gef/blob/master/LICENSE) which provides Open-Source access to the code and its use.
`gef` is placed under [license MIT](https://github.com/hugsy/gef/blob/main/LICENSE) which provides Open-Source access to the code and its use.

By contributing to `gef` code through the _Pull Requests_ mechanism, you accept to release the code written by you under the said license.

Expand All @@ -16,7 +16,7 @@ By contributing to `gef` code through the _Pull Requests_ mechanism, you accept
* Comment your code
* If you add a new feature/GDB command, also write the adequate
documentation (in [`docs/`](docs/))
1. Submit a pull request, **make sure it is made against the `dev` branch (not `master`, which only contains tested and stable features)**
1. Submit a pull request, **make sure it is made against the `dev` branch (not `main`, which only contains tested and stable features)**
1. The contributors will review your patch. If it is approved, the change will
be merged via the GitHub, and you will be seen as contributors. If it needs
additional work, the repo owner will respond with useful comments.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -27,7 +27,7 @@

<!-- N.B.: Your patch won't be reviewed unless fulfilling the following base requirements: -->
<!--- Put an `x` in all the boxes that are complete, or that don't apply -->
- [ ] My PR was done against the `dev` branch, not `master`.
- [ ] My PR was done against the `dev` branch, not `main`.
- [ ] My code follows the code style of this project.
- [ ] My change includes a change to the documentation, if required.
- [ ] If my change adds new code, [adequate tests](docs/testing.md) have been added.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/discord-notify.yml
Expand Up @@ -4,12 +4,12 @@ name: "Discord Notification"
on:
push:
branches:
- master
- main
- dev

pull_request:
branches:
- master
- main
- dev

env:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/generate-docs.yml
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- dev
- main
- master

jobs:
deploy:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Expand Up @@ -3,12 +3,12 @@ name: CI Test for GEF
on:
push:
branches:
- master
- main
- dev

pull_request:
branches:
- master
- main
- dev

jobs:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -43,10 +43,10 @@ You can immediately see that GEF is correctly installed by launching GDB:
A few of `GEF` features include:

* **One** single GDB script
* Entirely **OS Agnostic**, **NO** dependencies: `GEF` is battery-included and [is installable instantly](https://hugsy.github.io/gef/master/#setup)
* Entirely **OS Agnostic**, **NO** dependencies: `GEF` is battery-included and [is installable instantly](https://hugsy.github.io/gef/#setup)
* **Fast** limiting the number of dependencies and optimizing code to make the commands as fast as possible
* Provides a great variety of commands to drastically change your experience in GDB.
* [**Easily** extensible](https://hugsy.github.io/gef/master/api/) to create other commands by providing more comprehensible layout to GDB Python API.
* [**Easily** extensible](https://hugsy.github.io/gef/api/) to create other commands by providing more comprehensible layout to GDB Python API.
* Full Python3 support ([Python2 support was dropped](https://github.com/hugsy/gef/releases/tag/2020.03) - see [`gef-legacy`](https://github.com/hugsy/gef-legacy)).
* Built around an architecture abstraction layer, so all commands work in any GDB-supported architecture such as x86-32/64, ARMv5/6/7, AARCH64, SPARC, MIPS, PowerPC, etc.
* Suited for real-life apps debugging, exploit development, just as much as CTF
Expand All @@ -61,9 +61,9 @@ Unlike other GDB plugins, GEF has an extensive and up-to-date [documentation](ht

## Current status ##

| Documentation |License | Compatibility | CI Tests (`master`) | CI Tests (`dev`) |
| Documentation |License | Compatibility | CI Tests (`main`) | CI Tests (`dev`) |
|:---:|:---:|:---|--|--|
| [![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/master/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/run-tests.yml/badge.svg)](https://github.com/hugsy/gef/actions/workflows/run-tests.yml) | [![CI Test for GEF](https://github.com/hugsy/gef/actions/workflows/run-tests.yml/badge.svg?branch=dev)](https://github.com/hugsy/gef/actions/workflows/run-tests.yml) |
| [![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/run-tests.yml/badge.svg)](https://github.com/hugsy/gef/actions/workflows/run-tests.yml) | [![CI Test for GEF](https://github.com/hugsy/gef/actions/workflows/run-tests.yml/badge.svg?branch=dev)](https://github.com/hugsy/gef/actions/workflows/run-tests.yml) |


## Contribute ##
Expand Down
4 changes: 2 additions & 2 deletions docs/api.md
Expand Up @@ -8,7 +8,7 @@ quickly create their own commands. This page intends to summarize how to
create advanced GDB commands in moments using `GEF` as a library.

A [dedicated repository](https://github.com/hugsy/gef-extras) was born to host
[external scripts](https://github.com/hugsy/gef-extras/tree/master/scripts). This
[external scripts](https://github.com/hugsy/gef-extras/tree/main/scripts). This
repo is open to all for contributions, no restrictions and the most valuable
ones will be integrated into `gef.py`.

Expand Down Expand Up @@ -219,7 +219,7 @@ args.blah --> True # set to True because user input declared the option (would h
Support for new architectures can be added by inheriting from the `Architecture` class. To register the new architecture with gef, the decorator `@register_architecture` has to be added to the class. Examples can be found in [gef-extras](https://github.com/hugsy/gef-extras/tree/dev/archs).

Sometimes architectures can more precisely determine whether they apply to the current target by looking at the architecture determined by gdb. For these cases the custom architecture may implement the `supports_gdb_arch()` static function to signal that they should be used instead of the default. The function receives only one argument:
- `gdb_str` (of type `str`) which is the architecture name as reported by GDB.
- `gdb_str` (of type `str`) which is the architecture name as reported by GDB.

The function **must** return:
- `True` if the current `Architecture` class supports the target binary; `False` otherwise.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/gef.md
Expand Up @@ -57,7 +57,7 @@ Basic HTTP wrapper for GET request. Return the body of the page if HTTP code is
update_gef(argv: List[str]) → int
```

Try to update `gef` to the latest version pushed on GitHub master branch. Return 0 on success, 1 on failure.
Try to update `gef` to the latest version pushed on GitHub main branch. Return 0 on success, 1 on failure.


---
Expand Down
10 changes: 5 additions & 5 deletions docs/commands/gef.md
Expand Up @@ -120,21 +120,21 @@ gef➤ gef run ./binary
gef➤ gef install SCRIPTNAME1 [SCRIPTNAME2...]
```

Where `SCRIPTNAME1` ... are the names of script from the [`gef-extras` repository](https://github.com/hugsy/gef-extras/tree/master/scripts/).
Where `SCRIPTNAME1` ... are the names of script from the [`gef-extras` repository](https://github.com/hugsy/gef-extras/tree/main/scripts/).


```
gef➤ gef install remote windbg stack
[+] Searching for 'remote.py' in `gef-extras@master`...
[+] Searching for 'remote.py' in `gef-extras@main`...
[+] Installed file '/tmp/gef/remote.py', new command(s) available: `rpyc-remote`
[+] Searching for 'windbg.py' in `gef-extras@master`...
[+] Searching for 'windbg.py' in `gef-extras@main`...
[+] Installed file '/tmp/gef/windbg.py', new command(s) available: `pt`, `hh`, `tt`, `ptc`, `sxe`, `u`, `xs`, `tc`, `pc`, `g`, `r`
[+] Searching for 'stack.py' in `gef-extras@master`...
[+] Searching for 'stack.py' in `gef-extras@main`...
[+] Installed file '/tmp/gef/stack.py', new command(s) available: `current-stack-frame`
gef➤
```

This makes it easier to deploy new functionalities in limited environment. By default, the command looks up for script names in the `master` branch of `gef-extras`. However you can change specify a different branch through the `gef.default_branch` configuration setting:
This makes it easier to deploy new functionalities in limited environment. By default, the command looks up for script names in the `main` branch of `gef-extras`. However you can change specify a different branch through the `gef.default_branch` configuration setting:

```
gef➤ gef config gef.default_branch dev
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/pcustom.md
Expand Up @@ -2,7 +2,7 @@

`gef` provides a way to create and apply to the currently debugged environment, any new structure (in the C-struct way). On top of simply displaying known and user-defined structures, it also allows to apply those structures to the current context. It intends to mimic the very useful [WinDBG `dt`](https://msdn.microsoft.com/en-us/library/windows/hardware/ff542772(v=vs.85).aspx) command.

This is achieved via the command `pcustom` (for `print custom`), or you can use its alias, `dt` (in reference to the WinDBG command) as provided by the [`WinDbg compatibility extension`](https://github.com/hugsy/gef-extras/blob/master/scripts/windbg.py)
This is achieved via the command `pcustom` (for `print custom`), or you can use its alias, `dt` (in reference to the WinDBG command) as provided by the [`WinDbg compatibility extension`](https://github.com/hugsy/gef-extras/blob/main/scripts/windbg.py)


### Configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/trace-run.md
Expand Up @@ -3,7 +3,7 @@
The `trace-run` command is meant to be provide a visual appreciation directly
in IDA disassembler of the path taken by a specific execution. It should be
used with the IDA script
[`ida_color_gdb_trace.py`](https://github.com/hugsy/stuff/blob/master/ida_scripts/ida_color_gdb_trace.py)
[`ida_color_gdb_trace.py`](https://github.com/hugsy/stuff/blob/main/ida_scripts/ida_color_gdb_trace.py)

It will trace and store all values taken by `$pc` during the execution flow,
from its current value, until the value provided as argument.
Expand Down
4 changes: 2 additions & 2 deletions docs/compat.md
Expand Up @@ -7,8 +7,8 @@ This matrix indicates the version of Python and/or GDB
| [2018.02](https://github.com/hugsy/gef/releases/tag/2018.02) | 7.2 | Python 2.7, Python 3.4+ |
| [2020.03](https://github.com/hugsy/gef/releases/tag/2020.03) | 7.4 | Python 2.7, Python 3.4+ |
| [2022.01](https://github.com/hugsy/gef/releases/tag/2021.01) | 7.7 | Python 3.4+ |
| [Current](https://github.com/hugsy/gef/tree/master) | 8.0+ | Python 3.6+ |
| [Current](https://github.com/hugsy/gef/tree/main) | 8.0+ | Python 3.6+ |



* Up to - included
* Up to - included
2 changes: 1 addition & 1 deletion docs/faq.md
Expand Up @@ -80,7 +80,7 @@ Src: [@rick2600: terminator + gdb + gef + voltron cc: @snare @_hugsy_](https://t

I would suggest thoroughly reading this documentation, just having a look to
the
[CONTRIBUTE](https://github.com/hugsy/gef/blob/master/.github/CONTRIBUTING.md)
[CONTRIBUTE](https://github.com/hugsy/gef/blob/main/.github/CONTRIBUTING.md)
file of the project to give you pointers.

Also a good thing would be to join our [Discord
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
@@ -1,6 +1,6 @@
# GEF - GDB Enhanced Features #

[![Docs](https://img.shields.io/badge/Documentation-blue.svg)](https://hugsy.github.io/gef/) [![MIT](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=plastic)](https://github.com/hugsy/gef/blob/master/LICENSE) [![Python 3](https://img.shields.io/badge/Python-3-green.svg)](https://github.com/hugsy/gef/) [![Discord](https://img.shields.io/badge/Discord-GDB--GEF-yellow)](https://discord.gg/HCS8Hg7)
[![Docs](https://img.shields.io/badge/Documentation-blue.svg)](https://hugsy.github.io/gef/) [![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/) [![Discord](https://img.shields.io/badge/Discord-GDB--GEF-yellow)](https://discord.gg/HCS8Hg7)

`GEF` (pronounced ʤɛf - "Jeff") is a kick-ass set of commands for X86, ARM,
MIPS, PowerPC and SPARC to make GDB cool again for exploit dev. It is aimed to
Expand Down
10 changes: 5 additions & 5 deletions docs/install.md
Expand Up @@ -72,7 +72,7 @@ $ python ~/.gdbinit-gef.py --update
Updated
```

This will deploy the latest version of `gef`'s _master_ branch from Github. If no updates are available, `gef` will respond `No update` instead.
This will deploy the latest version of `gef`'s _main_ branch from Github. If no updates are available, `gef` will respond `No update` instead.

## Using git

Expand All @@ -85,13 +85,13 @@ $ echo source `pwd`/gef/gef.py >> ~/.gdbinit

GEF is in very active development, so the default branch is `dev`. This is the branch you must use if you intend to submit pull requests.

However if you prefer a more stable life, you can then switch to the `master` branch:
However if you prefer a more stable life, you can then switch to the `main` branch:

```bash
$ git checkout master
$ git checkout main
```

The `master` branch gets only updated for new releases, or also when critical fixes occur and need to be patched urgently.
The `main` branch gets only updated for new releases, or also when critical fixes occur and need to be patched urgently.


## Community repository: GEF-Extras
Expand All @@ -102,7 +102,7 @@ To benefit from it:
```bash
# using the automated way
## via the install script
$ bash -c "$(wget https://github.com/hugsy/gef/raw/master/scripts/gef-extras.sh -O -)"
$ bash -c "$(wget https://github.com/hugsy/gef/raw/main/scripts/gef-extras.sh -O -)"

# or manually
## clone the repo
Expand Down
6 changes: 3 additions & 3 deletions gef.py
Expand Up @@ -98,7 +98,7 @@ def http_get(url: str) -> Optional[bytes]:


def update_gef(argv: List[str]) -> int:
"""Try to update `gef` to the latest version pushed on GitHub master branch.
"""Try to update `gef` to the latest version pushed on GitHub main branch.
Return 0 on success, 1 on failure. """
ver = "dev" if "--dev" in argv else GEF_DEFAULT_BRANCH
latest_gef_data = http_get(f"https://raw.githubusercontent.com/hugsy/gef/{ver}/scripts/gef.sh")
Expand Down Expand Up @@ -154,8 +154,8 @@ def update_gef(argv: List[str]) -> int:

PATTERN_LIBC_VERSION = re.compile(rb"glibc (\d+)\.(\d+)")

GEF_DEFAULT_BRANCH = "master"
GEF_EXTRAS_DEFAULT_BRANCH = "master"
GEF_DEFAULT_BRANCH = "main"
GEF_EXTRAS_DEFAULT_BRANCH = "main"

gef : "Gef"
__registered_commands__ : List[Type["GenericCommand"]] = []
Expand Down
2 changes: 1 addition & 1 deletion scripts/gef.sh
Expand Up @@ -2,7 +2,7 @@

set -e

branch="master"
branch="main"
if [ "$1" = "dev" ]; then
branch="dev"
echo "set branch to dev"
Expand Down
2 changes: 1 addition & 1 deletion tests/api/misc.py
Expand Up @@ -57,7 +57,7 @@ def test_func_download_file(self):
@pytest.mark.skip
def test_func_update_gef(self):
bkp_home = os.environ["HOME"]
for branch in ("master", "dev"):
for branch in ("main", "dev"):
with tempfile.TemporaryDirectory() as tmpdir:
dirpath = pathlib.Path(tmpdir)
os.environ["HOME"] = str(dirpath.absolute())
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/syscall_args.py
Expand Up @@ -27,7 +27,7 @@ def setUp(self) -> None:
self.tempdirfd = tempfile.TemporaryDirectory(prefix=GEF_DEFAULT_TEMPDIR)
self.tempdirpath = pathlib.Path(self.tempdirfd.name).absolute()
# download some syscall tables from gef-extras
base = "https://raw.githubusercontent.com/hugsy/gef-extras/master/syscall-tables"
base = "https://raw.githubusercontent.com/hugsy/gef-extras/main/syscall-tables"
# todo: maybe add "PowerPC", "PowerPC64", "SPARC", "SPARC64"
for arch in ("ARM", "ARM_OABI", "X86", "X86_64"):
url = f"{base}/{arch}.py"
Expand Down

0 comments on commit f890579

Please sign in to comment.