Use fail_with

GSoC/Meterpreter_Web_Console
Jacob Robles 2018-10-10 11:24:16 -05:00
parent 4beb434054
commit 796579e265
No known key found for this signature in database
GPG Key ID: 3EC9F18F2B12401C
1 changed files with 2 additions and 3 deletions

View File

@ -115,8 +115,7 @@ class MetasploitModule < Msf::Exploit::Remote
h = format('%<num>x', num: num)
s = ('0' * (h.length % 2) + h).rjust(length * 2)
s = s.scan(/.{2}/).map! { |x| x.hex.chr }.join
return s if endianess == 'big'
return s.reverse
endianess == 'big' ? s : s.reverse
end
def data_size(number, numbytes = (1...9))
@ -126,7 +125,7 @@ class MetasploitModule < Msf::Exploit::Remote
bits = size * 7
return to_bytes(((1 << bits) + number), size) if number <= (1 << bits) - 2
end
raise ArgumentError, "Can't store #{number} in #{size} bytes"
fail_with(Failure::BadConfig, "Can't store #{number} in #{size} bytes")
end
def build_data(size)