modules/illScrappy/metasploit-framework/lib/msf/core/payload_generator.rb
def prepend_nops(shellcode)
      if nops > 0
        framework.nops.each_module_ranked('Arch' => [arch]) do |name, mod|
          nop = framework.nops.create(name)
          raw = nop.generate_sled(nops, {'BadChars' => badchars, 'SaveRegisters' => [ 'esp', 'ebp', 'esi', 'edi' ] })
          if raw
            cli_print "Successfully added NOP sled from #{name}"
            return raw + shellcode
          end
        end
      else
        shellcode
      end
    end
# This method takes an encoded payload and prepends a NOP Sled to it
# with a size based on the nops value given to the generator.
# @param shellcode [String] The shellcode to prepend the NOPs to
# @return [String] the shellcode with the appropriate nopsled affixed
This method takes an encoded payload and prepends a NOP Sled to it
with a size based on the nops value given to the generator.
This method takes an encoded payload and prepends a NOP Sled to it with a size based on the nops value given to the generator .
def prepend_nops(shellcode)
      if nops > 0
        framework.nops.each_module_ranked('Arch' => [arch]) do |name, mod|
          nop = framework.nops.create(name)
          raw = nop.generate_sled(nops, {'BadChars' => badchars, 'SaveRegisters' => [ 'esp', 'ebp', 'esi', 'edi' ] })
          if raw
            cli_print "Successfully added NOP sled from #{name}"
            return raw + shellcode
          end
        end
      else
        shellcode
      end
    end
def prepend_nops ( shellcode ) if nops > 0 framework . nops . each_module_ranked ( 'Arch' => [ arch ] ) do | name , mod | nop = framework . nops . create ( name ) raw = nop . generate_sled ( nops , { 'BadChars' => badchars , 'SaveRegisters' => [ 'esp' , 'ebp' , 'esi' , 'edi' ] } ) if raw cli_print "Successfully added NOP sled from #{name}" return raw + shellcode end end else shellcode end end
This method takes an encoded payload and prepends a NOP Sled to it
with a size based on the nops value given to the generator.
This method takes an encoded payload and prepends a NOP Sled to it with a size based on the nops value given to the generator .
the shellcode with the appropriate nopsled affixed
the shellcode with the appropriate nopsled affixed
String
shellcode
The shellcode to prepend the NOPs to
The shellcode to prepend the NOPs to