Fix loading binary modules on Windows
[#36737359, #36401509] Failed to follow HACKING guideline #5, open files in binary mode, so Pro modules were being truncated on Windows installs.
This commit is contained in:
@@ -73,6 +73,13 @@ class Msf::Modules::Loader::Directory < Msf::Modules::Loader::Base
|
||||
def read_module_content(parent_path, type, module_reference_name)
|
||||
full_path = module_path(parent_path, type, module_reference_name)
|
||||
|
||||
::File.read(full_path)
|
||||
module_content = ''
|
||||
|
||||
# force to read in binary mode so Pro modules won't be truncated on Windows
|
||||
File.open(full_path, 'rb') do |f|
|
||||
module_content = f.read
|
||||
end
|
||||
|
||||
module_content
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user