Skip to content

Instantly share code, notes, and snippets.

@larsenv
Created July 27, 2021 22:35
Show Gist options
  • Save larsenv/e17a068809f8b53fa15108afd00dfc16 to your computer and use it in GitHub Desktop.
Save larsenv/e17a068809f8b53fa15108afd00dfc16 to your computer and use it in GitHub Desktop.
crc32 seed brute force tool
import sys
import zlib
if len(sys.argv) != 3:
print("Usage: crc.py <input> <seed (in hex form)>")
sys.exit(1)
with open(sys.argv[1], "rb") as f:
read = f.read()
for i in range(0x00000000, 0x100000000):
crc = zlib.crc32(read, i)
if crc == int(sys.argv[2], 16):
print(hex(i) + " matches!")
else:
print(hex(i), end="\r")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment