* Allow dumpargs to format bit flags
If flags are supplied for a funciton in `functions_data.py`, the
`dumpargs` command can pretty-print the combination of flags used in the
call.
* Update format for flags arguments.
The format now includes the original integer value *and* the extracted
flag names (if any). A sample output would be `0x03 (FLAG_2|0x01)`.
* Fix lint
* Address review comments
* Remove import after rebase
---------
Co-authored-by: Loren Van Spronsen <lorenvs@google.com>
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Set the parameter in gdb to the new value when the abstraction in
pwndbg.lib.config.Parameter changes. This makes sure other commands
accessing the value in gdb like "show <parameter>" display the correct value.
Fixes#2744
This commit fixes#2674. A bug in commands.context implementation where we printed out the banner without a newline when context was forwarded to separate terminals.
Use the `PWNDBG_[BINJA|IDA]_SERVER_HOST` and `PWNDBG_[BINJA|IDA]_SERVER_PORT`
environment variables to specify where the XMLRPC server should listen on.
This allows you to change the host to e.g. "0.0.0.0" to allow connecting from WSL to an
IDA/Binja running on Windows without having to touch the scripts everytime.
* Fix remote procinfo error due to error in opening SELinux attribute file. Bring full functionality to xinfo on remote hosts
* Move try-catch block closer to function that raises error
Only resetting the foreground or background colors results in generating wrong colors in the TUI.
The workaround is to avoid the sequences that only reset the colors and replace them with a full reset sequence. It resets other styling attributes like bold too but it's better than having wrong colors.
Refs #2654
* Create an authoritative list of architectures that Pwndbg supports. Add test to ensure some important mappings exist - add i8086 pwnlib mapping
* make pwnlib mapping 'none' by default
* Update pwndbg/dbg/gdb/__init__.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* Update pwndbg/lib/arch.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* Update pwndbg/lib/arch.py
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* More type safety with the list of supported types, handle iwmmxt, iwmmxt2, and xscale manually
---------
Co-authored-by: patryk4815 <bux.patryk@gmail.com>
* lldb: port version and bugreport commands + refactor
Port `version` and `bugreport` commands to LLDB.
Additionally, refactor them to provide better information and be less
bloated.
* fix lint
* fix lint
* fix lint
* lldb: add support for attaching via `attach <pid|name>`
This commit adds support for the `attach <pid|name>` command so that it
can attach to a pid or full process name similarly to as in LLDB.
Please note that this LLDB command is a bit confusing.
It may seem it is an alias for `process attach` as in here:
```
(lldb) attach -n -w htop
error: 'process attach' doesn't take any arguments.
```
However, in practice it is not. It is an alias for `_regexp-attach`:
```
(lldb) help attach
Attach to process by ID or name. Expects 'raw' input (see 'help raw-input'.)
Syntax: _regexp-attach <pid> | <process-name>
'attach' is an abbreviation for '_regexp-attach'
```
...which has its own problems:
1) it does not perform any regexp match in practice. passing `hto.*`,
`hto?` or `hto[p]` will not attach to `htop`. One must pass the full process name like `htop`.
2) it can work without arguments, which is stupid and we should not
support it?:
```
(lldb) _regexp-attach
There is a running process, detach from it and attach?: [Y/n] y
Process 56358 detached
Process 56358 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007ff8118bedd2 libsystem_kernel.dylib`__select + 10
libsystem_kernel.dylib`__select:
-> 0x7ff8118bedd2 <+10>: jae 0x7ff8118beddc ; <+20>
0x7ff8118bedd4 <+12>: movq %rax, %rdi
0x7ff8118bedd7 <+15>: jmp 0x7ff8118b737b ; cerror
0x7ff8118beddc <+20>: retq
```
* fixup
* Update pwndbg/dbg/lldb/repl/__init__.py
Co-authored-by: Matt. <dark.ryu.550@gmail.com>
---------
Co-authored-by: Matt. <dark.ryu.550@gmail.com>
* Support for loongarch64. Add Loongarch64 register set definition, make a ManualPwndbgInstruction to define an instruction without a Capstone object underlying it, and detect Loongarch64 on GDB
* Update pwndbg/aglib/disasm/instruction.py
* Use Python Protocols to create an interface that the two PwndbgInstruction implementations conform to + make suggested changes
---------
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>