Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes to be able to use peda in hyperpwn #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/shellcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion peda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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('Init PEDA', "red")