diff --git a/lib/.gdb_history b/lib/.gdb_history new file mode 100644 index 0000000..b60bb04 --- /dev/null +++ b/lib/.gdb_history @@ -0,0 +1,4 @@ +b main +r +exit +q diff --git a/lib/utils.py b/lib/utils.py index 8f2b038..8ba3281 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -147,6 +147,22 @@ def blue(text, attrib=None): """Wrapper for colorize(text, 'blue')""" return colorize(text, "blue", attrib) +def cyan(text, attrib=None): + """Wrapper for colorize(text, 'cyan')""" + return colorize(text, "cyan", attrib) + +def purple(text, attrib=None): + """Wrapper for colorize(text, 'purple')""" + return colorize(text, "purple", attrib) + +def black(text, attrib=None): + """Wrapper for colorize(text, 'black')""" + return colorize(text, "black", attrib) + +def white(text, attrib=None): + """Wrapper for colorize(text, 'white')""" + return colorize(text, "white", attrib) + def clearscreen(): """Clear terminal screen""" sys.stdout.write("\x1b[2J\x1b[H") @@ -446,9 +462,9 @@ def check_badchars(data, chars=None): def format_address(addr, type): """Colorize an address""" colorcodes = { - "data": "blue", - "code": "red", - "rodata": "green", + "data": "cyan", + "code": "purple", + "rodata": "red", "value": None } return colorize(addr, colorcodes[type]) diff --git a/peda.py b/peda.py index dfcd7cd..0b5693d 100644 --- a/peda.py +++ b/peda.py @@ -42,7 +42,7 @@ import config from nasm import * -if sys.version_info.major is 3: +if sys.version_info.major == 3: from urllib.request import urlopen from urllib.parse import urlencode pyversion = 3 @@ -4250,7 +4250,7 @@ def context_register(self, *arg): pc = peda.getreg("pc") # display register info - msg("[%s]" % "registers".center(78, "-"), "blue") + msg("[%s]" % "registers".center(78, "-"), "yellow") self.xinfo("register") return @@ -4276,7 +4276,7 @@ def context_code(self, *arg): else: inst = None - text = blue("[%s]" % "code".center(78, "-")) + text = yellow("[%s]" % "code".center(78, "-")) msg(text) if inst: # valid $PC text = "" @@ -4337,7 +4337,7 @@ def context_stack(self, *arg): if not self._is_running(): return - text = blue("[%s]" % "stack".center(78, "-")) + text = yellow("[%s]" % "stack".center(78, "-")) msg(text) sp = peda.getreg("sp") if peda.is_address(sp): @@ -4387,8 +4387,8 @@ def context(self, *arg): # display stack content, forced in case SIGSEGV if "stack" in opt or "SIGSEGV" in status: self.context_stack(count) - msg("[%s]" % ("-"*78), "blue") - msg("Legend: %s, %s, %s, value" % (red("code"), blue("data"), green("rodata"))) + msg("[%s]" % ("-"*78), "yellow") + msg("Legend: %s, %s, %s, value" % (cyan("code"), purple("data"), red("rodata"))) # display stopped reason if "SIG" in status: @@ -5789,9 +5789,9 @@ def list_shellcode(): while True: for os in oslist: msg('%s %s'%(yellow('[+]'),green(os))) - if pyversion is 2: + if pyversion == 2: os = input('%s'%blue('os:')) - if pyversion is 3: + if pyversion == 3: os = input('%s'%blue('os:')) if os in oslist: #check if os exist break @@ -5800,9 +5800,9 @@ def list_shellcode(): while True: for job in joblist: msg('%s %s'%(yellow('[+]'),green(job))) - if pyversion is 2: + if pyversion == 2: job = raw_input('%s'%blue('job:')) - if pyversion is 3: + if pyversion == 3: job = input('%s'%blue('job:')) if job != '': break @@ -5811,9 +5811,9 @@ def list_shellcode(): while True: for encode in encodelist: msg('%s %s'%(yellow('[+]'),green(encode))) - if pyversion is 2: + if pyversion == 2: encode = raw_input('%s'%blue('encode:')) - if pyversion is 3: + if pyversion == 3: encode = input('%s'%blue('encode:')) if encode != '': break @@ -6151,7 +6151,7 @@ def sigint_handler(signal, frame): peda.execute("set confirm off") peda.execute("set verbose off") peda.execute("set output-radix 0x10") -peda.execute("set prompt \001%s\002" % red("\002gdb-peda$ \001")) # custom prompt +peda.execute("set prompt \001%s\002" % yellow("\002gdb-redhung$ \001")) # custom prompt peda.execute("set height 0") # disable paging peda.execute("set history expansion on") peda.execute("set history save on") # enable history saving