Skip to content

Commit

Permalink
2.1
Browse files Browse the repository at this point in the history
- added module [browser-backup]
- updated dank.tool ui and banner
- added error reporting for dank_tool_installer()
- added manual debug mode switch

dankware [3.1] updates:
- added export_registry_keys()
- added is_admin()
- updated clr(): you can now set custom colours for both text and special characters!
- improved err()


Former-commit-id: b7393a6
  • Loading branch information
SirDank committed Feb 25, 2023
1 parent 331a015 commit 9637a1c
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 30 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@

---

# 🚨 Browser Backup 🚨

- Creates a full backup of your browser data including registry keys and protects it using a user set password
- Easily transfer your browser to another system by following the provided steps

## ♦️ To Do ♦️

- [] Add support for more browsers

## ♦️ Preview ♦️

<br><p align="center"><img width="800" alt="image" src="https://user-images.githubusercontent.com/52797753/221374732-126bdd5e-da49-4d68-979e-0c688e88ea4b.png"></p><br>

<br><p align="center"><img width="800" alt="image" src="https://user-images.githubusercontent.com/52797753/221374800-f8d4d8c5-5a6e-4f51-a9b1-784c0322543d.png"></p><br>

<p>&nbsp;</p>

---

# 🚨 Auto-Clicker 🚨

- Set your own click speed!
Expand Down
101 changes: 101 additions & 0 deletions __modules__/dank.browser-backup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import os
import sys
import shutil
import datetime
import pyminizip
from psutil import process_iter
from alive_progress import alive_bar
from dankware import title, cls, clr, err, align, magenta, rm_line, is_admin, export_registry_keys

def backup(browser, password, compression_level):

if browser == "Chrome":

while True:
cls(); chrome_running = False
for proc in process_iter(['name']):
if proc.info['name'] == 'chrome.exe':
chrome_running = True; break
if chrome_running: input(clr("\n > Chrome is running! Terminate it and press [ENTER]... ",2))
else: break

print(clr("\n > Copying browser data... (this might take a minute)"))
if os.path.exists("User Data"): shutil.rmtree("User Data", ignore_errors=True)
shutil.copytree(os.path.expandvars(r"%LOCALAPPDATA%\Google\Chrome\User Data"), "User Data")

print(clr("\n > Exporting registry keys..."))
export_registry_keys('HKEY_CURRENT_USER', r'Software\Google\Chrome\PreferenceMACs')

print(clr("\n > Compressing... (this might take a few minutes)\n"))
source_files = ["export.reg"]
prefixes = ["export.reg"]

for root, dirs, files in os.walk("User Data"):
for file in files:
filepath = os.path.join(root, file)
relpath = os.path.relpath(filepath, "User Data")
source_files.append(filepath)
prefixes.append(relpath)

now = datetime.datetime.now()
zip_name = f'chrome_[{now.strftime("%d-%m-%Y")}]_[{now.strftime("%I-%M-%S-%p")}].zip'

with alive_bar(len(source_files)) as progress:
pyminizip.compress_multiple(source_files, prefixes, zip_name, password, compression_level, lambda x: progress(progress()+1))

print(clr("\n > Cleaning..."))
if os.path.exists("User Data"): shutil.rmtree("User Data", ignore_errors=True)
if os.path.exists("export.reg"): os.remove("export.reg")

cls(); input(clr(f'\n > [STEPS TO TRANSFER]: \n\n - Transfer {zip_name} to another computer\n - Unzip with the password "{password}"\n - Install chrome\n - Exit chrome\n - Open explorer\n - Paste path [%LOCALAPPDATA%\\Google\\Chrome]\n - Delete the [User Data] folder\n - Move extracted [User Data] folder to [%LOCALAPPDATA%\\Google\\Chrome]\n - Run [export.reg]\n - Transfer Complete!\n\n > Press [ENTER] once you have read the steps... '))

#elif browser == "Firefox"
#elif browser == "Opera":
#elif browser == "Brave":

def main():

