Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue docker #48

Merged
merged 11 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.11-slim
WORKDIR /app/CODE
COPY ../requirements.txt .
RUN pip install -r requirements.txt
COPY .. .
CMD ["python", "Logicytics.py", "-h"]
# Need someone to run `docker build -t logicytics .` as my wsl is corrupted and microsoft aint helping :(
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ WEB/** linguist-detectable=false
*.html linguist-vendored
*.rtf linguist-vendored
.build/** linguist-detectable=false
.dist/** linguist-detectable=false
.dist/** linguist-detectable=false
*.exe filter=lfs diff=lfs merge=lfs -text
*.cab filter=lfs diff=lfs merge=lfs -text
9 changes: 9 additions & 0 deletions .idea/Logicytics.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions CODE/Logicytics.exe
Git LFS file not shown
11 changes: 11 additions & 0 deletions CODE/Logicytics.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import ctypes
import os
import threading
Expand Down Expand Up @@ -170,26 +171,31 @@ def execute(script: str) -> None:
# Special actions -> Quit
if action == "debug":
debug()
input("Press Enter to exit...")
exit(0)
log = Log(debug=DEBUG)
if action == "dev":
dev_checks()
input("Press Enter to exit...")
exit(0)
if action == "extra":
log.info("Opening extra tools menu...")
menu()
input("Press Enter to exit...")
exit(0)
if action == "update":
log.info("Updating...")
update()
log.info("Update complete!")
input("Press Enter to exit...")
exit(0)
if action == "restore":
log.warning(
"Sorry, this feature is yet to be implemented. You can manually Restore your backups, We will open "
"the location for you"
)
open_file("../ACCESS/BACKUP/")
input("Press Enter to exit...")
exit(1)
if action == "backup":
log.info("Backing up...")
Expand All @@ -198,6 +204,7 @@ def execute(script: str) -> None:
backup(".", "Mods_Backup")
log.debug("Backup complete -> MODS dir")
log.info("Backup complete!")
input("Press Enter to exit...")
exit(0)
if action == "unzip_extra":
log.warning(
Expand All @@ -207,13 +214,15 @@ def execute(script: str) -> None:
log.info("Unzipping...")
unzip("..\\EXTRA\\EXTRA.zip")
log.info("Unzip complete!")
input("Press Enter to exit...")
exit(0)

log.info("Starting Logicytics...")

# Checks for privileges and errors
if not check_status.admin():
log.critical("Please run this script with admin privileges", "_W", "P", "BA")
input("Press Enter to exit...")
exit(1)
if check_status.uac():
log.warning("UAC is enabled, this may cause issues")
Expand Down Expand Up @@ -302,8 +311,10 @@ def execute(script: str) -> None:
log.info("Sending webhook...")
if WEBHOOK is None or WEBHOOK == "":
log.critical("WEBHOOK URL not set and the request action was webhook", "_W", "P", "BA")
input("Press Enter to exit...")
exit(1)
"""

log.info("Exiting...")
input("Press Enter to exit...")
exit(0)
Binary file modified CODE/SysInternal_Suite/PsGetsid.exe
Binary file not shown.
Binary file modified CODE/SysInternal_Suite/PsInfo.exe
Binary file not shown.
Binary file modified CODE/SysInternal_Suite/PsLoggedon.exe
Binary file not shown.
Binary file modified CODE/SysInternal_Suite/psfile.exe
Binary file not shown.
Binary file modified CODE/SysInternal_Suite/pslist.exe
Binary file not shown.
Binary file modified CODE/SysInternal_Suite/psloglist.exe
Binary file not shown.
1 change: 1 addition & 0 deletions CODE/__Test__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
import sys # MUST-USE FOR ALL CODE TO WORK WITH EXE


class MyTestCase(unittest.TestCase):
Expand Down
51 changes: 29 additions & 22 deletions CODE/__lib_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import argparse
import json
from subprocess import CompletedProcess
import sys


class Actions:
Expand All @@ -22,28 +23,28 @@ def run_command(command: str) -> str:
@staticmethod
def flags() -> tuple[str, ...]:
"""
A static method that defines and parses command-line flags for the Logicytics application.
A static method that defines and parses command-line Flags for the Logicytics application.

The flags method uses the argparse library to define a range of flags that can be used to customize the
The Flags method uses the argparse library to define a range of Flags that can be used to customize the
behavior of the application.

The method checks for exclusivity rules and ensures that only one flag is used, unless the --reboot,
--shutdown, or --webhook flags are used, in which case only two flags are allowed.
--shutdown, or --webhook Flags are used, in which case only two Flags are allowed.

The method returns a tuple of the keys of the flags that were used, or exits the application if the flags are
The method returns a tuple of the keys of the Flags that were used, or exits the application if the Flags are
invalid.

Parameters:
None

Returns:
tuple: A tuple of the keys of the flags that were used.
tuple: A tuple of the keys of the Flags that were used.
"""
# Define the argument parser
parser = argparse.ArgumentParser(
description="Logicytics, The most powerful tool for system data analysis."
)
# Define flags
# Define Flags
parser.add_argument(
"--default", action="store_true", help="Runs Logicytics default"
)
Expand Down Expand Up @@ -81,13 +82,13 @@ def flags() -> tuple[str, ...]:
"--dev",
action="store_true",
help="Run Logicytics developer mod, this is only for people who want to register their contributions "
"properly. - Use on your own device only -.",
"properly. - Use on your own device only -.",
)
parser.add_argument(
"--exe",
action="store_true",
help="Run Logicytics using its precompiled exe's, These may be outdated and not the best, use only if the "
"device doesnt have python installed.",
"device doesnt have python installed.",
)
parser.add_argument(
"--debug",
Expand Down Expand Up @@ -132,22 +133,23 @@ def flags() -> tuple[str, ...]:
)
if "True" not in empty_check:
parser.print_help()
input("Press Enter to exit...")
exit(1)

# Check for exclusivity rules
if args.reboot or args.shutdown or args.webhook:
if not (
args.basic
or args.speedy
or args.modded
or args.silent
or args.minimal
or args.exe
args.default
or args.threaded
or args.modded
or args.minimal
or args.exe
):
print(
"--reboot and --shutdown and --webhook flags require at least one of the following flags: "
"--reboot and --shutdown and --webhook Flags require at least one of the following Flags: "
"--default, --threaded, --modded, --minimal, --exe."
)
input("Press Enter to exit...")
exit(1)
else:
special_flag_used = True
Expand All @@ -157,24 +159,26 @@ def flags() -> tuple[str, ...]:
used_flags = [flag for flag in vars(args) if getattr(args, flag)]
if len(used_flags) > 1:
print("Only one flag is allowed.")
input("Press Enter to exit...")
exit(1)
else:
# Ensure only 2 flags is used
# Ensure only 2 Flags is used
used_flags = [flag for flag in vars(args) if getattr(args, flag)]
if len(used_flags) > 2:
print(
"Only one flag is allowed with the --reboot and --shutdown and --webhook flags."
"Only one flag is allowed with the --reboot and --shutdown and --webhook Flags."
)
input("Press Enter to exit...")
exit(1)

# Set flags to True or False based on whether they were used
flags = {key: getattr(args, key) for key in vars(args)}
# Set Flags to True or False based on whether they were used
Flags = {key: getattr(args, key) for key in vars(args)}

# Initialize an empty list to store the keys with values set to True
true_keys = []

# Iterate through the flags dictionary
for key, value in flags.items():
# Iterate through the Flags dictionary
for key, value in Flags.items():
# Check if the value is True and add the key to the list
if value:
true_keys.append(key)
Expand All @@ -187,8 +191,9 @@ def flags() -> tuple[str, ...]:
return tuple(true_keys)
else:
print(
"Only one flag is allowed with the --reboot and --shutdown and --webhook flags."
"Only one flag is allowed with the --reboot and --shutdown and --webhook Flags."
)
input("Press Enter to exit...")
exit(1)

@staticmethod
Expand Down Expand Up @@ -227,11 +232,13 @@ def read_config() -> tuple[str, bool, str, str, list[str]]:
and isinstance(files, list)
):
print("Invalid config.json format.")
input("Press Enter to exit...")
exit(1)

return webhook_url, debug, version, api_key, files
except FileNotFoundError:
print("The config.json File is not found.")
input("Press Enter to exit...")
exit(1)


Expand Down
1 change: 1 addition & 0 deletions CODE/__lib_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pathlib
from datetime import datetime
import colorlog
import sys


class Log:
Expand Down
17 changes: 17 additions & 0 deletions CODE/__wrapper__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Special wrapper
import argparse
import subprocess
import sys


FLAG = tuple(sys.argv[1:])
if len(FLAG) == 0:
subprocess.run(['python', 'Logicytics.py'], shell=True)
elif len(FLAG) == 2:
flag1, flag2 = FLAG
flag1 = '--' + flag1
flag2 = '--' + flag2
subprocess.run(['python', 'Logicytics.py', flag1, flag2], shell=True)
else:
flag1 = '--' + sys.argv[1]
subprocess.run(['python', 'Logicytics.py', flag1], shell=True)
1 change: 1 addition & 0 deletions CODE/_dev.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import json
import sys


# Super inefficient - If it works, it works tho ;)
Expand Down
1 change: 1 addition & 0 deletions CODE/_extra.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import subprocess
import zipfile
import sys


def unzip(zip_path: str) -> None:
Expand Down
1 change: 1 addition & 0 deletions CODE/_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import shutil
import zipfile
import subprocess
import sys


def backup(directory: str, name: str) -> None:
Expand Down
1 change: 1 addition & 0 deletions CODE/_hide_my_tracks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import subprocess
import os
import sys


def attempt_hide():
Expand Down
Binary file added CODE/_internal/VCRUNTIME140.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-core-debug-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-core-file-l1-1-0.dll
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-core-file-l1-2-0.dll
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-core-file-l2-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-core-heap-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-core-synch-l1-1-0.dll
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-core-synch-l1-2-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-core-util-l1-1-0.dll
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-crt-conio-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-crt-heap-l1-1-0.dll
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-crt-locale-l1-1-0.dll
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-crt-math-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-crt-stdio-l1-1-0.dll
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-crt-string-l1-1-0.dll
Binary file not shown.
Binary file added CODE/_internal/api-ms-win-crt-time-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file added CODE/_internal/base_library.zip
Binary file not shown.
Binary file added CODE/_internal/libcrypto-3.dll
Binary file not shown.
Binary file added CODE/_internal/python311.dll
Binary file not shown.
Binary file added CODE/_internal/ucrtbase.dll
Binary file not shown.
2 changes: 2 additions & 0 deletions CODE/_zipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from datetime import date
import zipfile
import hashlib
import sys



def zip_and_hash(path: str, name: str, action: str) -> tuple:
Expand Down
Binary file not shown.
Binary file not shown.
Loading