@@ -25,22 +25,20 @@ def event_handler(self, event):
25
25
# Get basic infomation about the event
26
26
msg = str (Crash (event ))
27
27
28
- # Try to disassembly the code around the fault instruction
29
28
try :
30
29
eip = thread .get_pc ()
31
- code = thread .disassemble_around (eip )
30
+ code = thread .disassemble_around_pc (eip )
32
31
msg += str (CrashDump .dump_code (code , eip ))
33
- except WindowsError , e :
32
+ except WindowsError as e :
34
33
pass
35
-
34
+ print msg
36
35
# Log information about the crash (registers, disassemby, so on)
37
36
#logger = Logger('crashes/' + filename + '.log')
38
37
#logger.log_event(event, msg)
39
38
40
39
# Attempt to kill the process
41
40
event .get_process ().kill ()
42
41
43
-
44
42
def run (self ):
45
43
testcase = 1
46
44
while True :
@@ -50,7 +48,7 @@ def run(self):
50
48
51
49
# get next case file...
52
50
# 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 '
54
52
55
53
print ("Case #%d: running %s %s" % (testcase , self .app , self .current_file ))
56
54
dbg .execv ([self .app ] + [self .current_file ])
@@ -77,13 +75,13 @@ def run(self):
77
75
78
76
79
77
# 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' ):
81
79
#print process.get_pid(), name
82
80
pid = process .get_pid ()
83
81
dbg .detach (process .get_pid ())
84
82
with open (os .devnull , "w" ) as fnull :
85
83
subprocess .call (['taskkill' , '/F' , '/T' , '/PID' , str (pid )], stdout = fnull , stderr = fnull )
86
84
87
85
88
- dbgengine = Dbg (r'c:\windows\system32\notepad .exe' )
86
+ dbgengine = Dbg (r'C:\Users\blackleitus\Desktop\fuzzing\fuzzing\fuzzme .exe' )
89
87
dbgengine .run ()
0 commit comments