pwndbg/pwndbg

errno definition in return register output

Open

#2,151 opened on May 6, 2024

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Python (776 forks)batch import
featuregood first issuehelp wanted

Repository metrics

Stars
 (5,820 stars)
PR merge metrics
 (Avg merge 3d 12h) (32 merged PRs in 30d)

Description

It would be nice if the register output of the return address register would display errno definitions (if the value is negative):

current output:

*RAX  0xfffffffffffffff7
 RBX  0x7fffffffde88 —▸ 0x7fffffffe1da ◂— '/home/user/Downloads/demo'
*RCX  0x7ffff7fbc017 ◂— 0
 RDX  0
 RDI  0x7fffffffdc98 ◂— '/bin//sh'
 RSI  0
 R8   0x7ffff7e03b20 (main_arena+96) —▸ 0x55555555a3b0 ◂— 0
 R9   0x410
 R10  0x7ffff7c0abe8 ◂— 0x11002200006cb5
*R11  0x346
 R12  1
 R13  0
 R14  0x555555557dc8 (__do_global_dtors_aux_fini_array_entry) —▸ 0x555555555170 (__do_global_dtors_aux) ◂— endbr64 
 R15  0x7ffff7ffd000 (_rtld_global) —▸ 0x7ffff7ffe2e0 —▸ 0x555555554000 ◂— 0x10102464c457f
 RBP  0x7fffffffdd60 —▸ 0x7fffffffde00 —▸ 0x7fffffffde60 ◂— 0
 RSP  0x7fffffffdc98 ◂— '/bin//sh'
*RIP  0x7ffff7fbc017 ◂— 0

what i expect:

*RAX  0xfffffffffffffff7 <EBADF: fd is not a valid file descriptor> 
 RBX  0x7fffffffde88 —▸ 0x7fffffffe1da ◂— '/home/user/Downloads/demo'
*RCX  0x7ffff7fbc017 ◂— 0
 RDX  0
 RDI  0x7fffffffdc98 ◂— '/bin//sh'
 RSI  0
 R8   0x7ffff7e03b20 (main_arena+96) —▸ 0x55555555a3b0 ◂— 0
 R9   0x410
 R10  0x7ffff7c0abe8 ◂— 0x11002200006cb5
*R11  0x346
 R12  1
 R13  0
 R14  0x555555557dc8 (__do_global_dtors_aux_fini_array_entry) —▸ 0x555555555170 (__do_global_dtors_aux) ◂— endbr64 
 R15  0x7ffff7ffd000 (_rtld_global) —▸ 0x7ffff7ffe2e0 —▸ 0x555555554000 ◂— 0x10102464c457f
 RBP  0x7fffffffdd60 —▸ 0x7fffffffde00 —▸ 0x7fffffffde60 ◂— 0
 RSP  0x7fffffffdc98 ◂— '/bin//sh'
*RIP  0x7ffff7fbc017 ◂— 0

I think <EBADF> should be enough, but having an additional short description would be nice.

Contributor guide