mirror of https://github.com/pwndbg/pwndbg.git
Various updates for symbolizing, auxv. Adds aslr command.
parent
c08cb916a1
commit
286206d163
@ -0,0 +1,13 @@
|
||||
import pwndbg.vmmap
|
||||
import pwndbg.commands
|
||||
import pwndbg.color
|
||||
|
||||
@pwndbg.commands.OnlyWhenRunning
|
||||
@pwndbg.commands.Command
|
||||
def aslr():
|
||||
status = pwndbg.color.red('OFF')
|
||||
if pwndbg.vmmap.aslr:
|
||||
status = pwndbg.color.green('ON')
|
||||
|
||||
print("ASLR is %s" % status)
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
"""
|
||||
Provides functionality to circumvent GDB's hooks on sys.stdin and sys.stdout
|
||||
which prevent output from appearing on-screen inside of certain event handlers.
|
||||
"""
|
||||
import gdb
|
||||
import io
|
||||
import sys
|
||||
|
||||
debug = True
|
||||
|
||||
def get(fd, mode):
|
||||
file = io.open(1, mode=mode, buffering=0, closefd=False)
|
||||
return io.TextIOWrapper(file, write_through=True)
|
||||
|
||||
if debug:
|
||||
sys.stdin = get(0, 'rb')
|
||||
sys.stdout = get(1, 'wb')
|
||||
sys.stderr = get(2, 'wb')
|
||||
Loading…
Reference in new issue