diff --git a/lib/msf/util/exe.rb b/lib/msf/util/exe.rb index 5d6c0e509a..98ac8c6850 100755 --- a/lib/msf/util/exe.rb +++ b/lib/msf/util/exe.rb @@ -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