Repository navigation
Expand file tree
/
Copy pathTeknikality.py
More file actions
460 lines (420 loc) · 18.7 KB
/
Copy pathTeknikality.py
File metadata and controls
460 lines (420 loc) · 18.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
import random, datetime, time, os, getpass
from pyfiglet import Figlet
version = "3.6"
class colors:
RESET = "\033[0m"
# Styles
BOLD = "\033[1m"
DIM = "\033[2m"
ITALIC = "\033[3m"
UNDERLINE = "\033[4m"
BLINK = "\033[5m"
INVERT = "\033[7m"
HIDDEN = "\033[8m"
STRIKETHROUGH = "\033[9m"
# Foreground (text) colors
BLACK = "\033[30m"
RED = "\033[31m"
GREEN = "\033[32m"
YELLOW = "\033[33m"
BLUE = "\033[34m"
PURPLE = "\033[35m"
CYAN = "\033[36m"
WHITE = "\033[37m"
# Bright Foreground colors
BRIGHT_BLACK = "\033[90m"
BRIGHT_RED = "\033[91m"
BRIGHT_GREEN = "\033[92m"
BRIGHT_YELLOW = "\033[93m"
BRIGHT_BLUE = "\033[94m"
BRIGHT_PURPLE = "\033[95m"
BRIGHT_CYAN = "\033[96m"
BRIGHT_WHITE = "\033[97m"
# Background colors
BG_BLACK = "\033[40m"
BG_RED = "\033[41m"
BG_GREEN = "\033[42m"
BG_YELLOW = "\033[43m"
BG_BLUE = "\033[44m"
BG_MAGENTA = "\033[45m"
BG_CYAN = "\033[46m"
BG_WHITE = "\033[47m"
# Bright Background colors
BG_BRIGHT_BLACK = "\033[100m"
BG_BRIGHT_RED = "\033[101m"
BG_BRIGHT_GREEN = "\033[102m"
BG_BRIGHT_YELLOW = "\033[103m"
BG_BRIGHT_BLUE = "\033[104m"
BG_BRIGHT_MAGENTA = "\033[105m"
BG_BRIGHT_CYAN = "\033[106m"
BG_BRIGHT_WHITE = "\033[107m"
def random_addr_generator():
return hex(random.randint(10000000, 99999999))
def print_message(loading_bar_included=random.choice([True, False]), state=random.choice(["Error", "Info"])):
ranissuenames = ["System.exe", "NetWorker98.exe", "Winxhlsl.dll", "Explorer.exe", f"(__unknown__>>>InMemory<<<).__FileType>>>InMemory<<<__", "ready.dll", "registry.ini", "xx8ui.dll"]
ranvictimnames = ["worker95.exe", "NetShop89.exe", "(__unknown__>>>InMemory<<<).__FileType>>>InMemory<<<__", "Duel.dll", "DualShock_4.exe", "msshch.dll"]
msgtypes = ["Memory", "Network"]
ms = datetime.datetime.now().microsecond
msgtype = random.choice(msgtypes)
if msgtype == "Memory":
if state == "Error":
print(f" [{ms}MS: Message] ERROR: Segmentation fault at address {random_addr_generator()} with program traceback {random.choice(ranissuenames)} tried to access memory at {random_addr_generator()} which belonged to {random.choice(ranvictimnames)}. The program will now be terminated.")
else:
print(f"[{ms}MS: Message] INFO: Cleared {random.randint(0, 99999)}B of memory at {random_addr_generator()} for {random.choice(ranissuenames)}")
else:
if state == "Error":
print(f" [{ms}MS: Message] ERROR: Lost connection to the sever!")
else:
print(f"[{ms}MS: Message] INFO: Connected to the cloud host server.")
if loading_bar_included:
print(f"Loading {msgtype} defaults... [", end="")
for i in range(random.randint(3, 30)):
time.sleep(random.uniform(0.02, 0.05))
if random.randint(1, 30) == 5:
time.sleep(0.3)
print("#", end="", flush=True)
print("]", end="")
print(" ...Finished!")
def clearscreen():
os.system("cls" if os.name == "nt" else "clear")
def very_long_loading_bar():
download_speed = 0
message = ""
total_bytes = 0
logs = ""
clearscreen()
for i in range(101):
total_bytes += 12884902
ranfiles = [
"Version.txt", "Logs.txt", "Program.exe", "PlayerHandlerx64.dll",
"Config.ini", "Settings.json", "UserData.db", "Cache.dat",
"GraphicsDriver.sys", "AudioEngine.dll", "InputManager.dll",
"NetworkHandler.dll", "PhysicsEngine.dll", "Shaders.bin",
"Textures.pak", "Models.pak", "Maps.pak", "SaveData.sav",
"Achievements.dat", "Localization_en.lang", "Localization_fr.lang",
"Localization_es.lang", "Localization_de.lang", "Themes.cfg",
"Fonts.ttf", "Update1.patch", "Update2.patch", "Hotfix1.patch",
"CrashReport.log", "DebugSymbols.sym", "AIController.dll",
"Pathfinding.dll", "AnimationController.dll", "SoundEffects.pak",
"MusicTracks.pak", "IntroVideo.mp4", "Cinematics.dat", "Launcher.exe",
"Bootstrap.dll", "EncryptionKey.key", "License.txt", "Readme.md",
"ThirdPartySDK.dll", "ProfilerTool.exe", "TestSuite.exe",
"Backup1.bak", "Backup2.bak", "TempCache.tmp", "OldLogs.zip",
"NetworkConfig.cfg", "ServerList.json", "PlayerProfiles.db",
"AchievementTracker.dll", "ErrorHandler.dll", "UpdateChecker.exe",
"PatchNotes.txt", "DefaultSettings.cfg", "ControllerMappings.cfg",
"TutorialVideo.mp4", "SplashScreen.png", "IconSet.ico", "ThemeMusic.mp3",
"VoicePack_en.pak", "VoicePack_fr.pak", "VoicePack_es.pak", "VoicePack_de.pak",
"AIProfiles.dat", "BehaviorTree.xml", "PhysicsProfiles.dat", "CollisionMap.dat",
"LightingProfiles.bin", "PostProcessingProfiles.bin", "Particles.pak",
"EffectsLibrary.dll", "UIElements.dll", "HUDAssets.pak", "FontsExtra.ttf",
"Localization_ja.lang", "Localization_ko.lang", "Localization_cn.lang",
"Localization_ru.lang", "CheatDetection.dll", "SecurityPatch1.patch",
"SecurityPatch2.patch", "TempFile1.tmp", "TempFile2.tmp", "DebugLog1.log",
"DebugLog2.log", "MetricsReport.csv", "AnalyticsData.json", "Telemetry.dll",
"CrashDump1.dmp", "CrashDump2.dmp", "ErrorLogs1.txt", "ErrorLogs2.txt",
"Updater.exe", "Installer.msi", "Uninstaller.exe", "LicenseAgreement.txt",
"ReleaseNotes.txt", "PatchInstaller.exe"
]
ranlogs = [
f" >> Processing data {random.randint(1000000, 1288490189)}B/1288490189B\n",
f" >> Failed to find original source file\n",
f" >> Successfully wrote {random.choice(ranfiles)}\n",
f" >> Failed to write to {random_addr_generator()}\n",
f" >> Network latency detected, retrying connection\n",
f" >> Checksum verified for {random.choice(ranfiles)}\n",
f" >> Warning: Temporary file {random_addr_generator()} was not deleted\n",
f" >> Encrypting {random.choice(ranfiles)}...\n",
f" >> Decrypting {random.choice(ranfiles)}...\n",
f" >> Backup completed for {random.choice(ranfiles)}\n",
f" >> Disk write speed: {random.randint(10, 120)}MB/s\n",
f" >> Memory allocation successful\n",
f" >> Memory allocation failed, retrying...\n",
f" >> Thread pool initialized with {random.randint(1, 16)} threads\n",
f" >> Connection to server established\n",
f" >> Connection to server lost, reconnecting...\n",
f" >> Loaded configuration from {random.choice(ranfiles)}\n",
f" >> Parsing data block #{random.randint(1000,9999)}\n",
f" >> CPU usage spike detected: {random.randint(50, 100)}%\n",
f" >> GPU usage spike detected: {random.randint(50, 100)}%\n",
f" >> Error code {random.randint(100, 599)} encountered\n",
f" >> Warning: Possible data corruption detected\n",
f" >> Successfully compressed {random.choice(ranfiles)}\n",
f" >> Decompression failed for {random.choice(ranfiles)}\n",
f" >> File integrity verified for {random.choice(ranfiles)}\n",
f" >> Temporary directory cleaned\n",
f" >> Logging system initialized\n",
f" >> Debug mode enabled\n",
f" >> Critical patch applied successfully\n",
f" >> Critical patch failed, rollback initiated\n",
f" >> Scan completed: 0 threats found\n",
f" >> Scan completed: 1 threat found\n",
f" >> Task scheduler started\n",
f" >> Task scheduler stopped unexpectedly\n",
f" >> {getpass.getuser()} Timed out!"
]
download_speed = random.randint(0, 60)
effect = random.randint(0, 30)
download_speed += effect
logs += colors.GREEN + random.choice(ranlogs) + colors.RESET
logs = "" if i % 50 == 0 else logs
message += f"{colors.GREEN}▓{colors.RESET}" if download_speed > 30 else f"{colors.GREEN}▒{colors.RESET}" if download_speed > 20 else f"{colors.YELLOW}░{colors.RESET}" if download_speed > 10 else f"{colors.RED}▓{colors.RESET}"
print("▏" + message + "-" * (100 - i) + "▕" + f" Speed: {str(download_speed) + "!" if download_speed < 10 else f"{download_speed}"}MB/s | Complete: {i}% | ETA: {abs(i - (effect - 20 ))} Seconds" + f"\n\n{logs}")
time.sleep(random.uniform(0.03, 0.17))
if i != 100:
clearscreen()
else:
time.sleep(3)
break
def dictionary_inverse(dict):
return {value: key for key, value in dict.items()}
def text_to_hex_dump(text, width=16):
"""Convert text to a memory-dump style hex output."""
hex_dump = ""
for i in range(0, len(text), width):
chunk = text[i:i+width]
# Hex part
hex_part = ' '.join(f"{ord(c):02x}" for c in chunk)
# ASCII part (printable characters only, others as '.')
ascii_part = ''.join(c if 32 <= ord(c) <= 126 else '.' for c in chunk)
hex_dump += f"{i:08x} {hex_part:<{width*3}} |{ascii_part}|\n"
return hex_dump
def BigText(m):
f = Figlet(font="slant")
return f.renderText(m)
class smartLogging:
def __init__(self, log_name):
self.running = False
self.point = log_name
self.since_start = 0
def start(self):
self.running = True
self.event("Logging started", "smart logging")
self.since_start = time.time()
def error(self, msg, fromwhat="NONE"):
if not self.running:
raise RuntimeError("Start smartLogging first!")
errortime = time.time() - self.since_start
print(f"{colors.BOLD}{colors.BRIGHT_BLACK}[{errortime}MS]-[{colors.RED} ERROR {colors.RESET}{colors.BRIGHT_BLACK}]{colors.BOLD}{self.point}@{fromwhat}: {msg}")
def event(self, msg, fromwhat="NONE"):
if not self.running:
raise RuntimeError("Start smartLogging first!")
errortime = time.time() - self.since_start
print(f"{colors.BOLD}{colors.BRIGHT_BLACK}[{errortime}MS]-[{colors.PURPLE} EVENT {colors.RESET}{colors.BRIGHT_BLACK}]{colors.BOLD}{self.point}@{fromwhat}: {msg}")
def info(self, msg):
if not self.running:
raise RuntimeError("Start smartLogging first!")
errortime = time.time() - self.since_start
print(f"{colors.BRIGHT_BLACK}[{errortime}MS]-[ INFO {colors.BRIGHT_BLACK}]{colors.BOLD} {msg}")
def warning(self, msg, fromwhat="NONE"):
if not self.running:
raise RuntimeError("Start smartLogging first!")
errortime = time.time() - self.since_start
print(f"{colors.BOLD}{colors.BRIGHT_BLACK}[{errortime}MS]-[{colors.YELLOW} WARN {colors.RESET}{colors.BRIGHT_BLACK}]{self.point}@{fromwhat}{colors.BOLD} {msg}")
def is_not_readable_symbol(s):
ascii_result = s
return ascii_result == " " or not ascii_result.isprintable() or ascii_result.strip() == " "
class numbertools:
@staticmethod
def positive(num):
return num > 0
@staticmethod
@staticmethod
def negative(num):
return num < 0
@staticmethod
def cap(num, min=0, max=100):
if num > max:
return max
elif num < min:
return min
else:
return num
@staticmethod
def inverse(num):
return num - num - num
class stringtools:
@staticmethod
def lines_amount(s):
s = s.split("\n")
return len(s)
@staticmethod
def strict_isin(s, m):
return m in list(s)
@staticmethod
def strict_replace(s, m, w):
finished = list(s)
count = 0
for char in finished:
if char == m:
finished[count] = w
count += 1
return ''.join(finished)
class _ThreadObject: # Represents a thread inside EasyThreadMultitasking
def __init__(self, name, code, location):
self.name = name
self.code = code
self.location = location
def which(self):
return [self.name, self.location]
def getCode(self):
return self.code
def runIndiv(self):
before = datetime.datetime.now().microsecond
ETM.log(f"runIndiv(): Running thread {self.name} at location {self.location}")
exec(self.code)
after = datetime.datetime.now().microsecond
ETM.log(f"runIndiv(): Finished running thread {self.name} at location {self.location}. Took {after - before}MS")
def boolOf(w):
return bool(w)
class EasyThreadMultitasking:
def __init__(self):
self.Log = "" # Because EVERYTHING needs a log.
self.currentThreads = [] # Stores thread name's
self.threads = {} # Stores current threads and their codes
self.running = [False, False] # [<is_thread_created? true: false>, <fired? true: false>]
def log(self, msg):
self.Log += f"[{datetime.datetime.now()}] {msg}\n"
def addThread(self, name, code): # Adds it to threads but also, can use <thread>.which() to get current thread name and number. <thread>.getCode() to get the threads code. And <thread.runIndiv> to run the thread as one.
self.running[0] = True
self.currentThreads.append(name)
location = len(self.currentThreads) - 1
self.threads[name] = code
return _ThreadObject(name, code, location)
def FIRE(self): # Runs the threads, uppercase because its IMPORTANT. AND COOL.
loop = len(self.currentThreads)
try:
self.running[1] = True
self.log(f"FIRE(): Starting thread execution! vars:loop={loop}")
for i in range(loop):
self.log(f"FIRE(InternalLoop): Starting thread {i}")
code = self.threads[self.currentThreads[i - 1]]
self.log(f"FIRE(InternalLoop): Running thread {self.currentThreads[i]} at location {i}")
before = datetime.datetime.now().microsecond
exec(code)
after = datetime.datetime.now().microsecond
self.log(f"FIRE(InternalLoop): Finished running thread {self.currentThreads[i]} at location {i}. Took {after - before}MS")
if loop > len(self.currentThreads):
self.log("FIRE(InternalLoop): Resseting loop count.")
loop = 1
self.log("FIRE(): Finished running all threads.")
self.log(f"Status: {self.running}")
self.log("FIRE(): Awaiting input...")
except Exception as e:
print("------------- ETM --------------- ThreadError")
raise RuntimeError(f"FIRE(): An error occurred while running thread {loop - 1}({self.currentThreads[loop - 1]}): {e}")
def getLogs(self): # Because some people are very nerdy.
return self.Log
ETM = EasyThreadMultitasking()
class Dynamic_Loading_Bar:
def __init__(self):
self.running = False
self.percent = 0
self.savedFixedText = ""
self.bar = "[" + "#" * self.percent + "-" * (100 - self.percent) + "]"
self.name = None
self.savedText = ""
self.title = ""
self.printWhenDone = "Finished"
def print_whilst_loading_bar(self, snapshot):
str_snap = " >> " + str(snapshot) + "\n"
self.savedText += str_snap
self.step()
def printg(self, msg):
print(colors.GREEN + msg + colors.RESET)
def initialize(self, name, whatafter):
self.printWhenDone = whatafter
if self.running:
raise RuntimeError("A loading bar is already in progress!")
self.name = name
printg = self.printg
self.running = True
clearscreen()
printg(f"{self.name}")
printg(self.bar)
def print_whilst_loading_bar_fixed_text(self, snapshot_fix):
str_snap = f"{colors.GREEN} >> {colors.RESET}" + str(snapshot_fix) + "\n"
self.savedFixedText += str_snap
self.step()
def step(self):
self.push(0)
def change_title(self, name):
self.name = name
self.step()
def push_to_given_percent(self, how_much):
how_much = numtools.cap(how_much)
self.percent = how_much
def push(self, how_much):
printg = self.printg
if not self.running:
raise RuntimeError("Initlize a loading bar instance before increasing it. Use DLB.initialize(<title>, <what to print when finished>)")
self.percent += how_much
if self.percent + how_much > 100:
self.percent = 100
self.percent = numtools.cap(self.percent, min=0, max=100)
self.bar = "[" + "#" * self.percent + "-" * (100 - self.percent) + "]"
clearscreen()
printg(f"{self.name}")
printg(self.bar)
printg(self.savedText)
print(self.savedFixedText)
if self.percent == 100:
printg(self.printWhenDone)
self.running = False
return
class tesseract:
def __init__(self):
self.is_file_installed = None
self.inner = {}
self.outer = {}
def create(self, where, variable, value):
if where == "inner":
self.inner[variable] = value
elif where == "outer":
self.outer[variable] = value
else:
raise RuntimeError(f"Tesseract levels not in inner or outer. Got: {where}")
def delete(self, where, variable):
try:
if where == "inner":
del self.inner[variable]
elif where == "outer":
del self.outer[variable]
else:
raise RuntimeError(f"Tesseract levels not in inner or outer. Got: {where}")
except (KeyError, Exception) as e:
if e == KeyError:
print(f"Couldn't find {variable}: {e}")
else:
pass
class serrikka:
def __init__(self):
self.saves = {}
def _parsecode(self, code):
parsed_code = ""
reportedlines = code.split("done")
for line in reportedlines:
parsed_line = ""
if line.startswith("set"):
# Correct: set [x.Hello, World!]
val = line.split(".")[1].strip("]")
var = line.split("[")[1].split(".")
var = var[0]
print(var)
print(val)
parsed_line += f"{"{" + var + f" = {val}" + "};\n"}"
print(parsed_line)
def save(self, name, data):
if type(data) is not str:
raise RuntimeError(f"Expected str for {name}, got {type(data)}")
else:
if not os.path.isdir("serrikka\\Saves"):
raise RuntimeError("Couldn't fine serrikka saves folder! Run serrikka.initilize() first!")
else:
with open(f"serrikka\\Saves\\{name}.mssf", "w") as f:
pass
serrikka_ = serrikka()
TESSERACT = tesseract()
numtools = numbertools()
DLB = Dynamic_Loading_Bar()
strtools = stringtools()