Mark PC as executable upon resuming execution

Fixes #90
pull/109/head
Zach Riggle 9 years ago
parent 65e5037cf0
commit 363ffcaea7

@ -185,9 +185,9 @@ class Page(object):
@property
def permstr(self):
flags = self.flags
return ''.join(['r' if flags & 4 else '-',
'w' if flags & 2 else '-',
'x' if flags & 1 else '-',
return ''.join(['r' if flags & os.R_OK else '-',
'w' if flags & os.W_OK else '-',
'x' if flags & os.X_OK else '-',
'p'])
def __str__(self):
width = 2 + 2*pwndbg.typeinfo.ptrsize

@ -10,6 +10,7 @@ system has /proc/$$/maps, which backs 'info proc mapping'.
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import gdb
@ -381,3 +382,9 @@ def check_aslr():
vmmap.aslr = True
return vmmap.aslr
@pwndbg.events.cont
def mark_pc_as_executable():
mapping = find(pwndbg.regs.pc)
if not mapping.execute:
mapping.flags |= os.X_OK

Loading…
Cancel
Save