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
| from zipfile import ZipFile | |
| file_name = "password.zip" | |
| with ZipFile(file_name, "r") as zip: | |
| for pwd in range(1000,10000): | |
| try: | |
| zip.extractall(path="uncompressed", pwd=(str(pwd)).encode("utf-8")) | |
| print(pwd) | |
| print("SUCCESS") | |
| break |
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
| def score(src, planet, pw): | |
| scoring = planet.growth_rate() * 10 - planet.num_ships() | |
| #distance | |
| for my_planet in pw.my_planets(): | |
| total_distance = pw.distance(my_planet, planet) | |
| scoring -= total_distance | |
| #fleets for planet |
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
| @echo off | |
| REM --> Check for permissions | |
| IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( | |
| >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" | |
| ) ELSE ( | |
| >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
| ) | |
| REM --> If error flag set, we do not have admin. |
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
| require 'openssl' | |
| class String | |
| def encrypt(key) | |
| cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt | |
| cipher.key = Digest::SHA1.hexdigest key | |
| s = cipher.update(self) + cipher.final | |
| s.unpack('H*')[0].upcase | |
| end |