* added/modified registers for kernel pwning
* added a RegisterContext class for more complex register context handling
* cleaned up register context selection and flag bits
* further cleaned up register context selection
* fixing None deref issue
* handling NoneType registers
* linting
* removed most of the extra register classes
* fully removed extra register classes in commands/context.py
* renamed var so that the linter doesn't confuse the var name with dataclass type name
* some comments on newly added classes
* fixed issues based on suggestions
* fixed issues when debug symbols are not present in x64 kernel
* Apply suggestions from code review
Co-authored-by: OBarronCS <55004530+OBarronCS@users.noreply.github.com>
* reduced performance overhead & added some examples for arm biflags & error handling
---------
Co-authored-by: OBarronCS <55004530+OBarronCS@users.noreply.github.com>
* Only apply TUI color workaround for gdb < 16.3
The fix was backported to GDB 16.3, it was fixed in a larger patchset in GDB 17 already.
https://lists.gnu.org/archive/html/info-gnu/2025-04/msg00014.html
* PR tui/32797 (Escape sequences to only reset foreground or background color
to default fail)
Fixes#2654
* Only test for TUI ANSI reset workaround once
* test that gdb and argparse give the same help message
* fix misc test
* rstrip outputs
* added comment explaining the down aliases
* Update pwndbg/commands/ida.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update tests/gdb-tests/tests/test_misc.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add support for examples and notes
* port epilog usage to 'examples'
* enforce example/note location
* generate notes, examples and epilog in the docs
* disable search highlight
* autogen docs
* cleanup a bit
#2767 adds a newline before the actual content of context sections. The layout leaves room for only one line for the legend section. The prepended newline caused the legend section to show up empty by default in TUI mode.
* - Use process network namespace instead of debugger network namespace for /proc/net/* files.
- Add tcp6 support
* - use tid
* - fix format ipv6
* fix lint
* add test + fixes
* convert little to big endian
* convert little to big endian
* Use Zig for compiling for cross architecture tests.
* comments/typos
* Check if GDB supports crossarch targets, inline _start definition in assembly, add comments
Instead of only allowing to lookup global symbols, allow reference local variables too.
This is done by iterating the local stack frame struct in IDA and comparing the name. Depending on whether IDA created an entry for the saved frame pointer in the stack frame, the stack variable offset is returned relative to the current stack or frame pointer.
This also fixes the error for invalid names in #2903
Based on https://gist.github.com/syndrowm/2968620
as of nix 2.25.0, `nix fmt` will not automatically recurse through
nix files so `nixfmt-rfc-style` will format from stdin instead.
see: https://github.com/NixOS/nix/pull/11438
this issue https://github.com/NixOS/nixfmt/issues/273 recommends that
we use `nixfmt-tree` which calls `treefmt` in the backend with a
minimal configuration for nix
* add editable pwndbg into the nix devshell
* remove repl-flakes, it is deprecated, see https://github.com/NixOS/nix/issues/10103
* formatting
* mipsel -> mips in devshell
* Don't auto-delete files during command generation, if they contain a hand-written part
* spelling fix
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* expand and add examples to pwndbg convenience functions
* update usage descriptions in _gen_*
* refactor out some common logic
* implement function doc generation
* change some mkdocs defaults around to be better for the general case
* generate function docs
* cleanup some examples, help, and quote escaping explanation
* move fsbase and gsbase definitions (and use decorator)
* cleanup signature for fsbase and gsbase
* autogen functions
* type annotation
* fix ida and binja descriptions
* rename arguments, reorder docs for `help function` and assert convention
* add missing imports
* use inspect.getdoc instead of directly accessing __doc__
for more consistency across python versions
* regen docs with getdoc()
* rewire exit and lint
* let users know about convenience functions through the `pwndbg` command
* sys.exit instead of exit
* Add a test that steps through each instruction in a program in different arches to detect crashes in annotations code
* lint
* Add symlinks so qemu can find libraries, simplify selecting correct qemu version
* lint
* compile cross-arch binaries with -static
* Add map of cross-arch library paths to avoid creating symlink
* lint
* clean up cross-arch makefile, skip the slow tests unless an environment variable is set
* correct compiler versions
* remove empty lines
* Makefile comment
* Add syscall to basic.c
* Increase performance
* Always run the tests
* lint
* initial PwndbgArchitecture
* pwndbg.aglib.arch refers to the PwndbgArchitecture instance
* Update pwndbg/aglib/arch.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* stuff
* Simplify setting the architecture, remove duplicated code
* ABI and SyscallABI now retrieved from the arch object
* lint
* fix syscall abi fetch
* rename
* lint
* Update pwndbg/aglib/arch.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* Update pwndbg/aglib/arch.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* Remove unused comment
* comment
* ABI fetch fix
* lint
* simplify sparc capstone constant
* Change how architectures are registered
* Ensure all uses of function abi/syscall abi have a check to see if they are not None
* More gracefully report error on unrecognized architectures
* Fix ABI function argument fetch
* remove old comment
* Add class for loongarch + s390x, add test to ensure all arches have a class defined
* Add variable 'max_instruction_size' to arch classes
* Rename mock arch to MockAmd64Arch
* Rebase
* Remove Protocol due to bug in __init__ in Python 3.10
* Remove name_raw, add ArchAttribute's + MIPS constants
* add @override decorator
* rebase
---------
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* readme/docs changes in install methods
* tip
* tip
* tip
* cleanup installation instructions
* gdb/lldb is bundled
---------
Co-authored-by: k4lizen <124312252+k4lizen@users.noreply.github.com>
* Fix crash on syscalls instructions when syscall ABI is not defined
* Fix crash when branch delay slot contains an invalid instruction
* Hotfix to detect mips version more precisely on gdb
* make parameter scope an enum
* brighter code text, smaller top-margins for level 2 headings
* cleanup configuration logic, add assertions
* add script for generating configuration docs, move out some common logic
* move heap-config to pwndbg category since it should encompass other allocators as well
* docs update for heap-config move
* don't annotate code blocks with line numbers; add ability to use github flavoured markdown-type tasklist
* hand write configuration index, auto generate other docs
oops the auto-generated docs/commands/index.md change is in this commit
* fix bug of discarding help_docstring
* auto-gen docs for previous bugfix
* make parameter help's work with markdown
* autogen docs again
* add scripts to lint and lint them
* import missing stuff
* update docs-live script
* fixups
* update docs