Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Improve HWId validity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
misandrie committed May 17, 2024
1 parent e7e31db commit 2f46a2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Marsey/Game/Patches/HWID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void SetHWID(string hwid)

private static string CleanHwid(string hwid)
{
return new string(hwid.Where(c => "0123456789ABCDEFabcdef".Contains(c)).ToArray());
return new string(hwid.Where(c => "0123456789ABCDEF".Contains(c)).ToArray());
}

private static void ForceHWID(string cleanedHwid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ private void OnSetHWIdClick()
string hwid = _HWIdString;

// Check if _HWIdString is a valid hex string (allowing empty string) and pad it if necessary
if (Regex.IsMatch(_HWIdString, "^[a-fA-F0-9]*$")) // '*' allows for zero or more characters
if (Regex.IsMatch(_HWIdString, "^$|^[A-F0-9]{64}$")) // '*' allows for zero or more characters
{
if (LIHWIDBind)
{
Expand Down

0 comments on commit 2f46a2e

Please sign in to comment.