Skip to content

Commit 32aa2c6

Browse files
committed
Make asm spacing easier to read
Also adds a #prepends callback to Payload::Windows to make it a little clearer what's happening.
1 parent 66d5f39 commit 32aa2c6

File tree

3 files changed

+418
-410
lines changed

3 files changed

+418
-410
lines changed

lib/msf/core/exploit.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,15 +1242,6 @@ def handler_enabled?
12421242
not datastore['DisablePayloadHandler']
12431243
end
12441244

1245-
#
1246-
# Returns the state of the PrependMigrate option
1247-
# See https://github.com/rapid7/metasploit-framework/pull/917
1248-
# for discussion.
1249-
#
1250-
def prepend_migrate?
1251-
!!(datastore['PrependMigrate'] && datastore['PrependMigrate'].to_s.downcase == 'true')
1252-
end
1253-
12541245
##
12551246
#
12561247
# Handler interaction

lib/msf/core/payload/windows.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
###
1313
module Msf::Payload::Windows
1414

15-
include Msf::Payload::PrependMigrate
15+
include Msf::Payload::Windows::PrependMigrate
1616

1717
#
1818
# ROR hash associations for some of the exit technique routines.
@@ -25,6 +25,18 @@ module Msf::Payload::Windows
2525
'none' => 0x5DE2C5AA, # GetLastError
2626
}
2727

28+
29+
# @abstract Override to add additional stubs to prepend to the final
30+
# shellcode. Be sure to call super so other modules may add stubs.
31+
# @return [String] Stub to place at the begginning of generated shellcode
32+
def prepends
33+
""
34+
end
35+
36+
def generate(*args)
37+
return prepends + super
38+
end
39+
2840
#
2941
# This mixin is chained within payloads that target the Windows platform.
3042
# It provides special variable substitution for things like EXITFUNC and

0 commit comments

Comments
 (0)