modules/illScrappy/metasploit-framework/lib/msf/core/payload_generator.rb
# This method takes the payload shellcode and formats it appropriately based
# on the selected output format.
# @param shellcode [String] the processed shellcode to be formatted
# @return [String] The final formatted form of the payload
This method takes the payload shellcode and formats it appropriately based
on the selected output format.
This method takes the payload shellcode and formats it appropriately based on the selected output format .
def format_payload(shellcode)
      case format.downcase
        when "js_be"
          if Rex::Arch.endian(arch) != ENDIAN_BIG
            raise IncompatibleEndianess, "Big endian format selected for a non big endian payload"
          else
            ::Msf::Simple::Buffer.transform(shellcode, format, @var_name)
          end
        when *::Msf::Simple::Buffer.transform_formats
          ::Msf::Simple::Buffer.transform(shellcode, format, @var_name)
        when *::Msf::Util::EXE.to_executable_fmt_formats
          ::Msf::Util::EXE.to_executable_fmt(framework, arch, platform_list, shellcode, format, exe_options)
        else
          raise InvalidFormat, "you have selected an invalid payload format"
      end
    end
def format_payload ( shellcode ) case format . downcase when "js_be" if Rex :: Arch . endian ( arch ) != ENDIAN_BIG raise IncompatibleEndianess , "Big endian format selected for a non big endian payload" else :: Msf :: Simple :: Buffer . transform ( shellcode , format , @var_name ) end when * :: Msf :: Simple :: Buffer . transform_formats :: Msf :: Simple :: Buffer . transform ( shellcode , format , @var_name ) when * :: Msf :: Util :: EXE . to_executable_fmt_formats :: Msf :: Util :: EXE . to_executable_fmt ( framework , arch , platform_list , shellcode , format , exe_options ) else raise InvalidFormat , "you have selected an invalid payload format" end end
This method takes the payload shellcode and formats it appropriately based
on the selected output format.
This method takes the payload shellcode and formats it appropriately based on the selected output format .
The final formatted form of the payload
The final formatted form of the payload
String
shellcode
the processed shellcode to be formatted
the processed shellcode to be formatted