cls(); title("𝚍𝚊𝚗𝚔.𝚋𝚛𝚘𝚠𝚜𝚎𝚛-𝚋𝚊𝚌𝚔𝚞𝚙"); banner = "\n\n \n _ _ _ _ _ \n _| |___ ___| |_ | |_ ___ ___ _ _ _ ___ ___ ___ ___| |_ ___ ___| |_ _ _ ___ \n| . | .'| | '_|_| . | _| . | | | |_ -| -_| _|___| . | .'| _| '_| | | . |\n|___|__,|_|_|_,_|_|___|_| |___|_____|___|___|_| |___|__,|___|_,_|___| _|\n |_| \n\n"
try:
if not is_admin(): raise RuntimeError(clr("Current user is not an administrator! Exporting browser data and registry keys requires admin privileges!"))
except: sys.exit(clr(err(sys.exc_info()),2))

try: os.chdir(os.path.join(os.environ['USERPROFILE'],'Documents'))
except: os.chdir("C:\\")
try: os.mkdir('dank.browser-backup')
except: pass
os.chdir('dank.browser-backup')

browsers = ['Chrome']
to_print = "\n > Supported Browsers: \n"
for _ in range(len(browsers)): to_print += f"\n - [{_+1}] {browsers[_]}"
to_print += "\n"

print(align(clr(banner,4)) + clr(to_print))

while True:
choice = input(clr(" > Enter choice: ") + magenta)
if choice.isdigit() and int(choice) > 0 and int(choice) <= int(len(browsers)):
choice = browsers[int(choice)-1]; break
else: rm_line()

print("")
while True:
password = input(clr(" > Enter backup password: ") + magenta)
if password: break
else: rm_line()

print("")
while True:
compression_level = input(clr(" > Compression level (Fast/Best) [1/2]: ") + magenta).lower()
if compression_level in ['1', 'fast']:
compression_level = 0; break
elif compression_level in ['2', 'best']:
compression_level = 10; break
else: rm_line()

backup(choice, password, compression_level)

os.system(f'explorer.exe "{os.getcwd()}"')

if __name__ == "__main__": main()
4 changes: 2 additions & 2 deletions __modules__/dank.minecraft-server-builder.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import sys
import time
import shutil
import requests
from shutil import unpack_archive
from dankware import title, rm_line, align, cls, clr, white, magenta, red, reset, github_file_selector, multithread, sys_open, err

def print_banner():
Expand Down Expand Up @@ -217,7 +217,7 @@ def file_downloader(url, file_name):
if file == 'overworld': tmp_name = 'stable'
else: tmp_name = 'main'

unpack_archive(f'plugins/Iris/packs/{file}.zip', 'plugins/Iris/packs', 'zip')
shutil.unpack_archive(f'plugins/Iris/packs/{file}.zip', 'plugins/Iris/packs', 'zip')
time.sleep(1)
try: os.rename(f'plugins/Iris/packs/{file}-{tmp_name}', f'plugins/Iris/packs/{file}')
except:
Expand Down
20 changes: 12 additions & 8 deletions __src__/dank.tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def updated_on(url, dankware_module = True):
if dankware_module: url = f"https://api.github.com/repos/SirDank/dank.tool/commits?path=__modules__/{url}.py&page=1&per_page=1"
try:

response = requests.get(url,timeout=3).json()
response = requests.get(url, timeout=3).json()
if response == []: return f"[ unreleased ]"
else:
date, time = response[0]["commit"]["author"]["date"].split("T")
Expand Down Expand Up @@ -62,6 +62,7 @@ def get_request_responses(task_id):
elif task_id == 5: request_responses["SpotX-Win"] = updated_on("https://api.github.com/repos/amd64fox/SpotX/commits?path=Install.ps1&page=1&per_page=1",False)
elif task_id == 6: request_responses["Spicetify"] = updated_on("https://api.github.com/repos/spicetify/spicetify-cli/commits?path=.&page=1&per_page=1",False)
elif task_id == 7: request_responses["dank.auto-clicker"] = updated_on("dank.auto-clicker")
elif task_id == 8: request_responses["dank.browser-backup"] = updated_on("dank.browser-backup")

# main

