CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/base/simple/nop.rb
Views: 1904
1
# -*- coding: binary -*-
2
3
module Msf
4
module Simple
5
6
###
7
#
8
# Simple nop wrapper class for performing generation.
9
#
10
###
11
module Nop
12
13
include Module
14
15
#
16
# Generate a nop sled, optionally with a few parameters.
17
#
18
# opts can have any of the standard nop generate sled options
19
# as well as:
20
#
21
# Format => The format to represent the data as: ruby, perl, c, raw
22
#
23
def self.generate_simple(nop, length, opts)
24
# Generate the nop sled using the options supplied
25
buf = nop.generate_sled(length, opts)
26
27
# Serialize the generated payload to some sort of format
28
return Buffer.transform(buf, opts['Format'] || 'raw')
29
end
30
31
#
32
# Calls the class method.
33
#
34
def generate_simple(length, opts)
35
Msf::Simple::Nop.generate_simple(self, length, opts)
36
end
37
38
end
39
40
end
41
end
42
43