Skip to content

Instantly share code, notes, and snippets.

@monester
Created September 20, 2017 09:42
Show Gist options
  • Save monester/e943aa21430a3560d235e29b15512d03 to your computer and use it in GitHub Desktop.
Save monester/e943aa21430a3560d235e29b15512d03 to your computer and use it in GitHub Desktop.
f = open("replay_last_battle.wotreplay", 'rb')
data = f.read()
magic_number, data = data[:4], data[4:]
block_count, data = int.from_bytes(data[:4], byteorder='little'), data[4:]
blocks = []
for block_id in range(block_count):
block_length, data = int.from_bytes(data[:4], byteorder='little'), data[4:]
block_data, data = data[:block_length], data[block_length:]
blocks.append(block_data)
from Crypto.Cipher import Blowfish
from struct import pack
bs = Blowfish.block_size
iv = data[:bs]
ciphertext = data[bs:]
key = 'DE72BEA0DE04BEB1DEFEBEEFDEADBEEF'
cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv)
msg = cipher.decrypt(ciphertext)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment