Fix src_size view

MS-2855/keylogger-mettle-extension
a1exdandy 2018-02-15 17:44:41 +05:00
parent a0c473f29e
commit 7e03bf838b
1 changed files with 2 additions and 1 deletions

View File

@ -286,7 +286,8 @@ class File < Rex::Post::Meterpreter::Extensions::Stdapi::Fs::IO
while (buf = src_fd.read(buf_size))
dest_fd.write(buf)
percent = dest_fd.pos.to_f / src_size.to_f * 100.0
msg = "Uploaded #{Filesize.new(dest_fd.pos).pretty} of #{src_size} (#{percent.round(2)}%)"
msg = "Uploaded #{Filesize.new(dest_fd.pos).pretty} of " \
"#{Filesize.new(src_size).pretty} (#{percent.round(2)}%)"
stat.call(msg, src_file, dest_file)
end
ensure