mirror of
https://github.com/dobin/ShellcodeObfuscationLab
synced 2026-06-08 13:53:31 +00:00
25 lines
661 B
Python
25 lines
661 B
Python
import sys
|
|
|
|
|
|
def get_raw_sc(input_file):
|
|
input_file = input_file
|
|
file_shellcode = b''
|
|
try:
|
|
with open(input_file, 'rb') as shellcode_file:
|
|
file_shellcode = shellcode_file.read()
|
|
file_shellcode = file_shellcode.strip()
|
|
return(file_shellcode)
|
|
except FileNotFoundError:
|
|
sys.exit("Supplied input file not found!")
|
|
|
|
|
|
def noobfuscation(input_file):
|
|
shellcode = get_raw_sc(input_file)
|
|
shellcode = list(shellcode)
|
|
|
|
ret = ""
|
|
ret += 'unsigned char shellcode[{}] = {};'.format(
|
|
str(len(shellcode)),
|
|
'{' + '{}'.format(', '.join(str(x) for x in shellcode)) + '}')
|
|
return ret
|