2023-05-04 15:42:40 +08:00
|
|
|
[tool.ruff]
|
2024-03-03 03:20:14 +08:00
|
|
|
line-length = 100
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
2023-05-04 15:42:40 +08:00
|
|
|
ignore = [
|
|
|
|
"A003",
|
|
|
|
"E402",
|
|
|
|
"E501",
|
|
|
|
"E731",
|
|
|
|
"F405",
|
|
|
|
"F821",
|
|
|
|
"W505",
|
|
|
|
]
|
2024-03-03 03:20:14 +08:00
|
|
|
|
2023-05-04 15:42:40 +08:00
|
|
|
select = [
|
2024-03-03 06:22:10 +08:00
|
|
|
"A", # flake8-builtins
|
|
|
|
"E", # pycodestyle
|
|
|
|
"F", # pyflakes
|
|
|
|
"W", # pycodestyle
|
|
|
|
"C4", # flake8-comprehensions
|
|
|
|
"ISC", # flake8-implicit-str-concat
|
|
|
|
"SLOT", # flake8-slots
|
|
|
|
"FLY", # flynt
|
|
|
|
"PGH", # pygrep-hooks
|
|
|
|
"RET506", # flake8-return: superfluous-else-raise
|
|
|
|
"RET507", # flake8-return: superfluous-else-continue
|
|
|
|
"RET508", # flake8-return: superfluous-else-break
|
|
|
|
# We want to enable the below lints, but they currently return too many errors
|
|
|
|
# "RET505", # flake8-return: superfluous-else-return
|
|
|
|
# "SLF" # flake8-self
|
|
|
|
# "SIM", # flake8-simplify
|
|
|
|
# "PTH", # flake8-use-pathlib
|
2023-05-04 15:42:40 +08:00
|
|
|
]
|
|
|
|
|
2024-03-03 03:20:14 +08:00
|
|
|
[tool.ruff.lint.flake8-builtins]
|
2023-05-04 15:42:40 +08:00
|
|
|
builtins-ignorelist = [
|
|
|
|
"all",
|
|
|
|
"bin",
|
|
|
|
"breakpoint",
|
|
|
|
"copyright",
|
|
|
|
"dir",
|
|
|
|
"exit",
|
|
|
|
"format",
|
|
|
|
"hex",
|
|
|
|
"map",
|
|
|
|
"max",
|
|
|
|
"min",
|
|
|
|
"next",
|
|
|
|
"type",
|
|
|
|
]
|
|
|
|
|
2024-03-03 03:20:14 +08:00
|
|
|
[tool.ruff.lint.per-file-ignores]
|
2023-05-04 15:42:40 +08:00
|
|
|
"__init__.py" = ["F401"]
|
|
|
|
|
2022-12-26 15:17:47 +08:00
|
|
|
[tool.mypy]
|
|
|
|
strict_optional = false
|
2022-12-27 08:10:26 +08:00
|
|
|
check_untyped_defs = true
|
2024-03-05 01:39:02 +08:00
|
|
|
allow_untyped_globals = false
|
2022-12-26 15:17:47 +08:00
|
|
|
allow_redefinition = true
|
2024-03-03 02:56:21 +08:00
|
|
|
allow_any_generics = false
|
2022-12-27 08:10:26 +08:00
|
|
|
warn_redundant_casts = true
|
|
|
|
warn_unused_ignores = true
|
|
|
|
warn_no_return = true
|
|
|
|
# warn_return_any = true
|
|
|
|
# warn_unreachable = true
|
2022-12-26 15:17:47 +08:00
|
|
|
show_error_context = true
|
|
|
|
pretty = true
|
|
|
|
show_error_codes = true
|
|
|
|
incremental = false
|
|
|
|
disable_error_code = [
|
2022-12-27 07:33:34 +08:00
|
|
|
# https://github.com/python/mypy/issues/6232
|
2023-01-11 20:39:30 +08:00
|
|
|
"assignment"
|
2022-12-27 07:33:34 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = [
|
2024-03-05 02:58:26 +08:00
|
|
|
"pwndbg.gdblib.elf",
|
2024-09-01 08:12:56 +08:00
|
|
|
"pwndbg.aglib.elf",
|
2022-12-26 15:17:47 +08:00
|
|
|
]
|
2022-12-27 07:33:34 +08:00
|
|
|
disable_error_code = ["name-defined"]
|
2022-12-26 15:17:47 +08:00
|
|
|
|
2024-03-05 02:58:26 +08:00
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = [
|
2024-09-01 08:12:56 +08:00
|
|
|
"pwndbg.aglib.arch",
|
2024-03-05 02:58:26 +08:00
|
|
|
"pwndbg.color.*",
|
|
|
|
"pwndbg.commands.context",
|
|
|
|
"pwndbg.commands.cymbol",
|
|
|
|
"pwndbg.commands.hexdump",
|
|
|
|
"pwndbg.commands.procinfo",
|
|
|
|
"pwndbg.commands.reload",
|
|
|
|
"pwndbg.commands.version",
|
|
|
|
"pwndbg.exception",
|
|
|
|
"pwndbg.gdblib.dt",
|
2024-09-01 08:12:56 +08:00
|
|
|
"pwndbg.aglib.dynamic",
|
2024-03-05 02:58:26 +08:00
|
|
|
"pwndbg.gdblib.events",
|
|
|
|
"pwndbg.gdblib.got",
|
|
|
|
"pwndbg.gdblib.heap_tracking",
|
|
|
|
"pwndbg.gdblib.stack",
|
2024-09-01 08:12:56 +08:00
|
|
|
"pwndbg.aglib.heap.*",
|
2024-03-05 02:58:26 +08:00
|
|
|
"pwndbg.hexdump",
|
|
|
|
"pwndbg.ui",
|
|
|
|
"pwndbg.wrappers.*",
|
|
|
|
]
|
|
|
|
disable_error_code = ["attr-defined"]
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = [
|
2024-09-01 08:12:56 +08:00
|
|
|
"pwndbg.commands.telescope",
|
|
|
|
]
|
|
|
|
disable_error_code = ["attr-defined", "index"]
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = [
|
|
|
|
"pwndbg.aglib.nearpc",
|
|
|
|
"pwndbg.aglib.typeinfo",
|
2024-03-05 02:58:26 +08:00
|
|
|
"pwndbg.gdblib.nearpc",
|
|
|
|
"pwndbg.gdblib.typeinfo",
|
|
|
|
]
|
|
|
|
disable_error_code = ["name-defined", "attr-defined"]
|
|
|
|
|
2023-01-05 16:12:03 +08:00
|
|
|
[[tool.mypy.overrides]]
|
2024-09-01 08:12:56 +08:00
|
|
|
module = [
|
|
|
|
"pwndbg.aglib.disasm.*",
|
|
|
|
]
|
|
|
|
disable_error_code = ["index", "name-defined", "attr-defined"]
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = ["capstone.*", "unicorn.*", "pwnlib.*", "elftools.*", "ipdb.*", "r2pipe", "rzpipe", "rich.*", "pt_gdb", "lldb.*", "gnureadline"]
|
2023-01-05 16:12:03 +08:00
|
|
|
ignore_missing_imports = true
|
|
|
|
|
2022-08-30 08:53:00 +08:00
|
|
|
[tool.isort]
|
|
|
|
profile = "black"
|
2022-08-31 02:45:10 +08:00
|
|
|
force_single_line = true
|
2024-06-22 03:31:38 +08:00
|
|
|
known_third_party = ["capstone", "unicorn", "psutil", "pycparser", "gdb", "lldb"]
|
2023-07-26 08:08:39 +08:00
|
|
|
add_imports = "from __future__ import annotations"
|
2022-10-19 04:17:19 +08:00
|
|
|
|
|
|
|
[tool.coverage.run]
|
|
|
|
branch = true
|
|
|
|
parallel = true
|
|
|
|
disable_warnings = ["module-not-imported"]
|
2022-10-19 06:41:53 +08:00
|
|
|
source = ["${SRC_DIR-.}"]
|
2022-10-19 04:17:19 +08:00
|
|
|
omit = ["ida_script.py"]
|
2022-10-19 04:45:43 +08:00
|
|
|
data_file = ".cov/coverage"
|
2022-10-19 06:41:53 +08:00
|
|
|
|
|
|
|
[tool.coverage.report]
|
|
|
|
omit = ["ida_script.py", "tests/*"]
|
2023-01-12 04:17:14 +08:00
|
|
|
|
2023-08-06 20:27:30 +08:00
|
|
|
[tool.poetry]
|
|
|
|
name = "pwndbg"
|
|
|
|
description = "Exploit Development and Reverse Engineering with GDB Made Easy"
|
2024-08-30 00:25:21 +08:00
|
|
|
version = "2024.08.29"
|
2023-08-06 20:27:30 +08:00
|
|
|
authors = ["Dominik 'disconnect3d' Czarnota <dominik.b.czarnota+dc@gmail.com>"]
|
|
|
|
readme = "README.md"
|
|
|
|
packages = [
|
|
|
|
{ include = "pwndbg" },
|
|
|
|
]
|
|
|
|
|
|
|
|
[tool.poetry.dependencies]
|
|
|
|
python = "^3.8"
|
2024-04-29 01:32:18 +08:00
|
|
|
# Newer versions of capstone break tests
|
2024-08-14 06:19:23 +08:00
|
|
|
capstone = "5.0.2"
|
2024-04-29 01:32:18 +08:00
|
|
|
# This is the last version of IPython that supports Python 3.8
|
2024-03-04 04:56:38 +08:00
|
|
|
ipython = "8.12.3"
|
Fix Pwndbg on Py3.12: add setuptools as dependency (#2008)
It turned out that in some cases - e.g. when installing Pwndbg on Fedora 39 which uses Python 3.12, Pwndbg does not work failing with:
```
Traceback (most recent call last):
File "/home/hhlp/.pwndbg/gdbinit.py", line 74, in <module>
import pwndbg # noqa: F401
^^^^^^^^^^^^^
File "/home/hhlp/.pwndbg/pwndbg/__init__.py", line 9, in <module>
import pwndbg.commands
File "/home/hhlp/.pwndbg/pwndbg/commands/__init__.py", line 24, in <module>
from pwndbg.heap.ptmalloc import DebugSymsHeap
File "/home/hhlp/.pwndbg/pwndbg/heap/ptmalloc.py", line 18, in <module>
import pwndbg.disasm
File "/home/hhlp/.pwndbg/pwndbg/disasm/__init__.py", line 14, in <module>
import capstone
File "/home/hhlp/.pwndbg/.venv/lib/python3.12/site-packages/capstone/__init__.py", line 326, in <module>
import distutils.sysconfig
ModuleNotFoundError: No module named 'distutils'
(gdb)
```
It turns out that `distutils` package was removed in Python 3.12 and it is now provided by the `setuptools` module.
This commit fixes this issue by adding `setuptools` as a direct Pwndbg dependency.
2024-02-01 23:43:08 +08:00
|
|
|
# Needed by Capstone due to https://github.com/pwndbg/pwndbg/pull/1946#issuecomment-1921603947
|
2024-07-16 15:23:21 +08:00
|
|
|
setuptools = "^70.0.0"
|
2024-04-29 00:30:49 +08:00
|
|
|
psutil = "^5.9.8"
|
2024-08-14 21:29:48 +08:00
|
|
|
pwntools = "^4.14.0b0"
|
2024-04-29 00:30:49 +08:00
|
|
|
pycparser = "^2.22"
|
|
|
|
pyelftools = "^0.29"
|
2024-08-14 06:19:23 +08:00
|
|
|
pygments = "^2.18.0"
|
2024-04-29 00:30:49 +08:00
|
|
|
ropgadget = "7.3"
|
|
|
|
sortedcontainers = "^2.4.0"
|
|
|
|
tabulate = "^0.9.0"
|
2024-08-14 06:19:23 +08:00
|
|
|
typing-extensions = "^4.12.0"
|
2024-04-29 00:30:49 +08:00
|
|
|
unicorn = "^2.0.1.post1"
|
2024-08-14 06:19:23 +08:00
|
|
|
requests = "^2.32.3"
|
2024-04-20 04:11:39 +08:00
|
|
|
pt = {git = "https://github.com/martinradev/gdb-pt-dump", rev = "50227bda0b6332e94027f811a15879588de6d5cb"}
|
2023-08-06 20:27:30 +08:00
|
|
|
|
2024-09-01 08:12:56 +08:00
|
|
|
[tool.poetry.group.lldb]
|
|
|
|
optional = true
|
|
|
|
|
|
|
|
[tool.poetry.group.lldb.dependencies]
|
|
|
|
# The LLDB REPL requires readline.
|
|
|
|
gnureadline = "^8.2.10"
|
|
|
|
|
2024-03-12 00:42:16 +08:00
|
|
|
[tool.poetry.group.dev]
|
|
|
|
optional = true
|
|
|
|
|
|
|
|
[tool.poetry.group.dev.dependencies]
|
2024-04-29 01:32:18 +08:00
|
|
|
coverage = {version = "^7.5.0", extras = ["toml"]}
|
|
|
|
isort = "^5.13.2"
|
|
|
|
mypy = "^1.10.0"
|
|
|
|
# Newer versions of pytest break CI on GitHub
|
2024-03-12 00:42:16 +08:00
|
|
|
pytest = "8.0.2"
|
2024-04-29 01:32:18 +08:00
|
|
|
pytest-cov = "^4.1.0"
|
|
|
|
rich = "^13.7.1"
|
|
|
|
ruff = "^0.4.1"
|
2024-05-14 04:39:20 +08:00
|
|
|
sortedcontainers-stubs = "^2.4.2"
|
2024-04-29 01:32:18 +08:00
|
|
|
testresources = "^2.0.1"
|
|
|
|
tomli = "^2.0.1"
|
2024-07-10 01:25:52 +08:00
|
|
|
types-gdb = "^12.1.4.20240704"
|
2024-04-29 01:32:18 +08:00
|
|
|
types-psutil = "^5.9.5.20240423"
|
|
|
|
types-pygments = "^2.17.0.20240310"
|
|
|
|
types-requests = "^2.31.0.20240406"
|
|
|
|
types-tabulate = "^0.9.0.20240106"
|
|
|
|
vermin = "^1.6.0"
|
2024-03-12 00:42:16 +08:00
|
|
|
|
2024-05-10 04:48:42 +08:00
|
|
|
[tool.poetry.group.docs]
|
|
|
|
optional = true
|
|
|
|
|
|
|
|
[tool.poetry.group.docs.dependencies]
|
2024-05-10 05:11:10 +08:00
|
|
|
mdutils = "*"
|
2024-05-10 04:48:42 +08:00
|
|
|
mkdocs = "*"
|
|
|
|
mkdocs-gen-files = "*"
|
|
|
|
mkdocs-material = "*"
|
|
|
|
mkdocs-minify-plugin = "*"
|
|
|
|
mkdocs-rss-plugin = "*"
|
|
|
|
mkdocstrings = "*"
|
|
|
|
mkdocstrings-python = "*"
|
|
|
|
pymdown-extensions = "*"
|
|
|
|
|
2023-08-06 20:27:30 +08:00
|
|
|
[build-system]
|
|
|
|
requires = ["poetry-core"]
|
|
|
|
build-backend = "poetry.core.masonry.api"
|