Change the .text-too-small error message.

The original error message apparently confuses people, and this
can be easily improved.  See the following:
https://community.rapid7.com/thread/2356
bug/bundler_fix
sinn3r 2013-01-05 01:57:41 -06:00
parent 990957917f
commit 4ff186c23d
1 changed files with 5 additions and 2 deletions

View File

@ -255,8 +255,11 @@ require 'digest/sha1'
raise RuntimeError, "The .text section does not contain an entry point"
end
if(text.size < (payload.length + 256))
raise RuntimeError, "The .text section is too small to be usable"
p_length = payload.length + 256
if(text.size < p_length)
msg = "The .text section is too small. "
msg << "Minimum is #{p_length.to_s} bytes, your .text section is #{text.size.to_s} bytes"
raise RuntimeError, msg
end
# Store some useful offsets