* ai plugin
* ai plugin ready to ship
* ai plugin ready to use
* textwrap on the ai's answer
* linted ai.py
* relaxed openai version requirement
* added pandas to requirements
* removed dependency on openai module, using requests instead
* removed dependency on openai module, using requests instead
* incorporating suggestions on PR
* added types requests and bumped requests version up to the version i'm using here
* lowering version req on requests for ubuntu 18 compat
* removed some 'if True' kludges that i was using to debug things at one point
* better error handling
* more config parameters for ai
* fixed a few config issues
* fixed bug in gdb list command
* now uses chatgpt's gpt-3.5-turbo model, instead of text-davinci-003, and follows a conversational protocol instead of completion.
* added support for anthropic's claude
* linted
* tidied up main function
Technically Arch Linux ARM is a separate distro from the x86_64 Arch Linux, but it uses pcaman and the same package names. So it installs just fine, just needs to be detected properly.
* feature: Add `killthreads` command (closes#1580)
This command allows the user to quickly kill multiple threads by
specyfying their ids as arguments to this command. It also supports
the `--all` flag, which will kill overy thread except the currently
selected one. This is useful for use with the `checkpoint` command.
The killing is done by calling `pthread_exit(0)`.
* fix: try fixing building test binaries by enabling -lpthread
* fix: remove error message check when calling pthread_exit
Removed the message check, because the error messages difffer between
versions of GDB.
* fix: Improve UX of the killthreads command
Add an extended description of the command, some validation on the thread IDs
and suppress GDB output.
* fix: lint
* fix: put the multiline help text in the correct place
* tests: fix test failing due to a race condition when running in parrallel to other tests
Replaced asserts with loops which wait for a cundition to be met, so that the tests doesn't fail due to scheduling issues.
* tests: add more fixes for race conditions in test_killthreads
* fix: lint
* Update pwndbg/commands/killthreads.py
* tests: Wait for exactly three threads
---------
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
* Fixed a crash that caused formatting failure in readlink when qemu returns None as the pid.
* Formated code
* Update pwndbg/arguments.py
* Assign a pid prevent repetitive calls.
* Format it
* remove the warning
* add a comment about the senario that PID is None in qemu
---------
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
* Add some basic heap heuristics support for riscv and powerpc
Use the relocation section to find the main_arena address if possible
* Refactor the code we used to get the field offset
* Fix linux_ppc(64)_syscall abi
The system call number is specified in r0.
There is a maximum of 6 integer parameters to a syscall, passed in r3-r8.
* Fix ppc syscall revert r9 back
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
* Remove r6/x6 from arm/aarch64 syscall
* Update pwndbg/lib/abi.py
---------
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Now the installation process contains the following steps:
1. Check for any line with source <gdbinit.py> before installation
2. If any, ask the user if they want to proceed
3. After the installation, comment out old source <gdbinit.py> lines if any and add a new source <gdbinit.py> line.
A check for presence of the line set debuginfod enabled on is also added to avoid being appended repeatedly.
* Add largebin reverse lookup tables
* Don't use None value for bin 95 size on i386
* Clarify "bin 95" comment
* Add comment to tables
* Immutable tables
* Make tables class attributes
I can confirm the search bug to happen on GDB 9.2, but not on GDB 10.2:
```
pwndbg> version
Gdb: 9.2
Python: 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]
Pwndbg: 1.1.1 build: a3f12bc
Capstone: 4.0.1024
Unicorn: 2.0.1
pwndbg> search "GNU C"
Searching for value: 'GNU C'
pwndbg> set remote search-memory-packet off
pwndbg> search "GNU C"
Searching for value: 'GNU C'
libc-2.31.so 0x7ffff7f85b80 0x694c204320554e47 ('GNU C Li')
libc-2.31.so 0x7ffff7f85c9e 'GNU CC version 9.3.0.\nlibc ABIs: UNIQUE IFUNC ABSOLUTE\nFor bug reporting instructions, please see:\n<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.\n'
```
* ai plugin
* ai plugin ready to ship
* ai plugin ready to use
* textwrap on the ai's answer
* linted ai.py
* relaxed openai version requirement
* added pandas to requirements
* removed dependency on openai module, using requests instead
* removed dependency on openai module, using requests instead
* incorporating suggestions on PR
* added types requests and bumped requests version up to the version i'm using here
* lowering version req on requests for ubuntu 18 compat
* removed some 'if True' kludges that i was using to debug things at one point
* better error handling
* more config parameters for ai
* fixed a few config issues
* fixed bug in gdb list command
* now uses chatgpt's gpt-3.5-turbo model, instead of text-davinci-003, and follows a conversational protocol instead of completion.
* ensuring backwards compatibility with older models, like text-davinci-003
* removed unneeded host and path vars
* Changing the arguments to vis_heap_chunks to be clearer
1. --native to --beyond_top
2. --display_all to --no_truncate
* Add print all chunks to vis_heap_chunks
* Preventing the use of the all_chunks argument together with the count argument in vis_heap_chunks
* Use linting for heap.py
* Fix test_vis_heap_chunks.py
According to cdd71a1d82 --display_all/-d moved to --no_truncate/-n
---------
Co-authored-by: Nerya Zadkani <nerya@tokagroup.com>
It seems this function is redundant. If you do:
```
gdbserver 0.0.0.0:1234 ./a.out
```
on a local machine and then do `gdb ./a.out --ex 'target remote :1234'`
the `_add_main_symbol_to_exe` will kick off and run its
`add-symbol-file` command to add the symbols from the binary. However,
the GDB already loaded the binary symbols and so we will do it for the
second time. As a result, we get something like this:
```
pwndbg> info symbol main
main in section .text of /pwndbg/bug/vaccine
main in section .text of /pwndbg/bug/vaccine
```
This function has been in Pwndbg since always and I am not sure why we
needed it. Perhaps an old GDB did not download the binary from the
remote target, but since now GDB does this automagically, this function
seems redundant.
Just for the sake of documenting it, here is how a symbol appears if you
connect to a remote target on a different machine without Pwndbg (the
GDB downloads the binary itself and loads its symbols):
```
(gdb) p main
$1 = {<text variable, no debug info>} 0x55555555466a <main>
(gdb) info symbol main
main in section .text of target:/home/dc/a.out
```