Expand All @@ -70,25 +71,26 @@ def get_request_responses(task_id):
title(f"𝚍𝚊𝚗𝚔.𝚝𝚘𝚘𝚕 [{current_version}]") # current_version defined in executor.py
os.chdir(os.path.dirname(__file__)) # exec_mode = "exe"; exec(chdir(exec_mode))
discord_rpc_state = "on the main menu"
banner='\n _ _ _ \n | | | | _ | |\n _ | | ____ ____ | | _ | |_ ___ ___ | |\n / || |/ _ | _ \\| | / )| _)/ _ \\ / _ \\| |\n( (_| ( ( | | | | | |< ( | |_| |_| | |_| | |\n \\____|\\_||_|_| |_|_| \\_|_)___)___/ \\___/|_|\n'
#old_banner='\n _ _ _ \n | | | | _ | |\n _ | | ____ ____ | | _ | |_ ___ ___ | |\n / || |/ _ | _ \\| | / )| _)/ _ \\ / _ \\| |\n( (_| ( ( | | | | | |< ( | |_| |_| | |_| | |\n \\____|\\_||_|_| |_|_| \\_|_)___)___/ \\___/|_|\n'
banner = '\n .. .. s .. \n dF < .z@8"` :8 x .d88" \n\'88bu. u. u. !@88E .88 u. u. 5888R \n\'*88888bu u x@88k u@88c. \'888E u :888ooo ...ue888b ...ue888b \'888R \n ^"*8888N us888u. ^"8888""8888" 888E u@8NL -*8888888 888R 888r 888R 888r 888R \n beWE "888L .@88 "8888" 8888 888R 888E`"88*" 8888 888R 888> 888R 888> 888R \n 888E 888E 9888 9888 8888 888R 888E .dN. 8888 888R 888> 888R 888> 888R \n 888E 888E 9888 9888 8888 888R 888E~8888 8888 888R 888> 888R 888> 888R \n 888E 888F 9888 9888 8888 888R 888E \'888& . .8888Lu= u8888cJ888 u8888cJ888 888R \n.888N..888 9888 9888 "*88*" 8888" 888E 9888. .@8c ^%888* "*888*P" "*888*P" .888B . \n `"888*"" "888*""888" "" \'Y" \'"888*" 4888" \'%888" \'Y" \'Y" \'Y" ^*888% \n "" ^Y" ^Y\' "" "" ^* "% \n'

# multithread requests

request_responses = {}
while True:
try: multithread(get_request_responses, 100, [ _ for _ in range(8) ], progress_bar=False); break
try: multithread(get_request_responses, 100, [ _ for _ in range(9) ], progress_bar=False); break
except KeyboardInterrupt: input(clr(f"\n > Failed to get request responses! Try not to use [COPY] or [PASTE]! Press [ENTER] to try again... ",2))
except: input(clr(f"\n > Failed to get request responses! Make sure you are connected to the internet! Press [ENTER] to try again... ",2))

while True:

# print randomly coloured and aligned banner

cls(); print(align(clr(banner,4) + f"\n{white}s i r {magenta}. {white}d a n k {magenta}<3"))
cls(); print(align(clr(banner,4) + f"\n{white}s i r {magenta}. {white}d a n k {magenta}<3\n"))

# global runs

stats = f"\n\n > Global dankware runs: {request_responses['dankware_runs']}\n\n > Global dank.tool runs: {request_responses['danktool_runs']}"
stats = f"dankware runs: {request_responses['dankware_runs']} | dank.tool runs: {request_responses['danktool_runs']}"

# available modules

Expand All @@ -97,15 +99,16 @@ def get_request_responses(task_id):
f'Minecraft Server Scanner {request_responses["dank.minecraft-server-scanner"]}',
f'SpotX {request_responses["SpotX-Win"]} + Spicetify {request_responses["Spicetify"]} Installer',
f'Auto Clicker {request_responses["dank.auto-clicker"]}',
f'Browser Backup {request_responses["dank.browser-backup"]}',
f'Chatroom [ {request_responses["chatroom_user_count"]} online ] [ coming soon! ]',
]

# print modules with counter and get choice

