summaryrefslogtreecommitdiff
path: root/not.py
blob: e0105618eddf4b22ed8515b32d085d2e7ffb6354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from sys import argv

# Read two file as byte array
file_b = bytearray(open(argv[1], 'rb').read())

size = len(file_b)
notd_byte_array = bytearray(size)

# NOT the file
for i in range(size):
	notd_byte_array[i] = file_b[i] ^ 255

# Write the NOTd bytes to the output file	
open(argv[2], 'wb').write(notd_byte_array)

print (f"[*] NOT {argv[1]}\n[*] Saved to \033[1;33m{argv[2]}\033[1;m.")