11 print(
"Usage: %s <pe_file_path>" % sys.argv[0])
14 pe_file_path = sys.argv[1]
16 with open(pe_file_path,
"rb")
as f:
19 if not b.startswith(
"MZ"):
20 print(
"Not a PE file")
23 e_lfanew = struct.unpack_from(
"<I", b, 0x3C)[0]
24 vb = struct.pack(
"<HHHHH", 5, 0, 0, 0, 5)
26 b = b[0:e_lfanew + 0x40] + vb + b[e_lfanew + 0x4A:]
28 with open(pe_file_path,
"wb")
as f: