-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
142 lines (124 loc) · 5.39 KB
/
app.py
File metadata and controls
142 lines (124 loc) · 5.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import ctypes.wintypes
import logging
import os
import shutil
import sys
import time
logging.basicConfig(filename="info.log", level=logging.INFO)
logging.basicConfig(filename="crash.log", level=logging.ERROR)
CSIDL_PERSONAL = 5 # My Documents
SHGFP_TYPE_CURRENT = 0 # Get current, not default value
global result, appMainPath, buf, myDocuments, gameList, SII_exe, active_profile, active_save, profileTable, saveTable
buf = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
ctypes.windll.shell32.SHGetFolderPathW(
None, CSIDL_PERSONAL, None, SHGFP_TYPE_CURRENT, buf
)
myDocumentsPath = buf.value
print("*****************************************************************")
print("* 【 Product Name : Scs ETS 2 - Profile SII Decrypt 】 *")
print("* 【 Author: MQuel 】 *")
print("* 【 Github: github@murselsen 】 *")
print("* 【 Discord: 35mursel 】 *")
print("* 【 Version: v1 】 b *")
print("* 【 License: 2025 - 2030 】 *")
print("****************************************************************")
print("* *")
print("* --gameName: *")
print("* *")
print("* ets : Euro Truck Simulator 2 *")
print("* ats : American Truck Simulator *")
print("* *")
print("* --profileDisplayName: (optional) *")
print("* *")
print("*****************************************************************")
profileTable = {"ID": [], "Profile": [], "Path": []}
gameList = {"ets": "Euro Truck Simulator 2", "ats": "American Truck Simulator"}
SII_exe = os.path.join(os.getcwd(), "profileDecrypt.exe")
def exit(status):
if status:
input("🚪 | Press any key to exit :")
else:
return True
def decrypt(profilesMainDirsPath, profileDisplayName):
print("🎮|Profile :", profileDisplayName)
_selectProfilePath = os.path.join(os.getcwd(), profileDisplayName)
os.chdir(_selectProfilePath)
shutil.copyfile(SII_exe, os.getcwd() + "/profileDecrypt.exe")
print("🔔 | Status: profileDecrypt.exe has been copied. Please Wait!")
logging.info("🔔 | Status: profileDecrypt.exe has been copied. Please Wait!")
time.sleep(1.0)
cmdDecrypt = "SII.exe profile.sii"
print("🔔 | Status: Profile.sii files will be decrypted. Please Wait!")
logging.info("🔔 | Status: Profile.sii files will be decrypted. Please Wait!")
time.sleep(1.0)
os.system(cmdDecrypt)
print("🔔 | Status: profileDecrypt.exe has been removed. Please Wait!")
logging.info("🔔 | Status: profileDecrypt.exe has been removed. Please Wait!")
os.remove("profileDecrypt.exe")
os.chdir(profilesMainDirsPath)
def main():
def cwd():
label = "📂 | Where I am: |"
labelLength = len(label)
cwd = os.getcwd() + " |"
cwdLength = len(cwd)
print(
"\n+",
"-".center(labelLength - 1, "-"),
"+",
"-".center(cwdLength - 2, "-"),
"+",
)
print("|", label, cwd)
print(
"+",
"-".center(labelLength - 1, "-"),
"+",
"-".center(cwdLength - 2, "-"),
"+\n",
)
print(sys.argv)
for index, game in enumerate(gameList):
print("🎮|App :", gameList.get(game))
if sys.argv[1] == "ets" or sys.argv[1] == "ats":
_selectGame = sys.argv[1]
_selectGameResult = gameList.get(_selectGame)
print("\nSelect Game: ", _selectGameResult)
_selectGamePath = os.path.join(myDocumentsPath, _selectGameResult, "profiles")
os.chdir(_selectGamePath)
# Index: 0
# Path: 45545332424F52444F
# Profile
# Index: 1
# Path: 52544853617665
# Profile
# Index: 2
# Path: 666F72756D2E776F746D702E636F6D
if len(sys.argv) > 2:
_selectProfile = sys.argv[2]
print("\nSelect Profile: ", _selectProfile)
if os.path.isdir(os.path.join(os.getcwd(), _selectProfile)):
decrypt(os.getcwd(), _selectProfile)
else:
logging.warning(
f"⚠️ | Warning: Profile directory '{_selectProfile}' does not exist."
)
else:
print(os.listdir(os.getcwd()))
for profileDir_index, profileDir_displayName in enumerate(
os.listdir(os.getcwd())
):
profileDir_path = os.path.join(os.getcwd(), profileDir_displayName)
print("Profile\nIndex:", profileDir_index, "\nPath:", profileDir_path)
if os.path.isdir(profileDir_path):
decrypt(os.getcwd(), profileDir_displayName)
else:
logging.warning(
f"⚠️ | Warning: Profile directory '{profileDir_displayName}' does not exist."
)
try:
main()
input("🚪 | Press any key to exit :")
# exit(1)
except Exception as e:
logging.error("Error: %s", e.args)