Added checksec command

(cherry picked from commit 2eeeb0d8b8)
pull/48/head
Gulshan Singh 10 years ago committed by Zach Riggle
parent 6e0fec8574
commit 1c6466d328

@ -61,8 +61,8 @@ import pwndbg.commands.xor
import pwndbg.commands.peda
import pwndbg.commands.gdbinit
import pwndbg.commands.defcon
import pwndbg.commands.elf
import pwndbg.commands.elfheader
import pwndbg.commands.checksec
__all__ = [

@ -0,0 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gdb
import pwndbg.commands
import subprocess
@pwndbg.commands.Command
def checksec():
'''
Prints out the binary security settings. Attempts to call the binjitsu
checksec first, and then falls back to checksec.sh.
'''
#local_path = pwndbg.file.get_file(pwndbg.proc.exe)
local_path = pwndbg.proc.exe
try:
subprocess.call(['checksec', local_path])
except:
try:
subprocess.call(['checksec.sh', '--file', local_path])
except:
print(pwndbg.color.red(
'An error occurred when calling checksec. ' \
'Make sure the checksec binary is in your PATH.'
))
Loading…
Cancel
Save