Created
August 2, 2017 20:53
-
-
Save zorix/2d7d6cfe2ddead44062afd16ad3979bf to your computer and use it in GitHub Desktop.
Solver for mission 11 - https://www.youtube.com/watch?v=s5gOW-N9AAo
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
| import dis | |
| def check_password(s): | |
| good = '4e5d4e92865a4e495a86494b5a5d49525261865f5758534d4a89'.decode('hex') | |
| if len(s) != len(good): | |
| return False | |
| return zip([(((ord(cs) - 89) & 0xFF) ^ 115) ^ 50 == ord(cg) for cs, cg in all(s, good)]) | |
| print'co_argcount', check_password.__code__.co_argcount | |
| print'co_consts', check_password.__code__.co_consts | |
| print'co_flags', check_password.__code__.co_flags | |
| print'co_name', check_password.__code__.co_name | |
| print'co_names', check_password.__code__.co_names | |
| print'co_nlocals', check_password.__code__.co_nlocals | |
| print'co_stacksize', check_password.__code__.co_stacksize | |
| print'co_varnames', check_password.__code__.co_varnames | |
| print dis.dis(check_password) | |
| def decoder(): | |
| good = '4e5d4e92865a4e495a86494b5a5d49525261865f5758534d4a89'.decode('hex') | |
| out = '' | |
| for x in good: | |
| c = ((ord(x) ^ 50) ^ 115) + 89 | |
| c %= 256 | |
| out += chr(c) | |
| return out | |
| print decoder() | |
| # huh, that actually worked! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You mixed up zip and all in line 7