Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- from hashlib import sha1
- with open('binaryfile', 'rb') as bin:
- binary = bin.read()
- base = 0x1234
- for seq in [[0xec, 0xb0, 0xaa, 0xaf], [0xed, 0xb0, 0xaa, 0xaf], ...]:
- copy = binary[0:base]
- copy += bytes(seq)
- copy += binary[base+len(seq):]
- if sha1(copy).hexdigest() = '9968733ce3ff0893bbb0a19e75faaf2fb0000e19':
- print('success with bytes {0}'.format(seq))
- break
- else:
- print('no success')
Add Comment
Please, Sign In to add comment