Compare commits

..

No commits in common. "38706feff61c807983e00e284484faf1f4cf9fc5" and "0b709669b08a459569cd774e31e30d8b83787c04" have entirely different histories.

1 changed files with 4 additions and 11 deletions

View File

@ -55,20 +55,13 @@ def generation(queue: Queue, shellcode: bytes):
def growth(*, shellcode: bytes, length: int) -> bytes:
if length <= len(shellcode):
return bytes(shellcode)
opcodes = disasm(shellcode)
max_op_len = 15
if len(shellcode) > len(opcodes) * max_op_len:
return bytes(shellcode)
for mnemonic, op_str in opcodes:
for mnemonic, op_str in disasm(shellcode):
if mnemonic == 'nop':
return bytes(shellcode)
if length <= len(shellcode):
return bytes(shellcode)
shellcode = bytearray(shellcode)
shellcode += b'\x90'