hugsy / gef-extras

Extra goodies for GEF to (try to) make GDB suck even less
https://hugsy.github.io/gef-extras
MIT License
149 stars 50 forks source link

Error Codes #34

Closed khaoticdude closed 3 years ago

khaoticdude commented 3 years ago

As discussed on Discord:

hugsy commented 3 years ago

@khaoticdude If you still plan on working on this, you can use strerror to avoid collecting manually all the Linux error codes:

from ctypes import *
libc = CDLL("libc.so.6")
libc.strerror.restype = c_char_p
libc.strerror.argtypes = [c_uint32,]
EPERM = 1
c_s = c_char_p( libc.strerror( EPERM ) ) 
print("%d -> %s" % (EPERM, c_s.value))

Will output something easy to plug into gef.

1 -> b'Operation not permitted'

Ping us if you have questions

hugsy commented 3 years ago

Done with d255e3c

Grazfather commented 3 years ago

If you're too slow @hugsy will just do it for you :D

khaoticdude commented 3 years ago

Yeah I saw lolol. Much appreciated neverthelessOn Apr 16, 2021 12:40, Grazfather @.***> wrote: If you're too slow @hugsy will just do it for you :D

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.