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.unstable
parent
e9b70a3a4f
commit
ef6dad2bc3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue