Use fail_with
parent
4beb434054
commit
796579e265
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue