Guest User

Untitled

a guest
Apr 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. from hashlib import sha1
  3.  
  4. with open('binaryfile', 'rb') as bin:
  5. binary = bin.read()
  6.  
  7. base = 0x1234
  8. for seq in [[0xec, 0xb0, 0xaa, 0xaf], [0xed, 0xb0, 0xaa, 0xaf], ...]:
  9. copy = binary[0:base]
  10. copy += bytes(seq)
  11. copy += binary[base+len(seq):]
  12. if sha1(copy).hexdigest() = '9968733ce3ff0893bbb0a19e75faaf2fb0000e19':
  13. print('success with bytes {0}'.format(seq))
  14. break
  15. else:
  16. print('no success')
Add Comment
Please, Sign In to add comment