Skip to content

Commit

Permalink
Make #prepends() actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
egypt committed Jan 22, 2013
1 parent c37510f commit ff7756c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/msf/core/payload/windows.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: binary -*-
require 'msf/core'
require 'msf/core/payload/windows/prepend_migrate'

###
#
Expand All @@ -12,6 +11,7 @@
###
module Msf::Payload::Windows

require 'msf/core/payload/windows/prepend_migrate'
# Provides the #prepends method
include Msf::Payload::Windows::PrependMigrate

Expand All @@ -27,8 +27,8 @@ module Msf::Payload::Windows
}


def generate(*args)
return prepends + super
def generate
return prepends(super)
end

#
Expand Down
4 changes: 2 additions & 2 deletions lib/msf/core/payload/windows/prepend_migrate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def prepend_migrate?
#
# Overload the generate() call to prefix our stubs
#
def prepends
def prepends(buf)
pre = ''

test_arch = [ *(self.arch) ]
Expand All @@ -49,7 +49,7 @@ def prepends
pre << Metasm::Shellcode.assemble(Metasm::X64.new, migrate_asm).encode_string
end
end
return pre
return pre + buf
end

#
Expand Down

0 comments on commit ff7756c

Please sign in to comment.