Skip to content

Commit 98a1663

Browse files
authored
Merge pull request #1 from SkyBulk/master
fixing disassemble part
2 parents 55225af + edcc76b commit 98a1663

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

winappdbgtest.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,20 @@ def event_handler(self, event):
2525
# Get basic infomation about the event
2626
msg = str(Crash(event))
2727

28-
# Try to disassembly the code around the fault instruction
2928
try:
3029
eip = thread.get_pc()
31-
code = thread.disassemble_around(eip)
30+
code = thread.disassemble_around_pc(eip)
3231
msg += str(CrashDump.dump_code(code, eip))
33-
except WindowsError, e:
32+
except WindowsError as e:
3433
pass
35-
34+
print msg
3635
# Log information about the crash (registers, disassemby, so on)
3736
#logger = Logger('crashes/' + filename + '.log')
3837
#logger.log_event(event, msg)
3938

4039
# Attempt to kill the process
4140
event.get_process().kill()
4241

43-
4442
def run(self):
4543
testcase = 1
4644
while True:
@@ -50,7 +48,7 @@ def run(self):
5048

5149
# get next case file...
5250
# for the sake of the exercise, we'll use the same file every time
53-
self.current_file = 'c:\\test.txt'
51+
self.current_file = r'C:\Users\blackleitus\Desktop\fuzzing\fuzzing\CRASH_POC\\crash_0a06fc26-a8fa-4e91-bec1-5090a50c6289.dat'
5452

5553
print("Case #%d: running %s %s" % (testcase, self.app, self.current_file))
5654
dbg.execv([self.app] + [self.current_file])
@@ -77,13 +75,13 @@ def run(self):
7775

7876

7977
# Kill any existing process of our target
80-
for (process, name) in dbg.system.find_processes_by_filename('notepad.exe'):
78+
for (process, name) in dbg.system.find_processes_by_filename('fuzzme.exe'):
8179
#print process.get_pid(), name
8280
pid = process.get_pid()
8381
dbg.detach(process.get_pid())
8482
with open(os.devnull, "w") as fnull:
8583
subprocess.call(['taskkill', '/F', '/T', '/PID', str(pid)], stdout = fnull, stderr = fnull)
8684

8785

88-
dbgengine = Dbg(r'c:\windows\system32\notepad.exe')
86+
dbgengine = Dbg(r'C:\Users\blackleitus\Desktop\fuzzing\fuzzing\fuzzme.exe')
8987
dbgengine.run()

0 commit comments

Comments
 (0)