Skip to content

Instantly share code, notes, and snippets.

@endes0
Created April 21, 2023 13:00
Show Gist options
  • Save endes0/cdc7ee66ab9b9414893a267105892d6e to your computer and use it in GitHub Desktop.
Save endes0/cdc7ee66ab9b9414893a267105892d6e to your computer and use it in GitHub Desktop.
Decrypt ChipGenius Chips.wdb file database
key = [0x19, 0x86, 0x10, 0x18]
with open('Chips.wdb', 'rb') as f:
f.seek(0x2)
date = f.readline()
f.seek(0xE)
magic = f.read(2)
print("DB date: " + date.decode('utf-8'))
print("DB magic: " + magic.decode('utf-8'))
print("OK" if magic == b'WR' else "Invalid magic")
f.seek(0x10)
data = f.read()
decrypted = ""
for i in range(len(data)):
#print("0x{:02x} ^ 0x{:02x} = 0x{:02x}".format(data[i], key[i % 4], data[i] ^ key[i % 4]))
decrypted += chr(data[i] ^ key[i % 4])
print(decrypted)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment