Skip to content

Commit 686450c

Browse files
Deprecated the EXTRA directory
Removed the --extra flag, and gave a deprecation warning to it, will be removed later however, also added new feature to Flag.py that allows you to print the flag help menu whenever needed! Signed-off-by: Shahm Najeeb <Nirt_12023@outlook.com>
1 parent 0568d28 commit 686450c

5 files changed

Lines changed: 47 additions & 90 deletions

File tree

CODE/Logicytics.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
import zipfile
88
from datetime import datetime
99
from typing import Any
10+
1011
from prettytable import PrettyTable
11-
from pathlib import Path
1212

1313
from logicytics import Log, Execute, Check, Get, FileManagement, Flag, DEBUG, DELETE_LOGS
1414

15-
1615
# Initialization
1716
FileManagement.mkdir()
1817
log = Log({"log_level": DEBUG, "delete_log": DELETE_LOGS})
@@ -136,9 +135,16 @@ def handle_special_actions():
136135
log.info("Opening developer menu...")
137136
special_execute("_dev.py")
138137

138+
# Deprecated, remove in v3.3.0
139139
if ACTION == "extra":
140-
log.info("Opening extra tools menu...")
141-
special_execute("_extra.py")
140+
print("\033[91mDeprecationWarning: "
141+
"A call to the deprecated feature `extra` has been called, "
142+
"this feature has been removed as it doesn't follow "
143+
"the required code standards or aim of Logicytics.\033[0m")
144+
log.info("No flag is supplied due to --extra flag deprecation, will show help menu instead")
145+
Flag.show_help_menu()
146+
input("Press Enter to exit...")
147+
exit(0)
142148

143149
if ACTION == "update":
144150
log.info("Updating...")
@@ -170,14 +176,14 @@ def handle_special_actions():
170176
input("Press Enter to exit...")
171177
exit(0)
172178

179+
# Deprecated, remove in v3.3.0
173180
if ACTION == "unzip_extra":
174-
log.warning(
175-
"The contents of this directory can be flagged as malicious and enter quarantine, please use with "
176-
"caution"
177-
)
178-
log.info("Unzipping...")
179-
FileManagement.unzip(Path("..\\EXTRA\\EXTRA.zip"))
180-
log.info("Unzip complete!")
181+
print("\033[91mDeprecationWarning: "
182+
"A call to the deprecated feature `unzip-extra` has been called, "
183+
"this feature has been removed as it doesn't follow "
184+
"the required code standards or aim of Logicytics.\033[0m")
185+
log.info("No flag is supplied due to --unzip-extra flag deprecation, will show help menu instead")
186+
Flag.show_help_menu()
181187
input("Press Enter to exit...")
182188
exit(0)
183189

@@ -327,12 +333,13 @@ def threaded_execution(execution_list_thread, index_thread):
327333

328334
def zip_generated_files():
329335
"""Zips generated files based on the action."""
336+
330337
def zip_and_log(directory: str, name: str):
331338
log.debug(f"Zipping directory '{directory}' with name '{name}' under action '{ACTION}'")
332339
zip_values = FileManagement.Zip.and_hash(
333-
directory,
334-
name,
335-
ACTION if ACTION is not None else f"ERROR_NO_ACTION_SPECIFIED_{datetime.now().isoformat()}"
340+
directory,
341+
name,
342+
ACTION if ACTION is not None else f"ERROR_NO_ACTION_SPECIFIED_{datetime.now().isoformat()}"
336343
)
337344
if isinstance(zip_values, str):
338345
log.error(zip_values)
@@ -362,8 +369,8 @@ def handle_sub_action():
362369
elif SUB_ACTION == "reboot":
363370
subprocess.call("shutdown /r /t 3", shell=False)
364371
# elif sub_action == "webhook":
365-
# Implement this in future
366-
# log.warning("This feature is not implemented yet! Sorry")
372+
# Implement this in future
373+
# log.warning("This feature is not implemented yet! Sorry")
367374

368375

369376
if __name__ == "__main__":

CODE/_extra.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

CODE/logicytics/Flag.py

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,6 @@ def __available_arguments(cls) -> tuple[argparse.Namespace, argparse.ArgumentPar
131131
f"{cls.colorify('- Use on your own device only -', 'y')}.",
132132
)
133133

134-
parser.add_argument(
135-
"--unzip-extra",
136-
action="store_true",
137-
help="Unzip the extra directory zip File "
138-
f"{cls.colorify('- Use on your own device only -', 'y')}.",
139-
)
140-
141-
parser.add_argument(
142-
"--extra",
143-
action="store_true",
144-
help="Open's the extra directory menu to use more tools. "
145-
f"{cls.colorify('- Still experimental -', 'y')} "
146-
f"{cls.colorify('- MUST have used --unzip-extra flag -', 'b')}.",
147-
)
148-
149134
parser.add_argument(
150135
"--dev",
151136
action="store_true",
@@ -183,6 +168,22 @@ def __available_arguments(cls) -> tuple[argparse.Namespace, argparse.ArgumentPar
183168
f"{cls.colorify('- Not yet Implemented -', 'r')}",
184169
)
185170

171+
# Deprecated Flags - v3.3
172+
parser.add_argument(
173+
"--unzip-extra",
174+
action="store_true",
175+
help="Unzip the extra directory zip File "
176+
f"{cls.colorify('- Use on your own device only -', 'y')}.",
177+
)
178+
179+
parser.add_argument(
180+
"--extra",
181+
action="store_true",
182+
help="Open's the extra directory menu to use more tools. "
183+
f"{cls.colorify('- Still experimental -', 'y')} "
184+
f"{cls.colorify('- MUST have used --unzip-extra flag -', 'b')}.",
185+
)
186+
186187
return parser.parse_args(), parser
187188

188189
@staticmethod
@@ -273,3 +274,11 @@ def data(cls) -> ArgumentParser | tuple[str]:
273274
if not tuple(used_flags):
274275
return parser
275276
return tuple(used_flags)
277+
278+
@staticmethod
279+
def show_help_menu():
280+
"""
281+
Displays the help menu for the Logicytics application.
282+
"""
283+
_, parser = Flag.__available_arguments()
284+
parser.print_help()

EXTRA/EXTRA.zip

-15 MB
Binary file not shown.

PLANS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
88
| Task | Version | Might or Will be done? |
99
|---------------------------------------------------------------------------------------------------------------------------------|----------------|------------------------|
10-
| Remove EXTRA dir, and zip features with custom proper features from Logicytics, as well as remove EXTRA wrapper | v3.2.0 ||
1110
| Implement a parser for Windows Prefetch files, Shellbags, Jump Lists, LNK files to extract data | snapshot-3.3.a ||
1211
| Implement a parser for Windows UserAssist registry key, SRUM database to extract data. | snapshot-3.3.b ||
1312
| Implement a parser for Windows Volume Shadow Copy, LSA Secrets, Syscache, Shimcache, Amcache Event Tracing logs to extract data | snapshot-3.3.c ||

0 commit comments

Comments
 (0)