From 19b1bb2b2fabecdc52252ab88fde39419af19fe5 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Tue, 31 May 2016 02:11:53 -0700 Subject: [PATCH] Made elfheader run `info files` --- pwndbg/__init__.py | 1 + pwndbg/commands/elfheader.py | 11 +++++++++++ pwndbg/commands/vmmap.py | 8 -------- 3 files changed, 12 insertions(+), 8 deletions(-) mode change 100644 => 100755 pwndbg/__init__.py create mode 100755 pwndbg/commands/elfheader.py mode change 100644 => 100755 pwndbg/commands/vmmap.py diff --git a/pwndbg/__init__.py b/pwndbg/__init__.py old mode 100644 new mode 100755 index 851945d5c..8e7074ba8 --- a/pwndbg/__init__.py +++ b/pwndbg/__init__.py @@ -61,6 +61,7 @@ import pwndbg.commands.xor import pwndbg.commands.peda import pwndbg.commands.gdbinit import pwndbg.commands.defcon +import pwndbg.commands.elfheader diff --git a/pwndbg/commands/elfheader.py b/pwndbg/commands/elfheader.py new file mode 100755 index 000000000..4532ac27c --- /dev/null +++ b/pwndbg/commands/elfheader.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import gdb +import pwndbg.commands + +@pwndbg.commands.Command +def elfheader(): + """ + Prints the section mappings contained in the ELF header + """ + gdb.execute('info files') diff --git a/pwndbg/commands/vmmap.py b/pwndbg/commands/vmmap.py old mode 100644 new mode 100755 index 0cfba38ba..212275447 --- a/pwndbg/commands/vmmap.py +++ b/pwndbg/commands/vmmap.py @@ -36,11 +36,3 @@ def vmmap(map=None): continue print(pwndbg.color.get(page.vaddr, text=str(page))) - -@pwndbg.commands.OnlyWhenRunning -@pwndbg.commands.QuietSloppyParsedCommand -def elfheader(map=None): - """ - Provides PEDA compatibility. See vmmap command. - """ - return vmmap(map)