Force binary string encoding in ruby 1.9.1, fix up a bad index call in x86.rb
git-svn-id: file:///home/svn/framework3/trunk@6618 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
2b4e0f440b
commit
0e35efaea2
|
@ -263,6 +263,7 @@ class Encoder < Module
|
|||
# initialized and is ready to go.
|
||||
#
|
||||
def do_encode(state)
|
||||
|
||||
# Copy the decoder stub since we may need to modify it
|
||||
stub = decoder_stub(state).dup
|
||||
|
||||
|
|
|
@ -28,8 +28,10 @@ if (RUBY_VERSION =~ /^1\.9\./)
|
|||
puts " issues trying to use this version with the Metasploit Framework"
|
||||
|
||||
|
||||
# Force binary encoding
|
||||
# Encoding.default_external = Encoding.default_internal = "binary"
|
||||
# Force binary encoding for Ruby versions that support it
|
||||
if(Object.const_defined?('Encoding') and Encoding.respond_to?('default_external='))
|
||||
Encoding.default_external = Encoding.default_internal = "binary"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -474,7 +474,7 @@ module X86
|
|||
end
|
||||
|
||||
pad = 0
|
||||
while (pad < (128-12) and badchars.index( (256-12-pad)))
|
||||
while (pad < (128-12) and badchars.index( (256-12-pad).chr))
|
||||
pad += 4
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue