Add Localization (HideBuildInAccounts not working)
Manschk3rl opened this issue · 4 comments
Describe the bug
If you have set your operating system to german, the setting "HideBuildInAccounts" does not work.
it shows entries like "NT-AUTHORITÄT\SYSTEM" (which is german for "NT-AUTHORITY\SYSTEM")
To Reproduce
Steps to reproduce the behavior:
- Set your OS language to german.
- Start SuperGrate.
- Under "Settings" set "HideBuildInAccounts" on "true".
- "Source Computer" > local machine
- "List Source"
- See the error
Expected behavior
"NT-xxx" entries should not appear in the list.
Logs
[SUCCESS]<11:49:53> Config loaded! [SUCCESS]<11:49:53> Welcome to Super Grate! v1.3.5.0 [INFO]<11:49:53> Enter some information to get started! [INFO]<11:49:59> Getting list of users on: ZE999-WIN11... [VERBOSE]<11:49:59> Found: ZE999-Win11\test [WARNING]<11:49:59> Could not resolve as an SID via WMI! [VERBOSE]<11:49:59> Found: S-1-5-21-85594344-4232975197-2231365188-1002 [VERBOSE]<11:49:59> Found: ZE999-Win11\Admin [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\Netzwerkdienst [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\Lokaler Dienst [VERBOSE]<11:49:59> Found: NT-AUTORITÄT\SYSTEM [SUCCESS]<11:49:59> Users listed successfully. [INFO]<11:55:00> Writing log to: C:\Users\Admin\Desktop\SuperGrate_30.11.2022_11-54-57.log...
Additional context
Im not a programmer but i guess its because the program is searching for "NT AUTHORITY". Found in "SuperGrate/Classes/Misc.cs" line 107 if (bool.TryParse(Config.Settings["HideBuiltInAccounts"], out bool setting) && setting && (**user.Contains("NT AUTHORITY")** || **user.Contains("NT SERVICE")**))
Thanks for the report, it sounds like I am going to need to localize Super Grate with different languages.
That is a big task so might take me a few weeks to build in localization. I will likely need help from you with translating to German as well if you are up for it.
Hi, i found a better solution. The SID from the NT-Accounts are always S-1-5-18 - 20. I replaced your user.Contains("NT AUTHORITY") || user.Contains("NT SERVICE")
with an easy Regex match Regex.IsMatch(SID, @"^S-1-5-[0-9]+$")
which searches for the String "S-1-5-" followed by numbers and an end after the numbers. User accounts SID are in a different format.
That will work for now, mind sending a pull request?
Done.
But sure im up for the "Add Localization" projekt if you need help with german :)