counter = 1; modules_to_print = ""
for module in modules: modules_to_print += f"\n\n {counter} > {module}"; counter += 1
choice = input(clr(f"\n - Stats: {stats}\n\n - Modules: {modules_to_print}\n\n - Choice: ") + magenta)
if choice.isdigit() and int(choice) > 0 and int(choice) < int(len(modules))+1:
for module in modules: modules_to_print += f"\n {counter} > {module}"; counter += 1
choice = input(clr(f"\n - Stats: {stats}\n\n - Modules: \n{modules_to_print}\n\n - Choice: ") + magenta)
if choice.isdigit() and int(choice) > 0 and int(choice) <= int(len(modules)):
choice = modules[int(choice)-1]; break

# debug menu
Expand All @@ -126,6 +129,7 @@ def get_request_responses(task_id):
elif "Software Downloader" in choice: project, discord_rpc_state = "dank.downloader", "bulk downloading software"
elif "SpotX" in choice: project, discord_rpc_state = "dank.spotify", "installing SpotX and Spicetify"
elif "Auto Clicker" in choice: project, discord_rpc_state = "dank.auto-clicker", "running auto-clicker"
elif "Browser Backup" in choice: project, discord_rpc_state = "dank.browser-backup", "backing up browser"
elif "Chatroom" in choice: project, discord_rpc_state = "dank.chatroom", "texting in the chatroom"
# elif "Analyze suspicious file" in choice: project = "dank.virus-total"
# elif "Sussy Optimiser" in choice: project = "dank.sussy-optimiser"
Expand Down
39 changes: 23 additions & 16 deletions __src__/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@
- [ exec_mode = "script" ] is used for testing, to be run as a script | It is automatically changed to [ exec_mode = "exe" ] to be run as an executable
'''

import shutil
import ctypes
import winreg
import pyminizip
import subprocess
from psutil import process_iter
from playsound import playsound
from mcstatus import JavaServer
from shutil import unpack_archive
from win10toast import ToastNotifier
from alive_progress import alive_bar
from pynput.keyboard import Key, Listener
from pynput.mouse import Button, Controller
from dankware import multithread, align, magenta, white, red, reset, github_downloads, github_file_selector, rm_line, random_ip, get_duration, chdir
from dankware import multithread, align, magenta, white, red, reset, github_downloads, github_file_selector, rm_line, random_ip, get_duration, chdir, sys_open, is_admin, export_registry_keys

# required imports for executor.py

Expand All @@ -33,14 +37,14 @@
from pypresence import Presence
from packaging.version import parse
from concurrent.futures import ThreadPoolExecutor
from dankware import cls, clr, title, sys_open, err
from dankware import cls, clr, title, err

# variables

session = requests.Session()
executor = ThreadPoolExecutor()

current_version = "2.0"
current_version = "2.1"
title("𝚍𝚊𝚗𝚔.𝚝𝚘𝚘𝚕 [ 𝚒𝚗𝚒𝚝𝚒𝚊𝚕𝚒𝚣𝚒𝚗𝚐 ]") # exec(chdir(exec_mode))
print(clr(f"\n > Version: {current_version}"))

Expand Down Expand Up @@ -73,7 +77,7 @@ def check_file_integrity():
if not checksum in checksums:
warning_banner = '\n\n\n\n888 888 d8888 8888888b. 888b 888 8888888 888b 888 .d8888b. 888 \n888 o 888 d88888 888 Y88b 8888b 888 888 8888b 888 d88P Y88b 888 \n888 d8b 888 d88P888 888 888 88888b 888 888 88888b 888 888 888 888 \n888 d888b 888 d88P 888 888 d88P 888Y88b 888 888 888Y88b 888 888 888 \n888d88888b888 d88P 888 8888888P" 888 Y88b888 888 888 Y88b888 888 88888 888 \n88888P Y88888 d88P 888 888 T88b 888 Y88888 888 888 Y88888 888 888 Y8P \n8888P Y8888 d8888888888 888 T88b 888 Y8888 888 888 Y8888 Y88b d88P " \n888P Y888 d88P 888 888 T88b 888 Y888 8888888 888 Y888 "Y8888P88 888 \n\n\n'
cls(); print(clr(align(warning_banner) + "\n > Integrity check failure! This may indicate that the software has been tampered with.\n\n > As a precaution, I recommend that you check your system for malware.", 2))
if 'dev' not in input(clr("\n > Press [ ENTER ] to force update dank.tool... ")): current_version = "0"
if 'debug' not in input(clr("\n > Press [ ENTER ] to force update dank.tool... ")): current_version = "0"
cls()
check_file_integrity()
Expand All @@ -86,29 +90,32 @@ def dank_tool_installer():
while True:
try: code = session.get("https://raw.githubusercontent.com/SirDank/dank.tool/main/__src__/updater.py").content.decode(); break
except: input(clr("\n > Failed to get code! Make sure you are connected to the internet! Press [ENTER] to try again... ",2))
try: exec(code)
try: exec(code); sys.exit("Updated!")
except:
err_message = err(sys.exc_info())
try: requests.post("https://dank-site.onrender.com/dank-tool-errors", data={"text": f"```<--- 🚨 ---> Version: {current_version}\n\n{err_message}```"})
except: pass
print(clr(err_message, 2))
input(clr("\n > Press [ENTER] to EXIT... ",2))
sys.exit(1)

development_version = False
if os.path.exists('debug'): development_version = True
else: development_version = False
if parse(latest_version) > parse(current_version):
print(clr(f"\n > Update Found: {latest_version}")); dank_tool_installer()
elif latest_version == current_version: print(clr(f"\n > Latest Version!"))
else: print(clr("\n > Development Version!")); development_version = True

# get main code from github if development_version = False else locally

if not development_version:
while True:
try: code = session.get("https://raw.githubusercontent.com/SirDank/dank.tool/main/__src__/dank.tool.py").content.decode(); break
except: input(clr("\n > Failed to get code! Make sure you are connected to the internet! Press [ENTER] to try again... ",2))
else:
if development_version:
while True:
try: code = open('__src__/dank.tool.py', 'r', encoding='utf-8').read(); break
except: input(clr("\n > Failed to get code! Unable to read '__src__/dank.tool.py'! Press [ENTER] to try again... ",2))
else:
while True:
try: code = session.get("https://raw.githubusercontent.com/SirDank/dank.tool/main/__src__/dank.tool.py").content.decode(); break
except: input(clr("\n > Failed to get code! Make sure you are connected to the internet! Press [ENTER] to try again... ",2))

# start discord rpc

Expand Down Expand Up @@ -137,17 +144,17 @@ def dank_tool_discord_rpc():
# update counter

def dank_tool_runs_counter():
try: requests.get("https://api.countapi.xyz/hit/dank.tool", timeout=3)
except: pass
while True:
try: requests.get("https://api.countapi.xyz/hit/dank.tool", timeout=3); break
except: pass
executor.submit(dank_tool_runs_counter)

# chatroom user validator

def dank_tool_chatroom():
session = requests.Session()
url = "https://dank-site.onrender.com/chatroom-users"
while True:
try: session.post(url)
try: session.post("https://dank-site.onrender.com/chatroom-users")
except: pass
time.sleep(240)
executor.submit(dank_tool_chatroom)
Expand Down
2 changes: 1 addition & 1 deletion __src__/executor_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0
2.1
2 changes: 1 addition & 1 deletion __src__/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
cls(); input(clr(f"\n > Failed to extract!\n > Please manually extract \"{os.path.join(os.getcwd(), 'dank.tool.zip')}\"\n > Press [ENTER] to EXIT... ",2))
sys.exit("Failed to extract")
sys_open("dank.tool-[installer].exe")
sys.exit("Updated!")
sys.exit("Updated!") # REMOVE THIS
2 changes: 1 addition & 1 deletion dank.tool.exe.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
be06419f0f0094e8e1d8dd90046b9c2770aa18ec
3ddc9d41686d10d63f8a9ab67bcb6dfa6603eb8b
2 changes: 1 addition & 1 deletion dank.tool.zip.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
70b8dcc0e5713768a3b018ae2b8a2cc709c0a224
288c69d3a99f3e514b4e0b7b70af6a6a18ffb0c1

0 comments on commit 9637a1c

Please sign in to comment.