Getting the Username from the HKEY_USERS values

前端 未结 9 1025
予麋鹿
予麋鹿 2021-01-30 04:08

Is there a way to connect between the values under HKEY_USERS to the actual username?
I saw some similar questions, but most (if not all) talks about C# code, and my need is

9条回答
  •  借酒劲吻你
    2021-01-30 04:55

    Done it, by a bit of creative programming,

    1. Enum the Keys in HKEY_USERS for those funny number keys...

    2. Enum the keys in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\

    and you will find the same numbers.... Now in those keys look at the String value: ProfileImagePath = "SomeValue" where the values are either:

    "%systemroot%\system32\config\systemprofile"... not interested in this one... as its not a directory path...

    %SystemDrive%\Documents and Settings\LocalService - "Local Services" %SystemDrive%\Documents and Settings\NetworkService "NETWORK SERVICE"

    or

    %SystemDrive%\Documents and Settings\USER_NAME, which translates directly to the "USERNAME" values in most un-tampered systems, ie. where the user has not changed the their user name after a few weeks or altered the paths explicitly...

提交回复
热议问题