Previously test scripts would just indiscriminately kill all qemu
processes on the system. This would kill other debug sessions I had
running. These changes make the test scripts record the qemu pids they
run and only kill those.
The old scripts would also not allow you to specify a gdb port, so
if you were already running a debug session with port 1234, the tests
would fail. This update allows you to pass --gdb-port=NNNN to use a
non-default port. You can pass -Q to preserve failing qemu instances.
The scripts now also will show qemu errors to console, and will warn
the user if there is a qemu port conflict.
Also update gdb-pt-dump submodule as it has been updated recently to not
throw an exception when multiple qemu processes are running. The
exception thrown in the event of a failure also changed, so
this has also been updated on the pwndbg side.
There were various problems running commands on kernels without
CONFIG_IKCONFIG support. This attempts to naively fix some of them,
although possibly not exhaustively.
Fix kconfig to not crash if the required symbols aren't found.
Introduce a new requires_kconfig() that is more strict than the old
requires_debug_symbols(). Move required decorators into the __init__
method of each architecture class, as it's ultimately what decides
requirements and differs between archs (ex: x86_64 is doable with just
debug symbols, whereas aarch64 seems to need kconfig).
Tweaks a couple commands so slab dumping works on kernels without
kconfig. Also gracefully handle kbase failure if vmmap is invalid
(due to gdb-pt-dump failure, etc).
I've run tests-qemu/tests.sh, and done basic testing on x86_64 kernel
without CONFIG_IKCONFIG, but I think ultimately
https://github.com/pwndbg/linux-exploit-dev-env needs to be updated
to include test kernels without it as well.
Fixes a bug with procinfo
```
pwndbg> procinfo
exe '/opt/teamviewer/tv_bin/teamviewerd'
Exception occurred: procinfo: embedded null character (<class 'ValueError'>)
For more info invoke `set exception-verbose on` and rerun the command
or debug it by yourself with `set exception-debugger on`
pwndbg> set exception-debugger on
Set whether to debug exceptions raised in Pwndbg commands to 'on'.
...
(Pdb) up
> /home/dc/pwndbg/pwndbg/commands/procinfo.py(227)procinfo()
-> print("%-10s %s" % ("cmdline", proc.cmdline))
(Pdb) print(proc.cmdline)
'/opt/teamviewer/tv_bin/teamviewerd\x00-d'
```
I had to switch to my private repo with poetry2nix because they missed a hash for cryptography==41.0.3 dependency that we updated throughout the dependabot alert about this dependency.
The missing hash was added to the upstream repo in https://github.com/nix-community/poetry2nix/pull/1249
We don't really use this dependency directly, but I went ahead and updated it just in case.