class MetasploitModule < Msf::Nop
def initialize
super(
'Name' => 'Simple',
'Alias' => 'armle_simple',
'Description' => 'Simple NOP generator',
'License' => MSF_LICENSE,
'Author' => ['timwr'],
'Arch' => ARCH_AARCH64)
register_advanced_options(
[
OptBool.new('RandomNops', [ false, "Generate a random NOP sled", true ])
])
end
def generate_sled(length, opts)
random = opts['Random'] || datastore['RandomNops']
nops = [
0xd503201f,
0xaa0103e1,
0xaa0203e2,
0x2a0303e3,
0x2a0403e4,
]
if random
return ([nops[rand(nops.length)]].pack("V*") * (length/4))
end
return ([nops[0]].pack("V*") * (length/4))
end
end