Skip to content

Commit

Permalink
Correct the use of the platform argument
Browse files Browse the repository at this point in the history
The platform argument is meant to be a PlatformList object, not as an array:
http://dev.metasploit.com/redmine/issues/6826
This commit undoes the last change to init_platform() in alpha_mixed and modifies msfvenom to use it as intended.
  • Loading branch information
jvazquez-r7 committed Jun 26, 2012
1 parent b966dda commit cc90a60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/encoders/x86/alpha_mixed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def decoder_stub(state)
# Configure SEH getpc code on Windows
#
def init_platform(platform)
if(::Msf::Module::PlatformList.from_a(platform).supports?(::Msf::Module::PlatformList.win32))
if(platform.supports?(::Msf::Module::PlatformList.win32))
datastore['AllowWin32SEH'] = true
end
end
Expand Down
3 changes: 2 additions & 1 deletion msfvenom
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ if opts[:encode]

1.upto(opts[:iterations].to_i) do |iteration|
begin
raw = enc.encode(payload_raw.dup, opts[:badchars], nil, opts[:platform])
plist = ::Msf::Module::PlatformList.from_a(opts[:platform])
raw = enc.encode(payload_raw.dup, opts[:badchars], nil, plist)
rescue Msf::EncodingError
print_error("#{enc.refname} failed: #{$!.class} : #{$!}")
skip = true
Expand Down

0 comments on commit cc90a60

Please sign in to comment.