'genNOP is used to create an arbitrary length NOP sled using characters of your choosing.
Perhaps you prefer , perhaps you like the defaults. Given a list of NOP characters,
genNOP will randomize and spit out something not easily recognized by the average human/rev engineer.
Still, while you are working a vulnerability, you may prefer to specify one byte such as "A" or
"" as they are easily identified while searching memory.
Defaults:
# inc eax       @       @
# inc ecx       A       A
# inc edx       B       B
# inc ebx       C       C
# inc esp       D       D
# inc ebp       E       E
# inc esi       F       F
# inc edi       G       G
# dec eax       H       H
# dec esx       J       J
# daa           \'       \'
# das           /       /
# nop                   
# xor eax,eax           3À
source: atlasutils'

@staticmethod
def gennop(size, NOPS=None):

    DEFAULT_NOPS = "ABCFGHKIJ@'"
    if (not NOPS):
        NOPS = DEFAULT_NOPS
    sled = ''
    for i in range(size, 0, (-1)):
        N = random.randint(0, (len(NOPS) - 1))
        sled += NOPS[N]
    return sled
