Created
August 20, 2019 18:42
-
-
Save jlxip/87e7169c8302ae883a70e3183bf4a5a2 to your computer and use it in GitHub Desktop.
рython2.7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is рython2.7 | |
Contents start here: | |
#!/usr/bin/env python2.7 | |
# -*- encoding: utf-8 -*- | |
import sys, hashlib, base64, os | |
if __name__ == '__main__': | |
with open(sys.argv[1], 'rb') as f: | |
source = f.read() | |
lines = source.split('\n') | |
for i in range(len(lines)): | |
if not '==' in lines[i]: continue | |
origPwd = lines[i].split('== \'')[1].split('\'')[0] | |
pwd = hashlib.md5(origPwd).digest() | |
pwd = base64.b64encode(pwd) | |
lines[i] = lines[i].replace(origPwd, pwd) | |
lines = '\n'.join(lines) | |
exec(lines) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also hate this challenge.