* add func to compile and load symbols from a file
* break out add_symbol_file, fix ext splitting
* Looks like for 2.7, file.flush invokes the native routine file_flush
which invokes fflush.
file.close invokes the native routine file_close --> close_the_file -->
PyFileObject->f_close --> close(2). There is no call to any flush
routine.
file.__exit__ just invokes the close method on the file object.
According to StackOverflow, file.close() implies file.flush(), but I
don't see any code for it in the cpython source.
Separately, flush() does not guarantee that the data is actually on
disk. That requires calling fsync() or using O_SYNC.
So it appears that the call to f.flush() is both unnecessary and
incorrect.
* We still need to call fsync to actually ensure the data hits the disk.
However, the file descriptor is closed outside of the with block, and we
can't guarantee the buffers are flushed in the with block without
.flush().
* Install GDB before attempting to install Pwndbg
* Bail if GDB is not found
* Revert "Remove --target from setup.sh"
This reverts commit 62b772a3d6.
* Revert "Remove unused variables from setup.sh"
This reverts commit 9042f5f761.
* Remove unused variables from setup.sh
* Ensure that pip is available via ensurepip
* Upgrade pip itself
* There is no ensurepip for Ubuntu installs
* Fix typo, use correct Python
This brings back the functionality to call disasm.one() without
and target address. As a default value the current regs.pc is
selected.
Fix the disasm.near() call to not pass None to disasm.one() when
the backward cache misses, otherwise it wrongly falls back to
the regs.pc value (which near() is not supposed to do in its
context).
* search: fix --word -2 param and allow --short in reflect to --type short
Search failed when using the --word (-2) parameter as 'word' was
not found in the type lookup. Using 'word' instead of 'short' seems
to be the better option as that matches better in this context.
* search: more robust and graceful error messages for invalid input
This makes error messages for wrong input more graceful instead of
dying and printing an ugly full traceback exception.
* harden hexdump and telescope commands against malformed arguments
* only allow retaddr and canary commands when in running mode
* xor: gracefully complain on invalid memory address
* next: check if proc is alive while continuing to avoid exceptions
If the program terminates while we are still looping/continuing for
the according next command, then an internal gdb.error is thrown as
the program is not being run.
We avoid such situations by adding the proc.alive to the looping
conditions.
* memory: force write_memory to be bytes for python2 gdb
* catch general gdb.error instead of specific gdb.MemoryError
This fixes an issue that too many values are printed when using
the second argument B as an address as it was simply subtracted
but in the context of telescope the count means ptrsize values
as its later (correctly) multiplied with ptrsize.
We also use ceil instead of floor division as its a better user
experience to not silently discard a value if the dest is unaligned
like with $sp $sp+1
On top do not allow count to be negative when B is used as actual
count integer rather then an address. When B is an address the
integer value is converted to an unsigned integer, therefor address
that, in binary, would represent an negative signed integer wont
be clamped by the max(count, 1).
It's quite handy to drop into radare2 in the middle of a deep debugging
session to fire up the visual mode and examine the current location in
gdb using the ascii graph view (or something else) in radare2.
This will result in an internal exception and make pwndbg stop
searching. Just avoid and exit this search block if the current
search length equals zero.
This fixes a regression when the emulator support is disabled via
setting it to None when the import fails. The access happens when
checking if a particular architecture actually supports emulation.
Ensure that emulate has the correct value depending on the availability
of the import and deactivate it otherwise. The following core can safely
rely on the boolean state of the emulate variable.