Improve method for brute-force of rooms
This commit is contained in:
@@ -1,21 +1,35 @@
|
||||
import vona.globals as globals
|
||||
import vona.config as config
|
||||
import os
|
||||
import multiprocessing
|
||||
|
||||
versions = [str(i) for i in range(1, 10)]
|
||||
desired_ver = input("Desired room version:\n\t")
|
||||
|
||||
if desired_ver not in versions:
|
||||
os._exit(1)
|
||||
print("Unsupported room version")
|
||||
exit(1)
|
||||
|
||||
try:
|
||||
while True:
|
||||
room_id = os.urandom(8).hex()
|
||||
room_ver = globals.room_version_from_id(room_id)
|
||||
def worker(room_found):
|
||||
try:
|
||||
while not room_found.value:
|
||||
room_id = globals.make_event_id().replace("$", "!")
|
||||
room_ver = globals.room_version_from_id(room_id)
|
||||
|
||||
if room_ver == desired_ver:
|
||||
print(f"!{room_id}:{config.server_name}")
|
||||
break
|
||||
except:
|
||||
print("")
|
||||
pass
|
||||
if room_ver == desired_ver:
|
||||
print(room_id)
|
||||
room_found.value = True
|
||||
break
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
room_found = multiprocessing.Value('b', False)
|
||||
processes = []
|
||||
|
||||
for _ in range(multiprocessing.cpu_count()):
|
||||
p = multiprocessing.Process(target=worker, args=(room_found,))
|
||||
processes.append(p)
|
||||
p.start()
|
||||
|
||||
for p in processes:
|
||||
p.join()
|
||||
|
||||
Reference in New Issue
Block a user