fixes #259. pass in badchars properly

git-svn-id: file:///home/svn/framework3/trunk@5957 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-11-19 06:41:42 +00:00
parent 2f049269d6
commit cfbb600304
1 changed files with 14 additions and 2 deletions

View File

@ -39,11 +39,23 @@ class PayloadsController < ApplicationController
payload_opts += "#{$1}=#{v} "
end
}
badchars_buff = ""
badchars.split(/,|\s+/).each do |c|
c.strip!
next if c.length == 0
if(c =~ /^0x/)
badchars_buff << c.hex.chr
else
badchars_buff << c.to_i.chr
end
end
begin
@generation = modinst.generate_simple(
'Encoder' => (pencoder == '__default') ? nil : pencoder,
'BadChars' => badchars,
'BadChars' => badchars_buff,
'Format' => pformat || 'c',
'OptionStr' => payload_opts,
'MaxSize' => (max_size == 0) ? nil : max_size)