From 809c544aa62ebbacf3ed2732f5070985043eeab5 Mon Sep 17 00:00:00 2001 From: Bet4 <0xbet4@gmail.com> Date: Thu, 5 Sep 2019 10:15:00 +0800 Subject: [PATCH 1/2] Small fixes to be able to use peda in hyperpwn --- lib/shellcode.py | 4 ++-- peda.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/shellcode.py b/lib/shellcode.py index 1a20188..6b87b0d 100644 --- a/lib/shellcode.py +++ b/lib/shellcode.py @@ -21,7 +21,7 @@ import config from utils import msg, error_msg -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 @@ -376,7 +376,7 @@ def zsc(self,os,job,encode): 'job': job, 'encode': encode}) shellcode = urlopen("http://api.z3r0d4y.com/index.py?%s\n"%(str(params))).read() - if pyversion is 3: + if pyversion == 3: shellcode = str(shellcode,encoding='ascii') return '\n"'+shellcode.replace('\n','')+'"\n' except: diff --git a/peda.py b/peda.py index 14a7f5e..4bc4687 100644 --- a/peda.py +++ b/peda.py @@ -4375,6 +4375,8 @@ def context(self, *arg): if clearscr == "on": clearscreen() + msg("Legend: %s, %s, %s, value" % (red("code"), blue("data"), green("rodata"))) + status = peda.get_status() # display registers if "reg" in opt or "register" in opt: @@ -4388,7 +4390,6 @@ def context(self, *arg): 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"))) # display stopped reason if "SIG" in status: @@ -6162,3 +6163,4 @@ def sigint_handler(signal, frame): peda.execute("set print pretty on") peda.execute("handle SIGALRM print nopass") # ignore SIGALRM peda.execute("handle SIGSEGV stop print nopass") # catch SIGSEGV +msg('PEDA loaded', "red") From 8f2fcc74b07c0f3d6a83beb8525d5dae786464fa Mon Sep 17 00:00:00 2001 From: Bet4 <0xbet4@gmail.com> Date: Wed, 30 Sep 2020 15:06:29 +0800 Subject: [PATCH 2/2] Change init message --- peda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peda.py b/peda.py index 4bc4687..e8ee3c5 100644 --- a/peda.py +++ b/peda.py @@ -6163,4 +6163,4 @@ def sigint_handler(signal, frame): peda.execute("set print pretty on") peda.execute("handle SIGALRM print nopass") # ignore SIGALRM peda.execute("handle SIGSEGV stop print nopass") # catch SIGSEGV -msg('PEDA loaded', "red") +msg('Init PEDA', "red")