Skip to content

Commit ff7756c

Browse files
committed
Make #prepends() actually work
1 parent c37510f commit ff7756c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/msf/core/payload/windows.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: binary -*-
22
require 'msf/core'
3-
require 'msf/core/payload/windows/prepend_migrate'
43

54
###
65
#
@@ -12,6 +11,7 @@
1211
###
1312
module Msf::Payload::Windows
1413

14+
require 'msf/core/payload/windows/prepend_migrate'
1515
# Provides the #prepends method
1616
include Msf::Payload::Windows::PrependMigrate
1717

@@ -27,8 +27,8 @@ module Msf::Payload::Windows
2727
}
2828

2929

30-
def generate(*args)
31-
return prepends + super
30+
def generate
31+
return prepends(super)
3232
end
3333

3434
#

lib/msf/core/payload/windows/prepend_migrate.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def prepend_migrate?
3333
#
3434
# Overload the generate() call to prefix our stubs
3535
#
36-
def prepends
36+
def prepends(buf)
3737
pre = ''
3838

3939
test_arch = [ *(self.arch) ]
@@ -49,7 +49,7 @@ def prepends
4949
pre << Metasm::Shellcode.assemble(Metasm::X64.new, migrate_asm).encode_string
5050
end
5151
end
52-
return pre
52+
return pre + buf
5353
end
5454

5555
#

0 commit comments

Comments
 (0)