Created
November 22, 2022 08:35
-
-
Save albertzsigovits/f726ae973ca4b2b5e4e4d7828d3e93da to your computer and use it in GitHub Desktop.
MalRE decrypt script - Exercise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mal-RE Decrypt script by @larsborn | |
#################################### | |
import binascii | |
import struct | |
buffer = binascii.unhexlify(b'') | |
def DecryptBlock(param_1: int, param_2: int) -> : | |
return (((param_1 ^ param_2) << 4 | (param_1 ^ param_2) >> 0x1 | |
out = b'' | |
for i in range(0, len(buffer), 4): | |
block = struct.unpack('<I', buffer[i:i + 4])[0] | |
decrypted_block = decrypt_block(block, 0x10a1) | |
out += struct.pack('<I', decrypted_block) | |
print(hashlib.sha256(out).hexdigest()) | |
with open('dump.bin', 'wb') as fp: | |
fp.write(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment