Skip to content

Commit d0df113

Browse files
committed
add PKLiteDetector
1 parent f73b198 commit d0df113

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# PKLiteDetector is based on SecuROMDetector
2+
3+
def identify_exe(exe_path, exe_check):
4+
try:
5+
with open(exe_path, 'rb') as file:
6+
exe_contents = file.read()
7+
if exe_check.encode() in exe_contents:
8+
return True
9+
except FileNotFoundError:
10+
print(f"File {exe_path} not found.")
11+
return False
12+
13+
# Define a list of valid executable names (case-insensitive)
14+
valid_exes = ["SYSTEM.EXE", "system.exe", "System.EXE", "System.exe", "loader7.exe", "Dev7VM.exe"]
15+
16+
# Ask the user for the file path
17+
exe_file = input("Enter the name of the EXE file (with .EXE extension): ")
18+
19+
# Check if the input file is valid by matching it against valid EXE names
20+
if exe_file.lower() in (valid_exe.lower() for valid_exe in valid_exes):
21+
found_pattern = False
22+
23+
# Check for PKLite v2.1
24+
if identify_exe(exe_file, "PKlite(R) Copr. 1990-1996 PKWARE Inc. All Rights Reserved"):
25+
print("PKLite v2.1")
26+
found_pattern = True
27+
28+
# If no recognized pattern was found
29+
if not found_pattern:
30+
print("Maybe this EXE uses a different version of PKLite, "
31+
"Please contact BJNFNE on Discord")
32+
else:
33+
print("Invalid EXE file. Please enter a valid executable name.")
34+
35+
input("Press enter to close PKLiteDetector")

0 commit comments

Comments
 (0)