Commit Graph

32 Commits

Author SHA1 Message Date
patryk4815 c80793f41e
add python3.10, add debian12, drop python3.8, drop ubuntu20.04, drop debian11 (#2421)
* drop ubuntu-20.04

* bump debian11->debian12

* bump python3.8->3.10

* bump py3.10 dependencies

* fix mypy/lint errors
2024-09-05 13:55:16 +02:00
Matt. c2bf902ea7
Port Pwndbg to LLDB (#2382)
* Port Pwndbg to LLDB

* Fix splitting mistakes

* I love typos

* We already check for Python 3.11 manually

* Update pwndbg/dbg/lldb/__init__.py

Co-authored-by: patryk4815 <bux.patryk@gmail.com>

* Fix use of wrong variable name that was preventing the vmmap from being used in LLDB memory reads

* Use cached vmmap for `read_memory` in LLDB

* Fix Pwndbg CLI jank

* Try using SBAddress to resolve objfile names in LLDB vmmap

* Fix missing changes in `pwndbg.gdblib`

* Update pwndbg/aglib/arch.py

* Update pwndbg/aglib/arch.py

* Remove outdated comment about `pwndbg.aglib.arch`

* Update pwndbg/dbg/lldb/repl/io.py

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>

* Fix lints

* Fix new test so that it points to `pwndbg.aglib.disasm`

* Fix lints

---------

Co-authored-by: patryk4815 <bux.patryk@gmail.com>
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2024-09-01 02:12:56 +02:00
Matt 4e5e44b3fb
Add initialization under LLDB (#2253) 2024-06-24 11:37:15 -07:00
Gulshan Singh 6cb96632a4
Cleanup gdbinit.py (#2239) 2024-06-19 22:25:55 -07:00
Gulshan Singh bf091df527
Make sure the vermin linter runs on all files (#2231) 2024-06-13 00:35:02 -07:00
Aaron Adams 9fe3a87b52
Fix lint script shebang, args, and nix env checks (#2167)
* Fix lint script shebang, args, and nix env checks

* Update lint.sh: fix lint issues

* Update lint.sh

Fix linting issue

---------

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2024-05-21 07:12:06 -07:00
peace-maker 90dc42e5b2
Additional type hints (#2120)
* Additional type hints

Activate `vermin --eval-annotations` to catch invalid type hints for Python 3.8.

Use `typing_extensions.ParamSpec` to avoid hiding function arguments through decorators.

* Fix safe linking detection

* Fix cast of glibc_version parameter in < Python 3.10

* Use "queue.Queue[int]" for Python 3.8 compatibility

* Address review

* Add comments and address review
2024-05-13 13:39:20 -07:00
Gulshan Singh 060106b1e6
Switch from `black` to `ruff format` in lint script (#2130)
* Update ruff version

* Switch from black to ruff format

* Reformat with ruff format

* Remove dependency on black
2024-04-25 13:29:19 +02:00
Divyansh Singh a75b150242
show `mypy` errors inline on PRs (#2075)
show mypy errors inline on PRs

---------

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Co-authored-by: intrigus-lgtm <60750685+intrigus-lgtm@users.noreply.github.com>
Co-authored-by: Gulshan Singh <gsingh2011@gmail.com>
2024-03-21 10:32:18 -07:00
Gulshan Singh da817b2378
Install dev dependencies with poetry (#2065)
* Add dev dependencies to pyproject.toml

* Add poetry.toml file

* Remove dev-requirements and install dev dependencies with poetry

* Update pwndbg.nix
2024-03-11 17:42:16 +01:00
Gulshan Singh 45665e823c
Make ruff output in github format if running on CI (#2070) 2024-03-06 09:41:23 -08:00
Gulshan Singh 3e855ad220
Allow fixing ruff errors in lint.sh (#2047) 2024-03-02 13:56:37 -08:00
Gulshan Singh 5ab3ed0888
Update dev requirements (#2046)
* Update dev-requirements

* Reformat after black upgrade

* Update ruff configuration after version upgrade

* Fix new ruff errors
2024-03-02 11:20:14 -08:00
Gulshan Singh 4191ceb5ec
Fix lint.sh (#2030) 2024-02-26 00:02:50 +01:00
Gulshan Singh c26832243c
Don't lint .venv files (#2028) 2024-02-24 16:43:28 -08:00
disconnect3d 03327ff510 lint.sh: use tools from .venv 2023-08-06 17:10:35 +02:00
Disconnect3d 9e9f328ccc
Update code to Python >= 3.8 (#1840)
* isort: import __future__ annotations & pyupgrade to 3.8

* dev-requirements.txt: update vermin to 1.5.2 & dont use --quiet

* pyupgrade 3.8 fixes

* fixes

* update vermin to 3.8-
2023-07-26 02:08:39 +02:00
Gulshan Singh 487afacc7a
Switch from flake8 to ruff (#1696) 2023-05-04 00:42:40 -07:00
Disconnect3d afa96abfa0
lint.sh: vermin -vvv instead of -vvvv (#1556)
My previous commit to this had a typo and used -vvvv instead of -vvv.

The -vvvv is imho a little bit too verbose and we should rather use -vvv only.
2023-01-30 21:46:38 +01:00
Disconnect3d 945f12a267 lint.sh vermin: use -vvv --no-tips
Adds `-vvvv --no-tips` to vermin invocation, so on CI instaed of seeing:

```
+ vermin -q -t=3.6 --violations ./pwndbg/
!2, 3.10     /home/runner/work/pwndbg/pwndbg/pwndbg/disasm/__init__.py
  union types as `X | Y` require !2, 3.10
```

We will now see:

```
+ vermin -vvv --no-tips -q -t=3.6 --violations ./pwndbg/
!2, 3.10     ./pwndbg/
Detecting python files..
Analyzing using 16 processes..
!2, 3.10     /home/runner/work/pwndbg/pwndbg/pwndbg/disasm/__init__.py
  L227: union types as `X | Y` require !2, 3.10

Minimum required versions: 3.10
Incompatible versions:     2
Target versions not met:   3.6
```
2023-01-29 23:50:57 -08:00
Gulshan Singh bc59a8eddd
Fix memoize type issues and enable mypy in lint script (#1518)
* memoize type fixes

* Add mypy to lint script

* Add mypy to dev-requirements.txt
2023-01-11 13:39:30 +01:00
Gulshan Singh ac5a6ebe64
Minor lint and pre-hook changes (#1349) 2022-10-25 17:46:53 -07:00
Gulshan Singh 7efaa33b0c
Install shfmt on Ubuntu 22.04, otherwise skip running linter (#1323) 2022-10-23 01:33:00 +02:00
Gulshan Singh bb3a7bfcb5 Add quiet flag to vermin 2022-10-22 02:27:22 -07:00
Gulshan Singh 85f4373737 Try to install missing lint dependencies 2022-10-22 02:27:22 -07:00
Filip Mazur e3c2b87239
Implementing vermin into CI (#1319) 2022-10-22 02:15:44 -07:00
Disconnect3d c74a551a6d
lint.sh: lint only pwndbg files (#1312) 2022-10-20 17:35:29 -07:00
Gulshan Singh 6af4753d8e
Add support for formatting the code directly from lint.sh (#1140) 2022-09-09 22:45:18 +02:00
Gulshan Singh 544ea0eab7
Linting/formatting improvements (#1138)
* Fix flake8 F403 warnings

* Fix more flake8 errors and warnings

* Run isort on the root directory
2022-09-09 04:46:46 +02:00
Disconnect3d b7ddf3a070
fix #1111 errno command edge case (#1126)
* fix #1111 errno command edge case

This commit fixes the case when errno command causes a binary to
segfault when the `__errno_location` symbol was defined but its .plt.got
entry was not filled yet by the dynamic loader (ld.so), so e.g. when the
glibc library was not loaded yet.

In such a case, us triggering a call to `__errno_location` function
triggered a jump to an unmapped address. Now, we dereference that
.plt.got symbol and see if it lives in mapped memory.

* add tip about errno command

* errno: fix case when __errno_location@got.plt is missing

* fix lint

* fix sh lint

* fix errno test
2022-09-05 14:56:37 +02:00
Gulshan Singh cc50024417
Format shell scripts with shfmt (#1123)
* Add lint.sh script

* Format shell scripts with shfmt and add to lint.sh

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2022-09-05 13:24:52 +02:00
Gulshan Singh bbf1397a2b
Add lint.sh script (#1122) 2022-09-05 13:18:40 +02:00