Skip to content

Commit af9b8d0

Browse files
committed
only allow official executable names
1 parent 2189d93 commit af9b8d0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/SecuROMDetector/SecuROMDetector.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ def identify_exe(exe_path, exe_check):
1010
print(f"File {exe_path} not found.")
1111
return False
1212

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+
1316
# Ask the user for the file path
1417
exe_file = input("Enter the name of the EXE file (with .EXE extension): ")
1518

16-
# Check if the input file has a valid .exe extension
17-
if exe_file.lower().endswith((".exe")):
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):
1821
found_pattern = False
1922

2023
# Check for SecuROM version 4.00.00
@@ -47,6 +50,6 @@ def identify_exe(exe_path, exe_check):
4750
print("Maybe this EXE uses a different version of SecuROM, "
4851
"Please contact BJNFNE on Discord")
4952
else:
50-
print("Invalid EXE file extension. Please add the .exe extension as well.")
53+
print("Invalid EXE file. Please enter a valid executable name.")
5154

5255
input("Press enter to close SecuROMDetector")

0 commit comments

Comments
 (0)