feature: 2-byte xor key

This commit is contained in:
Dobin
2024-05-20 09:21:44 +01:00
parent 87cb4bfe5b
commit 0e08fde15d
7 changed files with 22 additions and 5 deletions
+7
View File
@@ -46,5 +46,12 @@ def encode_payload(payload: bytes, decoder_style: DecoderStyle) -> bytes:
logger.info("---[ XOR payload with key 0x{:X}".format(xor_key))
xored = bytes([byte ^ xor_key for byte in payload])
return xored
elif decoder_style == DecoderStyle.XOR_2:
xor_key = config.xor_key2
logger.info("---[ XOR2 payload with key {}".format(xor_key))
xored = bytearray(payload)
for i in range(len(xored)):
xored[i] ^= xor_key[i % 2]
return xored
else:
raise Exception("Unknown decoder style")