Compare commits
2 Commits
0b709669b0
...
38706feff6
Author | SHA1 | Date |
---|---|---|
JoYo | 38706feff6 | |
JoYo | ad6277c0ee |
|
@ -55,13 +55,20 @@ def generation(queue: Queue, shellcode: bytes):
|
||||||
|
|
||||||
|
|
||||||
def growth(*, shellcode: bytes, length: int) -> bytes:
|
def growth(*, shellcode: bytes, length: int) -> bytes:
|
||||||
for mnemonic, op_str in disasm(shellcode):
|
|
||||||
if mnemonic == 'nop':
|
|
||||||
return bytes(shellcode)
|
|
||||||
|
|
||||||
if length <= len(shellcode):
|
if length <= len(shellcode):
|
||||||
return bytes(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:
|
||||||
|
if mnemonic == 'nop':
|
||||||
|
return bytes(shellcode)
|
||||||
|
|
||||||
shellcode = bytearray(shellcode)
|
shellcode = bytearray(shellcode)
|
||||||
shellcode += b'\x90'
|
shellcode += b'\x90'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue