Skip to content

Commit 4c56d8e

Browse files
committed
Still buggy
1 parent 315874a commit 4c56d8e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

modules/post/windows/gather/enum_prefetch.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,18 @@ def run
189189
# gather_prefetch_info function that enumerates all the pf info
190190

191191
getfile_prefetch_filenames = client.fs.file.search(full_path,file_type,recurse=false,timeout=-1)
192-
getfile_prefetch_filenames.each do |file|
193-
if file.empty? or file.nil?
194-
print_error("Could not open file: %s." % file['name'])
195-
196-
else
192+
if getfile_prefetch_filenames.empty? or getfile_prefetch_filenames.nil?
193+
print_error("Could not find/access any .pf files. Can't continue.")
194+
return nil
195+
else
196+
getfile_prefetch_filenames.each do |file|
197+
if file.empty? or file.nil?
198+
print_error("Could not open file: %s" % filename)
199+
else
200+
filename = File.join(file['path'], file['name'])
201+
gather_prefetch_info(name_offset, hash_offset, lastrun_offset, runcount_offset, filename, table)
197202

198-
filename = File.join(file['path'], file['name'])
199-
gather_prefetch_info(name_offset, hash_offset, lastrun_offset, runcount_offset, filename, table)
203+
end
200204
end
201205
end
202206
end

0 commit comments

Comments
 (0)