shadowbrokers-exploits/windows/Resources/Dsz/Scripts/Include/_Users.dsi
2017-04-14 11:45:07 +02:00

24 lines
550 B
Text

#-------------------------------------------------------------------------------
# _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