shadowbrokers-exploits/windows/Resources/Dsz/Scripts/Include/_Users.dsi

25 lines
550 B
Text
Raw Normal View History

#-------------------------------------------------------------------------------
# _GetCurrentUser
# Retrieves the user of the current process
# Params:
# user - On return contains the user for the current process
#-------------------------------------------------------------------------------
Sub _GetCurrentUser(OUT string $user)
{
@record on;
if (!`whoami`) {
return false;
}
@record off;
if (!GetCmdData("user::name", $user) || !defined($user)) {
return false;
}
return true;
}
# END GetCurrentUser