Skip to content

Commit

Permalink
Fix: registry path format
Browse files Browse the repository at this point in the history
  • Loading branch information
moesnow committed Dec 27, 2024
1 parent 636fdef commit d5c80b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/registry/gameaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
reg_path_oversea = "Software\\Cognosphere\\Star Rail"
uid_key = "App_LastUserID_h2841727341"


def get_reg_path() -> str:
try:
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, reg_path_cn):
Expand All @@ -17,9 +18,10 @@ def get_reg_path() -> str:
except FileNotFoundError:
return None


reg_path = get_reg_path()
if reg_path is not None:
full_reg_path = "HKEY_CURRENT_USER\{0}".format(reg_path.replace('\\\\', '\\'))
full_reg_path = "HKEY_CURRENT_USER\\{0}".format(reg_path.replace('\\\\', '\\'))
else:
full_reg_path = None

Expand Down

0 comments on commit d5c80b2

Please sign in to comment.